From 38aaba4c49cd9cece5775b05a9845ae6ab0d8fec Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 18 Aug 2023 09:11:11 +0000 Subject: [PATCH] CodeGen from PR 25383 in Azure/azure-rest-api-specs Merge e144e5565f3303ac9001c9b57bc1f1990c78ee50 into 624dbc769880e5676ae8bb20d3c82ebd1783c64a --- .../armrecoveryservicesbackup/CHANGELOG.md | 58 + .../armrecoveryservicesbackup/autorest.md | 6 +- .../backupengines_client.go | 22 +- .../backupengines_client_example_test.go | 136 - .../backupjobs_client.go | 7 +- .../backupjobs_client_example_test.go | 191 -- .../backupoperationresults_client.go | 15 +- ...kupoperationresults_client_example_test.go | 35 - .../backupoperationstatuses_client.go | 18 +- ...upoperationstatuses_client_example_test.go | 45 - .../backuppolicies_client.go | 7 +- .../backuppolicies_client_example_test.go | 292 --- .../backupprotectableitems_client.go | 7 +- ...kupprotectableitems_client_example_test.go | 62 - .../backupprotecteditems_client.go | 7 +- ...ackupprotecteditems_client_example_test.go | 71 - .../backupprotectioncontainers_client.go | 7 +- ...rotectioncontainers_client_example_test.go | 61 - .../backupprotectionintent_client.go | 7 +- ...kupprotectionintent_client_example_test.go | 59 - .../backupresourceencryptionconfigs_client.go | 35 +- ...ceencryptionconfigs_client_example_test.go | 77 - ...ckupresourcestorageconfigsnoncrr_client.go | 55 +- ...torageconfigsnoncrr_client_example_test.go | 106 - .../backupresourcevaultconfigs_client.go | 58 +- ...esourcevaultconfigs_client_example_test.go | 113 - .../backups_client.go | 20 +- .../backups_client_example_test.go | 40 - .../backupstatus_client.go | 23 +- .../backupstatus_client_example_test.go | 52 - .../backupusagesummaries_client.go | 7 +- ...ackupusagesummaries_client_example_test.go | 151 -- .../backupworkloaditems_client.go | 7 +- ...backupworkloaditems_client_example_test.go | 75 - ...mspreparedatamoveoperationresult_client.go | 18 +- ...moveoperationresult_client_example_test.go | 43 - .../armrecoveryservicesbackup/client.go | 90 +- .../client_example_test.go | 122 - .../client_factory.go | 191 +- .../armrecoveryservicesbackup/constants.go | 313 +-- .../deletedprotectioncontainers_client.go | 7 +- ...rotectioncontainers_client_example_test.go | 61 - .../exportjobsoperationresults_client.go | 18 +- ...obsoperationresults_client_example_test.go | 47 - .../featuresupport_client.go | 23 +- .../featuresupport_client_example_test.go | 46 - .../armrecoveryservicesbackup/go.mod | 22 +- .../armrecoveryservicesbackup/go.sum | 38 +- .../armrecoveryservicesbackup/interfaces.go | 473 ++++ .../itemlevelrecoveryconnections_client.go | 32 +- ...recoveryconnections_client_example_test.go | 61 - .../jobcancellations_client.go | 15 +- .../jobcancellations_client_example_test.go | 35 - .../jobdetails_client.go | 18 +- .../jobdetails_client_example_test.go | 70 - .../joboperationresults_client.go | 15 +- ...joboperationresults_client_example_test.go | 35 - .../armrecoveryservicesbackup/jobs_client.go | 15 +- .../jobs_client_example_test.go | 35 - .../armrecoveryservicesbackup/models.go | 2318 ++++++----------- .../armrecoveryservicesbackup/models_serde.go | 187 +- .../operation_client.go | 23 +- .../operation_client_example_test.go | 121 - .../operations_client.go | 7 +- .../operations_client_example_test.go | 496 ---- .../armrecoveryservicesbackup/options.go | 483 ++++ .../polymorphic_helpers.go | 97 +- .../privateendpoint_client.go | 18 +- .../privateendpoint_client_example_test.go | 45 - .../privateendpointconnection_client.go | 61 +- ...eendpointconnection_client_example_test.go | 125 - .../protectablecontainers_client.go | 7 +- ...otectablecontainers_client_example_test.go | 71 - .../protecteditemoperationresults_client.go | 18 +- ...temoperationresults_client_example_test.go | 59 - .../protecteditemoperationstatuses_client.go | 18 +- ...emoperationstatuses_client_example_test.go | 49 - .../protecteditems_client.go | 50 +- .../protecteditems_client_example_test.go | 214 -- ...tectioncontaineroperationresults_client.go | 18 +- ...neroperationresults_client_example_test.go | 77 - ...containerrefreshoperationresults_client.go | 15 +- ...eshoperationresults_client_example_test.go | 35 - .../protectioncontainers_client.go | 74 +- ...rotectioncontainers_client_example_test.go | 171 -- .../protectionintent_client.go | 70 +- .../protectionintent_client_example_test.go | 137 - .../protectionpolicies_client.go | 57 +- .../protectionpolicies_client_example_test.go | 1232 --------- ...protectionpolicyoperationresults_client.go | 18 +- ...icyoperationresults_client_example_test.go | 66 - ...rotectionpolicyoperationstatuses_client.go | 18 +- ...cyoperationstatuses_client_example_test.go | 52 - .../recoverypoints_client.go | 22 +- .../recoverypoints_client_example_test.go | 169 -- ...recoverypointsrecommendedformove_client.go | 12 +- ...srecommendedformove_client_example_test.go | 123 - .../resourceguardproxies_client.go | 7 +- ...esourceguardproxies_client_example_test.go | 65 - .../resourceguardproxy_client.go | 70 +- .../resourceguardproxy_client_example_test.go | 145 -- .../response_types.go | 52 +- .../restores_client.go | 27 +- .../restores_client_example_test.go | 271 -- .../securitypins_client.go | 23 +- .../securitypins_client_example_test.go | 43 - .../armrecoveryservicesbackup/time_rfc3339.go | 3 +- .../validateoperation_client.go | 27 +- .../validateoperation_client_example_test.go | 59 - .../validateoperationresults_client.go | 18 +- ...ateoperationresults_client_example_test.go | 49 - .../validateoperationstatuses_client.go | 18 +- ...teoperationstatuses_client_example_test.go | 57 - 113 files changed, 3038 insertions(+), 8504 deletions(-) delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/interfaces.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go create mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/options.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go delete mode 100644 sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md index ff75fbd9cce8..745b879b1357 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/CHANGELOG.md @@ -1,5 +1,63 @@ # Release History +## 3.0.0 (2023-08-18) +### Breaking Changes + +- Function `*AzureVMWorkloadSAPHanaHSR.GetAzureVMWorkloadProtectableItem` has been removed +- Function `*AzureVMWorkloadSAPHanaHSR.GetWorkloadProtectableItem` has been removed +- Struct `AzureVMWorkloadSAPHanaHSR` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureFileshareProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureIaaSClassicComputeVMProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureIaaSComputeVMProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureIaaSVMProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureSQLProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureVMWorkloadProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureVMWorkloadSAPAseDatabaseProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureVMWorkloadSAPHanaDBInstanceProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureVMWorkloadSAPHanaDatabaseProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `AzureVMWorkloadSQLDatabaseProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `DPMProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `GenericProtectedItem` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `MabFileFolderProtectedItem` has been removed +- Field `ActionRequired` of struct `PrivateLinkServiceConnectionState` has been removed +- Field `SoftDeleteRetentionPeriod` of struct `ProtectedItem` has been removed + +### Features Added + +- New value `SoftDeleteFeatureStateAlwaysON` added to enum type `SoftDeleteFeatureState` +- New enum type `VaultSubResourceType` with values `VaultSubResourceTypeAzureBackup`, `VaultSubResourceTypeAzureBackupSecondary`, `VaultSubResourceTypeAzureSiteRecovery` +- New function `*AzureVMWorkloadSAPHanaHSRProtectableItem.GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem` +- New function `*AzureVMWorkloadSAPHanaHSRProtectableItem.GetWorkloadProtectableItem() *WorkloadProtectableItem` +- New struct `AzureVMWorkloadSAPHanaHSRProtectableItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `AzureFileshareProtectedItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `AzureIaaSClassicComputeVMProtectedItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `AzureIaaSComputeVMProtectedItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `AzureIaaSVMProtectedItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `AzureSQLProtectedItem` +- New field `NodesList`, `SoftDeleteRetentionPeriodInDays` in struct `AzureVMWorkloadProtectedItem` +- New field `NodesList`, `SoftDeleteRetentionPeriodInDays` in struct `AzureVMWorkloadSAPAseDatabaseProtectedItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSAPAseSystemProtectableItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSAPHanaDBInstance` +- New field `NodesList`, `SoftDeleteRetentionPeriodInDays` in struct `AzureVMWorkloadSAPHanaDBInstanceProtectedItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSAPHanaDatabaseProtectableItem` +- New field `NodesList`, `SoftDeleteRetentionPeriodInDays` in struct `AzureVMWorkloadSAPHanaDatabaseProtectedItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSAPHanaSystemProtectableItem` +- New field `IsProtectable`, `NodesList` in struct `AzureVMWorkloadSQLAvailabilityGroupProtectableItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSQLDatabaseProtectableItem` +- New field `NodesList`, `SoftDeleteRetentionPeriodInDays` in struct `AzureVMWorkloadSQLDatabaseProtectedItem` +- New field `IsProtectable` in struct `AzureVMWorkloadSQLInstanceProtectableItem` +- New field `SoftDeleteRetentionPeriodInDays` in struct `BackupResourceVaultConfig` +- New field `AcquireStorageAccountLock`, `ProtectedItemsCount` in struct `BackupStatusResponse` +- New field `SoftDeleteRetentionPeriodInDays` in struct `DPMProtectedItem` +- New field `SourceResourceID` in struct `DistributedNodesInfo` +- New field `SoftDeleteRetentionPeriodInDays` in struct `GenericProtectedItem` +- New field `ProtectableItemCount` in struct `InquiryValidation` +- New field `SoftDeleteRetentionPeriodInDays` in struct `MabFileFolderProtectedItem` +- New field `GroupIDs` in struct `PrivateEndpointConnection` +- New field `ActionsRequired` in struct `PrivateLinkServiceConnectionState` +- New field `SoftDeleteRetentionPeriodInDays` in struct `ProtectedItem` + + ## 2.1.1 (2023-04-14) ### Bug Fixes diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/autorest.md index f7132c608d26..d3a39e464fc8 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/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/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: 2.1.1 +module-version: 3.0.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go index 82700d627dfa..0c8a1dd9756f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - BackupEnginesClientGetOptions contains the optional parameters for the BackupEnginesClient.Get method. func (client *BackupEnginesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, backupEngineName string, options *BackupEnginesClientGetOptions) (BackupEnginesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, backupEngineName, options) if err != nil { return BackupEnginesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupEnginesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupEnginesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupEnginesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -91,7 +93,7 @@ func (client *BackupEnginesClient) getCreateRequest(ctx context.Context, vaultNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -114,7 +116,7 @@ func (client *BackupEnginesClient) getHandleResponse(resp *http.Response) (Backu // NewListPager - Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager method. @@ -166,7 +168,7 @@ func (client *BackupEnginesClient) listCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go deleted file mode 100644 index 5062c08fccd8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupengines_client_example_test.go +++ /dev/null @@ -1,136 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupEnginesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupEnginesClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupEngineBaseResourceList = armrecoveryservicesbackup.BackupEngineBaseResourceList{ - // Value: []*armrecoveryservicesbackup.BackupEngineBaseResource{ - // { - // Name: to.Ptr("testServer1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer1"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer1"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // }, - // { - // Name: to.Ptr("testServer5"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer5"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9530.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer5"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupEnginesClient().Get(ctx, "testVault", "testRG", "testServer", &armrecoveryservicesbackup.BackupEnginesClientGetOptions{Filter: nil, - SkipToken: nil, - }) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupEngineBaseResource = armrecoveryservicesbackup.BackupEngineBaseResource{ - // Name: to.Ptr("testServer"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEngines"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/testVault/backupEngines/testServer"), - // Properties: &armrecoveryservicesbackup.DpmBackupEngine{ - // AzureBackupAgentVersion: to.Ptr("2.0.9532.0"), - // BackupEngineState: to.Ptr("Active"), - // BackupEngineType: to.Ptr(armrecoveryservicesbackup.BackupEngineTypeDpmBackupEngine), - // DpmVersion: to.Ptr("5.1.348.0"), - // ExtendedInfo: &armrecoveryservicesbackup.BackupEngineExtendedInfo{ - // AvailableDiskSpace: to.Ptr[float64](50), - // DiskCount: to.Ptr[int32](5), - // ProtectedItemsCount: to.Ptr[int32](35), - // ProtectedServersCount: to.Ptr[int32](21), - // UsedDiskSpace: to.Ptr[float64](20), - // }, - // FriendlyName: to.Ptr("testServer"), - // IsAzureBackupAgentUpgradeAvailable: to.Ptr(false), - // IsDpmUpgradeAvailable: to.Ptr(false), - // RegistrationStatus: to.Ptr("Registered"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go index d5daeda19973..e585f67ab062 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewBackupJobsClient(subscriptionID string, credential azcore.TokenCredentia // NewListPager - Provides a pageable list of jobs. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager method. @@ -98,7 +97,7 @@ func (client *BackupJobsClient) listCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go deleted file mode 100644 index bb97b426716d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupjobs_client_example_test.go +++ /dev/null @@ -1,191 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/ListJobs.json -func ExampleBackupJobsClient_NewListPager_listAllJobs() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }, - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.7553376Z"); return t}()), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("ConfigureBackup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.4487085Z"); return t}()), - // Status: to.Ptr("Completed"), - // Duration: to.Ptr("PT31.3066291S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/ListJobsWithAllSupportedFilters.json -func ExampleBackupJobsClient_NewListPager_listJobsWithFilters() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM' and operation eq 'Backup' and backupManagementType eq 'AzureIaasVM' and status eq 'InProgress'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/ListJobsWithStartTimeAndEndTimeFilters.json -func ExampleBackupJobsClient_NewListPager_listJobsWithTimeFilter() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupJobsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupJobsClientListOptions{Filter: to.Ptr("startTime eq '2016-01-01 00:00:00 AM' and endTime eq '2017-11-29 00:00:00 AM'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.JobResourceList = armrecoveryservicesbackup.JobResourceList{ - // Value: []*armrecoveryservicesbackup.JobResource{ - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT12.4272909S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }, - // { - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:03.7553376Z"); return t}()), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("ConfigureBackup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:30:32.4487085Z"); return t}()), - // Status: to.Ptr("Completed"), - // Duration: to.Ptr("PT31.3066291S"), - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go index c603e57a6fb5..44dd77b23f1a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -50,23 +49,25 @@ func NewBackupOperationResultsClient(subscriptionID string, credential azcore.To // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - BackupOperationResultsClientGetOptions contains the optional parameters for the BackupOperationResultsClient.Get // method. func (client *BackupOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BackupOperationResultsClientGetOptions) (BackupOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return BackupOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return BackupOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return BackupOperationResultsClientGetResponse{}, err } return BackupOperationResultsClientGetResponse{}, nil } @@ -95,7 +96,7 @@ func (client *BackupOperationResultsClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go deleted file mode 100644 index d572f65e34a8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationresults_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupOperationResultsClient().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/backupoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go index 6eddd70a1170..d3b80161e0e8 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,25 +48,28 @@ func NewBackupOperationStatusesClient(subscriptionID string, credential azcore.T // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - BackupOperationStatusesClientGetOptions contains the optional parameters for the BackupOperationStatusesClient.Get // method. func (client *BackupOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BackupOperationStatusesClientGetOptions) (BackupOperationStatusesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return BackupOperationStatusesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupOperationStatusesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupOperationStatusesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupOperationStatusesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -94,7 +96,7 @@ func (client *BackupOperationStatusesClient) getCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_test.go deleted file mode 100644 index 53506ba3381b..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupoperationstatuses_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupOperationStatusesClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "0001-01-01T00:00:00.00000Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T06:52:53.886027Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesInProgress), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go index 2f7f9b9de9f2..59c503ebf1a3 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager method. @@ -99,7 +98,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go deleted file mode 100644 index 08146f71f6c3..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backuppolicies_client_example_test.go +++ /dev/null @@ -1,292 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("DefaultPolicy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); 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, "2017-12-05T19:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/V2Policy/v2-List-Policies.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureIaasVmWithBothV1AndV2Policies() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("DefaultPolicy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/DefaultPolicy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); 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, "2017-12-05T19:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // }, - // { - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }, - // { - // Name: to.Ptr("v2-daily-policy"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-policy"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureWorkload/BackupPolicies_List.json -func ExampleBackupPoliciesClient_NewListPager_listProtectionPoliciesWithBackupManagementTypeFilterAsAzureWorkload() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupPoliciesClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupPoliciesClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionPolicyResourceList = armrecoveryservicesbackup.ProtectionPolicyResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionPolicyResource{ - // { - // Name: to.Ptr("HourlyLogBackup"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/HourlyLogBackup"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // ProtectedItemsCount: to.Ptr[int32](0), - // Settings: &armrecoveryservicesbackup.Settings{ - // Issqlcompression: to.Ptr(false), - // TimeZone: to.Ptr("UTC"), - // }, - // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-05T19:00:00Z"); 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, "2017-12-05T19:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](30), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - // ScheduleFrequencyInMins: to.Ptr[int32](60), - // }, - // }}, - // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go index 9ca5feb286b8..62509d40e59d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -100,7 +99,7 @@ func (client *BackupProtectableItemsClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_test.go deleted file mode 100644 index 84c552ee4a13..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectableitems_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectableItemsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectableItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadProtectableItemResourceList = armrecoveryservicesbackup.WorkloadProtectableItemResourceList{ - // Value: []*armrecoveryservicesbackup.WorkloadProtectableItemResource{ - // { - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectableItems"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectableItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectableItem{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // FriendlyName: to.Ptr("iaasvm-1"), - // ProtectableItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), - // WorkloadType: to.Ptr("VM"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go index 1bcbf7abb934..00f266307852 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewBackupProtectedItemsClient(subscriptionID string, credential azcore.Toke // NewListPager - Provides a pageable list of all items that are backed up within a vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -99,7 +98,7 @@ func (client *BackupProtectedItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go deleted file mode 100644 index 7e44268d588d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotecteditems_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectedItemsClient().NewListPager("NetSDKTestRsVault", "SwaggerTestRg", &armrecoveryservicesbackup.BackupProtectedItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureIaasVM' and itemType eq 'VM'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectedItemResourceList = armrecoveryservicesbackup.ProtectedItemResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectedItemResource{ - // { - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), - // PolicyID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go index 9f09975fac93..f61f4c1444a5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewBackupProtectionContainersClient(subscriptionID string, credential azcor // NewListPager - Lists the containers registered to Recovery Services Vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -99,7 +98,7 @@ func (client *BackupProtectionContainersClient) listCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go deleted file mode 100644 index 4dc7299abd7d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectionContainersClient().NewListPager("testVault", "testRg", &armrecoveryservicesbackup.BackupProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ - // { - // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("suchandrtestsa125"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("Registered"), - // ProtectedItemCount: to.Ptr[int64](2), - // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go index bd99d7c82dbb..4391ed383fea 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewBackupProtectionIntentClient(subscriptionID string, credential azcore.To // NewListPager - Provides a pageable list of all intents that are present within a vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -99,7 +98,7 @@ func (client *BackupProtectionIntentClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go deleted file mode 100644 index f3c4639e3564..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupprotectionintent_client_example_test.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupProtectionIntentClient().NewListPager("myVault", "myRG", &armrecoveryservicesbackup.BackupProtectionIntentClientListOptions{Filter: nil, - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionIntentResourceList = armrecoveryservicesbackup.ProtectionIntentResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionIntentResource{ - // { - // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), - // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go index 35ea4f770bcb..493d2b9e234d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ func NewBackupResourceEncryptionConfigsClient(subscriptionID string, credential // Get - Fetches Vault Encryption config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // method. func (client *BackupResourceEncryptionConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceEncryptionConfigsClientGetOptions) (BackupResourceEncryptionConfigsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { return BackupResourceEncryptionConfigsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceEncryptionConfigsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceEncryptionConfigsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceEncryptionConfigsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *BackupResourceEncryptionConfigsClient) getCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,23 +107,25 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - BackupResourceEncryptionConfigsClientUpdateOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Update // method. func (client *BackupResourceEncryptionConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceEncryptionConfigResource, options *BackupResourceEncryptionConfigsClientUpdateOptions) (BackupResourceEncryptionConfigsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return BackupResourceEncryptionConfigsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceEncryptionConfigsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceEncryptionConfigsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceEncryptionConfigsClientUpdateResponse{}, err } return BackupResourceEncryptionConfigsClientUpdateResponse{}, nil } @@ -146,8 +150,11 @@ func (client *BackupResourceEncryptionConfigsClient) updateCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go deleted file mode 100644 index 1512ff07695c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourceencryptionconfigs_client_example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceEncryptionConfigsClient().Get(ctx, "rishTestVault", "rishgrp", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceEncryptionConfigExtendedResource = armrecoveryservicesbackup.BackupResourceEncryptionConfigExtendedResource{ - // Name: to.Ptr("backupResourceEncryptionConfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupEncryptionConfigs"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rishgrp/providers/Microsoft.RecoveryServicesBVTD2/vaults/rishTestVault/backupEncryptionConfigs/backupResourceEncryptionConfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceEncryptionConfigExtended{ - // EncryptionAtRestType: to.Ptr(armrecoveryservicesbackup.EncryptionAtRestTypeCustomerManaged), - // InfrastructureEncryptionState: to.Ptr(armrecoveryservicesbackup.InfrastructureEncryptionStateDisabled), - // KeyURI: to.Ptr("https://gktestkv1.vault.azure.net/keys/Test1/ed2e8cdc7f86477ebf0c6462b504a9ed"), - // LastUpdateStatus: to.Ptr(armrecoveryservicesbackup.LastUpdateStatusSucceeded), - // SubscriptionID: to.Ptr("1a2311d9-66f5-47d3-a9fb-7a37da63934b"), - // UseSystemAssignedIdentity: to.Ptr(false), - // UserAssignedIdentity: to.Ptr("/subscriptions/85bf5e8c-3084-4f42-add2-746ebb7e97b2/resourcegroups/defaultrg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/examplemsi"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupResourceEncryptionConfigsClient().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/backupresourcestorageconfigsnoncrr_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go index 0446ee425bb6..7b9062985982 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ func NewBackupResourceStorageConfigsNonCRRClient(subscriptionID string, credenti // Get - Fetches resource storage config. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // method. func (client *BackupResourceStorageConfigsNonCRRClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceStorageConfigsNonCRRClientGetOptions) (BackupResourceStorageConfigsNonCRRClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { return BackupResourceStorageConfigsNonCRRClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceStorageConfigsNonCRRClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceStorageConfigsNonCRRClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceStorageConfigsNonCRRClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *BackupResourceStorageConfigsNonCRRClient) getCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,23 +107,25 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - BackupResourceStorageConfigsNonCRRClientPatchOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Patch // method. func (client *BackupResourceStorageConfigsNonCRRClient) Patch(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceConfigResource, options *BackupResourceStorageConfigsNonCRRClientPatchOptions) (BackupResourceStorageConfigsNonCRRClientPatchResponse, error) { + var err error req, err := client.patchCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return BackupResourceStorageConfigsNonCRRClientPatchResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceStorageConfigsNonCRRClientPatchResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return BackupResourceStorageConfigsNonCRRClientPatchResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return BackupResourceStorageConfigsNonCRRClientPatchResponse{}, err } return BackupResourceStorageConfigsNonCRRClientPatchResponse{}, nil } @@ -146,34 +150,40 @@ func (client *BackupResourceStorageConfigsNonCRRClient) patchCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // Update - Updates vault storage model type. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - BackupResourceStorageConfigsNonCRRClientUpdateOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Update // method. func (client *BackupResourceStorageConfigsNonCRRClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceConfigResource, options *BackupResourceStorageConfigsNonCRRClientUpdateOptions) (BackupResourceStorageConfigsNonCRRClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return BackupResourceStorageConfigsNonCRRClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceStorageConfigsNonCRRClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceStorageConfigsNonCRRClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceStorageConfigsNonCRRClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -196,10 +206,13 @@ func (client *BackupResourceStorageConfigsNonCRRClient) updateCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go deleted file mode 100644 index 286c4e86b830..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcestorageconfigsnoncrr_client_example_test.go +++ /dev/null @@ -1,106 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceStorageConfigsNonCRRClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ - // Name: to.Ptr("vaultstorageconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), - // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeGeoRedundant), - // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateLocked), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceStorageConfigsNonCRRClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceConfigResource = armrecoveryservicesbackup.BackupResourceConfigResource{ - // Name: to.Ptr("vaultstorageconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupstorageconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupstorageconfig/vaultstorageconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceConfig{ - // StorageModelType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - // StorageType: to.Ptr(armrecoveryservicesbackup.StorageTypeLocallyRedundant), - // StorageTypeState: to.Ptr(armrecoveryservicesbackup.StorageTypeStateUnlocked), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupResourceStorageConfigsNonCRRClient().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/backupresourcevaultconfigs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go index 7f3b95249b4e..c87d4401c843 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // method. func (client *BackupResourceVaultConfigsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *BackupResourceVaultConfigsClientGetOptions) (BackupResourceVaultConfigsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { return BackupResourceVaultConfigsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceVaultConfigsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceVaultConfigsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceVaultConfigsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -87,7 +89,7 @@ func (client *BackupResourceVaultConfigsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -105,25 +107,28 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - BackupResourceVaultConfigsClientPutOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Put // method. func (client *BackupResourceVaultConfigsClient) Put(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceVaultConfigResource, options *BackupResourceVaultConfigsClientPutOptions) (BackupResourceVaultConfigsClientPutResponse, error) { + var err error req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return BackupResourceVaultConfigsClientPutResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceVaultConfigsClientPutResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceVaultConfigsClientPutResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceVaultConfigsClientPutResponse{}, err } - return client.putHandleResponse(resp) + resp, err := client.putHandleResponse(httpResp) + return resp, err } // putCreateRequest creates the Put request. @@ -146,10 +151,13 @@ func (client *BackupResourceVaultConfigsClient) putCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // putHandleResponse handles the Put response. @@ -164,25 +172,28 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - BackupResourceVaultConfigsClientUpdateOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Update // method. func (client *BackupResourceVaultConfigsClient) Update(ctx context.Context, vaultName string, resourceGroupName string, parameters BackupResourceVaultConfigResource, options *BackupResourceVaultConfigsClientUpdateOptions) (BackupResourceVaultConfigsClientUpdateResponse, error) { + var err error req, err := client.updateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return BackupResourceVaultConfigsClientUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupResourceVaultConfigsClientUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupResourceVaultConfigsClientUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupResourceVaultConfigsClientUpdateResponse{}, err } - return client.updateHandleResponse(resp) + resp, err := client.updateHandleResponse(httpResp) + return resp, err } // updateCreateRequest creates the Update request. @@ -205,10 +216,13 @@ func (client *BackupResourceVaultConfigsClient) updateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // updateHandleResponse handles the Update response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go deleted file mode 100644 index 0f0f3fe96e69..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupresourcevaultconfigs_client_example_test.go +++ /dev/null @@ -1,113 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().Get(ctx, "SwaggerTest", "SwaggerTestRg", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupResourceVaultConfigsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupResourceVaultConfigResource = armrecoveryservicesbackup.BackupResourceVaultConfigResource{ - // Name: to.Ptr("vaultconfig"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupconfig"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/SwaggerTest/backupconfig/vaultconfig"), - // Properties: &armrecoveryservicesbackup.BackupResourceVaultConfig{ - // EnhancedSecurityState: to.Ptr(armrecoveryservicesbackup.EnhancedSecurityStateEnabled), - // SoftDeleteFeatureState: to.Ptr(armrecoveryservicesbackup.SoftDeleteFeatureStateEnabled), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go index c8076a200476..52023cf3eff1 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,7 +47,7 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -57,16 +56,18 @@ func NewBackupsClient(subscriptionID string, credential azcore.TokenCredential, // - parameters - resource backup request // - options - BackupsClientTriggerOptions contains the optional parameters for the BackupsClient.Trigger method. func (client *BackupsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters BackupRequestResource, options *BackupsClientTriggerOptions) (BackupsClientTriggerResponse, error) { + var err error req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, options) if err != nil { return BackupsClientTriggerResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupsClientTriggerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return BackupsClientTriggerResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return BackupsClientTriggerResponse{}, err } return BackupsClientTriggerResponse{}, nil } @@ -103,8 +104,11 @@ func (client *BackupsClient) triggerCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_test.go deleted file mode 100644 index 610ce5e7be92..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backups_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewBackupsClient().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/backupstatus_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go index 6479546c4f5d..8f4910105c66 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,23 +46,26 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - azureRegion - Azure region to hit Api // - parameters - Container Backup Status Request // - options - BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. func (client *BackupStatusClient) Get(ctx context.Context, azureRegion string, parameters BackupStatusRequest, options *BackupStatusClientGetOptions) (BackupStatusClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, azureRegion, parameters, options) if err != nil { return BackupStatusClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BackupStatusClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return BackupStatusClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return BackupStatusClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -82,10 +84,13 @@ func (client *BackupStatusClient) getCreateRequest(ctx context.Context, azureReg return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // getHandleResponse handles the Get response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go deleted file mode 100644 index db46285a1e81..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupstatus_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBackupStatusClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.BackupStatusResponse = armrecoveryservicesbackup.BackupStatusResponse{ - // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;testRg;testVm"), - // ErrorCode: to.Ptr("Success"), - // ErrorMessage: to.Ptr("ErrorMessage"), - // FabricName: to.Ptr(armrecoveryservicesbackup.FabricNameAzure), - // PolicyName: to.Ptr("myPolicy"), - // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;testRg;testVm"), - // ProtectionStatus: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), - // VaultID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/Vaults/testVault"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go index 401380c3e824..66b19cee9be9 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewBackupUsageSummariesClient(subscriptionID string, credential azcore.Toke // NewListPager - Fetches the backup management usage summaries of the vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -93,7 +92,7 @@ func (client *BackupUsageSummariesClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go deleted file mode 100644 index 114615d7ba37..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupusagesummaries_client_example_test.go +++ /dev/null @@ -1,151 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupProtectionContainers_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager_getProtectedContainersUsagesSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupUsageSummariesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectionContainerCountSummary'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ - // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Server"), - // Value: to.Ptr("AzureBackupServer"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Agent"), - // Value: to.Ptr("MAB"), - // }, - // CurrentValue: to.Ptr[int64](3), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("SQL in Azure VM"), - // Value: to.Ptr("AzureWorkload"), - // }, - // CurrentValue: to.Ptr[int64](1), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/Common/BackupProtectedItem_UsageSummary_Get.json -func ExampleBackupUsageSummariesClient_NewListPager_getProtectedItemsUsagesSummary() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupUsageSummariesClient().NewListPager("testVault", "testRG", &armrecoveryservicesbackup.BackupUsageSummariesClientListOptions{Filter: to.Ptr("type eq 'BackupProtectedItemCountSummary'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.BackupManagementUsageList = armrecoveryservicesbackup.BackupManagementUsageList{ - // Value: []*armrecoveryservicesbackup.BackupManagementUsage{ - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Virtual Machine"), - // Value: to.Ptr("AzureIaasVM"), - // }, - // CurrentValue: to.Ptr[int64](7), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Agent"), - // Value: to.Ptr("MAB"), - // }, - // CurrentValue: to.Ptr[int64](3), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Backup Server"), - // Value: to.Ptr("AzureBackupServer"), - // }, - // CurrentValue: to.Ptr[int64](1), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("Azure Storage (Azure Files)"), - // Value: to.Ptr("AzureStorage"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }, - // { - // Name: &armrecoveryservicesbackup.NameInfo{ - // LocalizedValue: to.Ptr("SQL in Azure VM"), - // Value: to.Ptr("AzureWorkload"), - // }, - // CurrentValue: to.Ptr[int64](2), - // Limit: to.Ptr[int64](-1), - // Unit: to.Ptr(armrecoveryservicesbackup.UsagesUnitCount), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go index 190329494fc9..c1b3e5e231df 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -110,7 +109,7 @@ func (client *BackupWorkloadItemsClient) listCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_test.go deleted file mode 100644 index 0823451f0605..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/backupworkloaditems_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewBackupWorkloadItemsClient().NewListPager("suchandr-seacan-rsv", "testRg", "Azure", "VMAppContainer;Compute;bvtdtestag;sqlserver-1", &armrecoveryservicesbackup.BackupWorkloadItemsClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'"), - SkipToken: nil, - }) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.WorkloadItemResourceList = armrecoveryservicesbackup.WorkloadItemResourceList{ - // Value: []*armrecoveryservicesbackup.WorkloadItemResource{ - // { - // Name: to.Ptr("SQLInstance;MSSQLSERVER"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/items"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/testRg/providers/Microsoft.RecoveryServices/vaults/suchandr-seacan-rsv/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;bvtdtestag;sqlserver-1/protectableItems/SQLInstance;MSSQLSERVER"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadSQLInstanceWorkloadItem{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // FriendlyName: to.Ptr("MSSQLSERVER"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusNotProtected), - // WorkloadItemType: to.Ptr("SQLInstance"), - // WorkloadType: to.Ptr("SQL"), - // IsAutoProtectable: to.Ptr(true), - // ParentName: to.Ptr("MSSQLSERVER"), - // ServerName: to.Ptr("sqlserver-1.contoso.com"), - // SubWorkloadItemCount: to.Ptr[int32](3), - // Subinquireditemcount: to.Ptr[int32](0), - // DataDirectoryPaths: []*armrecoveryservicesbackup.SQLDataDirectory{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeData), - // Path: to.Ptr("F:\\DATA\\"), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.SQLDataDirectoryTypeLog), - // Path: to.Ptr("F:\\LOG\\"), - // }}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go index 9bf1eecf41e5..2f77f47a8f82 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // method. func (client *BMSPrepareDataMoveOperationResultClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *BMSPrepareDataMoveOperationResultClientGetOptions) (BMSPrepareDataMoveOperationResultClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return BMSPrepareDataMoveOperationResultClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return BMSPrepareDataMoveOperationResultClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return BMSPrepareDataMoveOperationResultClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return BMSPrepareDataMoveOperationResultClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -91,7 +93,7 @@ func (client *BMSPrepareDataMoveOperationResultClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_test.go deleted file mode 100644 index 76defb7dfd0e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/bmspreparedatamoveoperationresult_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewBMSPrepareDataMoveOperationResultClient().Get(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res = armrecoveryservicesbackup.BMSPrepareDataMoveOperationResultClientGetResponse{ - // VaultStorageConfigOperationResultResponseClassification: &armrecoveryservicesbackup.PrepareDataMoveResponse{ - // ObjectType: to.Ptr("PrepareDataMoveResponse"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go index c78d9851fc07..92583911d07d 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 @@ -59,7 +58,8 @@ func (client *Client) BeginBMSPrepareDataMove(ctx context.Context, vaultName str if err != nil { return nil, err } - return runtime.NewPoller[ClientBMSPrepareDataMoveResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClientBMSPrepareDataMoveResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClientBMSPrepareDataMoveResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 func (client *Client) bMSPrepareDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters PrepareDataMoveRequest, options *ClientBeginBMSPrepareDataMoveOptions) (*http.Response, error) { + var err error req, err := client.bmsPrepareDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // bmsPrepareDataMoveCreateRequest creates the BMSPrepareDataMove request. @@ -104,16 +106,19 @@ func (client *Client) bmsPrepareDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // BeginBMSTriggerDataMove - Triggers Data Move Operation on target vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 @@ -125,7 +130,8 @@ func (client *Client) BeginBMSTriggerDataMove(ctx context.Context, vaultName str if err != nil { return nil, err } - return runtime.NewPoller[ClientBMSTriggerDataMoveResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClientBMSTriggerDataMoveResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClientBMSTriggerDataMoveResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -134,20 +140,22 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 func (client *Client) bMSTriggerDataMove(ctx context.Context, vaultName string, resourceGroupName string, parameters TriggerDataMoveRequest, options *ClientBeginBMSTriggerDataMoveOptions) (*http.Response, error) { + var err error req, err := client.bmsTriggerDataMoveCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // bmsTriggerDataMoveCreateRequest creates the BMSTriggerDataMove request. @@ -170,32 +178,38 @@ func (client *Client) bmsTriggerDataMoveCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // GetOperationStatus - Fetches operation status for data move operation on vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. func (client *Client) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ClientGetOperationStatusOptions) (ClientGetOperationStatusResponse, error) { + var err error req, err := client.getOperationStatusCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return ClientGetOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ClientGetOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ClientGetOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ClientGetOperationStatusResponse{}, err } - return client.getOperationStatusHandleResponse(resp) + resp, err := client.getOperationStatusHandleResponse(httpResp) + return resp, err } // getOperationStatusCreateRequest creates the GetOperationStatus request. @@ -222,7 +236,7 @@ func (client *Client) getOperationStatusCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -240,7 +254,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 @@ -251,7 +265,8 @@ func (client *Client) BeginMoveRecoveryPoint(ctx context.Context, vaultName stri if err != nil { return nil, err } - return runtime.NewPoller[ClientMoveRecoveryPointResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ClientMoveRecoveryPointResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ClientMoveRecoveryPointResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -260,20 +275,22 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 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) { + var err error req, err := client.moveRecoveryPointCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // moveRecoveryPointCreateRequest creates the MoveRecoveryPoint request. @@ -312,8 +329,11 @@ func (client *Client) moveRecoveryPointCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_test.go deleted file mode 100644 index 81c13b2b1543..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewClient().GetOperationStatus(ctx, "source-rsv", "sourceRG", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), - // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewClient().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/client_factory.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_factory.go index 7f0209119b75..b512bb78380b 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_factory.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/client_factory.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -38,113 +37,113 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewBackupResourceStorageConfigsNonCRRClient() *BackupResourceStorageConfigsNonCRRClient { - subClient, _ := NewBackupResourceStorageConfigsNonCRRClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBMSPrepareDataMoveOperationResultClient() *BMSPrepareDataMoveOperationResultClient { + subClient, _ := NewBMSPrepareDataMoveOperationResultClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectionIntentClient() *ProtectionIntentClient { - subClient, _ := NewProtectionIntentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupEnginesClient() *BackupEnginesClient { + subClient, _ := NewBackupEnginesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupStatusClient() *BackupStatusClient { - subClient, _ := NewBackupStatusClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupJobsClient() *BackupJobsClient { + subClient, _ := NewBackupJobsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewFeatureSupportClient() *FeatureSupportClient { - subClient, _ := NewFeatureSupportClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupOperationResultsClient() *BackupOperationResultsClient { + subClient, _ := NewBackupOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupProtectionIntentClient() *BackupProtectionIntentClient { - subClient, _ := NewBackupProtectionIntentClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupOperationStatusesClient() *BackupOperationStatusesClient { + subClient, _ := NewBackupOperationStatusesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupUsageSummariesClient() *BackupUsageSummariesClient { - subClient, _ := NewBackupUsageSummariesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { + subClient, _ := NewBackupPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewBackupProtectableItemsClient() *BackupProtectableItemsClient { + subClient, _ := NewBackupProtectableItemsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupResourceVaultConfigsClient() *BackupResourceVaultConfigsClient { - subClient, _ := NewBackupResourceVaultConfigsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupProtectedItemsClient() *BackupProtectedItemsClient { + subClient, _ := NewBackupProtectedItemsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupResourceEncryptionConfigsClient() *BackupResourceEncryptionConfigsClient { - subClient, _ := NewBackupResourceEncryptionConfigsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupProtectionContainersClient() *BackupProtectionContainersClient { + subClient, _ := NewBackupProtectionContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { - subClient, _ := NewPrivateEndpointConnectionClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupProtectionIntentClient() *BackupProtectionIntentClient { + subClient, _ := NewBackupProtectionIntentClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewPrivateEndpointClient() *PrivateEndpointClient { - subClient, _ := NewPrivateEndpointClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupResourceEncryptionConfigsClient() *BackupResourceEncryptionConfigsClient { + subClient, _ := NewBackupResourceEncryptionConfigsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewClient() *Client { - subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupResourceStorageConfigsNonCRRClient() *BackupResourceStorageConfigsNonCRRClient { + subClient, _ := NewBackupResourceStorageConfigsNonCRRClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBMSPrepareDataMoveOperationResultClient() *BMSPrepareDataMoveOperationResultClient { - subClient, _ := NewBMSPrepareDataMoveOperationResultClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupResourceVaultConfigsClient() *BackupResourceVaultConfigsClient { + subClient, _ := NewBackupResourceVaultConfigsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectedItemsClient() *ProtectedItemsClient { - subClient, _ := NewProtectedItemsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupStatusClient() *BackupStatusClient { + subClient, _ := NewBackupStatusClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectedItemOperationResultsClient() *ProtectedItemOperationResultsClient { - subClient, _ := NewProtectedItemOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupUsageSummariesClient() *BackupUsageSummariesClient { + subClient, _ := NewBackupUsageSummariesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRecoveryPointsClient() *RecoveryPointsClient { - subClient, _ := NewRecoveryPointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupWorkloadItemsClient() *BackupWorkloadItemsClient { + subClient, _ := NewBackupWorkloadItemsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRestoresClient() *RestoresClient { - subClient, _ := NewRestoresClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewBackupsClient() *BackupsClient { + subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupPoliciesClient() *BackupPoliciesClient { - subClient, _ := NewBackupPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewClient() *Client { + subClient, _ := NewClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectionPoliciesClient() *ProtectionPoliciesClient { - subClient, _ := NewProtectionPoliciesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDeletedProtectionContainersClient() *DeletedProtectionContainersClient { + subClient, _ := NewDeletedProtectionContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectionPolicyOperationResultsClient() *ProtectionPolicyOperationResultsClient { - subClient, _ := NewProtectionPolicyOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewExportJobsOperationResultsClient() *ExportJobsOperationResultsClient { + subClient, _ := NewExportJobsOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupJobsClient() *BackupJobsClient { - subClient, _ := NewBackupJobsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewFeatureSupportClient() *FeatureSupportClient { + subClient, _ := NewFeatureSupportClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewJobDetailsClient() *JobDetailsClient { - subClient, _ := NewJobDetailsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewItemLevelRecoveryConnectionsClient() *ItemLevelRecoveryConnectionsClient { + subClient, _ := NewItemLevelRecoveryConnectionsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -153,13 +152,13 @@ func (c *ClientFactory) NewJobCancellationsClient() *JobCancellationsClient { return subClient } -func (c *ClientFactory) NewJobOperationResultsClient() *JobOperationResultsClient { - subClient, _ := NewJobOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewJobDetailsClient() *JobDetailsClient { + subClient, _ := NewJobDetailsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewExportJobsOperationResultsClient() *ExportJobsOperationResultsClient { - subClient, _ := NewExportJobsOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewJobOperationResultsClient() *JobOperationResultsClient { + subClient, _ := NewJobOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -168,53 +167,43 @@ func (c *ClientFactory) NewJobsClient() *JobsClient { return subClient } -func (c *ClientFactory) NewBackupProtectedItemsClient() *BackupProtectedItemsClient { - subClient, _ := NewBackupProtectedItemsClient(c.subscriptionID, c.credential, c.options) - return subClient -} - func (c *ClientFactory) NewOperationClient() *OperationClient { subClient, _ := NewOperationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewValidateOperationClient() *ValidateOperationClient { - subClient, _ := NewValidateOperationClient(c.subscriptionID, c.credential, c.options) - return subClient -} - -func (c *ClientFactory) NewValidateOperationResultsClient() *ValidateOperationResultsClient { - subClient, _ := NewValidateOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewValidateOperationStatusesClient() *ValidateOperationStatusesClient { - subClient, _ := NewValidateOperationStatusesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateEndpointClient() *PrivateEndpointClient { + subClient, _ := NewPrivateEndpointClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupEnginesClient() *BackupEnginesClient { - subClient, _ := NewBackupEnginesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewPrivateEndpointConnectionClient() *PrivateEndpointConnectionClient { + subClient, _ := NewPrivateEndpointConnectionClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectionContainerRefreshOperationResultsClient() *ProtectionContainerRefreshOperationResultsClient { - subClient, _ := NewProtectionContainerRefreshOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectableContainersClient() *ProtectableContainersClient { + subClient, _ := NewProtectableContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectableContainersClient() *ProtectableContainersClient { - subClient, _ := NewProtectableContainersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectedItemOperationResultsClient() *ProtectedItemOperationResultsClient { + subClient, _ := NewProtectedItemOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectionContainersClient() *ProtectionContainersClient { - subClient, _ := NewProtectionContainersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectedItemOperationStatusesClient() *ProtectedItemOperationStatusesClient { + subClient, _ := NewProtectedItemOperationStatusesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupWorkloadItemsClient() *BackupWorkloadItemsClient { - subClient, _ := NewBackupWorkloadItemsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectedItemsClient() *ProtectedItemsClient { + subClient, _ := NewProtectedItemsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -223,28 +212,28 @@ func (c *ClientFactory) NewProtectionContainerOperationResultsClient() *Protecti return subClient } -func (c *ClientFactory) NewBackupsClient() *BackupsClient { - subClient, _ := NewBackupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectionContainerRefreshOperationResultsClient() *ProtectionContainerRefreshOperationResultsClient { + subClient, _ := NewProtectionContainerRefreshOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProtectedItemOperationStatusesClient() *ProtectedItemOperationStatusesClient { - subClient, _ := NewProtectedItemOperationStatusesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectionContainersClient() *ProtectionContainersClient { + subClient, _ := NewProtectionContainersClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewItemLevelRecoveryConnectionsClient() *ItemLevelRecoveryConnectionsClient { - subClient, _ := NewItemLevelRecoveryConnectionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectionIntentClient() *ProtectionIntentClient { + subClient, _ := NewProtectionIntentClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupOperationResultsClient() *BackupOperationResultsClient { - subClient, _ := NewBackupOperationResultsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectionPoliciesClient() *ProtectionPoliciesClient { + subClient, _ := NewProtectionPoliciesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupOperationStatusesClient() *BackupOperationStatusesClient { - subClient, _ := NewBackupOperationStatusesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProtectionPolicyOperationResultsClient() *ProtectionPolicyOperationResultsClient { + subClient, _ := NewProtectionPolicyOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -253,18 +242,28 @@ func (c *ClientFactory) NewProtectionPolicyOperationStatusesClient() *Protection return subClient } -func (c *ClientFactory) NewBackupProtectableItemsClient() *BackupProtectableItemsClient { - subClient, _ := NewBackupProtectableItemsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRecoveryPointsClient() *RecoveryPointsClient { + subClient, _ := NewRecoveryPointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewBackupProtectionContainersClient() *BackupProtectionContainersClient { - subClient, _ := NewBackupProtectionContainersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRecoveryPointsRecommendedForMoveClient() *RecoveryPointsRecommendedForMoveClient { + subClient, _ := NewRecoveryPointsRecommendedForMoveClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDeletedProtectionContainersClient() *DeletedProtectionContainersClient { - subClient, _ := NewDeletedProtectionContainersClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewResourceGuardProxiesClient() *ResourceGuardProxiesClient { + subClient, _ := NewResourceGuardProxiesClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewResourceGuardProxyClient() *ResourceGuardProxyClient { + subClient, _ := NewResourceGuardProxyClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +func (c *ClientFactory) NewRestoresClient() *RestoresClient { + subClient, _ := NewRestoresClient(c.subscriptionID, c.credential, c.options) return subClient } @@ -273,17 +272,17 @@ func (c *ClientFactory) NewSecurityPINsClient() *SecurityPINsClient { return subClient } -func (c *ClientFactory) NewRecoveryPointsRecommendedForMoveClient() *RecoveryPointsRecommendedForMoveClient { - subClient, _ := NewRecoveryPointsRecommendedForMoveClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewValidateOperationClient() *ValidateOperationClient { + subClient, _ := NewValidateOperationClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewResourceGuardProxiesClient() *ResourceGuardProxiesClient { - subClient, _ := NewResourceGuardProxiesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewValidateOperationResultsClient() *ValidateOperationResultsClient { + subClient, _ := NewValidateOperationResultsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewResourceGuardProxyClient() *ResourceGuardProxyClient { - subClient, _ := NewResourceGuardProxyClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewValidateOperationStatusesClient() *ValidateOperationStatusesClient { + subClient, _ := NewValidateOperationStatusesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go index 5ca554b2517e..80cc6c379a71 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/constants.go @@ -3,15 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup const ( moduleName = "armrecoveryservicesbackup" - moduleVersion = "v2.1.1" + moduleVersion = "v3.0.0" ) // AcquireStorageAccountLock - Whether storage account lock is to be acquired for this container or not. @@ -317,25 +316,25 @@ func PossibleDataSourceTypeValues() []DataSourceType { type DayOfWeek string const ( - DayOfWeekSunday DayOfWeek = "Sunday" + DayOfWeekFriday DayOfWeek = "Friday" DayOfWeekMonday DayOfWeek = "Monday" + DayOfWeekSaturday DayOfWeek = "Saturday" + DayOfWeekSunday DayOfWeek = "Sunday" + DayOfWeekThursday DayOfWeek = "Thursday" DayOfWeekTuesday DayOfWeek = "Tuesday" DayOfWeekWednesday DayOfWeek = "Wednesday" - DayOfWeekThursday DayOfWeek = "Thursday" - DayOfWeekFriday DayOfWeek = "Friday" - DayOfWeekSaturday DayOfWeek = "Saturday" ) // PossibleDayOfWeekValues returns the possible values for the DayOfWeek const type. func PossibleDayOfWeekValues() []DayOfWeek { return []DayOfWeek{ - DayOfWeekSunday, + DayOfWeekFriday, DayOfWeekMonday, + DayOfWeekSaturday, + DayOfWeekSunday, + DayOfWeekThursday, DayOfWeekTuesday, DayOfWeekWednesday, - DayOfWeekThursday, - DayOfWeekFriday, - DayOfWeekSaturday, } } @@ -413,105 +412,105 @@ func PossibleFabricNameValues() []FabricName { type HTTPStatusCode string const ( - HTTPStatusCodeContinue HTTPStatusCode = "Continue" - HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" - HTTPStatusCodeOK HTTPStatusCode = "OK" - HTTPStatusCodeCreated HTTPStatusCode = "Created" HTTPStatusCodeAccepted HTTPStatusCode = "Accepted" - HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" - HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" - HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" - HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" - HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" HTTPStatusCodeAmbiguous HTTPStatusCode = "Ambiguous" - HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" - HTTPStatusCodeMoved HTTPStatusCode = "Moved" - HTTPStatusCodeFound HTTPStatusCode = "Found" - HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" - HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" - HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" - HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" - HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" - HTTPStatusCodeUnused HTTPStatusCode = "Unused" - HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" - HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" HTTPStatusCodeBadRequest HTTPStatusCode = "BadRequest" - HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" - HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" - HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" - HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" - HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" - HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" - HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" - HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" HTTPStatusCodeConflict HTTPStatusCode = "Conflict" + HTTPStatusCodeContinue HTTPStatusCode = "Continue" + HTTPStatusCodeCreated HTTPStatusCode = "Created" + HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" + HTTPStatusCodeForbidden HTTPStatusCode = "Forbidden" + HTTPStatusCodeFound HTTPStatusCode = "Found" + HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" HTTPStatusCodeGone HTTPStatusCode = "Gone" + HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" HTTPStatusCodeLengthRequired HTTPStatusCode = "LengthRequired" + HTTPStatusCodeMethodNotAllowed HTTPStatusCode = "MethodNotAllowed" + HTTPStatusCodeMoved HTTPStatusCode = "Moved" + HTTPStatusCodeMovedPermanently HTTPStatusCode = "MovedPermanently" + HTTPStatusCodeMultipleChoices HTTPStatusCode = "MultipleChoices" + HTTPStatusCodeNoContent HTTPStatusCode = "NoContent" + HTTPStatusCodeNonAuthoritativeInformation HTTPStatusCode = "NonAuthoritativeInformation" + HTTPStatusCodeNotAcceptable HTTPStatusCode = "NotAcceptable" + HTTPStatusCodeNotFound HTTPStatusCode = "NotFound" + HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" + HTTPStatusCodeNotModified HTTPStatusCode = "NotModified" + HTTPStatusCodeOK HTTPStatusCode = "OK" + HTTPStatusCodePartialContent HTTPStatusCode = "PartialContent" + HTTPStatusCodePaymentRequired HTTPStatusCode = "PaymentRequired" HTTPStatusCodePreconditionFailed HTTPStatusCode = "PreconditionFailed" + HTTPStatusCodeProxyAuthenticationRequired HTTPStatusCode = "ProxyAuthenticationRequired" + HTTPStatusCodeRedirect HTTPStatusCode = "Redirect" + HTTPStatusCodeRedirectKeepVerb HTTPStatusCode = "RedirectKeepVerb" + HTTPStatusCodeRedirectMethod HTTPStatusCode = "RedirectMethod" HTTPStatusCodeRequestEntityTooLarge HTTPStatusCode = "RequestEntityTooLarge" + HTTPStatusCodeRequestTimeout HTTPStatusCode = "RequestTimeout" HTTPStatusCodeRequestURITooLong HTTPStatusCode = "RequestUriTooLong" - HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" HTTPStatusCodeRequestedRangeNotSatisfiable HTTPStatusCode = "RequestedRangeNotSatisfiable" - HTTPStatusCodeExpectationFailed HTTPStatusCode = "ExpectationFailed" - HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" - HTTPStatusCodeInternalServerError HTTPStatusCode = "InternalServerError" - HTTPStatusCodeNotImplemented HTTPStatusCode = "NotImplemented" - HTTPStatusCodeBadGateway HTTPStatusCode = "BadGateway" + HTTPStatusCodeResetContent HTTPStatusCode = "ResetContent" + HTTPStatusCodeSeeOther HTTPStatusCode = "SeeOther" HTTPStatusCodeServiceUnavailable HTTPStatusCode = "ServiceUnavailable" - HTTPStatusCodeGatewayTimeout HTTPStatusCode = "GatewayTimeout" - HTTPStatusCodeHTTPVersionNotSupported HTTPStatusCode = "HttpVersionNotSupported" + HTTPStatusCodeSwitchingProtocols HTTPStatusCode = "SwitchingProtocols" + HTTPStatusCodeTemporaryRedirect HTTPStatusCode = "TemporaryRedirect" + HTTPStatusCodeUnauthorized HTTPStatusCode = "Unauthorized" + HTTPStatusCodeUnsupportedMediaType HTTPStatusCode = "UnsupportedMediaType" + HTTPStatusCodeUnused HTTPStatusCode = "Unused" + HTTPStatusCodeUpgradeRequired HTTPStatusCode = "UpgradeRequired" + HTTPStatusCodeUseProxy HTTPStatusCode = "UseProxy" ) // PossibleHTTPStatusCodeValues returns the possible values for the HTTPStatusCode const type. func PossibleHTTPStatusCodeValues() []HTTPStatusCode { return []HTTPStatusCode{ - HTTPStatusCodeContinue, - HTTPStatusCodeSwitchingProtocols, - HTTPStatusCodeOK, - HTTPStatusCodeCreated, HTTPStatusCodeAccepted, - HTTPStatusCodeNonAuthoritativeInformation, - HTTPStatusCodeNoContent, - HTTPStatusCodeResetContent, - HTTPStatusCodePartialContent, - HTTPStatusCodeMultipleChoices, HTTPStatusCodeAmbiguous, - HTTPStatusCodeMovedPermanently, - HTTPStatusCodeMoved, - HTTPStatusCodeFound, - HTTPStatusCodeRedirect, - HTTPStatusCodeSeeOther, - HTTPStatusCodeRedirectMethod, - HTTPStatusCodeNotModified, - HTTPStatusCodeUseProxy, - HTTPStatusCodeUnused, - HTTPStatusCodeTemporaryRedirect, - HTTPStatusCodeRedirectKeepVerb, + HTTPStatusCodeBadGateway, HTTPStatusCodeBadRequest, - HTTPStatusCodeUnauthorized, - HTTPStatusCodePaymentRequired, - HTTPStatusCodeForbidden, - HTTPStatusCodeNotFound, - HTTPStatusCodeMethodNotAllowed, - HTTPStatusCodeNotAcceptable, - HTTPStatusCodeProxyAuthenticationRequired, - HTTPStatusCodeRequestTimeout, HTTPStatusCodeConflict, + HTTPStatusCodeContinue, + HTTPStatusCodeCreated, + HTTPStatusCodeExpectationFailed, + HTTPStatusCodeForbidden, + HTTPStatusCodeFound, + HTTPStatusCodeGatewayTimeout, HTTPStatusCodeGone, + HTTPStatusCodeHTTPVersionNotSupported, + HTTPStatusCodeInternalServerError, HTTPStatusCodeLengthRequired, + HTTPStatusCodeMethodNotAllowed, + HTTPStatusCodeMoved, + HTTPStatusCodeMovedPermanently, + HTTPStatusCodeMultipleChoices, + HTTPStatusCodeNoContent, + HTTPStatusCodeNonAuthoritativeInformation, + HTTPStatusCodeNotAcceptable, + HTTPStatusCodeNotFound, + HTTPStatusCodeNotImplemented, + HTTPStatusCodeNotModified, + HTTPStatusCodeOK, + HTTPStatusCodePartialContent, + HTTPStatusCodePaymentRequired, HTTPStatusCodePreconditionFailed, + HTTPStatusCodeProxyAuthenticationRequired, + HTTPStatusCodeRedirect, + HTTPStatusCodeRedirectKeepVerb, + HTTPStatusCodeRedirectMethod, HTTPStatusCodeRequestEntityTooLarge, + HTTPStatusCodeRequestTimeout, HTTPStatusCodeRequestURITooLong, - HTTPStatusCodeUnsupportedMediaType, HTTPStatusCodeRequestedRangeNotSatisfiable, - HTTPStatusCodeExpectationFailed, - HTTPStatusCodeUpgradeRequired, - HTTPStatusCodeInternalServerError, - HTTPStatusCodeNotImplemented, - HTTPStatusCodeBadGateway, + HTTPStatusCodeResetContent, + HTTPStatusCodeSeeOther, HTTPStatusCodeServiceUnavailable, - HTTPStatusCodeGatewayTimeout, - HTTPStatusCodeHTTPVersionNotSupported, + HTTPStatusCodeSwitchingProtocols, + HTTPStatusCodeTemporaryRedirect, + HTTPStatusCodeUnauthorized, + HTTPStatusCodeUnsupportedMediaType, + HTTPStatusCodeUnused, + HTTPStatusCodeUpgradeRequired, + HTTPStatusCodeUseProxy, } } @@ -688,16 +687,16 @@ func PossibleJobStatusValues() []JobStatus { type JobSupportedAction string const ( - JobSupportedActionInvalid JobSupportedAction = "Invalid" JobSupportedActionCancellable JobSupportedAction = "Cancellable" + JobSupportedActionInvalid JobSupportedAction = "Invalid" JobSupportedActionRetriable JobSupportedAction = "Retriable" ) // PossibleJobSupportedActionValues returns the possible values for the JobSupportedAction const type. func PossibleJobSupportedActionValues() []JobSupportedAction { return []JobSupportedAction{ - JobSupportedActionInvalid, JobSupportedActionCancellable, + JobSupportedActionInvalid, JobSupportedActionRetriable, } } @@ -794,37 +793,37 @@ func PossibleMabServerTypeValues() []MabServerType { type MonthOfYear string const ( + MonthOfYearApril MonthOfYear = "April" + MonthOfYearAugust MonthOfYear = "August" + MonthOfYearDecember MonthOfYear = "December" + MonthOfYearFebruary MonthOfYear = "February" MonthOfYearInvalid MonthOfYear = "Invalid" MonthOfYearJanuary MonthOfYear = "January" - MonthOfYearFebruary MonthOfYear = "February" + MonthOfYearJuly MonthOfYear = "July" + MonthOfYearJune MonthOfYear = "June" MonthOfYearMarch MonthOfYear = "March" - MonthOfYearApril MonthOfYear = "April" MonthOfYearMay MonthOfYear = "May" - MonthOfYearJune MonthOfYear = "June" - MonthOfYearJuly MonthOfYear = "July" - MonthOfYearAugust MonthOfYear = "August" - MonthOfYearSeptember MonthOfYear = "September" - MonthOfYearOctober MonthOfYear = "October" MonthOfYearNovember MonthOfYear = "November" - MonthOfYearDecember MonthOfYear = "December" + MonthOfYearOctober MonthOfYear = "October" + MonthOfYearSeptember MonthOfYear = "September" ) // PossibleMonthOfYearValues returns the possible values for the MonthOfYear const type. func PossibleMonthOfYearValues() []MonthOfYear { return []MonthOfYear{ + MonthOfYearApril, + MonthOfYearAugust, + MonthOfYearDecember, + MonthOfYearFebruary, MonthOfYearInvalid, MonthOfYearJanuary, - MonthOfYearFebruary, + MonthOfYearJuly, + MonthOfYearJune, MonthOfYearMarch, - MonthOfYearApril, MonthOfYearMay, - MonthOfYearJune, - MonthOfYearJuly, - MonthOfYearAugust, - MonthOfYearSeptember, - MonthOfYearOctober, MonthOfYearNovember, - MonthOfYearDecember, + MonthOfYearOctober, + MonthOfYearSeptember, } } @@ -940,47 +939,47 @@ func PossiblePrivateEndpointConnectionStatusValues() []PrivateEndpointConnection 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" + ProtectableContainerTypeAzureWorkloadContainer ProtectableContainerType = "AzureWorkloadContainer" + ProtectableContainerTypeCluster ProtectableContainerType = "Cluster" + ProtectableContainerTypeDPMContainer ProtectableContainerType = "DPMContainer" ProtectableContainerTypeGenericContainer ProtectableContainerType = "GenericContainer" + ProtectableContainerTypeIaasVMContainer ProtectableContainerType = "IaasVMContainer" + ProtectableContainerTypeIaasVMServiceContainer ProtectableContainerType = "IaasVMServiceContainer" + ProtectableContainerTypeInvalid ProtectableContainerType = "Invalid" + ProtectableContainerTypeMABContainer ProtectableContainerType = "MABContainer" ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines ProtectableContainerType = "Microsoft.ClassicCompute/virtualMachines" ProtectableContainerTypeMicrosoftComputeVirtualMachines ProtectableContainerType = "Microsoft.Compute/virtualMachines" - ProtectableContainerTypeAzureWorkloadContainer ProtectableContainerType = "AzureWorkloadContainer" + ProtectableContainerTypeSQLAGWorkLoadContainer ProtectableContainerType = "SQLAGWorkLoadContainer" + ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer" + ProtectableContainerTypeUnknown ProtectableContainerType = "Unknown" + ProtectableContainerTypeVCenter ProtectableContainerType = "VCenter" + ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer" + ProtectableContainerTypeWindows ProtectableContainerType = "Windows" ) // 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, + ProtectableContainerTypeAzureWorkloadContainer, + ProtectableContainerTypeCluster, + ProtectableContainerTypeDPMContainer, ProtectableContainerTypeGenericContainer, + ProtectableContainerTypeIaasVMContainer, + ProtectableContainerTypeIaasVMServiceContainer, + ProtectableContainerTypeInvalid, + ProtectableContainerTypeMABContainer, ProtectableContainerTypeMicrosoftClassicComputeVirtualMachines, ProtectableContainerTypeMicrosoftComputeVirtualMachines, - ProtectableContainerTypeAzureWorkloadContainer, + ProtectableContainerTypeSQLAGWorkLoadContainer, + ProtectableContainerTypeStorageContainer, + ProtectableContainerTypeUnknown, + ProtectableContainerTypeVCenter, + ProtectableContainerTypeVMAppContainer, + ProtectableContainerTypeWindows, } } @@ -1146,21 +1145,21 @@ func PossibleRecoveryModeValues() []RecoveryMode { type RecoveryPointTierStatus string const ( - RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" - RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" - RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" + RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" + RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" RecoveryPointTierStatusRehydrated RecoveryPointTierStatus = "Rehydrated" + RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" ) // PossibleRecoveryPointTierStatusValues returns the possible values for the RecoveryPointTierStatus const type. func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { return []RecoveryPointTierStatus{ - RecoveryPointTierStatusInvalid, - RecoveryPointTierStatusValid, - RecoveryPointTierStatusDisabled, RecoveryPointTierStatusDeleted, + RecoveryPointTierStatusDisabled, + RecoveryPointTierStatusInvalid, RecoveryPointTierStatusRehydrated, + RecoveryPointTierStatusValid, } } @@ -1168,19 +1167,19 @@ func PossibleRecoveryPointTierStatusValues() []RecoveryPointTierStatus { type RecoveryPointTierType string const ( - RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" - RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" - RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" RecoveryPointTierTypeArchivedRP RecoveryPointTierType = "ArchivedRP" + RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" + RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" + RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" ) // PossibleRecoveryPointTierTypeValues returns the possible values for the RecoveryPointTierType const type. func PossibleRecoveryPointTierTypeValues() []RecoveryPointTierType { return []RecoveryPointTierType{ - RecoveryPointTierTypeInvalid, - RecoveryPointTierTypeInstantRP, - RecoveryPointTierTypeHardenedRP, RecoveryPointTierTypeArchivedRP, + RecoveryPointTierTypeHardenedRP, + RecoveryPointTierTypeInstantRP, + RecoveryPointTierTypeInvalid, } } @@ -1402,6 +1401,7 @@ func PossibleScheduleRunTypeValues() []ScheduleRunType { type SoftDeleteFeatureState string const ( + SoftDeleteFeatureStateAlwaysON SoftDeleteFeatureState = "AlwaysON" SoftDeleteFeatureStateDisabled SoftDeleteFeatureState = "Disabled" SoftDeleteFeatureStateEnabled SoftDeleteFeatureState = "Enabled" SoftDeleteFeatureStateInvalid SoftDeleteFeatureState = "Invalid" @@ -1410,6 +1410,7 @@ const ( // PossibleSoftDeleteFeatureStateValues returns the possible values for the SoftDeleteFeatureState const type. func PossibleSoftDeleteFeatureStateValues() []SoftDeleteFeatureState { return []SoftDeleteFeatureState{ + SoftDeleteFeatureStateAlwaysON, SoftDeleteFeatureStateDisabled, SoftDeleteFeatureStateEnabled, SoftDeleteFeatureStateInvalid, @@ -1483,17 +1484,17 @@ func PossibleSupportStatusValues() []SupportStatus { type TargetDiskNetworkAccessOption string const ( - TargetDiskNetworkAccessOptionSameAsOnSourceDisks TargetDiskNetworkAccessOption = "SameAsOnSourceDisks" TargetDiskNetworkAccessOptionEnablePrivateAccessForAllDisks TargetDiskNetworkAccessOption = "EnablePrivateAccessForAllDisks" TargetDiskNetworkAccessOptionEnablePublicAccessForAllDisks TargetDiskNetworkAccessOption = "EnablePublicAccessForAllDisks" + TargetDiskNetworkAccessOptionSameAsOnSourceDisks TargetDiskNetworkAccessOption = "SameAsOnSourceDisks" ) // PossibleTargetDiskNetworkAccessOptionValues returns the possible values for the TargetDiskNetworkAccessOption const type. func PossibleTargetDiskNetworkAccessOptionValues() []TargetDiskNetworkAccessOption { return []TargetDiskNetworkAccessOption{ - TargetDiskNetworkAccessOptionSameAsOnSourceDisks, TargetDiskNetworkAccessOptionEnablePrivateAccessForAllDisks, TargetDiskNetworkAccessOptionEnablePublicAccessForAllDisks, + TargetDiskNetworkAccessOptionSameAsOnSourceDisks, } } @@ -1580,26 +1581,44 @@ func PossibleValidationStatusValues() []ValidationStatus { } } +// VaultSubResourceType - GroupId for the PrivateEndpointConnection - AzureBackup, AzureBackup_secondary or AzureSiteRecovery +type VaultSubResourceType string + +const ( + VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" + VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" + VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" +) + +// PossibleVaultSubResourceTypeValues returns the possible values for the VaultSubResourceType const type. +func PossibleVaultSubResourceTypeValues() []VaultSubResourceType { + return []VaultSubResourceType{ + VaultSubResourceTypeAzureBackup, + VaultSubResourceTypeAzureBackupSecondary, + VaultSubResourceTypeAzureSiteRecovery, + } +} + type WeekOfMonth string const ( WeekOfMonthFirst WeekOfMonth = "First" - WeekOfMonthSecond WeekOfMonth = "Second" - WeekOfMonthThird WeekOfMonth = "Third" WeekOfMonthFourth WeekOfMonth = "Fourth" - WeekOfMonthLast WeekOfMonth = "Last" WeekOfMonthInvalid WeekOfMonth = "Invalid" + WeekOfMonthLast WeekOfMonth = "Last" + WeekOfMonthSecond WeekOfMonth = "Second" + WeekOfMonthThird WeekOfMonth = "Third" ) // PossibleWeekOfMonthValues returns the possible values for the WeekOfMonth const type. func PossibleWeekOfMonthValues() []WeekOfMonth { return []WeekOfMonth{ WeekOfMonthFirst, - WeekOfMonthSecond, - WeekOfMonthThird, WeekOfMonthFourth, - WeekOfMonthLast, WeekOfMonthInvalid, + WeekOfMonthLast, + WeekOfMonthSecond, + WeekOfMonthThird, } } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go index 1944c73f7db4..1768242b4293 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewDeletedProtectionContainersClient(subscriptionID string, credential azco // NewListPager - Lists the soft deleted containers registered to Recovery Services Vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -99,7 +98,7 @@ func (client *DeletedProtectionContainersClient) listCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go deleted file mode 100644 index eb42d462eae0..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/deletedprotectioncontainers_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureStorage/SoftDeletedContainers_List.json -func ExampleDeletedProtectionContainersClient_NewListPager() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewDeletedProtectionContainersClient().NewListPager("testRg", "testVault", &armrecoveryservicesbackup.DeletedProtectionContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureWorkload'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectionContainerResourceList = armrecoveryservicesbackup.ProtectionContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectionContainerResource{ - // { - // Name: to.Ptr("StorageContainer;Storage;testrg;suchandrtestsa125"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourcegroups/testrg/providers/microsoft.recoveryservices/vaults/suchandr-test-vault-wcus/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;testrg;suchandrtestsa125"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("suchandrtestsa125"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("SoftDeleted"), - // ProtectedItemCount: to.Ptr[int64](2), - // SourceResourceID: to.Ptr("/subscriptions/172424a4-d65f-421e-a8de-197d98aabeba/resourceGroups/testrg/providers/Microsoft.Storage/storageAccounts/suchandrtestsa125"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go index 26b3be45f613..7d3753e3ce3a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,25 +48,28 @@ func NewExportJobsOperationResultsClient(subscriptionID string, credential azcor // jobs in JSON serialized format. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - ExportJobsOperationResultsClientGetOptions contains the optional parameters for the ExportJobsOperationResultsClient.Get // method. func (client *ExportJobsOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ExportJobsOperationResultsClientGetOptions) (ExportJobsOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return ExportJobsOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ExportJobsOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return ExportJobsOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ExportJobsOperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -94,7 +96,7 @@ func (client *ExportJobsOperationResultsClient) getCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go deleted file mode 100644 index dbacbd7378f4..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/exportjobsoperationresults_client_example_test.go +++ /dev/null @@ -1,47 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewExportJobsOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationResultInfoBaseResource = armrecoveryservicesbackup.OperationResultInfoBaseResource{ - // Headers: map[string][]*string{ - // }, - // Operation: &armrecoveryservicesbackup.ExportJobsOperationResultInfo{ - // ObjectType: to.Ptr("ExportJobsOperationResultInfo"), - // BlobSasKey: to.Ptr("?sv=2014-02-14&sr=b&sig=&st=2017-11-29T07%3A53%3A34Z&se=2017-11-29T08%3A03%3A34Z&sp=r"), - // BlobURL: to.Ptr("https://azureblob.blob.core.windows.net/reportcontainer/exportjobsreportc00000000-0000-0000-0000-000000000000"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go index cf099d1c2974..ab83543301e5 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,23 +46,26 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - azureRegion - Azure region to hit Api // - parameters - Feature support request object // - options - FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. func (client *FeatureSupportClient) Validate(ctx context.Context, azureRegion string, parameters FeatureSupportRequestClassification, options *FeatureSupportClientValidateOptions) (FeatureSupportClientValidateResponse, error) { + var err error req, err := client.validateCreateRequest(ctx, azureRegion, parameters, options) if err != nil { return FeatureSupportClientValidateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return FeatureSupportClientValidateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return FeatureSupportClientValidateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FeatureSupportClientValidateResponse{}, err } - return client.validateHandleResponse(resp) + resp, err := client.validateHandleResponse(httpResp) + return resp, err } // validateCreateRequest creates the Validate request. @@ -82,10 +84,13 @@ func (client *FeatureSupportClient) validateCreateRequest(ctx context.Context, a return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // validateHandleResponse handles the Validate response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_test.go deleted file mode 100644 index 894b7b210d6c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/featuresupport_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewFeatureSupportClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.AzureVMResourceFeatureSupportResponse = armrecoveryservicesbackup.AzureVMResourceFeatureSupportResponse{ - // SupportStatus: to.Ptr(armrecoveryservicesbackup.SupportStatusDefaultOFF), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.mod index c93c6af3d12f..11fcf5b48e9f 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/v2 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/v3 go 1.18 -require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 -) +require github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 require ( - github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 // indirect - github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 // indirect - github.com/golang-jwt/jwt/v4 v4.5.0 // indirect - github.com/google/uuid v1.3.0 // indirect - github.com/kylelemons/godebug v1.1.0 // indirect - github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 // indirect - golang.org/x/crypto v0.6.0 // indirect - golang.org/x/net v0.7.0 // indirect - golang.org/x/sys v0.5.0 // indirect - golang.org/x/text v0.7.0 // indirect + github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + golang.org/x/net v0.8.0 // indirect + golang.org/x/text v0.8.0 // 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 8ba445a8c4da..5c6bee428364 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/go.sum @@ -1,31 +1,15 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0 h1:rTnT/Jrcm+figWlYz4Ixzt0SJVR2cMC8lvZcimipiEY= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.4.0/go.mod h1:ON4tFdPTwRcgWEaVDrN3584Ef+b7GgSJaXxe5fW9t4M= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0 h1:leh5DwKv6Ihwi+h60uHtn6UWAxBbZ0q8DwQVMzf61zw= -github.com/Azure/azure-sdk-for-go/sdk/internal v1.2.0/go.mod h1:eWRD7oawr1Mu1sLCawqVc0CUiF43ia3qQMxLscsKQ9w= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0 h1:UE9n9rkJF62ArLb1F3DEjRt8O3jLwMWdSoypKV4f3MU= -github.com/AzureAD/microsoft-authentication-library-for-go v0.9.0/go.mod h1:kgDmCTgBzIEPFElEF+FK0SdjAor06dRq2Go927dnQ6o= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= +github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM= 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/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg= -github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= -github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= -github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= -github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8 h1:KoWmjvw+nsYOo29YJK9vDA65RGE3NrOnUtO7a+RF9HU= -github.com/pkg/browser v0.0.0-20210911075715-681adbf594b8/go.mod h1:HKlIX3XHQyzLZPlr7++PzdhaXEj94dEiJgZDTsxEqUI= +github.com/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.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc= -golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58= -golang.org/x/net v0.7.0 h1:rJrUqqhjsgNp7KqAIc25s9pZnjU7TUcSY7HcVZjdn1g= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/sys v0.0.0-20210616045830-e2b7044e8c71/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0 h1:MUK/U/4lj1t1oPg0HfuXDN/Z1wv31ZJ/YcPiGccS4DU= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.7.0 h1:4BRB4x83lYWy72KwLD/qYDuTu7q9PjSagHvijDw7cLo= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ= +golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= +golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68= +golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= +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/interfaces.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/interfaces.go new file mode 100644 index 000000000000..4936e761c77c --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/interfaces.go @@ -0,0 +1,473 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armrecoveryservicesbackup + +// AzureIaaSVMProtectedItemClassification provides polymorphic access to related types. +// Call the interface's GetAzureIaaSVMProtectedItem() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureIaaSClassicComputeVMProtectedItem, *AzureIaaSComputeVMProtectedItem, *AzureIaaSVMProtectedItem +type AzureIaaSVMProtectedItemClassification interface { + ProtectedItemClassification + // GetAzureIaaSVMProtectedItem returns the AzureIaaSVMProtectedItem content of the underlying type. + GetAzureIaaSVMProtectedItem() *AzureIaaSVMProtectedItem +} + +// AzureRecoveryServiceVaultProtectionIntentClassification provides polymorphic access to related types. +// Call the interface's GetAzureRecoveryServiceVaultProtectionIntent() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureRecoveryServiceVaultProtectionIntent, *AzureWorkloadAutoProtectionIntent, *AzureWorkloadSQLAutoProtectionIntent +type AzureRecoveryServiceVaultProtectionIntentClassification interface { + ProtectionIntentClassification + // GetAzureRecoveryServiceVaultProtectionIntent returns the AzureRecoveryServiceVaultProtectionIntent content of the underlying type. + GetAzureRecoveryServiceVaultProtectionIntent() *AzureRecoveryServiceVaultProtectionIntent +} + +// AzureRecoveryServiceVaultProtectionIntentClassification provides polymorphic access to related types. +// Call the interface's GetAzureRecoveryServiceVaultProtectionIntent() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureRecoveryServiceVaultProtectionIntent, *AzureWorkloadAutoProtectionIntent, *AzureWorkloadSQLAutoProtectionIntent +type AzureRecoveryServiceVaultProtectionIntentClassification interface { + ProtectionIntentClassification + // GetAzureRecoveryServiceVaultProtectionIntent returns the AzureRecoveryServiceVaultProtectionIntent content of the underlying type. + GetAzureRecoveryServiceVaultProtectionIntent() *AzureRecoveryServiceVaultProtectionIntent +} + +// AzureVMWorkloadItemClassification provides polymorphic access to related types. +// Call the interface's GetAzureVMWorkloadItem() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureVMWorkloadItem, *AzureVMWorkloadSAPAseDatabaseWorkloadItem, *AzureVMWorkloadSAPAseSystemWorkloadItem, *AzureVMWorkloadSAPHanaDatabaseWorkloadItem, +// - *AzureVMWorkloadSAPHanaSystemWorkloadItem, *AzureVMWorkloadSQLDatabaseWorkloadItem, *AzureVMWorkloadSQLInstanceWorkloadItem +type AzureVMWorkloadItemClassification interface { + WorkloadItemClassification + // GetAzureVMWorkloadItem returns the AzureVMWorkloadItem content of the underlying type. + GetAzureVMWorkloadItem() *AzureVMWorkloadItem +} + +// 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, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSRProtectableItem, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, +// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem +type AzureVMWorkloadProtectableItemClassification interface { + WorkloadProtectableItemClassification + // GetAzureVMWorkloadProtectableItem returns the AzureVMWorkloadProtectableItem content of the underlying type. + GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem +} + +// 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, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem +type AzureVMWorkloadProtectedItemClassification interface { + ProtectedItemClassification + // GetAzureVMWorkloadProtectedItem returns the AzureVMWorkloadProtectedItem content of the underlying type. + GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem +} + +// AzureWorkloadAutoProtectionIntentClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadAutoProtectionIntent() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadAutoProtectionIntent, *AzureWorkloadSQLAutoProtectionIntent +type AzureWorkloadAutoProtectionIntentClassification interface { + AzureRecoveryServiceVaultProtectionIntentClassification + // GetAzureWorkloadAutoProtectionIntent returns the AzureWorkloadAutoProtectionIntent content of the underlying type. + GetAzureWorkloadAutoProtectionIntent() *AzureWorkloadAutoProtectionIntent +} + +// AzureWorkloadContainerClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadContainer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureSQLAGWorkloadContainerProtectionContainer, *AzureVMAppContainerProtectionContainer, *AzureWorkloadContainer +type AzureWorkloadContainerClassification interface { + ProtectionContainerClassification + // GetAzureWorkloadContainer returns the AzureWorkloadContainer content of the underlying type. + GetAzureWorkloadContainer() *AzureWorkloadContainer +} + +// AzureWorkloadPointInTimeRecoveryPointClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadPointInTimeRecoveryPoint() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint +type AzureWorkloadPointInTimeRecoveryPointClassification interface { + AzureWorkloadRecoveryPointClassification + // GetAzureWorkloadPointInTimeRecoveryPoint returns the AzureWorkloadPointInTimeRecoveryPoint content of the underlying type. + GetAzureWorkloadPointInTimeRecoveryPoint() *AzureWorkloadPointInTimeRecoveryPoint +} + +// AzureWorkloadRecoveryPointClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadRecoveryPoint() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint, *AzureWorkloadSAPHanaRecoveryPoint, +// - *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint +type AzureWorkloadRecoveryPointClassification interface { + RecoveryPointClassification + // GetAzureWorkloadRecoveryPoint returns the AzureWorkloadRecoveryPoint content of the underlying type. + GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint +} + +// AzureWorkloadRecoveryPointClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadRecoveryPoint() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint, *AzureWorkloadSAPHanaRecoveryPoint, +// - *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint +type AzureWorkloadRecoveryPointClassification interface { + RecoveryPointClassification + // GetAzureWorkloadRecoveryPoint returns the AzureWorkloadRecoveryPoint content of the underlying type. + GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint +} + +// AzureWorkloadRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadPointInTimeRestoreRequest, *AzureWorkloadRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreRequest, +// - *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, *AzureWorkloadSAPHanaRestoreWithRehydrateRequest, +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, +// - *AzureWorkloadSQLRestoreWithRehydrateRequest +type AzureWorkloadRestoreRequestClassification interface { + RestoreRequestClassification + // GetAzureWorkloadRestoreRequest returns the AzureWorkloadRestoreRequest content of the underlying type. + GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest +} + +// AzureWorkloadRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadPointInTimeRestoreRequest, *AzureWorkloadRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreRequest, +// - *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, *AzureWorkloadSAPHanaRestoreWithRehydrateRequest, +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, +// - *AzureWorkloadSQLRestoreWithRehydrateRequest +type AzureWorkloadRestoreRequestClassification interface { + RestoreRequestClassification + // GetAzureWorkloadRestoreRequest returns the AzureWorkloadRestoreRequest content of the underlying type. + GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest +} + +// AzureWorkloadSAPHanaPointInTimeRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSAPHanaPointInTimeRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSAPHanaPointInTimeRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest +type AzureWorkloadSAPHanaPointInTimeRestoreRequestClassification interface { + AzureWorkloadSAPHanaRestoreRequestClassification + // GetAzureWorkloadSAPHanaPointInTimeRestoreRequest returns the AzureWorkloadSAPHanaPointInTimeRestoreRequest content of the underlying type. + GetAzureWorkloadSAPHanaPointInTimeRestoreRequest() *AzureWorkloadSAPHanaPointInTimeRestoreRequest +} + +// AzureWorkloadSAPHanaRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSAPHanaRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSAPHanaPointInTimeRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, +// - *AzureWorkloadSAPHanaRestoreWithRehydrateRequest +type AzureWorkloadSAPHanaRestoreRequestClassification interface { + AzureWorkloadRestoreRequestClassification + // GetAzureWorkloadSAPHanaRestoreRequest returns the AzureWorkloadSAPHanaRestoreRequest content of the underlying type. + GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest +} + +// AzureWorkloadSAPHanaRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSAPHanaRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSAPHanaPointInTimeRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, +// - *AzureWorkloadSAPHanaRestoreWithRehydrateRequest +type AzureWorkloadSAPHanaRestoreRequestClassification interface { + AzureWorkloadRestoreRequestClassification + // GetAzureWorkloadSAPHanaRestoreRequest returns the AzureWorkloadSAPHanaRestoreRequest content of the underlying type. + GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest +} + +// AzureWorkloadSQLPointInTimeRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSQLPointInTimeRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest +type AzureWorkloadSQLPointInTimeRestoreRequestClassification interface { + AzureWorkloadSQLRestoreRequestClassification + // GetAzureWorkloadSQLPointInTimeRestoreRequest returns the AzureWorkloadSQLPointInTimeRestoreRequest content of the underlying type. + GetAzureWorkloadSQLPointInTimeRestoreRequest() *AzureWorkloadSQLPointInTimeRestoreRequest +} + +// AzureWorkloadSQLRecoveryPointClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSQLRecoveryPoint() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint +type AzureWorkloadSQLRecoveryPointClassification interface { + AzureWorkloadRecoveryPointClassification + // GetAzureWorkloadSQLRecoveryPoint returns the AzureWorkloadSQLRecoveryPoint content of the underlying type. + GetAzureWorkloadSQLRecoveryPoint() *AzureWorkloadSQLRecoveryPoint +} + +// AzureWorkloadSQLRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSQLRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, +// - *AzureWorkloadSQLRestoreWithRehydrateRequest +type AzureWorkloadSQLRestoreRequestClassification interface { + AzureWorkloadRestoreRequestClassification + // GetAzureWorkloadSQLRestoreRequest returns the AzureWorkloadSQLRestoreRequest content of the underlying type. + GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest +} + +// AzureWorkloadSQLRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetAzureWorkloadSQLRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, +// - *AzureWorkloadSQLRestoreWithRehydrateRequest +type AzureWorkloadSQLRestoreRequestClassification interface { + AzureWorkloadRestoreRequestClassification + // GetAzureWorkloadSQLRestoreRequest returns the AzureWorkloadSQLRestoreRequest content of the underlying type. + GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest +} + +// BackupEngineBaseClassification provides polymorphic access to related types. +// Call the interface's GetBackupEngineBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBackupServerEngine, *BackupEngineBase, *DpmBackupEngine +type BackupEngineBaseClassification interface { + // GetBackupEngineBase returns the BackupEngineBase content of the underlying type. + GetBackupEngineBase() *BackupEngineBase +} + +// BackupRequestClassification provides polymorphic access to related types. +// Call the interface's GetBackupRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileShareBackupRequest, *AzureWorkloadBackupRequest, *BackupRequest, *IaasVMBackupRequest +type BackupRequestClassification interface { + // GetBackupRequest returns the BackupRequest content of the underlying type. + GetBackupRequest() *BackupRequest +} + +// DpmContainerClassification provides polymorphic access to related types. +// Call the interface's GetDpmContainer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBackupServerContainer, *DpmContainer +type DpmContainerClassification interface { + ProtectionContainerClassification + // GetDpmContainer returns the DpmContainer content of the underlying type. + GetDpmContainer() *DpmContainer +} + +// FeatureSupportRequestClassification provides polymorphic access to related types. +// Call the interface's GetFeatureSupportRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBackupGoalFeatureSupportRequest, *AzureVMResourceFeatureSupportRequest, *FeatureSupportRequest +type FeatureSupportRequestClassification interface { + // GetFeatureSupportRequest returns the FeatureSupportRequest content of the underlying type. + GetFeatureSupportRequest() *FeatureSupportRequest +} + +// ILRRequestClassification provides polymorphic access to related types. +// Call the interface's GetILRRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileShareProvisionILRRequest, *ILRRequest, *IaasVMILRRegistrationRequest +type ILRRequestClassification interface { + // GetILRRequest returns the ILRRequest content of the underlying type. + GetILRRequest() *ILRRequest +} + +// IaaSVMContainerClassification provides polymorphic access to related types. +// Call the interface's GetIaaSVMContainer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureIaaSClassicComputeVMContainer, *AzureIaaSComputeVMContainer, *IaaSVMContainer +type IaaSVMContainerClassification interface { + ProtectionContainerClassification + // GetIaaSVMContainer returns the IaaSVMContainer content of the underlying type. + GetIaaSVMContainer() *IaaSVMContainer +} + +// IaaSVMProtectableItemClassification provides polymorphic access to related types. +// Call the interface's GetIaaSVMProtectableItem() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureIaaSClassicComputeVMProtectableItem, *AzureIaaSComputeVMProtectableItem, *IaaSVMProtectableItem +type IaaSVMProtectableItemClassification interface { + WorkloadProtectableItemClassification + // GetIaaSVMProtectableItem returns the IaaSVMProtectableItem content of the underlying type. + GetIaaSVMProtectableItem() *IaaSVMProtectableItem +} + +// IaasVMRestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetIaasVMRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *IaasVMRestoreRequest, *IaasVMRestoreWithRehydrationRequest +type IaasVMRestoreRequestClassification interface { + RestoreRequestClassification + // GetIaasVMRestoreRequest returns the IaasVMRestoreRequest content of the underlying type. + GetIaasVMRestoreRequest() *IaasVMRestoreRequest +} + +// JobClassification provides polymorphic access to related types. +// Call the interface's GetJob() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureIaaSVMJob, *AzureIaaSVMJobV2, *AzureStorageJob, *AzureWorkloadJob, *DpmJob, *Job, *MabJob, *VaultJob +type JobClassification interface { + // GetJob returns the Job content of the underlying type. + GetJob() *Job +} + +// OperationResultInfoBaseClassification provides polymorphic access to related types. +// Call the interface's GetOperationResultInfoBase() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ExportJobsOperationResultInfo, *OperationResultInfo, *OperationResultInfoBase +type OperationResultInfoBaseClassification interface { + // GetOperationResultInfoBase returns the OperationResultInfoBase content of the underlying type. + GetOperationResultInfoBase() *OperationResultInfoBase +} + +// OperationStatusExtendedInfoClassification provides polymorphic access to related types. +// Call the interface's GetOperationStatusExtendedInfo() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *OperationStatusExtendedInfo, *OperationStatusJobExtendedInfo, *OperationStatusJobsExtendedInfo, *OperationStatusProvisionILRExtendedInfo, +// - *OperationStatusValidateOperationExtendedInfo +type OperationStatusExtendedInfoClassification interface { + // GetOperationStatusExtendedInfo returns the OperationStatusExtendedInfo content of the underlying type. + GetOperationStatusExtendedInfo() *OperationStatusExtendedInfo +} + +// ProtectableContainerClassification provides polymorphic access to related types. +// Call the interface's GetProtectableContainer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureStorageProtectableContainer, *AzureVMAppContainerProtectableContainer, *ProtectableContainer +type ProtectableContainerClassification interface { + // GetProtectableContainer returns the ProtectableContainer content of the underlying type. + GetProtectableContainer() *ProtectableContainer +} + +// ProtectedItemClassification provides polymorphic access to related types. +// 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, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, +// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, +// - *MabFileFolderProtectedItem, *ProtectedItem +type ProtectedItemClassification interface { + // GetProtectedItem returns the ProtectedItem content of the underlying type. + GetProtectedItem() *ProtectedItem +} + +// ProtectionContainerClassification provides polymorphic access to related types. +// Call the interface's GetProtectionContainer() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureBackupServerContainer, *AzureIaaSClassicComputeVMContainer, *AzureIaaSComputeVMContainer, *AzureSQLAGWorkloadContainerProtectionContainer, +// - *AzureSQLContainer, *AzureStorageContainer, *AzureVMAppContainerProtectionContainer, *AzureWorkloadContainer, *DpmContainer, +// - *GenericContainer, *IaaSVMContainer, *MabContainer, *ProtectionContainer +type ProtectionContainerClassification interface { + // GetProtectionContainer returns the ProtectionContainer content of the underlying type. + GetProtectionContainer() *ProtectionContainer +} + +// ProtectionIntentClassification provides polymorphic access to related types. +// Call the interface's GetProtectionIntent() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureRecoveryServiceVaultProtectionIntent, *AzureResourceProtectionIntent, *AzureWorkloadAutoProtectionIntent, *AzureWorkloadContainerAutoProtectionIntent, +// - *AzureWorkloadSQLAutoProtectionIntent, *ProtectionIntent +type ProtectionIntentClassification interface { + // GetProtectionIntent returns the ProtectionIntent content of the underlying type. + GetProtectionIntent() *ProtectionIntent +} + +// ProtectionPolicyClassification provides polymorphic access to related types. +// Call the interface's GetProtectionPolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileShareProtectionPolicy, *AzureIaaSVMProtectionPolicy, *AzureSQLProtectionPolicy, *AzureVMWorkloadProtectionPolicy, +// - *GenericProtectionPolicy, *MabProtectionPolicy, *ProtectionPolicy +type ProtectionPolicyClassification interface { + // GetProtectionPolicy returns the ProtectionPolicy content of the underlying type. + GetProtectionPolicy() *ProtectionPolicy +} + +// RecoveryPointClassification provides polymorphic access to related types. +// Call the interface's GetRecoveryPoint() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileShareRecoveryPoint, *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint, +// - *AzureWorkloadSAPHanaRecoveryPoint, *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint, *GenericRecoveryPoint, +// - *IaasVMRecoveryPoint, *RecoveryPoint +type RecoveryPointClassification interface { + // GetRecoveryPoint returns the RecoveryPoint content of the underlying type. + GetRecoveryPoint() *RecoveryPoint +} + +// RestoreRequestClassification provides polymorphic access to related types. +// Call the interface's GetRestoreRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureFileShareRestoreRequest, *AzureWorkloadPointInTimeRestoreRequest, *AzureWorkloadRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreRequest, +// - *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, *AzureWorkloadSAPHanaRestoreWithRehydrateRequest, +// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, +// - *AzureWorkloadSQLRestoreWithRehydrateRequest, *IaasVMRestoreRequest, *IaasVMRestoreWithRehydrationRequest, *RestoreRequest +type RestoreRequestClassification interface { + // GetRestoreRequest returns the RestoreRequest content of the underlying type. + GetRestoreRequest() *RestoreRequest +} + +// RetentionPolicyClassification provides polymorphic access to related types. +// Call the interface's GetRetentionPolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LongTermRetentionPolicy, *RetentionPolicy, *SimpleRetentionPolicy +type RetentionPolicyClassification interface { + // GetRetentionPolicy returns the RetentionPolicy content of the underlying type. + GetRetentionPolicy() *RetentionPolicy +} + +// SchedulePolicyClassification provides polymorphic access to related types. +// Call the interface's GetSchedulePolicy() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *LogSchedulePolicy, *LongTermSchedulePolicy, *SchedulePolicy, *SimpleSchedulePolicy, *SimpleSchedulePolicyV2 +type SchedulePolicyClassification interface { + // GetSchedulePolicy returns the SchedulePolicy content of the underlying type. + GetSchedulePolicy() *SchedulePolicy +} + +// ValidateOperationRequestClassification provides polymorphic access to related types. +// Call the interface's GetValidateOperationRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ValidateIaasVMRestoreOperationRequest, *ValidateOperationRequest, *ValidateRestoreOperationRequest +type ValidateOperationRequestClassification interface { + // GetValidateOperationRequest returns the ValidateOperationRequest content of the underlying type. + GetValidateOperationRequest() *ValidateOperationRequest +} + +// ValidateRestoreOperationRequestClassification provides polymorphic access to related types. +// Call the interface's GetValidateRestoreOperationRequest() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *ValidateIaasVMRestoreOperationRequest, *ValidateRestoreOperationRequest +type ValidateRestoreOperationRequestClassification interface { + ValidateOperationRequestClassification + // GetValidateRestoreOperationRequest returns the ValidateRestoreOperationRequest content of the underlying type. + GetValidateRestoreOperationRequest() *ValidateRestoreOperationRequest +} + +// VaultStorageConfigOperationResultResponseClassification provides polymorphic access to related types. +// Call the interface's GetVaultStorageConfigOperationResultResponse() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *PrepareDataMoveResponse, *VaultStorageConfigOperationResultResponse +type VaultStorageConfigOperationResultResponseClassification interface { + // GetVaultStorageConfigOperationResultResponse returns the VaultStorageConfigOperationResultResponse content of the underlying type. + GetVaultStorageConfigOperationResultResponse() *VaultStorageConfigOperationResultResponse +} + +// WorkloadItemClassification provides polymorphic access to related types. +// Call the interface's GetWorkloadItem() method to access the common type. +// Use a type switch to determine the concrete type. The possible types are: +// - *AzureVMWorkloadItem, *AzureVMWorkloadSAPAseDatabaseWorkloadItem, *AzureVMWorkloadSAPAseSystemWorkloadItem, *AzureVMWorkloadSAPHanaDatabaseWorkloadItem, +// - *AzureVMWorkloadSAPHanaSystemWorkloadItem, *AzureVMWorkloadSQLDatabaseWorkloadItem, *AzureVMWorkloadSQLInstanceWorkloadItem, +// - *WorkloadItem +type WorkloadItemClassification interface { + // GetWorkloadItem returns the WorkloadItem content of the underlying type. + GetWorkloadItem() *WorkloadItem +} + +// WorkloadProtectableItemClassification provides polymorphic access to related types. +// 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, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, +// - *AzureVMWorkloadSAPHanaHSRProtectableItem, *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/itemlevelrecoveryconnections_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go index 26aa8dafa3d7..25c75e9c485f 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,7 +48,7 @@ func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azc // operation. To know the status of provisioning, call GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -61,16 +60,18 @@ func NewItemLevelRecoveryConnectionsClient(subscriptionID string, credential azc // - options - ItemLevelRecoveryConnectionsClientProvisionOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Provision // method. func (client *ItemLevelRecoveryConnectionsClient) Provision(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, parameters ILRRequestResource, options *ItemLevelRecoveryConnectionsClientProvisionOptions) (ItemLevelRecoveryConnectionsClientProvisionResponse, error) { + var err error req, err := client.provisionCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { return ItemLevelRecoveryConnectionsClientProvisionResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ItemLevelRecoveryConnectionsClientProvisionResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ItemLevelRecoveryConnectionsClientProvisionResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ItemLevelRecoveryConnectionsClientProvisionResponse{}, err } return ItemLevelRecoveryConnectionsClientProvisionResponse{}, nil } @@ -111,17 +112,20 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -132,16 +136,18 @@ func (client *ItemLevelRecoveryConnectionsClient) provisionCreateRequest(ctx con // - options - ItemLevelRecoveryConnectionsClientRevokeOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Revoke // method. func (client *ItemLevelRecoveryConnectionsClient) Revoke(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, options *ItemLevelRecoveryConnectionsClientRevokeOptions) (ItemLevelRecoveryConnectionsClientRevokeResponse, error) { + var err error req, err := client.revokeCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, options) if err != nil { return ItemLevelRecoveryConnectionsClientRevokeResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ItemLevelRecoveryConnectionsClientRevokeResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ItemLevelRecoveryConnectionsClientRevokeResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ItemLevelRecoveryConnectionsClientRevokeResponse{}, err } return ItemLevelRecoveryConnectionsClientRevokeResponse{}, nil } @@ -182,7 +188,7 @@ func (client *ItemLevelRecoveryConnectionsClient) revokeCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go deleted file mode 100644 index 52ffd7d31b36..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/itemlevelrecoveryconnections_client_example_test.go +++ /dev/null @@ -1,61 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewItemLevelRecoveryConnectionsClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewItemLevelRecoveryConnectionsClient().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/jobcancellations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go index a9878bcab821..6fa19d33d1bf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,23 +47,25 @@ func NewJobCancellationsClient(subscriptionID string, credential azcore.TokenCre // API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - JobCancellationsClientTriggerOptions contains the optional parameters for the JobCancellationsClient.Trigger // method. func (client *JobCancellationsClient) Trigger(ctx context.Context, vaultName string, resourceGroupName string, jobName string, options *JobCancellationsClientTriggerOptions) (JobCancellationsClientTriggerResponse, error) { + var err error req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, jobName, options) if err != nil { return JobCancellationsClientTriggerResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobCancellationsClientTriggerResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return JobCancellationsClientTriggerResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return JobCancellationsClientTriggerResponse{}, err } return JobCancellationsClientTriggerResponse{}, nil } @@ -93,7 +94,7 @@ func (client *JobCancellationsClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go deleted file mode 100644 index b48bd9724a43..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobcancellations_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobCancellationsClient().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/jobdetails_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go index dd514ae1f6ee..a52e2a6f7a81 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - JobDetailsClientGetOptions contains the optional parameters for the JobDetailsClient.Get method. func (client *JobDetailsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, options *JobDetailsClientGetOptions) (JobDetailsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, jobName, options) if err != nil { return JobDetailsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobDetailsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return JobDetailsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return JobDetailsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -91,7 +93,7 @@ func (client *JobDetailsClient) getCreateRequest(ctx context.Context, vaultName return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_test.go deleted file mode 100644 index bd22d3c7065c..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobdetails_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewJobDetailsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.JobResource = armrecoveryservicesbackup.JobResource{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupJobs"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupJobs/00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMJob{ - // ActivityID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // EntityFriendlyName: to.Ptr("testvm"), - // JobType: to.Ptr("AzureIaaSVMJob"), - // Operation: to.Ptr("Backup"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-08-03T05:31:07.014604Z"); return t}()), - // Status: to.Ptr("InProgress"), - // Duration: to.Ptr("PT9.8782791S"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureIaaSVMJobExtendedInfo{ - // PropertyBag: map[string]*string{ - // "VM Name": to.Ptr("testvm"), - // }, - // TasksList: []*armrecoveryservicesbackup.AzureIaaSVMJobTaskDetails{ - // { - // Duration: to.Ptr("PT0S"), - // Status: to.Ptr("InProgress"), - // TaskID: to.Ptr("Take Snapshot"), - // }, - // { - // Duration: to.Ptr("PT0S"), - // Status: to.Ptr("NotStarted"), - // TaskID: to.Ptr("Transfer data to vault"), - // }}, - // }, - // VirtualMachineVersion: to.Ptr("Compute"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go index 3ce7f2fe201a..71e6711fbc73 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,23 +46,25 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - operationID - OperationID which represents the operation whose result has to be fetched. // - options - JobOperationResultsClientGetOptions contains the optional parameters for the JobOperationResultsClient.Get method. func (client *JobOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, jobName string, operationID string, options *JobOperationResultsClientGetOptions) (JobOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, jobName, operationID, options) if err != nil { return JobOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return JobOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return JobOperationResultsClientGetResponse{}, err } return JobOperationResultsClientGetResponse{}, nil } @@ -96,7 +97,7 @@ func (client *JobOperationResultsClient) getCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go deleted file mode 100644 index 2143f7fb3307..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/joboperationresults_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobOperationResultsClient().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/jobs_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go index 7e22ef78b46a..53421ff834af 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,21 +46,23 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. func (client *JobsClient) Export(ctx context.Context, vaultName string, resourceGroupName string, options *JobsClientExportOptions) (JobsClientExportResponse, error) { + var err error req, err := client.exportCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { return JobsClientExportResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return JobsClientExportResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return JobsClientExportResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return JobsClientExportResponse{}, err } return JobsClientExportResponse{}, nil } @@ -86,7 +87,7 @@ func (client *JobsClient) exportCreateRequest(ctx context.Context, vaultName str return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go deleted file mode 100644 index 52e31ed35ad5..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/jobs_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewJobsClient().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/models.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go index f3506f2675fe..c7d68479d5a2 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -75,32 +74,32 @@ type AzureBackupServerContainer struct { // GetDpmContainer implements the DpmContainerClassification interface for type AzureBackupServerContainer. func (a *AzureBackupServerContainer) GetDpmContainer() *DpmContainer { return &DpmContainer{ + BackupManagementType: a.BackupManagementType, CanReRegister: a.CanReRegister, ContainerID: a.ContainerID, - ProtectedItemCount: a.ProtectedItemCount, + ContainerType: a.ContainerType, DpmAgentVersion: a.DpmAgentVersion, DpmServers: a.DpmServers, - UpgradeAvailable: a.UpgradeAvailable, - ProtectionStatus: a.ProtectionStatus, ExtendedInfo: a.ExtendedInfo, FriendlyName: a.FriendlyName, - BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, HealthStatus: a.HealthStatus, - ContainerType: a.ContainerType, ProtectableObjectType: a.ProtectableObjectType, + ProtectedItemCount: a.ProtectedItemCount, + ProtectionStatus: a.ProtectionStatus, + RegistrationStatus: a.RegistrationStatus, + UpgradeAvailable: a.UpgradeAvailable, } } // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureBackupServerContainer. func (a *AzureBackupServerContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -149,19 +148,19 @@ type AzureBackupServerEngine struct { // GetBackupEngineBase implements the BackupEngineBaseClassification interface for type AzureBackupServerEngine. func (a *AzureBackupServerEngine) GetBackupEngineBase() *BackupEngineBase { return &BackupEngineBase{ - FriendlyName: a.FriendlyName, - BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, + AzureBackupAgentVersion: a.AzureBackupAgentVersion, + BackupEngineID: a.BackupEngineID, BackupEngineState: a.BackupEngineState, - HealthStatus: a.HealthStatus, BackupEngineType: a.BackupEngineType, + BackupManagementType: a.BackupManagementType, CanReRegister: a.CanReRegister, - BackupEngineID: a.BackupEngineID, DpmVersion: a.DpmVersion, - AzureBackupAgentVersion: a.AzureBackupAgentVersion, + ExtendedInfo: a.ExtendedInfo, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, IsAzureBackupAgentUpgradeAvailable: a.IsAzureBackupAgentUpgradeAvailable, IsDpmUpgradeAvailable: a.IsDpmUpgradeAvailable, - ExtendedInfo: a.ExtendedInfo, + RegistrationStatus: a.RegistrationStatus, } } @@ -212,10 +211,10 @@ type AzureFileShareProtectableItem struct { func (a *AzureFileShareProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -246,8 +245,8 @@ type AzureFileShareProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type AzureFileShareProtectionPolicy. func (a *AzureFileShareProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: a.ProtectedItemsCount, BackupManagementType: a.BackupManagementType, + ProtectedItemsCount: a.ProtectedItemsCount, ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, } } @@ -396,7 +395,7 @@ type AzureFileshareProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -411,24 +410,24 @@ type AzureFileshareProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type AzureFileshareProtectedItem. func (a *AzureFileshareProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -487,27 +486,27 @@ type AzureIaaSClassicComputeVMContainer struct { // GetIaaSVMContainer implements the IaaSVMContainerClassification interface for type AzureIaaSClassicComputeVMContainer. func (a *AzureIaaSClassicComputeVMContainer) GetIaaSVMContainer() *IaaSVMContainer { return &IaaSVMContainer{ - VirtualMachineID: a.VirtualMachineID, - VirtualMachineVersion: a.VirtualMachineVersion, - ResourceGroup: a.ResourceGroup, - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, + ResourceGroup: a.ResourceGroup, + VirtualMachineID: a.VirtualMachineID, + VirtualMachineVersion: a.VirtualMachineVersion, } } // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureIaaSClassicComputeVMContainer. func (a *AzureIaaSClassicComputeVMContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -541,14 +540,14 @@ type AzureIaaSClassicComputeVMProtectableItem struct { // GetIaaSVMProtectableItem implements the IaaSVMProtectableItemClassification interface for type AzureIaaSClassicComputeVMProtectableItem. func (a *AzureIaaSClassicComputeVMProtectableItem) GetIaaSVMProtectableItem() *IaaSVMProtectableItem { return &IaaSVMProtectableItem{ - VirtualMachineID: a.VirtualMachineID, - VirtualMachineVersion: a.VirtualMachineVersion, - ResourceGroup: a.ResourceGroup, BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + ResourceGroup: a.ResourceGroup, + VirtualMachineID: a.VirtualMachineID, + VirtualMachineVersion: a.VirtualMachineVersion, + WorkloadType: a.WorkloadType, } } @@ -556,10 +555,10 @@ func (a *AzureIaaSClassicComputeVMProtectableItem) GetIaaSVMProtectableItem() *I func (a *AzureIaaSClassicComputeVMProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -629,7 +628,7 @@ type AzureIaaSClassicComputeVMProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -659,60 +658,60 @@ type AzureIaaSClassicComputeVMProtectedItem struct { // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSClassicComputeVMProtectedItem. func (a *AzureIaaSClassicComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() *AzureIaaSVMProtectedItem { return &AzureIaaSVMProtectedItem{ - FriendlyName: a.FriendlyName, - VirtualMachineID: a.VirtualMachineID, - ProtectionStatus: a.ProtectionStatus, - ProtectionState: a.ProtectionState, - HealthStatus: a.HealthStatus, - HealthDetails: a.HealthDetails, - KpisHealths: a.KpisHealths, - LastBackupStatus: a.LastBackupStatus, - LastBackupTime: a.LastBackupTime, - ProtectedItemDataID: a.ProtectedItemDataID, - ExtendedInfo: a.ExtendedInfo, - ExtendedProperties: a.ExtendedProperties, - ProtectedItemType: a.ProtectedItemType, BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ContainerName: a.ContainerName, - SourceResourceID: a.SourceResourceID, - PolicyID: a.PolicyID, - LastRecoveryPoint: a.LastRecoveryPoint, BackupSetName: a.BackupSetName, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + ExtendedProperties: a.ExtendedProperties, + FriendlyName: a.FriendlyName, + HealthDetails: a.HealthDetails, + HealthStatus: a.HealthStatus, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataID: a.ProtectedItemDataID, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + VirtualMachineID: a.VirtualMachineID, + WorkloadType: a.WorkloadType, } } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureIaaSClassicComputeVMProtectedItem. func (a *AzureIaaSClassicComputeVMProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -752,27 +751,27 @@ type AzureIaaSComputeVMContainer struct { // GetIaaSVMContainer implements the IaaSVMContainerClassification interface for type AzureIaaSComputeVMContainer. func (a *AzureIaaSComputeVMContainer) GetIaaSVMContainer() *IaaSVMContainer { return &IaaSVMContainer{ - VirtualMachineID: a.VirtualMachineID, - VirtualMachineVersion: a.VirtualMachineVersion, - ResourceGroup: a.ResourceGroup, - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, + ResourceGroup: a.ResourceGroup, + VirtualMachineID: a.VirtualMachineID, + VirtualMachineVersion: a.VirtualMachineVersion, } } // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureIaaSComputeVMContainer. func (a *AzureIaaSComputeVMContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -806,14 +805,14 @@ type AzureIaaSComputeVMProtectableItem struct { // GetIaaSVMProtectableItem implements the IaaSVMProtectableItemClassification interface for type AzureIaaSComputeVMProtectableItem. func (a *AzureIaaSComputeVMProtectableItem) GetIaaSVMProtectableItem() *IaaSVMProtectableItem { return &IaaSVMProtectableItem{ - VirtualMachineID: a.VirtualMachineID, - VirtualMachineVersion: a.VirtualMachineVersion, - ResourceGroup: a.ResourceGroup, BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + ResourceGroup: a.ResourceGroup, + VirtualMachineID: a.VirtualMachineID, + VirtualMachineVersion: a.VirtualMachineVersion, + WorkloadType: a.WorkloadType, } } @@ -821,10 +820,10 @@ func (a *AzureIaaSComputeVMProtectableItem) GetIaaSVMProtectableItem() *IaaSVMPr func (a *AzureIaaSComputeVMProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -894,7 +893,7 @@ type AzureIaaSComputeVMProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -924,60 +923,60 @@ type AzureIaaSComputeVMProtectedItem struct { // GetAzureIaaSVMProtectedItem implements the AzureIaaSVMProtectedItemClassification interface for type AzureIaaSComputeVMProtectedItem. func (a *AzureIaaSComputeVMProtectedItem) GetAzureIaaSVMProtectedItem() *AzureIaaSVMProtectedItem { return &AzureIaaSVMProtectedItem{ - FriendlyName: a.FriendlyName, - VirtualMachineID: a.VirtualMachineID, - ProtectionStatus: a.ProtectionStatus, - ProtectionState: a.ProtectionState, - HealthStatus: a.HealthStatus, - HealthDetails: a.HealthDetails, - KpisHealths: a.KpisHealths, - LastBackupStatus: a.LastBackupStatus, - LastBackupTime: a.LastBackupTime, - ProtectedItemDataID: a.ProtectedItemDataID, - ExtendedInfo: a.ExtendedInfo, - ExtendedProperties: a.ExtendedProperties, - ProtectedItemType: a.ProtectedItemType, BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ContainerName: a.ContainerName, - SourceResourceID: a.SourceResourceID, - PolicyID: a.PolicyID, - LastRecoveryPoint: a.LastRecoveryPoint, BackupSetName: a.BackupSetName, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + ExtendedProperties: a.ExtendedProperties, + FriendlyName: a.FriendlyName, + HealthDetails: a.HealthDetails, + HealthStatus: a.HealthStatus, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataID: a.ProtectedItemDataID, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + VirtualMachineID: a.VirtualMachineID, + WorkloadType: a.WorkloadType, } } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureIaaSComputeVMProtectedItem. func (a *AzureIaaSComputeVMProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -1062,14 +1061,14 @@ type AzureIaaSVMJob struct { // GetJob implements the JobClassification interface for type AzureIaaSVMJob. func (a *AzureIaaSVMJob) GetJob() *Job { return &Job{ - EntityFriendlyName: a.EntityFriendlyName, + ActivityID: a.ActivityID, BackupManagementType: a.BackupManagementType, - Operation: a.Operation, - Status: a.Status, - StartTime: a.StartTime, EndTime: a.EndTime, - ActivityID: a.ActivityID, + EntityFriendlyName: a.EntityFriendlyName, JobType: a.JobType, + Operation: a.Operation, + StartTime: a.StartTime, + Status: a.Status, } } @@ -1169,27 +1168,17 @@ type AzureIaaSVMJobV2 struct { // GetJob implements the JobClassification interface for type AzureIaaSVMJobV2. func (a *AzureIaaSVMJobV2) GetJob() *Job { return &Job{ - EntityFriendlyName: a.EntityFriendlyName, + ActivityID: a.ActivityID, BackupManagementType: a.BackupManagementType, + EndTime: a.EndTime, + EntityFriendlyName: a.EntityFriendlyName, + JobType: a.JobType, Operation: a.Operation, - Status: a.Status, StartTime: a.StartTime, - EndTime: a.EndTime, - ActivityID: a.ActivityID, - JobType: a.JobType, + Status: a.Status, } } -// AzureIaaSVMProtectedItemClassification provides polymorphic access to related types. -// Call the interface's GetAzureIaaSVMProtectedItem() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureIaaSClassicComputeVMProtectedItem, *AzureIaaSComputeVMProtectedItem, *AzureIaaSVMProtectedItem -type AzureIaaSVMProtectedItemClassification interface { - ProtectedItemClassification - // GetAzureIaaSVMProtectedItem returns the AzureIaaSVMProtectedItem content of the underlying type. - GetAzureIaaSVMProtectedItem() *AzureIaaSVMProtectedItem -} - // AzureIaaSVMProtectedItem - IaaS VM workload-specific backup item. type AzureIaaSVMProtectedItem struct { // REQUIRED; backup item type. @@ -1256,7 +1245,7 @@ type AzureIaaSVMProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -1289,24 +1278,24 @@ func (a *AzureIaaSVMProtectedItem) GetAzureIaaSVMProtectedItem() *AzureIaaSVMPro // GetProtectedItem implements the ProtectedItemClassification interface for type AzureIaaSVMProtectedItem. func (a *AzureIaaSVMProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -1364,22 +1353,12 @@ type AzureIaaSVMProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type AzureIaaSVMProtectionPolicy. func (a *AzureIaaSVMProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: a.ProtectedItemsCount, BackupManagementType: a.BackupManagementType, + ProtectedItemsCount: a.ProtectedItemsCount, ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, } } -// AzureRecoveryServiceVaultProtectionIntentClassification provides polymorphic access to related types. -// Call the interface's GetAzureRecoveryServiceVaultProtectionIntent() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureRecoveryServiceVaultProtectionIntent, *AzureWorkloadAutoProtectionIntent, *AzureWorkloadSQLAutoProtectionIntent -type AzureRecoveryServiceVaultProtectionIntentClassification interface { - ProtectionIntentClassification - // GetAzureRecoveryServiceVaultProtectionIntent returns the AzureRecoveryServiceVaultProtectionIntent content of the underlying type. - GetAzureRecoveryServiceVaultProtectionIntent() *AzureRecoveryServiceVaultProtectionIntent -} - // AzureRecoveryServiceVaultProtectionIntent - Azure Recovery Services Vault specific protection intent item. type AzureRecoveryServiceVaultProtectionIntent struct { // REQUIRED; backup protectionIntent type. @@ -1410,12 +1389,12 @@ func (a *AzureRecoveryServiceVaultProtectionIntent) GetAzureRecoveryServiceVault // GetProtectionIntent implements the ProtectionIntentClassification interface for type AzureRecoveryServiceVaultProtectionIntent. func (a *AzureRecoveryServiceVaultProtectionIntent) GetProtectionIntent() *ProtectionIntent { return &ProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -1446,12 +1425,12 @@ type AzureResourceProtectionIntent struct { // GetProtectionIntent implements the ProtectionIntentClassification interface for type AzureResourceProtectionIntent. func (a *AzureResourceProtectionIntent) GetProtectionIntent() *ProtectionIntent { return &ProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -1497,29 +1476,29 @@ type AzureSQLAGWorkloadContainerProtectionContainer struct { // GetAzureWorkloadContainer implements the AzureWorkloadContainerClassification interface for type AzureSQLAGWorkloadContainerProtectionContainer. func (a *AzureSQLAGWorkloadContainerProtectionContainer) GetAzureWorkloadContainer() *AzureWorkloadContainer { return &AzureWorkloadContainer{ - SourceResourceID: a.SourceResourceID, - LastUpdatedTime: a.LastUpdatedTime, + BackupManagementType: a.BackupManagementType, + ContainerType: a.ContainerType, ExtendedInfo: a.ExtendedInfo, - WorkloadType: a.WorkloadType, - OperationType: a.OperationType, FriendlyName: a.FriendlyName, - BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, HealthStatus: a.HealthStatus, - ContainerType: a.ContainerType, + LastUpdatedTime: a.LastUpdatedTime, + OperationType: a.OperationType, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureSQLAGWorkloadContainerProtectionContainer. func (a *AzureSQLAGWorkloadContainerProtectionContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -1550,12 +1529,12 @@ type AzureSQLContainer struct { // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureSQLContainer. func (a *AzureSQLContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -1613,7 +1592,7 @@ type AzureSQLProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -1628,24 +1607,24 @@ type AzureSQLProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type AzureSQLProtectedItem. func (a *AzureSQLProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -1679,8 +1658,8 @@ type AzureSQLProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type AzureSQLProtectionPolicy. func (a *AzureSQLProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: a.ProtectedItemsCount, BackupManagementType: a.BackupManagementType, + ProtectedItemsCount: a.ProtectedItemsCount, ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, } } @@ -1727,12 +1706,12 @@ type AzureStorageContainer struct { // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureStorageContainer. func (a *AzureStorageContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -1799,14 +1778,14 @@ type AzureStorageJob struct { // GetJob implements the JobClassification interface for type AzureStorageJob. func (a *AzureStorageJob) GetJob() *Job { return &Job{ - EntityFriendlyName: a.EntityFriendlyName, + ActivityID: a.ActivityID, BackupManagementType: a.BackupManagementType, - Operation: a.Operation, - Status: a.Status, - StartTime: a.StartTime, EndTime: a.EndTime, - ActivityID: a.ActivityID, + EntityFriendlyName: a.EntityFriendlyName, JobType: a.JobType, + Operation: a.Operation, + StartTime: a.StartTime, + Status: a.Status, } } @@ -1854,11 +1833,11 @@ type AzureStorageProtectableContainer struct { // GetProtectableContainer implements the ProtectableContainerClassification interface for type AzureStorageProtectableContainer. func (a *AzureStorageProtectableContainer) GetProtectableContainer() *ProtectableContainer { return &ProtectableContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - ProtectableContainerType: a.ProtectableContainerType, - HealthStatus: a.HealthStatus, ContainerID: a.ContainerID, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, + ProtectableContainerType: a.ProtectableContainerType, } } @@ -1885,11 +1864,11 @@ type AzureVMAppContainerProtectableContainer struct { // GetProtectableContainer implements the ProtectableContainerClassification interface for type AzureVMAppContainerProtectableContainer. func (a *AzureVMAppContainerProtectableContainer) GetProtectableContainer() *ProtectableContainer { return &ProtectableContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - ProtectableContainerType: a.ProtectableContainerType, - HealthStatus: a.HealthStatus, ContainerID: a.ContainerID, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, + ProtectableContainerType: a.ProtectableContainerType, } } @@ -1935,29 +1914,29 @@ type AzureVMAppContainerProtectionContainer struct { // GetAzureWorkloadContainer implements the AzureWorkloadContainerClassification interface for type AzureVMAppContainerProtectionContainer. func (a *AzureVMAppContainerProtectionContainer) GetAzureWorkloadContainer() *AzureWorkloadContainer { return &AzureWorkloadContainer{ - SourceResourceID: a.SourceResourceID, - LastUpdatedTime: a.LastUpdatedTime, + BackupManagementType: a.BackupManagementType, + ContainerType: a.ContainerType, ExtendedInfo: a.ExtendedInfo, - WorkloadType: a.WorkloadType, - OperationType: a.OperationType, FriendlyName: a.FriendlyName, - BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, HealthStatus: a.HealthStatus, - ContainerType: a.ContainerType, + LastUpdatedTime: a.LastUpdatedTime, + OperationType: a.OperationType, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureVMAppContainerProtectionContainer. func (a *AzureVMAppContainerProtectionContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -1986,17 +1965,6 @@ type AzureVMResourceFeatureSupportResponse struct { SupportStatus *SupportStatus } -// AzureVMWorkloadItemClassification provides polymorphic access to related types. -// Call the interface's GetAzureVMWorkloadItem() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadItem, *AzureVMWorkloadSAPAseDatabaseWorkloadItem, *AzureVMWorkloadSAPAseSystemWorkloadItem, *AzureVMWorkloadSAPHanaDatabaseWorkloadItem, -// - *AzureVMWorkloadSAPHanaSystemWorkloadItem, *AzureVMWorkloadSQLDatabaseWorkloadItem, *AzureVMWorkloadSQLInstanceWorkloadItem -type AzureVMWorkloadItemClassification interface { - WorkloadItemClassification - // GetAzureVMWorkloadItem returns the AzureVMWorkloadItem content of the underlying type. - GetAzureVMWorkloadItem() *AzureVMWorkloadItem -} - // AzureVMWorkloadItem - Azure VM workload-specific workload item. type AzureVMWorkloadItem struct { // REQUIRED; Type of the backup item. @@ -2037,25 +2005,13 @@ func (a *AzureVMWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { re func (a *AzureVMWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } -// 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, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, -// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, -// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem -type AzureVMWorkloadProtectableItemClassification interface { - WorkloadProtectableItemClassification - // GetAzureVMWorkloadProtectableItem returns the AzureVMWorkloadProtectableItem content of the underlying type. - GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem -} - // AzureVMWorkloadProtectableItem - Azure VM workload-specific protectable item. type AzureVMWorkloadProtectableItem struct { // REQUIRED; Type of the backup item. @@ -2073,6 +2029,9 @@ type AzureVMWorkloadProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -2108,24 +2067,13 @@ func (a *AzureVMWorkloadProtectableItem) GetAzureVMWorkloadProtectableItem() *Az func (a *AzureVMWorkloadProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } -// 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, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, -// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem -type AzureVMWorkloadProtectedItemClassification interface { - ProtectedItemClassification - // GetAzureVMWorkloadProtectedItem returns the AzureVMWorkloadProtectedItem content of the underlying type. - GetAzureVMWorkloadProtectedItem() *AzureVMWorkloadProtectedItem -} - // AzureVMWorkloadProtectedItem - Azure VM workload-specific protected item. type AzureVMWorkloadProtectedItem struct { // REQUIRED; backup item type. @@ -2176,6 +2124,9 @@ type AzureVMWorkloadProtectedItem struct { // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Parent name of the DB such as Instance or Availability Group. ParentName *string @@ -2204,7 +2155,7 @@ type AzureVMWorkloadProtectedItem struct { ServerName *string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -2230,24 +2181,24 @@ func (a *AzureVMWorkloadProtectedItem) GetAzureVMWorkloadProtectedItem() *AzureV // GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadProtectedItem. func (a *AzureVMWorkloadProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -2302,8 +2253,8 @@ type AzureVMWorkloadProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type AzureVMWorkloadProtectionPolicy. func (a *AzureVMWorkloadProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: a.ProtectedItemsCount, BackupManagementType: a.BackupManagementType, + ProtectedItemsCount: a.ProtectedItemsCount, ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, } } @@ -2358,6 +2309,9 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Parent name of the DB such as Instance or Availability Group. ParentName *string @@ -2386,7 +2340,7 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { ServerName *string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -2407,61 +2361,62 @@ type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPAseDatabaseProtectedItem. func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + FriendlyName: a.FriendlyName, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupErrorDetail: a.LastBackupErrorDetail, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + NodesList: a.NodesList, + ParentName: a.ParentName, + ParentType: a.ParentType, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + ServerName: a.ServerName, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadSAPAseDatabaseProtectedItem. func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -2501,16 +2456,16 @@ type AzureVMWorkloadSAPAseDatabaseWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSAPAseDatabaseWorkloadItem. func (a *AzureVMWorkloadSAPAseDatabaseWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -2518,10 +2473,10 @@ func (a *AzureVMWorkloadSAPAseDatabaseWorkloadItem) GetAzureVMWorkloadItem() *Az func (a *AzureVMWorkloadSAPAseDatabaseWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } @@ -2542,6 +2497,9 @@ type AzureVMWorkloadSAPAseSystemProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -2571,19 +2529,20 @@ type AzureVMWorkloadSAPAseSystemProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPAseSystemProtectableItem. func (a *AzureVMWorkloadSAPAseSystemProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ - ParentName: a.ParentName, - ParentUniqueName: a.ParentUniqueName, - ServerName: a.ServerName, + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, IsAutoProtectable: a.IsAutoProtectable, IsAutoProtected: a.IsAutoProtected, - Subinquireditemcount: a.Subinquireditemcount, - Subprotectableitemcount: a.Subprotectableitemcount, + IsProtectable: a.IsProtectable, + ParentName: a.ParentName, + ParentUniqueName: a.ParentUniqueName, Prebackupvalidation: a.Prebackupvalidation, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, ProtectableItemType: a.ProtectableItemType, - FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + ServerName: a.ServerName, + Subinquireditemcount: a.Subinquireditemcount, + Subprotectableitemcount: a.Subprotectableitemcount, + WorkloadType: a.WorkloadType, } } @@ -2591,10 +2550,10 @@ func (a *AzureVMWorkloadSAPAseSystemProtectableItem) GetAzureVMWorkloadProtectab func (a *AzureVMWorkloadSAPAseSystemProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -2634,16 +2593,16 @@ type AzureVMWorkloadSAPAseSystemWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSAPAseSystemWorkloadItem. func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -2651,10 +2610,10 @@ func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) GetAzureVMWorkloadItem() *Azur func (a *AzureVMWorkloadSAPAseSystemWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } @@ -2675,6 +2634,9 @@ type AzureVMWorkloadSAPHanaDBInstance struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -2704,19 +2666,20 @@ type AzureVMWorkloadSAPHanaDBInstance struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDBInstance. func (a *AzureVMWorkloadSAPHanaDBInstance) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -2724,10 +2687,10 @@ func (a *AzureVMWorkloadSAPHanaDBInstance) GetAzureVMWorkloadProtectableItem() * func (a *AzureVMWorkloadSAPHanaDBInstance) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -2781,6 +2744,9 @@ type AzureVMWorkloadSAPHanaDBInstanceProtectedItem struct { // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Parent name of the DB such as Instance or Availability Group. ParentName *string @@ -2809,7 +2775,7 @@ type AzureVMWorkloadSAPHanaDBInstanceProtectedItem struct { ServerName *string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -2830,61 +2796,62 @@ type AzureVMWorkloadSAPHanaDBInstanceProtectedItem struct { // 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + FriendlyName: a.FriendlyName, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupErrorDetail: a.LastBackupErrorDetail, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + NodesList: a.NodesList, + ParentName: a.ParentName, + ParentType: a.ParentType, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + ServerName: a.ServerName, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -2905,6 +2872,9 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -2934,19 +2904,20 @@ type AzureVMWorkloadSAPHanaDatabaseProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseProtectableItem. func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -2954,10 +2925,10 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) GetAzureVMWorkloadProtec func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3011,6 +2982,9 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Parent name of the DB such as Instance or Availability Group. ParentName *string @@ -3039,7 +3013,7 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { ServerName *string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -3060,61 +3034,62 @@ type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + FriendlyName: a.FriendlyName, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupErrorDetail: a.LastBackupErrorDetail, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + NodesList: a.NodesList, + ParentName: a.ParentName, + ParentType: a.ParentType, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + ServerName: a.ServerName, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseProtectedItem. func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -3154,16 +3129,16 @@ type AzureVMWorkloadSAPHanaDatabaseWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSAPHanaDatabaseWorkloadItem. func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3171,15 +3146,15 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) GetAzureVMWorkloadItem() *A func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } -// AzureVMWorkloadSAPHanaHSR - Azure VM workload-specific protectable item representing SAP HANA Dbinstance. -type AzureVMWorkloadSAPHanaHSR struct { +// AzureVMWorkloadSAPHanaHSRProtectableItem - Azure VM workload-specific protectable item representing HANA HSR. +type AzureVMWorkloadSAPHanaHSRProtectableItem struct { // REQUIRED; Type of the backup item. ProtectableItemType *string @@ -3195,6 +3170,9 @@ type AzureVMWorkloadSAPHanaHSR struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -3221,33 +3199,34 @@ type AzureVMWorkloadSAPHanaHSR struct { WorkloadType *string } -// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSR. -func (a *AzureVMWorkloadSAPHanaHSR) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { +// GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSRProtectableItem. +func (a *AzureVMWorkloadSAPHanaHSRProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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 { +// GetWorkloadProtectableItem implements the WorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaHSRProtectableItem. +func (a *AzureVMWorkloadSAPHanaHSRProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3268,6 +3247,9 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -3297,19 +3279,20 @@ type AzureVMWorkloadSAPHanaSystemProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSAPHanaSystemProtectableItem. func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -3317,10 +3300,10 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) GetAzureVMWorkloadProtecta func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3360,16 +3343,16 @@ type AzureVMWorkloadSAPHanaSystemWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSAPHanaSystemWorkloadItem. func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3377,10 +3360,10 @@ func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) GetAzureVMWorkloadItem() *Azu func (a *AzureVMWorkloadSAPHanaSystemWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } @@ -3402,6 +3385,12 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Name for instance or AG ParentName *string @@ -3431,19 +3420,20 @@ type AzureVMWorkloadSQLAvailabilityGroupProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSQLAvailabilityGroupProtectableItem. func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -3451,10 +3441,10 @@ func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) GetAzureVMWorkloadP func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3475,6 +3465,9 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -3504,19 +3497,20 @@ type AzureVMWorkloadSQLDatabaseProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSQLDatabaseProtectableItem. func (a *AzureVMWorkloadSQLDatabaseProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -3524,10 +3518,10 @@ func (a *AzureVMWorkloadSQLDatabaseProtectableItem) GetAzureVMWorkloadProtectabl func (a *AzureVMWorkloadSQLDatabaseProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3581,6 +3575,9 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // Timestamp when the last (latest) backup copy was created for this backup item. LastRecoveryPoint *time.Time + // List of the nodes in case of distributed container. + NodesList []*DistributedNodesInfo + // Parent name of the DB such as Instance or Availability Group. ParentName *string @@ -3609,7 +3606,7 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { ServerName *string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -3630,61 +3627,62 @@ type AzureVMWorkloadSQLDatabaseProtectedItem struct { // GetAzureVMWorkloadProtectedItem implements the AzureVMWorkloadProtectedItemClassification interface for type AzureVMWorkloadSQLDatabaseProtectedItem. func (a *AzureVMWorkloadSQLDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + ExtendedInfo: a.ExtendedInfo, + FriendlyName: a.FriendlyName, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + KpisHealths: a.KpisHealths, + LastBackupErrorDetail: a.LastBackupErrorDetail, + LastBackupStatus: a.LastBackupStatus, + LastBackupTime: a.LastBackupTime, + LastRecoveryPoint: a.LastRecoveryPoint, + NodesList: a.NodesList, + ParentName: a.ParentName, + ParentType: a.ParentType, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemDataSourceID: a.ProtectedItemDataSourceID, + ProtectedItemHealthStatus: a.ProtectedItemHealthStatus, + ProtectedItemType: a.ProtectedItemType, + ProtectionState: a.ProtectionState, + ProtectionStatus: a.ProtectionStatus, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + ServerName: a.ServerName, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } // GetProtectedItem implements the ProtectedItemClassification interface for type AzureVMWorkloadSQLDatabaseProtectedItem. func (a *AzureVMWorkloadSQLDatabaseProtectedItem) 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, + ContainerName: a.ContainerName, CreateMode: a.CreateMode, DeferredDeleteTimeInUTC: a.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: a.DeferredDeleteTimeRemaining, + IsArchiveEnabled: a.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: a.IsDeferredDeleteScheduleUpcoming, IsRehydrate: a.IsRehydrate, - ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, - IsArchiveEnabled: a.IsArchiveEnabled, + IsScheduledForDeferredDelete: a.IsScheduledForDeferredDelete, + LastRecoveryPoint: a.LastRecoveryPoint, + PolicyID: a.PolicyID, PolicyName: a.PolicyName, - SoftDeleteRetentionPeriod: a.SoftDeleteRetentionPeriod, + ProtectedItemType: a.ProtectedItemType, + ResourceGuardOperationRequests: a.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: a.SoftDeleteRetentionPeriodInDays, + SourceResourceID: a.SourceResourceID, + WorkloadType: a.WorkloadType, } } @@ -3724,16 +3722,16 @@ type AzureVMWorkloadSQLDatabaseWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSQLDatabaseWorkloadItem. func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3741,10 +3739,10 @@ func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) GetAzureVMWorkloadItem() *Azure func (a *AzureVMWorkloadSQLDatabaseWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } @@ -3765,6 +3763,9 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { // Indicates if protectable item is auto-protected IsAutoProtected *bool + // Indicates if item is protectable + IsProtectable *bool + // Name for instance or AG ParentName *string @@ -3794,19 +3795,20 @@ type AzureVMWorkloadSQLInstanceProtectableItem struct { // GetAzureVMWorkloadProtectableItem implements the AzureVMWorkloadProtectableItemClassification interface for type AzureVMWorkloadSQLInstanceProtectableItem. func (a *AzureVMWorkloadSQLInstanceProtectableItem) GetAzureVMWorkloadProtectableItem() *AzureVMWorkloadProtectableItem { return &AzureVMWorkloadProtectableItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, + IsAutoProtected: a.IsAutoProtected, + IsProtectable: a.IsProtectable, ParentName: a.ParentName, ParentUniqueName: a.ParentUniqueName, + Prebackupvalidation: a.Prebackupvalidation, + ProtectableItemType: a.ProtectableItemType, + ProtectionState: a.ProtectionState, 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, } } @@ -3814,10 +3816,10 @@ func (a *AzureVMWorkloadSQLInstanceProtectableItem) GetAzureVMWorkloadProtectabl func (a *AzureVMWorkloadSQLInstanceProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - ProtectableItemType: a.ProtectableItemType, FriendlyName: a.FriendlyName, + ProtectableItemType: a.ProtectableItemType, ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3860,16 +3862,16 @@ type AzureVMWorkloadSQLInstanceWorkloadItem struct { // GetAzureVMWorkloadItem implements the AzureVMWorkloadItemClassification interface for type AzureVMWorkloadSQLInstanceWorkloadItem. func (a *AzureVMWorkloadSQLInstanceWorkloadItem) GetAzureVMWorkloadItem() *AzureVMWorkloadItem { return &AzureVMWorkloadItem{ + BackupManagementType: a.BackupManagementType, + FriendlyName: a.FriendlyName, + IsAutoProtectable: a.IsAutoProtectable, ParentName: a.ParentName, + ProtectionState: a.ProtectionState, ServerName: a.ServerName, - IsAutoProtectable: a.IsAutoProtectable, - Subinquireditemcount: a.Subinquireditemcount, SubWorkloadItemCount: a.SubWorkloadItemCount, - BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, + Subinquireditemcount: a.Subinquireditemcount, WorkloadItemType: a.WorkloadItemType, - FriendlyName: a.FriendlyName, - ProtectionState: a.ProtectionState, + WorkloadType: a.WorkloadType, } } @@ -3877,23 +3879,13 @@ func (a *AzureVMWorkloadSQLInstanceWorkloadItem) GetAzureVMWorkloadItem() *Azure func (a *AzureVMWorkloadSQLInstanceWorkloadItem) GetWorkloadItem() *WorkloadItem { return &WorkloadItem{ BackupManagementType: a.BackupManagementType, - WorkloadType: a.WorkloadType, - WorkloadItemType: a.WorkloadItemType, FriendlyName: a.FriendlyName, ProtectionState: a.ProtectionState, + WorkloadItemType: a.WorkloadItemType, + WorkloadType: a.WorkloadType, } } -// AzureWorkloadAutoProtectionIntentClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadAutoProtectionIntent() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadAutoProtectionIntent, *AzureWorkloadSQLAutoProtectionIntent -type AzureWorkloadAutoProtectionIntentClassification interface { - AzureRecoveryServiceVaultProtectionIntentClassification - // GetAzureWorkloadAutoProtectionIntent returns the AzureWorkloadAutoProtectionIntent content of the underlying type. - GetAzureWorkloadAutoProtectionIntent() *AzureWorkloadAutoProtectionIntent -} - // AzureWorkloadAutoProtectionIntent - Azure Recovery Services Vault specific protection intent item. type AzureWorkloadAutoProtectionIntent struct { // REQUIRED; backup protectionIntent type. @@ -3919,12 +3911,12 @@ type AzureWorkloadAutoProtectionIntent struct { // for type AzureWorkloadAutoProtectionIntent. func (a *AzureWorkloadAutoProtectionIntent) GetAzureRecoveryServiceVaultProtectionIntent() *AzureRecoveryServiceVaultProtectionIntent { return &AzureRecoveryServiceVaultProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -3937,12 +3929,12 @@ func (a *AzureWorkloadAutoProtectionIntent) GetAzureWorkloadAutoProtectionIntent // GetProtectionIntent implements the ProtectionIntentClassification interface for type AzureWorkloadAutoProtectionIntent. func (a *AzureWorkloadAutoProtectionIntent) GetProtectionIntent() *ProtectionIntent { return &ProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -3968,16 +3960,6 @@ func (a *AzureWorkloadBackupRequest) GetBackupRequest() *BackupRequest { } } -// AzureWorkloadContainerClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadContainer() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureSQLAGWorkloadContainerProtectionContainer, *AzureVMAppContainerProtectionContainer, *AzureWorkloadContainer -type AzureWorkloadContainerClassification interface { - ProtectionContainerClassification - // GetAzureWorkloadContainer returns the AzureWorkloadContainer content of the underlying type. - GetAzureWorkloadContainer() *AzureWorkloadContainer -} - // AzureWorkloadContainer - Container for the workloads running inside Azure Compute or Classic Compute. type AzureWorkloadContainer struct { // REQUIRED; Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines @@ -4023,12 +4005,12 @@ func (a *AzureWorkloadContainer) GetAzureWorkloadContainer() *AzureWorkloadConta // GetProtectionContainer implements the ProtectionContainerClassification interface for type AzureWorkloadContainer. func (a *AzureWorkloadContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: a.FriendlyName, BackupManagementType: a.BackupManagementType, - RegistrationStatus: a.RegistrationStatus, - HealthStatus: a.HealthStatus, ContainerType: a.ContainerType, + FriendlyName: a.FriendlyName, + HealthStatus: a.HealthStatus, ProtectableObjectType: a.ProtectableObjectType, + RegistrationStatus: a.RegistrationStatus, } } @@ -4056,12 +4038,12 @@ type AzureWorkloadContainerAutoProtectionIntent struct { // GetProtectionIntent implements the ProtectionIntentClassification interface for type AzureWorkloadContainerAutoProtectionIntent. func (a *AzureWorkloadContainerAutoProtectionIntent) GetProtectionIntent() *ProtectionIntent { return &ProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -4140,14 +4122,14 @@ type AzureWorkloadJob struct { // GetJob implements the JobClassification interface for type AzureWorkloadJob. func (a *AzureWorkloadJob) GetJob() *Job { return &Job{ - EntityFriendlyName: a.EntityFriendlyName, + ActivityID: a.ActivityID, BackupManagementType: a.BackupManagementType, - Operation: a.Operation, - Status: a.Status, - StartTime: a.StartTime, EndTime: a.EndTime, - ActivityID: a.ActivityID, + EntityFriendlyName: a.EntityFriendlyName, JobType: a.JobType, + Operation: a.Operation, + StartTime: a.StartTime, + Status: a.Status, } } @@ -4172,16 +4154,6 @@ type AzureWorkloadJobTaskDetails struct { TaskID *string } -// AzureWorkloadPointInTimeRecoveryPointClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadPointInTimeRecoveryPoint() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint -type AzureWorkloadPointInTimeRecoveryPointClassification interface { - AzureWorkloadRecoveryPointClassification - // GetAzureWorkloadPointInTimeRecoveryPoint returns the AzureWorkloadPointInTimeRecoveryPoint content of the underlying type. - GetAzureWorkloadPointInTimeRecoveryPoint() *AzureWorkloadPointInTimeRecoveryPoint -} - // AzureWorkloadPointInTimeRecoveryPoint - Recovery point specific to PointInTime type AzureWorkloadPointInTimeRecoveryPoint struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -4215,12 +4187,12 @@ func (a *AzureWorkloadPointInTimeRecoveryPoint) GetAzureWorkloadPointInTimeRecov // GetAzureWorkloadRecoveryPoint implements the AzureWorkloadRecoveryPointClassification interface for type AzureWorkloadPointInTimeRecoveryPoint. func (a *AzureWorkloadPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint { return &AzureWorkloadRecoveryPoint{ - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -4261,13 +4233,13 @@ type AzureWorkloadPointInTimeRestoreRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadPointInTimeRestoreRequest. func (a *AzureWorkloadPointInTimeRestoreRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4278,17 +4250,6 @@ func (a *AzureWorkloadPointInTimeRestoreRequest) GetRestoreRequest() *RestoreReq } } -// AzureWorkloadRecoveryPointClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadRecoveryPoint() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint, *AzureWorkloadSAPHanaRecoveryPoint, -// - *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint -type AzureWorkloadRecoveryPointClassification interface { - RecoveryPointClassification - // GetAzureWorkloadRecoveryPoint returns the AzureWorkloadRecoveryPoint content of the underlying type. - GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint -} - // AzureWorkloadRecoveryPoint - Workload specific recovery point, specifically encapsulates full/diff recovery point type AzureWorkloadRecoveryPoint struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -4322,19 +4283,6 @@ func (a *AzureWorkloadRecoveryPoint) GetRecoveryPoint() *RecoveryPoint { } } -// AzureWorkloadRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadPointInTimeRestoreRequest, *AzureWorkloadRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreRequest, -// - *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, *AzureWorkloadSAPHanaRestoreWithRehydrateRequest, -// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, -// - *AzureWorkloadSQLRestoreWithRehydrateRequest -type AzureWorkloadRestoreRequestClassification interface { - RestoreRequestClassification - // GetAzureWorkloadRestoreRequest returns the AzureWorkloadRestoreRequest content of the underlying type. - GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest -} - // AzureWorkloadRestoreRequest - AzureWorkload-specific restore. type AzureWorkloadRestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -4399,25 +4347,25 @@ type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { // type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) GetAzureWorkloadPointInTimeRecoveryPoint() *AzureWorkloadPointInTimeRecoveryPoint { return &AzureWorkloadPointInTimeRecoveryPoint{ - TimeRanges: a.TimeRanges, - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + TimeRanges: a.TimeRanges, + Type: a.Type, } } // GetAzureWorkloadRecoveryPoint implements the AzureWorkloadRecoveryPointClassification interface for type AzureWorkloadSAPHanaPointInTimeRecoveryPoint. func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint { return &AzureWorkloadRecoveryPoint{ - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -4428,16 +4376,6 @@ func (a *AzureWorkloadSAPHanaPointInTimeRecoveryPoint) GetRecoveryPoint() *Recov } } -// AzureWorkloadSAPHanaPointInTimeRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadSAPHanaPointInTimeRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadSAPHanaPointInTimeRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest -type AzureWorkloadSAPHanaPointInTimeRestoreRequestClassification interface { - AzureWorkloadSAPHanaRestoreRequestClassification - // GetAzureWorkloadSAPHanaPointInTimeRestoreRequest returns the AzureWorkloadSAPHanaPointInTimeRestoreRequest content of the underlying type. - GetAzureWorkloadSAPHanaPointInTimeRestoreRequest() *AzureWorkloadSAPHanaPointInTimeRestoreRequest -} - // AzureWorkloadSAPHanaPointInTimeRestoreRequest - AzureWorkload SAP Hana -specific restore. Specifically for PointInTime/Log // restore type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { @@ -4469,13 +4407,13 @@ type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSAPHanaPointInTimeRestoreRequest. func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4489,13 +4427,13 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) GetAzureWorkloadSAPHanaP // AzureWorkloadSAPHanaPointInTimeRestoreRequest. func (a *AzureWorkloadSAPHanaPointInTimeRestoreRequest) GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest { return &AzureWorkloadSAPHanaRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4540,13 +4478,13 @@ type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4554,14 +4492,14 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) GetAzureWor // interface for type AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadSAPHanaPointInTimeRestoreRequest() *AzureWorkloadSAPHanaPointInTimeRestoreRequest { return &AzureWorkloadSAPHanaPointInTimeRestoreRequest{ + ObjectType: a.ObjectType, PointInTime: a.PointInTime, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4569,13 +4507,13 @@ func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) GetAzureWor // AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest { return &AzureWorkloadSAPHanaRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4610,12 +4548,12 @@ type AzureWorkloadSAPHanaRecoveryPoint struct { // GetAzureWorkloadRecoveryPoint implements the AzureWorkloadRecoveryPointClassification interface for type AzureWorkloadSAPHanaRecoveryPoint. func (a *AzureWorkloadSAPHanaRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint { return &AzureWorkloadRecoveryPoint{ - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -4626,17 +4564,6 @@ func (a *AzureWorkloadSAPHanaRecoveryPoint) GetRecoveryPoint() *RecoveryPoint { } } -// AzureWorkloadSAPHanaRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadSAPHanaRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadSAPHanaPointInTimeRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, -// - *AzureWorkloadSAPHanaRestoreWithRehydrateRequest -type AzureWorkloadSAPHanaRestoreRequestClassification interface { - AzureWorkloadRestoreRequestClassification - // GetAzureWorkloadSAPHanaRestoreRequest returns the AzureWorkloadSAPHanaRestoreRequest content of the underlying type. - GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest -} - // AzureWorkloadSAPHanaRestoreRequest - AzureWorkload SAP Hana-specific restore. type AzureWorkloadSAPHanaRestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -4664,13 +4591,13 @@ type AzureWorkloadSAPHanaRestoreRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSAPHanaRestoreRequest. func (a *AzureWorkloadSAPHanaRestoreRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4718,13 +4645,13 @@ type AzureWorkloadSAPHanaRestoreWithRehydrateRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSAPHanaRestoreWithRehydrateRequest. func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4732,13 +4659,13 @@ func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) GetAzureWorkloadRestor // AzureWorkloadSAPHanaRestoreWithRehydrateRequest. func (a *AzureWorkloadSAPHanaRestoreWithRehydrateRequest) GetAzureWorkloadSAPHanaRestoreRequest() *AzureWorkloadSAPHanaRestoreRequest { return &AzureWorkloadSAPHanaRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4777,12 +4704,12 @@ type AzureWorkloadSQLAutoProtectionIntent struct { // for type AzureWorkloadSQLAutoProtectionIntent. func (a *AzureWorkloadSQLAutoProtectionIntent) GetAzureRecoveryServiceVaultProtectionIntent() *AzureRecoveryServiceVaultProtectionIntent { return &AzureRecoveryServiceVaultProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -4790,24 +4717,24 @@ func (a *AzureWorkloadSQLAutoProtectionIntent) GetAzureRecoveryServiceVaultProte // AzureWorkloadSQLAutoProtectionIntent. func (a *AzureWorkloadSQLAutoProtectionIntent) GetAzureWorkloadAutoProtectionIntent() *AzureWorkloadAutoProtectionIntent { return &AzureWorkloadAutoProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } // GetProtectionIntent implements the ProtectionIntentClassification interface for type AzureWorkloadSQLAutoProtectionIntent. func (a *AzureWorkloadSQLAutoProtectionIntent) GetProtectionIntent() *ProtectionIntent { return &ProtectionIntent{ - ProtectionIntentItemType: a.ProtectionIntentItemType, BackupManagementType: a.BackupManagementType, - SourceResourceID: a.SourceResourceID, ItemID: a.ItemID, PolicyID: a.PolicyID, + ProtectionIntentItemType: a.ProtectionIntentItemType, ProtectionState: a.ProtectionState, + SourceResourceID: a.SourceResourceID, } } @@ -4843,12 +4770,12 @@ type AzureWorkloadSQLPointInTimeRecoveryPoint struct { // GetAzureWorkloadRecoveryPoint implements the AzureWorkloadRecoveryPointClassification interface for type AzureWorkloadSQLPointInTimeRecoveryPoint. func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint { return &AzureWorkloadRecoveryPoint{ - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -4856,12 +4783,12 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetAzureWorkloadRecoveryPoint func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetAzureWorkloadSQLRecoveryPoint() *AzureWorkloadSQLRecoveryPoint { return &AzureWorkloadSQLRecoveryPoint{ ExtendedInfo: a.ExtendedInfo, - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -4872,16 +4799,6 @@ func (a *AzureWorkloadSQLPointInTimeRecoveryPoint) GetRecoveryPoint() *RecoveryP } } -// AzureWorkloadSQLPointInTimeRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadSQLPointInTimeRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest -type AzureWorkloadSQLPointInTimeRestoreRequestClassification interface { - AzureWorkloadSQLRestoreRequestClassification - // GetAzureWorkloadSQLPointInTimeRestoreRequest returns the AzureWorkloadSQLPointInTimeRestoreRequest content of the underlying type. - GetAzureWorkloadSQLPointInTimeRestoreRequest() *AzureWorkloadSQLPointInTimeRestoreRequest -} - // AzureWorkloadSQLPointInTimeRestoreRequest - AzureWorkload SQL -specific restore. Specifically for PointInTime/Log restore type AzureWorkloadSQLPointInTimeRestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -4921,13 +4838,13 @@ type AzureWorkloadSQLPointInTimeRestoreRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSQLPointInTimeRestoreRequest. func (a *AzureWorkloadSQLPointInTimeRestoreRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -4940,16 +4857,16 @@ func (a *AzureWorkloadSQLPointInTimeRestoreRequest) GetAzureWorkloadSQLPointInTi // GetAzureWorkloadSQLRestoreRequest implements the AzureWorkloadSQLRestoreRequestClassification interface for type AzureWorkloadSQLPointInTimeRestoreRequest. func (a *AzureWorkloadSQLPointInTimeRestoreRequest) GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest { return &AzureWorkloadSQLRestoreRequest{ - ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, - IsNonRecoverable: a.IsNonRecoverable, AlternateDirectoryPaths: a.AlternateDirectoryPaths, + IsNonRecoverable: a.IsNonRecoverable, + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, + ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -5003,13 +4920,13 @@ type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -5017,33 +4934,33 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloa // for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadSQLPointInTimeRestoreRequest() *AzureWorkloadSQLPointInTimeRestoreRequest { return &AzureWorkloadSQLPointInTimeRestoreRequest{ - PointInTime: a.PointInTime, - ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, - IsNonRecoverable: a.IsNonRecoverable, AlternateDirectoryPaths: a.AlternateDirectoryPaths, + IsNonRecoverable: a.IsNonRecoverable, + ObjectType: a.ObjectType, + PointInTime: a.PointInTime, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, + ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } // GetAzureWorkloadSQLRestoreRequest implements the AzureWorkloadSQLRestoreRequestClassification interface for type AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest. func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest { return &AzureWorkloadSQLRestoreRequest{ - ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, - IsNonRecoverable: a.IsNonRecoverable, AlternateDirectoryPaths: a.AlternateDirectoryPaths, + IsNonRecoverable: a.IsNonRecoverable, + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, + ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -5054,16 +4971,6 @@ func (a *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest) GetRestoreReque } } -// AzureWorkloadSQLRecoveryPointClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadSQLRecoveryPoint() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint -type AzureWorkloadSQLRecoveryPointClassification interface { - AzureWorkloadRecoveryPointClassification - // GetAzureWorkloadSQLRecoveryPoint returns the AzureWorkloadSQLRecoveryPoint content of the underlying type. - GetAzureWorkloadSQLRecoveryPoint() *AzureWorkloadSQLRecoveryPoint -} - // AzureWorkloadSQLRecoveryPoint - SQL specific recoverypoint, specifically encapsulates full/diff recoverypoint along with // extended info type AzureWorkloadSQLRecoveryPoint struct { @@ -5094,12 +5001,12 @@ type AzureWorkloadSQLRecoveryPoint struct { // GetAzureWorkloadRecoveryPoint implements the AzureWorkloadRecoveryPointClassification interface for type AzureWorkloadSQLRecoveryPoint. func (a *AzureWorkloadSQLRecoveryPoint) GetAzureWorkloadRecoveryPoint() *AzureWorkloadRecoveryPoint { return &AzureWorkloadRecoveryPoint{ - RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, - Type: a.Type, - RecoveryPointTierDetails: a.RecoveryPointTierDetails, + ObjectType: a.ObjectType, RecoveryPointMoveReadinessInfo: a.RecoveryPointMoveReadinessInfo, RecoveryPointProperties: a.RecoveryPointProperties, - ObjectType: a.ObjectType, + RecoveryPointTierDetails: a.RecoveryPointTierDetails, + RecoveryPointTimeInUTC: a.RecoveryPointTimeInUTC, + Type: a.Type, } } @@ -5124,17 +5031,6 @@ type AzureWorkloadSQLRecoveryPointExtendedInfo struct { DataDirectoryTimeInUTC *time.Time } -// AzureWorkloadSQLRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetAzureWorkloadSQLRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, -// - *AzureWorkloadSQLRestoreWithRehydrateRequest -type AzureWorkloadSQLRestoreRequestClassification interface { - AzureWorkloadRestoreRequestClassification - // GetAzureWorkloadSQLRestoreRequest returns the AzureWorkloadSQLRestoreRequest content of the underlying type. - GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest -} - // AzureWorkloadSQLRestoreRequest - AzureWorkload SQL -specific restore. Specifically for full/diff restore type AzureWorkloadSQLRestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -5171,13 +5067,13 @@ type AzureWorkloadSQLRestoreRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSQLRestoreRequest. func (a *AzureWorkloadSQLRestoreRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -5233,29 +5129,29 @@ type AzureWorkloadSQLRestoreWithRehydrateRequest struct { // GetAzureWorkloadRestoreRequest implements the AzureWorkloadRestoreRequestClassification interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) GetAzureWorkloadRestoreRequest() *AzureWorkloadRestoreRequest { return &AzureWorkloadRestoreRequest{ + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } // GetAzureWorkloadSQLRestoreRequest implements the AzureWorkloadSQLRestoreRequestClassification interface for type AzureWorkloadSQLRestoreWithRehydrateRequest. func (a *AzureWorkloadSQLRestoreWithRehydrateRequest) GetAzureWorkloadSQLRestoreRequest() *AzureWorkloadSQLRestoreRequest { return &AzureWorkloadSQLRestoreRequest{ - ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, - IsNonRecoverable: a.IsNonRecoverable, AlternateDirectoryPaths: a.AlternateDirectoryPaths, + IsNonRecoverable: a.IsNonRecoverable, + ObjectType: a.ObjectType, + PropertyBag: a.PropertyBag, + RecoveryMode: a.RecoveryMode, RecoveryType: a.RecoveryType, + ShouldUseAlternateTargetLocation: a.ShouldUseAlternateTargetLocation, SourceResourceID: a.SourceResourceID, - PropertyBag: a.PropertyBag, TargetInfo: a.TargetInfo, - RecoveryMode: a.RecoveryMode, TargetVirtualMachineID: a.TargetVirtualMachineID, - ObjectType: a.ObjectType, } } @@ -5350,12 +5246,6 @@ type BMSPOQueryObject struct { WorkloadType *WorkloadType } -// BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get -// method. -type BMSPrepareDataMoveOperationResultClientGetOptions struct { - // placeholder for future optional parameters -} - // BMSRPQueryObject - Filters to list backup copies. type BMSRPQueryObject struct { // Backup copies created before this time. @@ -5398,15 +5288,6 @@ type BMSWorkloadItemQueryObject struct { WorkloadType *WorkloadType } -// BackupEngineBaseClassification provides polymorphic access to related types. -// Call the interface's GetBackupEngineBase() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBackupServerEngine, *BackupEngineBase, *DpmBackupEngine -type BackupEngineBaseClassification interface { - // GetBackupEngineBase returns the BackupEngineBase content of the underlying type. - GetBackupEngineBase() *BackupEngineBase -} - // BackupEngineBase - The base backup engine class. All workload specific backup engines derive from this class. type BackupEngineBase struct { // REQUIRED; Type of the backup engine. @@ -5512,30 +5393,6 @@ type BackupEngineExtendedInfo struct { UsedDiskSpace *float64 } -// BackupEnginesClientGetOptions contains the optional parameters for the BackupEnginesClient.Get method. -type BackupEnginesClientGetOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.NewListPager method. -type BackupEnginesClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.NewListPager method. -type BackupJobsClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - // BackupManagementUsage - Backup management usages of a vault. type BackupManagementUsage struct { // Current value of usage. @@ -5563,65 +5420,6 @@ type BackupManagementUsageList struct { Value []*BackupManagementUsage } -// BackupOperationResultsClientGetOptions contains the optional parameters for the BackupOperationResultsClient.Get method. -type BackupOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupOperationStatusesClientGetOptions contains the optional parameters for the BackupOperationStatusesClient.Get method. -type BackupOperationStatusesClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. -type BackupPoliciesClientListOptions struct { - // OData filter options. - Filter *string -} - -// BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.NewListPager -// method. -type BackupProtectableItemsClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.NewListPager -// method. -type BackupProtectedItemsClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.NewListPager -// method. -type BackupProtectionContainersClientListOptions struct { - // OData filter options. - Filter *string -} - -// BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.NewListPager -// method. -type BackupProtectionIntentClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupRequestClassification provides polymorphic access to related types. -// Call the interface's GetBackupRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileShareBackupRequest, *AzureWorkloadBackupRequest, *BackupRequest, *IaasVMBackupRequest -type BackupRequestClassification interface { - // GetBackupRequest returns the BackupRequest content of the underlying type. - GetBackupRequest() *BackupRequest -} - // BackupRequest - Base class for backup request. Workload-specific backup requests are derived from this class. type BackupRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -5778,42 +5576,12 @@ type BackupResourceEncryptionConfigResource struct { Type *string } -// BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get -// method. -type BackupResourceEncryptionConfigsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceEncryptionConfigsClientUpdateOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Update -// method. -type BackupResourceEncryptionConfigsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get -// method. -type BackupResourceStorageConfigsNonCRRClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceStorageConfigsNonCRRClientPatchOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Patch -// method. -type BackupResourceStorageConfigsNonCRRClientPatchOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceStorageConfigsNonCRRClientUpdateOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Update -// method. -type BackupResourceStorageConfigsNonCRRClientUpdateOptions struct { - // placeholder for future optional parameters -} - // BackupResourceVaultConfig - Backup resource vault config details. type BackupResourceVaultConfig struct { // Enabled or Disabled. EnhancedSecurityState *EnhancedSecurityState - // Is soft delete feature state editable + // This flag is no longer in use. Please use 'softDeleteFeatureState' to set the soft delete state for the vault IsSoftDeleteFeatureStateEditable *bool // ResourceGuard Operation Requests @@ -5822,6 +5590,9 @@ type BackupResourceVaultConfig struct { // Soft Delete feature state SoftDeleteFeatureState *SoftDeleteFeatureState + // Soft delete retention period in days + SoftDeleteRetentionPeriodInDays *int32 + // Storage type. StorageModelType *StorageType @@ -5856,29 +5627,6 @@ type BackupResourceVaultConfigResource struct { Type *string } -// BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get -// method. -type BackupResourceVaultConfigsClientGetOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceVaultConfigsClientPutOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Put -// method. -type BackupResourceVaultConfigsClientPutOptions struct { - // placeholder for future optional parameters -} - -// BackupResourceVaultConfigsClientUpdateOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Update -// method. -type BackupResourceVaultConfigsClientUpdateOptions struct { - // placeholder for future optional parameters -} - -// BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. -type BackupStatusClientGetOptions struct { - // placeholder for future optional parameters -} - // BackupStatusRequest - BackupStatus request. type BackupStatusRequest struct { // Protectable Item Logical Name @@ -5893,6 +5641,9 @@ type BackupStatusRequest struct { // BackupStatusResponse - BackupStatus response. type BackupStatusResponse struct { + // Specifies whether the storage account lock has been acquired or not + AcquireStorageAccountLock *AcquireStorageAccountLock + // Specifies the product specific container name. E.g. iaasvmcontainer;iaasvmcontainer;csname;vmname. ContainerName *string @@ -5911,6 +5662,9 @@ type BackupStatusResponse struct { // Specifies the product specific ds name. E.g. vm;iaasvmcontainer;csname;vmname. ProtectedItemName *string + // Number of protected items + ProtectedItemsCount *int32 + // Specifies whether the container is registered or not ProtectionStatus *ProtectionStatus @@ -5921,46 +5675,6 @@ type BackupStatusResponse struct { VaultID *string } -// BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.NewListPager -// method. -type BackupUsageSummariesClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.NewListPager method. -type BackupWorkloadItemsClientListOptions struct { - // OData filter options. - Filter *string - // skipToken Filter. - SkipToken *string -} - -// BackupsClientTriggerOptions contains the optional parameters for the BackupsClient.Trigger method. -type BackupsClientTriggerOptions struct { - // placeholder for future optional parameters -} - -// ClientBeginBMSPrepareDataMoveOptions contains the optional parameters for the Client.BeginBMSPrepareDataMove method. -type ClientBeginBMSPrepareDataMoveOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClientBeginBMSTriggerDataMoveOptions contains the optional parameters for the Client.BeginBMSTriggerDataMove method. -type ClientBeginBMSTriggerDataMoveOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ClientBeginMoveRecoveryPointOptions contains the optional parameters for the Client.BeginMoveRecoveryPoint method. -type ClientBeginMoveRecoveryPointOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // ClientDiscoveryDisplay - Localized display information of an operation. type ClientDiscoveryDisplay struct { // Description of the operation having details of what operation is about. @@ -6024,11 +5738,6 @@ type ClientDiscoveryValueForSingleAPI struct { Properties *ClientDiscoveryForProperties } -// ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. -type ClientGetOperationStatusOptions struct { - // placeholder for future optional parameters -} - // ClientScriptForConnect - Client script details for file / folder restore. type ClientScriptForConnect struct { // OS type - Windows, Linux etc. for which this file / folder restore client script works. @@ -6126,7 +5835,7 @@ type DPMProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -6141,24 +5850,24 @@ type DPMProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type DPMProtectedItem. func (d *DPMProtectedItem) GetProtectedItem() *ProtectedItem { return &ProtectedItem{ - ProtectedItemType: d.ProtectedItemType, BackupManagementType: d.BackupManagementType, - WorkloadType: d.WorkloadType, - ContainerName: d.ContainerName, - SourceResourceID: d.SourceResourceID, - PolicyID: d.PolicyID, - LastRecoveryPoint: d.LastRecoveryPoint, BackupSetName: d.BackupSetName, + ContainerName: d.ContainerName, CreateMode: d.CreateMode, DeferredDeleteTimeInUTC: d.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: d.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: d.DeferredDeleteTimeRemaining, + IsArchiveEnabled: d.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: d.IsDeferredDeleteScheduleUpcoming, IsRehydrate: d.IsRehydrate, - ResourceGuardOperationRequests: d.ResourceGuardOperationRequests, - IsArchiveEnabled: d.IsArchiveEnabled, + IsScheduledForDeferredDelete: d.IsScheduledForDeferredDelete, + LastRecoveryPoint: d.LastRecoveryPoint, + PolicyID: d.PolicyID, PolicyName: d.PolicyName, - SoftDeleteRetentionPeriod: d.SoftDeleteRetentionPeriod, + ProtectedItemType: d.ProtectedItemType, + ResourceGuardOperationRequests: d.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: d.SoftDeleteRetentionPeriodInDays, + SourceResourceID: d.SourceResourceID, + WorkloadType: d.WorkloadType, } } @@ -6236,13 +5945,6 @@ type Day struct { IsLast *bool } -// DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.NewListPager -// 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 @@ -6265,6 +5967,9 @@ type DistributedNodesInfo struct { // Name of the node under a distributed container. NodeName *string + // ARM resource id of the node + SourceResourceID *string + // Status of this Node. Failed | Succeeded Status *string } @@ -6314,32 +6019,22 @@ type DpmBackupEngine struct { // GetBackupEngineBase implements the BackupEngineBaseClassification interface for type DpmBackupEngine. func (d *DpmBackupEngine) GetBackupEngineBase() *BackupEngineBase { return &BackupEngineBase{ - FriendlyName: d.FriendlyName, - BackupManagementType: d.BackupManagementType, - RegistrationStatus: d.RegistrationStatus, + AzureBackupAgentVersion: d.AzureBackupAgentVersion, + BackupEngineID: d.BackupEngineID, BackupEngineState: d.BackupEngineState, - HealthStatus: d.HealthStatus, BackupEngineType: d.BackupEngineType, + BackupManagementType: d.BackupManagementType, CanReRegister: d.CanReRegister, - BackupEngineID: d.BackupEngineID, DpmVersion: d.DpmVersion, - AzureBackupAgentVersion: d.AzureBackupAgentVersion, + ExtendedInfo: d.ExtendedInfo, + FriendlyName: d.FriendlyName, + HealthStatus: d.HealthStatus, IsAzureBackupAgentUpgradeAvailable: d.IsAzureBackupAgentUpgradeAvailable, IsDpmUpgradeAvailable: d.IsDpmUpgradeAvailable, - ExtendedInfo: d.ExtendedInfo, + RegistrationStatus: d.RegistrationStatus, } } -// DpmContainerClassification provides polymorphic access to related types. -// Call the interface's GetDpmContainer() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBackupServerContainer, *DpmContainer -type DpmContainerClassification interface { - ProtectionContainerClassification - // GetDpmContainer returns the DpmContainer content of the underlying type. - GetDpmContainer() *DpmContainer -} - // DpmContainer - DPM workload-specific protection container. type DpmContainer struct { // REQUIRED; Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines @@ -6394,12 +6089,12 @@ func (d *DpmContainer) GetDpmContainer() *DpmContainer { return d } // GetProtectionContainer implements the ProtectionContainerClassification interface for type DpmContainer. func (d *DpmContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: d.FriendlyName, BackupManagementType: d.BackupManagementType, - RegistrationStatus: d.RegistrationStatus, - HealthStatus: d.HealthStatus, ContainerType: d.ContainerType, + FriendlyName: d.FriendlyName, + HealthStatus: d.HealthStatus, ProtectableObjectType: d.ProtectableObjectType, + RegistrationStatus: d.RegistrationStatus, } } @@ -6466,14 +6161,14 @@ type DpmJob struct { // GetJob implements the JobClassification interface for type DpmJob. func (d *DpmJob) GetJob() *Job { return &Job{ - EntityFriendlyName: d.EntityFriendlyName, + ActivityID: d.ActivityID, BackupManagementType: d.BackupManagementType, - Operation: d.Operation, - Status: d.Status, - StartTime: d.StartTime, EndTime: d.EndTime, - ActivityID: d.ActivityID, + EntityFriendlyName: d.EntityFriendlyName, JobType: d.JobType, + Operation: d.Operation, + StartTime: d.StartTime, + Status: d.Status, } } @@ -6571,12 +6266,6 @@ func (e *ExportJobsOperationResultInfo) GetOperationResultInfoBase() *OperationR } } -// ExportJobsOperationResultsClientGetOptions contains the optional parameters for the ExportJobsOperationResultsClient.Get -// method. -type ExportJobsOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - // ExtendedLocation - The extended location of Recovery point where VM was present. type ExtendedLocation struct { // Name of the extended location. @@ -6595,20 +6284,6 @@ type ExtendedProperties struct { LinuxVMApplicationName *string } -// FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. -type FeatureSupportClientValidateOptions struct { - // placeholder for future optional parameters -} - -// FeatureSupportRequestClassification provides polymorphic access to related types. -// Call the interface's GetFeatureSupportRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBackupGoalFeatureSupportRequest, *AzureVMResourceFeatureSupportRequest, *FeatureSupportRequest -type FeatureSupportRequestClassification interface { - // GetFeatureSupportRequest returns the FeatureSupportRequest content of the underlying type. - GetFeatureSupportRequest() *FeatureSupportRequest -} - // FeatureSupportRequest - Base class for feature request type FeatureSupportRequest struct { // REQUIRED; backup support feature type. @@ -6651,12 +6326,12 @@ type GenericContainer struct { // GetProtectionContainer implements the ProtectionContainerClassification interface for type GenericContainer. func (g *GenericContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: g.FriendlyName, BackupManagementType: g.BackupManagementType, - RegistrationStatus: g.RegistrationStatus, - HealthStatus: g.HealthStatus, ContainerType: g.ContainerType, + FriendlyName: g.FriendlyName, + HealthStatus: g.HealthStatus, ProtectableObjectType: g.ProtectableObjectType, + RegistrationStatus: g.RegistrationStatus, } } @@ -6732,7 +6407,7 @@ type GenericProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // Loosely coupled (type, value) associations (example - parent of a protected item) SourceAssociations map[string]*string @@ -6750,24 +6425,24 @@ type GenericProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type GenericProtectedItem. func (g *GenericProtectedItem) GetProtectedItem() *ProtectedItem { return &ProtectedItem{ - ProtectedItemType: g.ProtectedItemType, BackupManagementType: g.BackupManagementType, - WorkloadType: g.WorkloadType, - ContainerName: g.ContainerName, - SourceResourceID: g.SourceResourceID, - PolicyID: g.PolicyID, - LastRecoveryPoint: g.LastRecoveryPoint, BackupSetName: g.BackupSetName, + ContainerName: g.ContainerName, CreateMode: g.CreateMode, DeferredDeleteTimeInUTC: g.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: g.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: g.DeferredDeleteTimeRemaining, + IsArchiveEnabled: g.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: g.IsDeferredDeleteScheduleUpcoming, IsRehydrate: g.IsRehydrate, - ResourceGuardOperationRequests: g.ResourceGuardOperationRequests, - IsArchiveEnabled: g.IsArchiveEnabled, + IsScheduledForDeferredDelete: g.IsScheduledForDeferredDelete, + LastRecoveryPoint: g.LastRecoveryPoint, + PolicyID: g.PolicyID, PolicyName: g.PolicyName, - SoftDeleteRetentionPeriod: g.SoftDeleteRetentionPeriod, + ProtectedItemType: g.ProtectedItemType, + ResourceGuardOperationRequests: g.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: g.SoftDeleteRetentionPeriodInDays, + SourceResourceID: g.SourceResourceID, + WorkloadType: g.WorkloadType, } } @@ -6795,8 +6470,8 @@ type GenericProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type GenericProtectionPolicy. func (g *GenericProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: g.ProtectedItemsCount, BackupManagementType: g.BackupManagementType, + ProtectedItemsCount: g.ProtectedItemsCount, ResourceGuardOperationRequests: g.ResourceGuardOperationRequests, } } @@ -6846,15 +6521,6 @@ type HourlySchedule struct { ScheduleWindowStartTime *time.Time } -// ILRRequestClassification provides polymorphic access to related types. -// Call the interface's GetILRRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileShareProvisionILRRequest, *ILRRequest, *IaasVMILRRegistrationRequest -type ILRRequestClassification interface { - // GetILRRequest returns the ILRRequest content of the underlying type. - GetILRRequest() *ILRRequest -} - // ILRRequest - Parameters to Provision ILR API. type ILRRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -6888,16 +6554,6 @@ type ILRRequestResource struct { Type *string } -// IaaSVMContainerClassification provides polymorphic access to related types. -// Call the interface's GetIaaSVMContainer() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureIaaSClassicComputeVMContainer, *AzureIaaSComputeVMContainer, *IaaSVMContainer -type IaaSVMContainerClassification interface { - ProtectionContainerClassification - // GetIaaSVMContainer returns the IaaSVMContainer content of the underlying type. - GetIaaSVMContainer() *IaaSVMContainer -} - // IaaSVMContainer - IaaS VM workload-specific container. type IaaSVMContainer struct { // REQUIRED; Type of the container. The value of this property for: 1. Compute Azure VM is Microsoft.Compute/virtualMachines @@ -6937,25 +6593,15 @@ func (i *IaaSVMContainer) GetIaaSVMContainer() *IaaSVMContainer { return i } // GetProtectionContainer implements the ProtectionContainerClassification interface for type IaaSVMContainer. func (i *IaaSVMContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: i.FriendlyName, BackupManagementType: i.BackupManagementType, - RegistrationStatus: i.RegistrationStatus, - HealthStatus: i.HealthStatus, ContainerType: i.ContainerType, + FriendlyName: i.FriendlyName, + HealthStatus: i.HealthStatus, ProtectableObjectType: i.ProtectableObjectType, + RegistrationStatus: i.RegistrationStatus, } } -// IaaSVMProtectableItemClassification provides polymorphic access to related types. -// Call the interface's GetIaaSVMProtectableItem() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureIaaSClassicComputeVMProtectableItem, *AzureIaaSComputeVMProtectableItem, *IaaSVMProtectableItem -type IaaSVMProtectableItemClassification interface { - WorkloadProtectableItemClassification - // GetIaaSVMProtectableItem returns the IaaSVMProtectableItem content of the underlying type. - GetIaaSVMProtectableItem() *IaaSVMProtectableItem -} - // IaaSVMProtectableItem - IaaS VM workload-specific backup item. type IaaSVMProtectableItem struct { // REQUIRED; Type of the backup item. @@ -6990,10 +6636,10 @@ func (i *IaaSVMProtectableItem) GetIaaSVMProtectableItem() *IaaSVMProtectableIte func (i *IaaSVMProtectableItem) GetWorkloadProtectableItem() *WorkloadProtectableItem { return &WorkloadProtectableItem{ BackupManagementType: i.BackupManagementType, - WorkloadType: i.WorkloadType, - ProtectableItemType: i.ProtectableItemType, FriendlyName: i.FriendlyName, + ProtectableItemType: i.ProtectableItemType, ProtectionState: i.ProtectionState, + WorkloadType: i.WorkloadType, } } @@ -7105,16 +6751,6 @@ func (i *IaasVMRecoveryPoint) GetRecoveryPoint() *RecoveryPoint { } } -// IaasVMRestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetIaasVMRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *IaasVMRestoreRequest, *IaasVMRestoreWithRehydrationRequest -type IaasVMRestoreRequestClassification interface { - RestoreRequestClassification - // GetIaasVMRestoreRequest returns the IaasVMRestoreRequest content of the underlying type. - GetIaasVMRestoreRequest() *IaasVMRestoreRequest -} - // IaasVMRestoreRequest - IaaS VM workload-specific restore. type IaasVMRestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -7293,30 +6929,30 @@ type IaasVMRestoreWithRehydrationRequest struct { // GetIaasVMRestoreRequest implements the IaasVMRestoreRequestClassification interface for type IaasVMRestoreWithRehydrationRequest. func (i *IaasVMRestoreWithRehydrationRequest) GetIaasVMRestoreRequest() *IaasVMRestoreRequest { return &IaasVMRestoreRequest{ - RecoveryPointID: i.RecoveryPointID, - RecoveryType: i.RecoveryType, - SourceResourceID: i.SourceResourceID, - TargetVirtualMachineID: i.TargetVirtualMachineID, - TargetResourceGroupID: i.TargetResourceGroupID, - StorageAccountID: i.StorageAccountID, - VirtualNetworkID: i.VirtualNetworkID, - SubnetID: i.SubnetID, - TargetDomainNameID: i.TargetDomainNameID, - Region: i.Region, AffinityGroup: i.AffinityGroup, CreateNewCloudService: i.CreateNewCloudService, - OriginalStorageAccountOption: i.OriginalStorageAccountOption, + DiskEncryptionSetID: i.DiskEncryptionSetID, EncryptionDetails: i.EncryptionDetails, + ExtendedLocation: i.ExtendedLocation, + IdentityBasedRestoreDetails: i.IdentityBasedRestoreDetails, + IdentityInfo: i.IdentityInfo, + ObjectType: i.ObjectType, + OriginalStorageAccountOption: i.OriginalStorageAccountOption, + RecoveryPointID: i.RecoveryPointID, + RecoveryType: i.RecoveryType, + Region: i.Region, RestoreDiskLunList: i.RestoreDiskLunList, RestoreWithManagedDisks: i.RestoreWithManagedDisks, - DiskEncryptionSetID: i.DiskEncryptionSetID, - Zones: i.Zones, - IdentityInfo: i.IdentityInfo, - IdentityBasedRestoreDetails: i.IdentityBasedRestoreDetails, - ExtendedLocation: i.ExtendedLocation, SecuredVMDetails: i.SecuredVMDetails, + SourceResourceID: i.SourceResourceID, + StorageAccountID: i.StorageAccountID, + SubnetID: i.SubnetID, TargetDiskNetworkAccessSettings: i.TargetDiskNetworkAccessSettings, - ObjectType: i.ObjectType, + TargetDomainNameID: i.TargetDomainNameID, + TargetResourceGroupID: i.TargetResourceGroupID, + TargetVirtualMachineID: i.TargetVirtualMachineID, + VirtualNetworkID: i.VirtualNetworkID, + Zones: i.Zones, } } @@ -7367,6 +7003,9 @@ type InquiryValidation struct { // READ-ONLY; Error Additional Detail in case the status is non-success. AdditionalDetail *string + + // READ-ONLY; Dictionary to store the count of ProtectableItems with key POType. + ProtectableItemCount any } // InstantItemRecoveryTarget - Target details for file / folder restore. @@ -7380,27 +7019,6 @@ type InstantRPAdditionalDetails struct { AzureBackupRGNameSuffix *string } -// ItemLevelRecoveryConnectionsClientProvisionOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Provision -// method. -type ItemLevelRecoveryConnectionsClientProvisionOptions struct { - // placeholder for future optional parameters -} - -// ItemLevelRecoveryConnectionsClientRevokeOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Revoke -// method. -type ItemLevelRecoveryConnectionsClientRevokeOptions struct { - // placeholder for future optional parameters -} - -// JobClassification provides polymorphic access to related types. -// Call the interface's GetJob() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureIaaSVMJob, *AzureIaaSVMJobV2, *AzureStorageJob, *AzureWorkloadJob, *DpmJob, *Job, *MabJob, *VaultJob -type JobClassification interface { - // GetJob returns the Job content of the underlying type. - GetJob() *Job -} - // Job - Defines workload agnostic properties for a job. type Job struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -7431,21 +7049,6 @@ type Job struct { // GetJob implements the JobClassification interface for type Job. func (j *Job) GetJob() *Job { return j } -// JobCancellationsClientTriggerOptions contains the optional parameters for the JobCancellationsClient.Trigger method. -type JobCancellationsClientTriggerOptions struct { - // placeholder for future optional parameters -} - -// JobDetailsClientGetOptions contains the optional parameters for the JobDetailsClient.Get method. -type JobDetailsClientGetOptions struct { - // placeholder for future optional parameters -} - -// JobOperationResultsClientGetOptions contains the optional parameters for the JobOperationResultsClient.Get method. -type JobOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - // JobQueryObject - Filters to list the jobs. type JobQueryObject struct { // Type of backup management for the job. @@ -7500,12 +7103,6 @@ type JobResourceList struct { Value []*JobResource } -// JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. -type JobsClientExportOptions struct { - // OData filter options. - Filter *string -} - // KEKDetails - KEK is encryption key for BEK. type KEKDetails struct { // KEK data. @@ -7669,12 +7266,12 @@ type MabContainer struct { // GetProtectionContainer implements the ProtectionContainerClassification interface for type MabContainer. func (m *MabContainer) GetProtectionContainer() *ProtectionContainer { return &ProtectionContainer{ - FriendlyName: m.FriendlyName, BackupManagementType: m.BackupManagementType, - RegistrationStatus: m.RegistrationStatus, - HealthStatus: m.HealthStatus, ContainerType: m.ContainerType, + FriendlyName: m.FriendlyName, + HealthStatus: m.HealthStatus, ProtectableObjectType: m.ProtectableObjectType, + RegistrationStatus: m.RegistrationStatus, } } @@ -7771,7 +7368,7 @@ type MabFileFolderProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -7786,24 +7383,24 @@ type MabFileFolderProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type MabFileFolderProtectedItem. func (m *MabFileFolderProtectedItem) GetProtectedItem() *ProtectedItem { return &ProtectedItem{ - ProtectedItemType: m.ProtectedItemType, BackupManagementType: m.BackupManagementType, - WorkloadType: m.WorkloadType, - ContainerName: m.ContainerName, - SourceResourceID: m.SourceResourceID, - PolicyID: m.PolicyID, - LastRecoveryPoint: m.LastRecoveryPoint, BackupSetName: m.BackupSetName, + ContainerName: m.ContainerName, CreateMode: m.CreateMode, DeferredDeleteTimeInUTC: m.DeferredDeleteTimeInUTC, - IsScheduledForDeferredDelete: m.IsScheduledForDeferredDelete, DeferredDeleteTimeRemaining: m.DeferredDeleteTimeRemaining, + IsArchiveEnabled: m.IsArchiveEnabled, IsDeferredDeleteScheduleUpcoming: m.IsDeferredDeleteScheduleUpcoming, IsRehydrate: m.IsRehydrate, - ResourceGuardOperationRequests: m.ResourceGuardOperationRequests, - IsArchiveEnabled: m.IsArchiveEnabled, + IsScheduledForDeferredDelete: m.IsScheduledForDeferredDelete, + LastRecoveryPoint: m.LastRecoveryPoint, + PolicyID: m.PolicyID, PolicyName: m.PolicyName, - SoftDeleteRetentionPeriod: m.SoftDeleteRetentionPeriod, + ProtectedItemType: m.ProtectedItemType, + ResourceGuardOperationRequests: m.ResourceGuardOperationRequests, + SoftDeleteRetentionPeriodInDays: m.SoftDeleteRetentionPeriodInDays, + SourceResourceID: m.SourceResourceID, + WorkloadType: m.WorkloadType, } } @@ -7870,14 +7467,14 @@ type MabJob struct { // GetJob implements the JobClassification interface for type MabJob. func (m *MabJob) GetJob() *Job { return &Job{ - EntityFriendlyName: m.EntityFriendlyName, + ActivityID: m.ActivityID, BackupManagementType: m.BackupManagementType, - Operation: m.Operation, - Status: m.Status, - StartTime: m.StartTime, EndTime: m.EndTime, - ActivityID: m.ActivityID, + EntityFriendlyName: m.EntityFriendlyName, JobType: m.JobType, + Operation: m.Operation, + StartTime: m.StartTime, + Status: m.Status, } } @@ -7932,8 +7529,8 @@ type MabProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type MabProtectionPolicy. func (m *MabProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return &ProtectionPolicy{ - ProtectedItemsCount: m.ProtectedItemsCount, BackupManagementType: m.BackupManagementType, + ProtectedItemsCount: m.ProtectedItemsCount, ResourceGuardOperationRequests: m.ResourceGuardOperationRequests, } } @@ -8000,11 +7597,6 @@ type NewErrorResponseError struct { Target *string } -// OperationClientValidateOptions contains the optional parameters for the OperationClient.Validate method. -type OperationClientValidateOptions struct { - // placeholder for future optional parameters -} - // OperationResultInfo - Operation result info. type OperationResultInfo struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -8021,15 +7613,6 @@ func (o *OperationResultInfo) GetOperationResultInfoBase() *OperationResultInfoB } } -// OperationResultInfoBaseClassification provides polymorphic access to related types. -// Call the interface's GetOperationResultInfoBase() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ExportJobsOperationResultInfo, *OperationResultInfo, *OperationResultInfoBase -type OperationResultInfoBaseClassification interface { - // GetOperationResultInfoBase returns the OperationResultInfoBase content of the underlying type. - GetOperationResultInfoBase() *OperationResultInfoBase -} - // OperationResultInfoBase - Base class for operation result info. type OperationResultInfoBase struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -8084,16 +7667,6 @@ type OperationStatusError struct { Message *string } -// OperationStatusExtendedInfoClassification provides polymorphic access to related types. -// Call the interface's GetOperationStatusExtendedInfo() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *OperationStatusExtendedInfo, *OperationStatusJobExtendedInfo, *OperationStatusJobsExtendedInfo, *OperationStatusProvisionILRExtendedInfo, -// - *OperationStatusValidateOperationExtendedInfo -type OperationStatusExtendedInfoClassification interface { - // GetOperationStatusExtendedInfo returns the OperationStatusExtendedInfo content of the underlying type. - GetOperationStatusExtendedInfo() *OperationStatusExtendedInfo -} - // OperationStatusExtendedInfo - Base class for additional information of operation status. type OperationStatusExtendedInfo struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -8181,11 +7754,6 @@ type OperationWorkerResponse struct { StatusCode *HTTPStatusCode } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // PointInTimeRange - Provides details for log ranges type PointInTimeRange struct { // End time of the time range for log recovery. @@ -8292,14 +7860,11 @@ type PrivateEndpoint struct { ID *string } -// PrivateEndpointClientGetOperationStatusOptions contains the optional parameters for the PrivateEndpointClient.GetOperationStatus -// method. -type PrivateEndpointClientGetOperationStatusOptions struct { - // placeholder for future optional parameters -} - // PrivateEndpointConnection - Private Endpoint Connection Response Properties type PrivateEndpointConnection struct { + // Group Ids for the Private Endpoint + GroupIDs []*VaultSubResourceType + // Gets or sets private endpoint associated with the private endpoint connection PrivateEndpoint *PrivateEndpoint @@ -8310,26 +7875,6 @@ type PrivateEndpointConnection struct { ProvisioningState *ProvisioningState } -// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete -// method. -type PrivateEndpointConnectionClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionClientBeginPutOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginPut -// method. -type PrivateEndpointConnectionClientBeginPutOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// PrivateEndpointConnectionClientGetOptions contains the optional parameters for the PrivateEndpointConnectionClient.Get -// method. -type PrivateEndpointConnectionClientGetOptions struct { - // placeholder for future optional parameters -} - // PrivateEndpointConnectionResource - Private Endpoint Connection Response Properties type PrivateEndpointConnectionResource struct { // Optional ETag. @@ -8357,7 +7902,7 @@ type PrivateEndpointConnectionResource struct { // PrivateLinkServiceConnectionState - Private Link Service Connection State type PrivateLinkServiceConnectionState struct { // Gets or sets actions required - ActionRequired *string + ActionsRequired *string // Gets or sets description Description *string @@ -8366,15 +7911,6 @@ type PrivateLinkServiceConnectionState struct { Status *PrivateEndpointConnectionStatus } -// ProtectableContainerClassification provides polymorphic access to related types. -// Call the interface's GetProtectableContainer() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureStorageProtectableContainer, *AzureVMAppContainerProtectableContainer, *ProtectableContainer -type ProtectableContainerClassification interface { - // GetProtectableContainer returns the ProtectableContainer content of the underlying type. - GetProtectableContainer() *ProtectableContainer -} - // ProtectableContainer - Protectable Container Class. type ProtectableContainer struct { // REQUIRED; Type of the container. The value of this property for @@ -8431,25 +7967,6 @@ type ProtectableContainerResourceList struct { Value []*ProtectableContainerResource } -// ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.NewListPager -// method. -type ProtectableContainersClientListOptions struct { - // OData filter options. - Filter *string -} - -// ProtectedItemClassification provides polymorphic access to related types. -// 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, *AzureVMWorkloadSAPHanaDBInstanceProtectedItem, -// - *AzureVMWorkloadSAPHanaDatabaseProtectedItem, *AzureVMWorkloadSQLDatabaseProtectedItem, *DPMProtectedItem, *GenericProtectedItem, -// - *MabFileFolderProtectedItem, *ProtectedItem -type ProtectedItemClassification interface { - // GetProtectedItem returns the ProtectedItem content of the underlying type. - GetProtectedItem() *ProtectedItem -} - // ProtectedItem - Base class for backup items. type ProtectedItem struct { // REQUIRED; backup item type. @@ -8495,7 +8012,7 @@ type ProtectedItem struct { ResourceGuardOperationRequests []*string // Soft delete retention period in days - SoftDeleteRetentionPeriod *int32 + SoftDeleteRetentionPeriodInDays *int32 // ARM ID of the resource to be backed up. SourceResourceID *string @@ -8510,18 +8027,6 @@ type ProtectedItem struct { // GetProtectedItem implements the ProtectedItemClassification interface for type ProtectedItem. func (p *ProtectedItem) GetProtectedItem() *ProtectedItem { return p } -// ProtectedItemOperationResultsClientGetOptions contains the optional parameters for the ProtectedItemOperationResultsClient.Get -// method. -type ProtectedItemOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectedItemOperationStatusesClientGetOptions contains the optional parameters for the ProtectedItemOperationStatusesClient.Get -// method. -type ProtectedItemOperationStatusesClientGetOptions struct { - // placeholder for future optional parameters -} - // ProtectedItemQueryObject - Filters to list backup items. type ProtectedItemQueryObject struct { // Backup Engine name @@ -8585,34 +8090,6 @@ type ProtectedItemResourceList struct { Value []*ProtectedItemResource } -// ProtectedItemsClientCreateOrUpdateOptions contains the optional parameters for the ProtectedItemsClient.CreateOrUpdate -// method. -type ProtectedItemsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProtectedItemsClientDeleteOptions contains the optional parameters for the ProtectedItemsClient.Delete method. -type ProtectedItemsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProtectedItemsClientGetOptions contains the optional parameters for the ProtectedItemsClient.Get method. -type ProtectedItemsClientGetOptions struct { - // OData filter options. - Filter *string -} - -// ProtectionContainerClassification provides polymorphic access to related types. -// Call the interface's GetProtectionContainer() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureBackupServerContainer, *AzureIaaSClassicComputeVMContainer, *AzureIaaSComputeVMContainer, *AzureSQLAGWorkloadContainerProtectionContainer, -// - *AzureSQLContainer, *AzureStorageContainer, *AzureVMAppContainerProtectionContainer, *AzureWorkloadContainer, *DpmContainer, -// - *GenericContainer, *IaaSVMContainer, *MabContainer, *ProtectionContainer -type ProtectionContainerClassification interface { - // GetProtectionContainer returns the ProtectionContainer content of the underlying type. - GetProtectionContainer() *ProtectionContainer -} - // ProtectionContainer - Base class for container with backup items. Containers with specific workloads are derived from this // class. type ProtectionContainer struct { @@ -8641,18 +8118,6 @@ type ProtectionContainer struct { // GetProtectionContainer implements the ProtectionContainerClassification interface for type ProtectionContainer. func (p *ProtectionContainer) GetProtectionContainer() *ProtectionContainer { return p } -// ProtectionContainerOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerOperationResultsClient.Get -// method. -type ProtectionContainerOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectionContainerRefreshOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerRefreshOperationResultsClient.Get -// method. -type ProtectionContainerRefreshOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - // ProtectionContainerResource - Base class for container with backup items. Containers with specific workloads are derived // from this class. type ProtectionContainerResource struct { @@ -8687,45 +8152,6 @@ type ProtectionContainerResourceList struct { Value []*ProtectionContainerResource } -// ProtectionContainersClientGetOptions contains the optional parameters for the ProtectionContainersClient.Get method. -type ProtectionContainersClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectionContainersClientInquireOptions contains the optional parameters for the ProtectionContainersClient.Inquire method. -type ProtectionContainersClientInquireOptions struct { - // OData filter options. - Filter *string -} - -// ProtectionContainersClientRefreshOptions contains the optional parameters for the ProtectionContainersClient.Refresh method. -type ProtectionContainersClientRefreshOptions struct { - // OData filter options. - Filter *string -} - -// ProtectionContainersClientRegisterOptions contains the optional parameters for the ProtectionContainersClient.Register -// method. -type ProtectionContainersClientRegisterOptions struct { - // placeholder for future optional parameters -} - -// ProtectionContainersClientUnregisterOptions contains the optional parameters for the ProtectionContainersClient.Unregister -// method. -type ProtectionContainersClientUnregisterOptions struct { - // placeholder for future optional parameters -} - -// ProtectionIntentClassification provides polymorphic access to related types. -// Call the interface's GetProtectionIntent() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureRecoveryServiceVaultProtectionIntent, *AzureResourceProtectionIntent, *AzureWorkloadAutoProtectionIntent, *AzureWorkloadContainerAutoProtectionIntent, -// - *AzureWorkloadSQLAutoProtectionIntent, *ProtectionIntent -type ProtectionIntentClassification interface { - // GetProtectionIntent returns the ProtectionIntent content of the underlying type. - GetProtectionIntent() *ProtectionIntent -} - // ProtectionIntent - Base class for backup ProtectionIntent. type ProtectionIntent struct { // REQUIRED; backup protectionIntent type. @@ -8750,27 +8176,6 @@ type ProtectionIntent struct { // GetProtectionIntent implements the ProtectionIntentClassification interface for type ProtectionIntent. func (p *ProtectionIntent) GetProtectionIntent() *ProtectionIntent { return p } -// ProtectionIntentClientCreateOrUpdateOptions contains the optional parameters for the ProtectionIntentClient.CreateOrUpdate -// method. -type ProtectionIntentClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProtectionIntentClientDeleteOptions contains the optional parameters for the ProtectionIntentClient.Delete method. -type ProtectionIntentClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProtectionIntentClientGetOptions contains the optional parameters for the ProtectionIntentClient.Get method. -type ProtectionIntentClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate method. -type ProtectionIntentClientValidateOptions struct { - // placeholder for future optional parameters -} - // ProtectionIntentQueryObject - Filters to list protection intent. type ProtectionIntentQueryObject struct { // Backup management type for the backed up item @@ -8819,34 +8224,6 @@ type ProtectionIntentResourceList struct { Value []*ProtectionIntentResource } -// ProtectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ProtectionPoliciesClient.BeginDelete -// method. -type ProtectionPoliciesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ProtectionPoliciesClient.CreateOrUpdate -// method. -type ProtectionPoliciesClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProtectionPoliciesClientGetOptions contains the optional parameters for the ProtectionPoliciesClient.Get method. -type ProtectionPoliciesClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectionPolicyClassification provides polymorphic access to related types. -// Call the interface's GetProtectionPolicy() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileShareProtectionPolicy, *AzureIaaSVMProtectionPolicy, *AzureSQLProtectionPolicy, *AzureVMWorkloadProtectionPolicy, -// - *GenericProtectionPolicy, *MabProtectionPolicy, *ProtectionPolicy -type ProtectionPolicyClassification interface { - // GetProtectionPolicy returns the ProtectionPolicy content of the underlying type. - GetProtectionPolicy() *ProtectionPolicy -} - // ProtectionPolicy - Base class for backup policy. Workload-specific backup policies are derived from this class. type ProtectionPolicy struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -8862,18 +8239,6 @@ type ProtectionPolicy struct { // GetProtectionPolicy implements the ProtectionPolicyClassification interface for type ProtectionPolicy. func (p *ProtectionPolicy) GetProtectionPolicy() *ProtectionPolicy { return p } -// ProtectionPolicyOperationResultsClientGetOptions contains the optional parameters for the ProtectionPolicyOperationResultsClient.Get -// method. -type ProtectionPolicyOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ProtectionPolicyOperationStatusesClientGetOptions contains the optional parameters for the ProtectionPolicyOperationStatusesClient.Get -// method. -type ProtectionPolicyOperationStatusesClientGetOptions struct { - // placeholder for future optional parameters -} - // ProtectionPolicyQueryObject - Filters the list backup policies API. type ProtectionPolicyQueryObject struct { // Backup management type for the backup policy. @@ -8919,17 +8284,6 @@ type ProtectionPolicyResourceList struct { Value []*ProtectionPolicyResource } -// RecoveryPointClassification provides polymorphic access to related types. -// Call the interface's GetRecoveryPoint() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileShareRecoveryPoint, *AzureWorkloadPointInTimeRecoveryPoint, *AzureWorkloadRecoveryPoint, *AzureWorkloadSAPHanaPointInTimeRecoveryPoint, -// - *AzureWorkloadSAPHanaRecoveryPoint, *AzureWorkloadSQLPointInTimeRecoveryPoint, *AzureWorkloadSQLRecoveryPoint, *GenericRecoveryPoint, -// - *IaasVMRecoveryPoint, *RecoveryPoint -type RecoveryPointClassification interface { - // GetRecoveryPoint returns the RecoveryPoint content of the underlying type. - GetRecoveryPoint() *RecoveryPoint -} - // RecoveryPoint - Base class for backup copies. Workload-specific backup copies are derived from this class. type RecoveryPoint struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9037,23 +8391,6 @@ type RecoveryPointTierInformationV2 struct { Type *RecoveryPointTierType } -// RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. -type RecoveryPointsClientGetOptions struct { - // placeholder for future optional parameters -} - -// RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.NewListPager method. -type RecoveryPointsClientListOptions struct { - // OData filter options. - Filter *string -} - -// RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.NewListPager -// method. -type RecoveryPointsRecommendedForMoveClientListOptions struct { - // placeholder for future optional parameters -} - // Resource - ARM Resource. type Resource struct { // Optional ETag. @@ -9080,11 +8417,6 @@ type ResourceGuardOperationDetail struct { VaultCriticalOperation *string } -// ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.NewGetPager method. -type ResourceGuardProxiesClientGetOptions struct { - // placeholder for future optional parameters -} - type ResourceGuardProxyBase struct { Description *string LastUpdatedTime *string @@ -9124,27 +8456,6 @@ type ResourceGuardProxyBaseResourceList struct { Value []*ResourceGuardProxyBaseResource } -// ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete method. -type ResourceGuardProxyClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. -type ResourceGuardProxyClientGetOptions struct { - // placeholder for future optional parameters -} - -// ResourceGuardProxyClientPutOptions contains the optional parameters for the ResourceGuardProxyClient.Put method. -type ResourceGuardProxyClientPutOptions struct { - // placeholder for future optional parameters -} - -// ResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.UnlockDelete -// method. -type ResourceGuardProxyClientUnlockDeleteOptions struct { - // placeholder for future optional parameters -} - // ResourceHealthDetails - Health Details for backup items. type ResourceHealthDetails struct { // READ-ONLY; Health Code @@ -9178,18 +8489,6 @@ type RestoreFileSpecs struct { TargetFolderPath *string } -// RestoreRequestClassification provides polymorphic access to related types. -// Call the interface's GetRestoreRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureFileShareRestoreRequest, *AzureWorkloadPointInTimeRestoreRequest, *AzureWorkloadRestoreRequest, *AzureWorkloadSAPHanaPointInTimeRestoreRequest, -// - *AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSAPHanaRestoreRequest, *AzureWorkloadSAPHanaRestoreWithRehydrateRequest, -// - *AzureWorkloadSQLPointInTimeRestoreRequest, *AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest, *AzureWorkloadSQLRestoreRequest, -// - *AzureWorkloadSQLRestoreWithRehydrateRequest, *IaasVMRestoreRequest, *IaasVMRestoreWithRehydrationRequest, *RestoreRequest -type RestoreRequestClassification interface { - // GetRestoreRequest returns the RestoreRequest content of the underlying type. - GetRestoreRequest() *RestoreRequest -} - // RestoreRequest - Base class for restore request. Workload-specific restore requests are derived from this class. type RestoreRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9223,12 +8522,6 @@ type RestoreRequestResource struct { Type *string } -// RestoresClientBeginTriggerOptions contains the optional parameters for the RestoresClient.BeginTrigger method. -type RestoresClientBeginTriggerOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // RetentionDuration - Retention duration. type RetentionDuration struct { // Count of duration types. Retention duration is obtained by the counting the duration type Count times. For example, when @@ -9239,15 +8532,6 @@ type RetentionDuration struct { DurationType *RetentionDurationType } -// RetentionPolicyClassification provides polymorphic access to related types. -// Call the interface's GetRetentionPolicy() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *LongTermRetentionPolicy, *RetentionPolicy, *SimpleRetentionPolicy -type RetentionPolicyClassification interface { - // GetRetentionPolicy returns the RetentionPolicy content of the underlying type. - GetRetentionPolicy() *RetentionPolicy -} - // RetentionPolicy - Base class for retention policy. type RetentionPolicy struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9284,15 +8568,6 @@ type SQLDataDirectoryMapping struct { TargetPath *string } -// SchedulePolicyClassification provides polymorphic access to related types. -// Call the interface's GetSchedulePolicy() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *LogSchedulePolicy, *LongTermSchedulePolicy, *SchedulePolicy, *SimpleSchedulePolicy, *SimpleSchedulePolicyV2 -type SchedulePolicyClassification interface { - // GetSchedulePolicy returns the SchedulePolicy content of the underlying type. - GetSchedulePolicy() *SchedulePolicy -} - // SchedulePolicy - Base class for backup schedule. type SchedulePolicy struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9308,12 +8583,6 @@ type SecuredVMDetails struct { SecuredVMOsDiskEncryptionSetID *string } -// SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. -type SecurityPINsClientGetOptions struct { - // security pin request - Parameters *SecurityPinBase -} - // SecurityPinBase - Base class for get security pin request body type SecurityPinBase struct { // ResourceGuard Operation Requests @@ -9532,27 +8801,11 @@ func (v *ValidateIaasVMRestoreOperationRequest) GetValidateOperationRequest() *V // GetValidateRestoreOperationRequest implements the ValidateRestoreOperationRequestClassification interface for type ValidateIaasVMRestoreOperationRequest. func (v *ValidateIaasVMRestoreOperationRequest) GetValidateRestoreOperationRequest() *ValidateRestoreOperationRequest { return &ValidateRestoreOperationRequest{ - RestoreRequest: v.RestoreRequest, ObjectType: v.ObjectType, + RestoreRequest: v.RestoreRequest, } } -// ValidateOperationClientBeginTriggerOptions contains the optional parameters for the ValidateOperationClient.BeginTrigger -// method. -type ValidateOperationClientBeginTriggerOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ValidateOperationRequestClassification provides polymorphic access to related types. -// Call the interface's GetValidateOperationRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ValidateIaasVMRestoreOperationRequest, *ValidateOperationRequest, *ValidateRestoreOperationRequest -type ValidateOperationRequestClassification interface { - // GetValidateOperationRequest returns the ValidateOperationRequest content of the underlying type. - GetValidateOperationRequest() *ValidateOperationRequest -} - // ValidateOperationRequest - Base class for validate operation request. type ValidateOperationRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9568,32 +8821,11 @@ type ValidateOperationResponse struct { ValidationResults []*ErrorDetail } -// ValidateOperationResultsClientGetOptions contains the optional parameters for the ValidateOperationResultsClient.Get method. -type ValidateOperationResultsClientGetOptions struct { - // placeholder for future optional parameters -} - -// ValidateOperationStatusesClientGetOptions contains the optional parameters for the ValidateOperationStatusesClient.Get -// method. -type ValidateOperationStatusesClientGetOptions struct { - // placeholder for future optional parameters -} - type ValidateOperationsResponse struct { // Base class for validate operation response. ValidateOperationResponse *ValidateOperationResponse } -// ValidateRestoreOperationRequestClassification provides polymorphic access to related types. -// Call the interface's GetValidateRestoreOperationRequest() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *ValidateIaasVMRestoreOperationRequest, *ValidateRestoreOperationRequest -type ValidateRestoreOperationRequestClassification interface { - ValidateOperationRequestClassification - // GetValidateRestoreOperationRequest returns the ValidateRestoreOperationRequest content of the underlying type. - GetValidateRestoreOperationRequest() *ValidateRestoreOperationRequest -} - // ValidateRestoreOperationRequest - AzureRestoreValidation request. type ValidateRestoreOperationRequest struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9657,14 +8889,14 @@ type VaultJob struct { // GetJob implements the JobClassification interface for type VaultJob. func (v *VaultJob) GetJob() *Job { return &Job{ - EntityFriendlyName: v.EntityFriendlyName, + ActivityID: v.ActivityID, BackupManagementType: v.BackupManagementType, - Operation: v.Operation, - Status: v.Status, - StartTime: v.StartTime, EndTime: v.EndTime, - ActivityID: v.ActivityID, + EntityFriendlyName: v.EntityFriendlyName, JobType: v.JobType, + Operation: v.Operation, + StartTime: v.StartTime, + Status: v.Status, } } @@ -9686,15 +8918,6 @@ type VaultJobExtendedInfo struct { PropertyBag map[string]*string } -// VaultStorageConfigOperationResultResponseClassification provides polymorphic access to related types. -// Call the interface's GetVaultStorageConfigOperationResultResponse() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *PrepareDataMoveResponse, *VaultStorageConfigOperationResultResponse -type VaultStorageConfigOperationResultResponseClassification interface { - // GetVaultStorageConfigOperationResultResponse returns the VaultStorageConfigOperationResultResponse content of the underlying type. - GetVaultStorageConfigOperationResultResponse() *VaultStorageConfigOperationResultResponse -} - // VaultStorageConfigOperationResultResponse - Operation result response for Vault Storage Config type VaultStorageConfigOperationResultResponse struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. @@ -9747,17 +8970,6 @@ type WorkloadInquiryDetails struct { Type *string } -// WorkloadItemClassification provides polymorphic access to related types. -// Call the interface's GetWorkloadItem() method to access the common type. -// Use a type switch to determine the concrete type. The possible types are: -// - *AzureVMWorkloadItem, *AzureVMWorkloadSAPAseDatabaseWorkloadItem, *AzureVMWorkloadSAPAseSystemWorkloadItem, *AzureVMWorkloadSAPHanaDatabaseWorkloadItem, -// - *AzureVMWorkloadSAPHanaSystemWorkloadItem, *AzureVMWorkloadSQLDatabaseWorkloadItem, *AzureVMWorkloadSQLInstanceWorkloadItem, -// - *WorkloadItem -type WorkloadItemClassification interface { - // GetWorkloadItem returns the WorkloadItem content of the underlying type. - GetWorkloadItem() *WorkloadItem -} - // WorkloadItem - Base class for backup item. Workload-specific backup items are derived from this class. type WorkloadItem struct { // REQUIRED; Type of the backup item. @@ -9812,18 +9024,6 @@ type WorkloadItemResourceList struct { Value []*WorkloadItemResource } -// WorkloadProtectableItemClassification provides polymorphic access to related types. -// 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, *AzureVMWorkloadSAPHanaDBInstance, *AzureVMWorkloadSAPHanaDatabaseProtectableItem, -// - *AzureVMWorkloadSAPHanaHSR, *AzureVMWorkloadSAPHanaSystemProtectableItem, *AzureVMWorkloadSQLAvailabilityGroupProtectableItem, -// - *AzureVMWorkloadSQLDatabaseProtectableItem, *AzureVMWorkloadSQLInstanceProtectableItem, *IaaSVMProtectableItem, *WorkloadProtectableItem -type WorkloadProtectableItemClassification interface { - // GetWorkloadProtectableItem returns the WorkloadProtectableItem content of the underlying type. - GetWorkloadProtectableItem() *WorkloadProtectableItem -} - // WorkloadProtectableItem - Base class for backup item. Workload-specific backup items are derived from this class. type WorkloadProtectableItem struct { // REQUIRED; Type of the backup item. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go index 69f0018d4087..09bfbbe111ad 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/models_serde.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -493,7 +492,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -574,8 +573,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -777,7 +776,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -871,8 +870,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -1034,7 +1033,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1128,8 +1127,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -1519,7 +1518,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "virtualMachineId", a.VirtualMachineID) populate(objectMap, "workloadType", a.WorkloadType) @@ -1613,8 +1612,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -1976,7 +1975,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2045,8 +2044,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -2672,6 +2671,7 @@ func (a AzureVMWorkloadProtectableItem) MarshalJSON() ([]byte, error) { populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -2705,6 +2705,9 @@ func (a *AzureVMWorkloadProtectableItem) UnmarshalJSON(data []byte) error { case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -2760,6 +2763,7 @@ func (a AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "lastBackupStatus", a.LastBackupStatus) populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentType", a.ParentType) populate(objectMap, "policyId", a.PolicyID) @@ -2771,7 +2775,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -2837,6 +2841,9 @@ func (a *AzureVMWorkloadProtectedItem) UnmarshalJSON(data []byte) error { case "lastRecoveryPoint": err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -2870,8 +2877,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -3009,6 +3016,7 @@ func (a AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error populate(objectMap, "lastBackupStatus", a.LastBackupStatus) populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentType", a.ParentType) populate(objectMap, "policyId", a.PolicyID) @@ -3020,7 +3028,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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -3086,6 +3094,9 @@ func (a *AzureVMWorkloadSAPAseDatabaseProtectedItem) UnmarshalJSON(data []byte) case "lastRecoveryPoint": err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3119,8 +3130,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -3206,6 +3217,7 @@ func (a AzureVMWorkloadSAPAseSystemProtectableItem) MarshalJSON() ([]byte, error populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -3239,6 +3251,9 @@ func (a *AzureVMWorkloadSAPAseSystemProtectableItem) UnmarshalJSON(data []byte) case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3344,6 +3359,7 @@ func (a AzureVMWorkloadSAPHanaDBInstance) MarshalJSON() ([]byte, error) { populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -3377,6 +3393,9 @@ func (a *AzureVMWorkloadSAPHanaDBInstance) UnmarshalJSON(data []byte) error { case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3432,6 +3451,7 @@ func (a AzureVMWorkloadSAPHanaDBInstanceProtectedItem) MarshalJSON() ([]byte, er populate(objectMap, "lastBackupStatus", a.LastBackupStatus) populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentType", a.ParentType) populate(objectMap, "policyId", a.PolicyID) @@ -3443,7 +3463,7 @@ func (a AzureVMWorkloadSAPHanaDBInstanceProtectedItem) MarshalJSON() ([]byte, er populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -3509,6 +3529,9 @@ func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) UnmarshalJSON(data []byt case "lastRecoveryPoint": err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3542,8 +3565,8 @@ func (a *AzureVMWorkloadSAPHanaDBInstanceProtectedItem) UnmarshalJSON(data []byt case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -3566,6 +3589,7 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectableItem) MarshalJSON() ([]byte, er populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -3599,6 +3623,9 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectableItem) UnmarshalJSON(data []byt case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3654,6 +3681,7 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, erro populate(objectMap, "lastBackupStatus", a.LastBackupStatus) populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentType", a.ParentType) populate(objectMap, "policyId", a.PolicyID) @@ -3665,7 +3693,7 @@ func (a AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, erro populate(objectMap, "protectionStatus", a.ProtectionStatus) populate(objectMap, "resourceGuardOperationRequests", a.ResourceGuardOperationRequests) populate(objectMap, "serverName", a.ServerName) - populate(objectMap, "softDeleteRetentionPeriod", a.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -3731,6 +3759,9 @@ func (a *AzureVMWorkloadSAPHanaDatabaseProtectedItem) UnmarshalJSON(data []byte) case "lastRecoveryPoint": err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3764,8 +3795,8 @@ 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) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -3844,17 +3875,18 @@ func (a *AzureVMWorkloadSAPHanaDatabaseWorkloadItem) UnmarshalJSON(data []byte) return nil } -// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaHSR. -func (a AzureVMWorkloadSAPHanaHSR) MarshalJSON() ([]byte, error) { +// MarshalJSON implements the json.Marshaller interface for type AzureVMWorkloadSAPHanaHSRProtectableItem. +func (a AzureVMWorkloadSAPHanaHSRProtectableItem) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "backupManagementType", a.BackupManagementType) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) - objectMap["protectableItemType"] = "SAPHanaHSR" + objectMap["protectableItemType"] = "HanaHSRContainer" populate(objectMap, "protectionState", a.ProtectionState) populate(objectMap, "serverName", a.ServerName) populate(objectMap, "subinquireditemcount", a.Subinquireditemcount) @@ -3863,8 +3895,8 @@ func (a AzureVMWorkloadSAPHanaHSR) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaHSR. -func (a *AzureVMWorkloadSAPHanaHSR) UnmarshalJSON(data []byte) error { +// UnmarshalJSON implements the json.Unmarshaller interface for type AzureVMWorkloadSAPHanaHSRProtectableItem. +func (a *AzureVMWorkloadSAPHanaHSRProtectableItem) UnmarshalJSON(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) @@ -3884,6 +3916,9 @@ func (a *AzureVMWorkloadSAPHanaHSR) UnmarshalJSON(data []byte) error { case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -3926,6 +3961,7 @@ func (a AzureVMWorkloadSAPHanaSystemProtectableItem) MarshalJSON() ([]byte, erro populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -3959,6 +3995,9 @@ func (a *AzureVMWorkloadSAPHanaSystemProtectableItem) UnmarshalJSON(data []byte) case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -4064,6 +4103,8 @@ func (a AzureVMWorkloadSQLAvailabilityGroupProtectableItem) MarshalJSON() ([]byt populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -4097,6 +4138,12 @@ func (a *AzureVMWorkloadSQLAvailabilityGroupProtectableItem) UnmarshalJSON(data case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -4139,6 +4186,7 @@ func (a AzureVMWorkloadSQLDatabaseProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -4172,6 +4220,9 @@ func (a *AzureVMWorkloadSQLDatabaseProtectableItem) UnmarshalJSON(data []byte) e case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -4227,6 +4278,7 @@ func (a AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "lastBackupStatus", a.LastBackupStatus) populateTimeRFC3339(objectMap, "lastBackupTime", a.LastBackupTime) populateTimeRFC3339(objectMap, "lastRecoveryPoint", a.LastRecoveryPoint) + populate(objectMap, "nodesList", a.NodesList) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentType", a.ParentType) populate(objectMap, "policyId", a.PolicyID) @@ -4238,7 +4290,7 @@ func (a AzureVMWorkloadSQLDatabaseProtectedItem) 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, "softDeleteRetentionPeriodInDays", a.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", a.SourceResourceID) populate(objectMap, "workloadType", a.WorkloadType) return json.Marshal(objectMap) @@ -4304,6 +4356,9 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err case "lastRecoveryPoint": err = unpopulateTimeRFC3339(val, "LastRecoveryPoint", &a.LastRecoveryPoint) delete(rawMsg, key) + case "nodesList": + err = unpopulate(val, "NodesList", &a.NodesList) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -4337,8 +4392,8 @@ func (a *AzureVMWorkloadSQLDatabaseProtectedItem) UnmarshalJSON(data []byte) err case "serverName": err = unpopulate(val, "ServerName", &a.ServerName) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &a.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &a.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &a.SourceResourceID) @@ -4424,6 +4479,7 @@ func (a AzureVMWorkloadSQLInstanceProtectableItem) MarshalJSON() ([]byte, error) populate(objectMap, "friendlyName", a.FriendlyName) populate(objectMap, "isAutoProtectable", a.IsAutoProtectable) populate(objectMap, "isAutoProtected", a.IsAutoProtected) + populate(objectMap, "isProtectable", a.IsProtectable) populate(objectMap, "parentName", a.ParentName) populate(objectMap, "parentUniqueName", a.ParentUniqueName) populate(objectMap, "prebackupvalidation", a.Prebackupvalidation) @@ -4457,6 +4513,9 @@ func (a *AzureVMWorkloadSQLInstanceProtectableItem) UnmarshalJSON(data []byte) e case "isAutoProtected": err = unpopulate(val, "IsAutoProtected", &a.IsAutoProtected) delete(rawMsg, key) + case "isProtectable": + err = unpopulate(val, "IsProtectable", &a.IsProtectable) + delete(rawMsg, key) case "parentName": err = unpopulate(val, "ParentName", &a.ParentName) delete(rawMsg, key) @@ -6979,6 +7038,7 @@ func (b BackupResourceVaultConfig) MarshalJSON() ([]byte, error) { populate(objectMap, "isSoftDeleteFeatureStateEditable", b.IsSoftDeleteFeatureStateEditable) populate(objectMap, "resourceGuardOperationRequests", b.ResourceGuardOperationRequests) populate(objectMap, "softDeleteFeatureState", b.SoftDeleteFeatureState) + populate(objectMap, "softDeleteRetentionPeriodInDays", b.SoftDeleteRetentionPeriodInDays) populate(objectMap, "storageModelType", b.StorageModelType) populate(objectMap, "storageType", b.StorageType) populate(objectMap, "storageTypeState", b.StorageTypeState) @@ -7006,6 +7066,9 @@ func (b *BackupResourceVaultConfig) UnmarshalJSON(data []byte) error { case "softDeleteFeatureState": err = unpopulate(val, "SoftDeleteFeatureState", &b.SoftDeleteFeatureState) delete(rawMsg, key) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &b.SoftDeleteRetentionPeriodInDays) + delete(rawMsg, key) case "storageModelType": err = unpopulate(val, "StorageModelType", &b.StorageModelType) delete(rawMsg, key) @@ -7112,12 +7175,14 @@ func (b *BackupStatusRequest) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type BackupStatusResponse. func (b BackupStatusResponse) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "acquireStorageAccountLock", b.AcquireStorageAccountLock) 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, "protectedItemsCount", b.ProtectedItemsCount) populate(objectMap, "protectionStatus", b.ProtectionStatus) populate(objectMap, "registrationStatus", b.RegistrationStatus) populate(objectMap, "vaultId", b.VaultID) @@ -7133,6 +7198,9 @@ func (b *BackupStatusResponse) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "acquireStorageAccountLock": + err = unpopulate(val, "AcquireStorageAccountLock", &b.AcquireStorageAccountLock) + delete(rawMsg, key) case "containerName": err = unpopulate(val, "ContainerName", &b.ContainerName) delete(rawMsg, key) @@ -7151,6 +7219,9 @@ func (b *BackupStatusResponse) UnmarshalJSON(data []byte) error { case "protectedItemName": err = unpopulate(val, "ProtectedItemName", &b.ProtectedItemName) delete(rawMsg, key) + case "protectedItemsCount": + err = unpopulate(val, "ProtectedItemsCount", &b.ProtectedItemsCount) + delete(rawMsg, key) case "protectionStatus": err = unpopulate(val, "ProtectionStatus", &b.ProtectionStatus) delete(rawMsg, key) @@ -7497,7 +7568,7 @@ func (d DPMProtectedItem) MarshalJSON() ([]byte, error) { objectMap["protectedItemType"] = "DPMProtectedItem" populate(objectMap, "protectionState", d.ProtectionState) populate(objectMap, "resourceGuardOperationRequests", d.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteRetentionPeriod", d.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", d.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", d.SourceResourceID) populate(objectMap, "workloadType", d.WorkloadType) return json.Marshal(objectMap) @@ -7569,8 +7640,8 @@ func (d *DPMProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &d.ResourceGuardOperationRequests) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &d.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &d.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) @@ -7864,6 +7935,7 @@ func (d DistributedNodesInfo) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "errorDetail", d.ErrorDetail) populate(objectMap, "nodeName", d.NodeName) + populate(objectMap, "sourceResourceId", d.SourceResourceID) populate(objectMap, "status", d.Status) return json.Marshal(objectMap) } @@ -7883,6 +7955,9 @@ func (d *DistributedNodesInfo) UnmarshalJSON(data []byte) error { case "nodeName": err = unpopulate(val, "NodeName", &d.NodeName) delete(rawMsg, key) + case "sourceResourceId": + err = unpopulate(val, "SourceResourceID", &d.SourceResourceID) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &d.Status) delete(rawMsg, key) @@ -8598,7 +8673,7 @@ func (g GenericProtectedItem) MarshalJSON() ([]byte, error) { objectMap["protectedItemType"] = "GenericProtectedItem" populate(objectMap, "protectionState", g.ProtectionState) populate(objectMap, "resourceGuardOperationRequests", g.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteRetentionPeriod", g.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", g.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceAssociations", g.SourceAssociations) populate(objectMap, "sourceResourceId", g.SourceResourceID) populate(objectMap, "workloadType", g.WorkloadType) @@ -8674,8 +8749,8 @@ func (g *GenericProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &g.ResourceGuardOperationRequests) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &g.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &g.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceAssociations": err = unpopulate(val, "SourceAssociations", &g.SourceAssociations) @@ -9559,6 +9634,7 @@ func (i InquiryValidation) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) populate(objectMap, "additionalDetail", i.AdditionalDetail) populate(objectMap, "errorDetail", i.ErrorDetail) + populateAny(objectMap, "protectableItemCount", i.ProtectableItemCount) populate(objectMap, "status", i.Status) return json.Marshal(objectMap) } @@ -9578,6 +9654,9 @@ func (i *InquiryValidation) UnmarshalJSON(data []byte) error { case "errorDetail": err = unpopulate(val, "ErrorDetail", &i.ErrorDetail) delete(rawMsg, key) + case "protectableItemCount": + err = unpopulate(val, "ProtectableItemCount", &i.ProtectableItemCount) + delete(rawMsg, key) case "status": err = unpopulate(val, "Status", &i.Status) delete(rawMsg, key) @@ -10277,7 +10356,7 @@ func (m MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { objectMap["protectedItemType"] = "MabFileFolderProtectedItem" populate(objectMap, "protectionState", m.ProtectionState) populate(objectMap, "resourceGuardOperationRequests", m.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteRetentionPeriod", m.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", m.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", m.SourceResourceID) populate(objectMap, "workloadType", m.WorkloadType) return json.Marshal(objectMap) @@ -10358,8 +10437,8 @@ func (m *MabFileFolderProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &m.ResourceGuardOperationRequests) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &m.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &m.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &m.SourceResourceID) @@ -11422,6 +11501,7 @@ func (p *PrivateEndpoint) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnection. func (p PrivateEndpointConnection) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) + populate(objectMap, "groupIds", p.GroupIDs) populate(objectMap, "privateEndpoint", p.PrivateEndpoint) populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) populate(objectMap, "provisioningState", p.ProvisioningState) @@ -11437,6 +11517,9 @@ func (p *PrivateEndpointConnection) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { + case "groupIds": + err = unpopulate(val, "GroupIDs", &p.GroupIDs) + delete(rawMsg, key) case "privateEndpoint": err = unpopulate(val, "PrivateEndpoint", &p.PrivateEndpoint) delete(rawMsg, key) @@ -11508,7 +11591,7 @@ func (p *PrivateEndpointConnectionResource) UnmarshalJSON(data []byte) error { // MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnectionState. func (p PrivateLinkServiceConnectionState) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) - populate(objectMap, "actionRequired", p.ActionRequired) + populate(objectMap, "actionsRequired", p.ActionsRequired) populate(objectMap, "description", p.Description) populate(objectMap, "status", p.Status) return json.Marshal(objectMap) @@ -11523,8 +11606,8 @@ func (p *PrivateLinkServiceConnectionState) UnmarshalJSON(data []byte) error { for key, val := range rawMsg { var err error switch key { - case "actionRequired": - err = unpopulate(val, "ActionRequired", &p.ActionRequired) + case "actionsRequired": + err = unpopulate(val, "ActionsRequired", &p.ActionsRequired) delete(rawMsg, key) case "description": err = unpopulate(val, "Description", &p.Description) @@ -11683,7 +11766,7 @@ func (p ProtectedItem) MarshalJSON() ([]byte, error) { populate(objectMap, "policyName", p.PolicyName) objectMap["protectedItemType"] = p.ProtectedItemType populate(objectMap, "resourceGuardOperationRequests", p.ResourceGuardOperationRequests) - populate(objectMap, "softDeleteRetentionPeriod", p.SoftDeleteRetentionPeriod) + populate(objectMap, "softDeleteRetentionPeriodInDays", p.SoftDeleteRetentionPeriodInDays) populate(objectMap, "sourceResourceId", p.SourceResourceID) populate(objectMap, "workloadType", p.WorkloadType) return json.Marshal(objectMap) @@ -11743,8 +11826,8 @@ func (p *ProtectedItem) UnmarshalJSON(data []byte) error { case "resourceGuardOperationRequests": err = unpopulate(val, "ResourceGuardOperationRequests", &p.ResourceGuardOperationRequests) delete(rawMsg, key) - case "softDeleteRetentionPeriod": - err = unpopulate(val, "SoftDeleteRetentionPeriod", &p.SoftDeleteRetentionPeriod) + case "softDeleteRetentionPeriodInDays": + err = unpopulate(val, "SoftDeleteRetentionPeriodInDays", &p.SoftDeleteRetentionPeriodInDays) delete(rawMsg, key) case "sourceResourceId": err = unpopulate(val, "SourceResourceID", &p.SourceResourceID) diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go index a0204f1235c7..0d982517d9a7 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,24 +46,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - OperationClientValidateOptions contains the optional parameters for the OperationClient.Validate method. func (client *OperationClient) Validate(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *OperationClientValidateOptions) (OperationClientValidateResponse, error) { + var err error req, err := client.validateCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return OperationClientValidateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return OperationClientValidateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return OperationClientValidateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return OperationClientValidateResponse{}, err } - return client.validateHandleResponse(resp) + resp, err := client.validateHandleResponse(httpResp) + return resp, err } // validateCreateRequest creates the Validate request. @@ -87,10 +89,13 @@ func (client *OperationClient) validateCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // validateHandleResponse handles the Validate response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go deleted file mode 100644 index 8e14f551d7b8..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operation_client_example_test.go +++ /dev/null @@ -1,121 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk.json -func ExampleOperationClient_Validate_validateOperation() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ValidateOperation_RestoreDisk_IdentityBasedRestoreDetails.json -func ExampleOperationClient_Validate_validateOperationWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewOperationClient().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), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - 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"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go index 84219ccec87b..90b7b2be9a64 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -40,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Returns the list of available operations. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - options - OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. func (client *OperationsClient) NewListPager(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { return runtime.NewPager(runtime.PagingHandler[OperationsClientListResponse]{ @@ -78,7 +77,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go deleted file mode 100644 index 2735196e3d8f..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/operations_client_example_test.go +++ /dev/null @@ -1,496 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewOperationsClient().NewListPager(nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ClientDiscoveryResponse = armrecoveryservicesbackup.ClientDiscoveryResponse{ - // Value: []*armrecoveryservicesbackup.ClientDiscoveryValueForSingleAPI{ - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/usages/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns usage details for a Recovery Services Vault."), - // Operation: to.Ptr("Recovery Services Vault usage details."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Usage"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupUsageSummaries/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns summaries for Protected Items and Protected Servers for a Recovery Services ."), - // Operation: to.Ptr("Recovery Services Protected Items and Protected Servers usage summaries details."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Usages Summaries"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Storage Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/storageConfig/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Updates Storage Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Write Resource Storage Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Storage Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Get Resource Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupconfig/vaultconfig/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Updates Configuration for Recovery Services Vault."), - // Operation: to.Ptr("Update Resource Config"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Vault Config"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/tokenInfo/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns token information for Recovery Services Vault."), - // Operation: to.Ptr("Get Vault Token Info"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Token Info"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupSecurityPIN/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Security PIN Information for Recovery Services Vault."), - // Operation: to.Ptr("Get Security PIN Info"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("SecurityPINInfo"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupManagementMetaData/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Management Metadata for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Management Metadata"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Management Metadata"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Result for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupOperations/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns Backup Operation Status for Recovery Services Vault."), - // Operation: to.Ptr("Get Backup Operation Status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Job Objects"), - // Operation: to.Ptr("Get Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/cancel/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Cancel the Job"), - // Operation: to.Ptr("Cancel Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Export Jobs"), - // Operation: to.Ptr("Export Jobs"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Export Backup Jobs"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobs/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the Result of Job Operation."), - // Operation: to.Ptr("Get Job Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupJobsExport/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the Result of Export Job Operation."), - // Operation: to.Ptr("Get Export Job Operation Result"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Export Backup Jobs Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Recovery Points for Protected Items."), - // Operation: to.Ptr("Get Recovery Points"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/restore/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Restore Recovery Points for Protected Items."), - // Operation: to.Ptr("Restore Recovery Points"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/provisionInstantItemRecovery/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Provision Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints/revokeInstantItemRecovery/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Operation: to.Ptr("Revoke Instant Item Recovery for Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Recovery Points"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all Protection Policies"), - // Operation: to.Ptr("Get Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Creates Protection Policy"), - // Operation: to.Ptr("Create Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/delete"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Delete a Protection Policy"), - // Operation: to.Ptr("Delete Protection Policy"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policies"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Results of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policy Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPolicies/operationsStatus/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get Status of Policy Operation."), - // Operation: to.Ptr("Get Policy Operation Status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Policy Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns object details of the Protected Item"), - // Operation: to.Ptr("Get Protected Item Details"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectedItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the list of all Protected Items."), - // Operation: to.Ptr("Get All Protected Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create a backup Protected Item"), - // Operation: to.Ptr("Create Backup Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/delete"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Deletes Protected Item"), - // Operation: to.Ptr("Delete Protected Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets Result of Operation Performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Item Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/operationsStatus/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns the status of Operation performed on Protected Items."), - // Operation: to.Ptr("Get Protected Items operation status"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Item Operation Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/protectedItems/backup/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Performs Backup for Protected Item."), - // Operation: to.Ptr("Backup Protected Item"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protected Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectableItems/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns list of all Protectable Items."), - // Operation: to.Ptr("Get Protectable Items"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Protectable Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/refreshContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Refreshes the container list"), - // Operation: to.Ptr("Refresh container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Refresh Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns status of the operation"), - // Operation: to.Ptr("Get Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Refresh Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupProtectionContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all containers belonging to the subscription"), - // Operation: to.Ptr("Get Containers In Subscription"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all registered containers"), - // Operation: to.Ptr("Get Registered Container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/operationResults/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Gets result of Operation performed on Protection Container."), - // Operation: to.Ptr("Get Container Operation Results"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers Operation Results"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupEngines"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Returns all the backup management servers registered with vault."), - // Operation: to.Ptr("List of backup management servers."), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Engines"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupStatus"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Check Backup Status for Recovery Services Vaults"), - // Operation: to.Ptr("Check Backup Status for Vault"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Backup Status"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupPreValidateProtection"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr(""), - // Operation: to.Ptr("Pre Validate Enable Protection"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("PreValidate Protection"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupValidateFeatures"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Validate Features"), - // Operation: to.Ptr("Validate Features"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Validate Features"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/backupProtectionIntent/write"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Create a backup Protection Intent"), - // Operation: to.Ptr("Create backup Protection Intent"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Intent"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/{fabricName}/protectionContainers/{containerName}/items/read"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get all items in a container"), - // Operation: to.Ptr("Get all items in a container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Workload Items"), - // }, - // Origin: to.Ptr("user"), - // }, - // { - // Name: to.Ptr("microsoft.recoveryservices/vaults/backupFabrics/protectionContainers/inquire/action"), - // Display: &armrecoveryservicesbackup.ClientDiscoveryDisplay{ - // Description: to.Ptr("Get all items in a container"), - // Operation: to.Ptr("Get all items in a container"), - // Provider: to.Ptr("microsoft.recoveryservices"), - // Resource: to.Ptr("Protection Containers Inquire"), - // }, - // Origin: to.Ptr("user"), - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/options.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/options.go new file mode 100644 index 000000000000..8e0585c5bfcc --- /dev/null +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/options.go @@ -0,0 +1,483 @@ +//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. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armrecoveryservicesbackup + +// BMSPrepareDataMoveOperationResultClientGetOptions contains the optional parameters for the BMSPrepareDataMoveOperationResultClient.Get +// method. +type BMSPrepareDataMoveOperationResultClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupEnginesClientGetOptions contains the optional parameters for the BackupEnginesClient.Get method. +type BackupEnginesClientGetOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupEnginesClientListOptions contains the optional parameters for the BackupEnginesClient.NewListPager method. +type BackupEnginesClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupJobsClientListOptions contains the optional parameters for the BackupJobsClient.NewListPager method. +type BackupJobsClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupOperationResultsClientGetOptions contains the optional parameters for the BackupOperationResultsClient.Get method. +type BackupOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupOperationStatusesClientGetOptions contains the optional parameters for the BackupOperationStatusesClient.Get method. +type BackupOperationStatusesClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. +type BackupPoliciesClientListOptions struct { + // OData filter options. + Filter *string +} + +// BackupProtectableItemsClientListOptions contains the optional parameters for the BackupProtectableItemsClient.NewListPager +// method. +type BackupProtectableItemsClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupProtectedItemsClientListOptions contains the optional parameters for the BackupProtectedItemsClient.NewListPager +// method. +type BackupProtectedItemsClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupProtectionContainersClientListOptions contains the optional parameters for the BackupProtectionContainersClient.NewListPager +// method. +type BackupProtectionContainersClientListOptions struct { + // OData filter options. + Filter *string +} + +// BackupProtectionIntentClientListOptions contains the optional parameters for the BackupProtectionIntentClient.NewListPager +// method. +type BackupProtectionIntentClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupResourceEncryptionConfigsClientGetOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Get +// method. +type BackupResourceEncryptionConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceEncryptionConfigsClientUpdateOptions contains the optional parameters for the BackupResourceEncryptionConfigsClient.Update +// method. +type BackupResourceEncryptionConfigsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceStorageConfigsNonCRRClientGetOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Get +// method. +type BackupResourceStorageConfigsNonCRRClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceStorageConfigsNonCRRClientPatchOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Patch +// method. +type BackupResourceStorageConfigsNonCRRClientPatchOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceStorageConfigsNonCRRClientUpdateOptions contains the optional parameters for the BackupResourceStorageConfigsNonCRRClient.Update +// method. +type BackupResourceStorageConfigsNonCRRClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceVaultConfigsClientGetOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Get +// method. +type BackupResourceVaultConfigsClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceVaultConfigsClientPutOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Put +// method. +type BackupResourceVaultConfigsClientPutOptions struct { + // placeholder for future optional parameters +} + +// BackupResourceVaultConfigsClientUpdateOptions contains the optional parameters for the BackupResourceVaultConfigsClient.Update +// method. +type BackupResourceVaultConfigsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// BackupStatusClientGetOptions contains the optional parameters for the BackupStatusClient.Get method. +type BackupStatusClientGetOptions struct { + // placeholder for future optional parameters +} + +// BackupUsageSummariesClientListOptions contains the optional parameters for the BackupUsageSummariesClient.NewListPager +// method. +type BackupUsageSummariesClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupWorkloadItemsClientListOptions contains the optional parameters for the BackupWorkloadItemsClient.NewListPager method. +type BackupWorkloadItemsClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + +// BackupsClientTriggerOptions contains the optional parameters for the BackupsClient.Trigger method. +type BackupsClientTriggerOptions struct { + // placeholder for future optional parameters +} + +// ClientBeginBMSPrepareDataMoveOptions contains the optional parameters for the Client.BeginBMSPrepareDataMove method. +type ClientBeginBMSPrepareDataMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientBeginBMSTriggerDataMoveOptions contains the optional parameters for the Client.BeginBMSTriggerDataMove method. +type ClientBeginBMSTriggerDataMoveOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientBeginMoveRecoveryPointOptions contains the optional parameters for the Client.BeginMoveRecoveryPoint method. +type ClientBeginMoveRecoveryPointOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ClientGetOperationStatusOptions contains the optional parameters for the Client.GetOperationStatus method. +type ClientGetOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// DeletedProtectionContainersClientListOptions contains the optional parameters for the DeletedProtectionContainersClient.NewListPager +// method. +type DeletedProtectionContainersClientListOptions struct { + // OData filter options. + Filter *string +} + +// ExportJobsOperationResultsClientGetOptions contains the optional parameters for the ExportJobsOperationResultsClient.Get +// method. +type ExportJobsOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// FeatureSupportClientValidateOptions contains the optional parameters for the FeatureSupportClient.Validate method. +type FeatureSupportClientValidateOptions struct { + // placeholder for future optional parameters +} + +// ItemLevelRecoveryConnectionsClientProvisionOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Provision +// method. +type ItemLevelRecoveryConnectionsClientProvisionOptions struct { + // placeholder for future optional parameters +} + +// ItemLevelRecoveryConnectionsClientRevokeOptions contains the optional parameters for the ItemLevelRecoveryConnectionsClient.Revoke +// method. +type ItemLevelRecoveryConnectionsClientRevokeOptions struct { + // placeholder for future optional parameters +} + +// JobCancellationsClientTriggerOptions contains the optional parameters for the JobCancellationsClient.Trigger method. +type JobCancellationsClientTriggerOptions struct { + // placeholder for future optional parameters +} + +// JobDetailsClientGetOptions contains the optional parameters for the JobDetailsClient.Get method. +type JobDetailsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobOperationResultsClientGetOptions contains the optional parameters for the JobOperationResultsClient.Get method. +type JobOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// JobsClientExportOptions contains the optional parameters for the JobsClient.Export method. +type JobsClientExportOptions struct { + // OData filter options. + Filter *string +} + +// OperationClientValidateOptions contains the optional parameters for the OperationClient.Validate method. +type OperationClientValidateOptions struct { + // placeholder for future optional parameters +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointClientGetOperationStatusOptions contains the optional parameters for the PrivateEndpointClient.GetOperationStatus +// method. +type PrivateEndpointClientGetOperationStatusOptions struct { + // placeholder for future optional parameters +} + +// PrivateEndpointConnectionClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginDelete +// method. +type PrivateEndpointConnectionClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionClientBeginPutOptions contains the optional parameters for the PrivateEndpointConnectionClient.BeginPut +// method. +type PrivateEndpointConnectionClientBeginPutOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// PrivateEndpointConnectionClientGetOptions contains the optional parameters for the PrivateEndpointConnectionClient.Get +// method. +type PrivateEndpointConnectionClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectableContainersClientListOptions contains the optional parameters for the ProtectableContainersClient.NewListPager +// method. +type ProtectableContainersClientListOptions struct { + // OData filter options. + Filter *string +} + +// ProtectedItemOperationResultsClientGetOptions contains the optional parameters for the ProtectedItemOperationResultsClient.Get +// method. +type ProtectedItemOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectedItemOperationStatusesClientGetOptions contains the optional parameters for the ProtectedItemOperationStatusesClient.Get +// method. +type ProtectedItemOperationStatusesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectedItemsClientCreateOrUpdateOptions contains the optional parameters for the ProtectedItemsClient.CreateOrUpdate +// method. +type ProtectedItemsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProtectedItemsClientDeleteOptions contains the optional parameters for the ProtectedItemsClient.Delete method. +type ProtectedItemsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProtectedItemsClientGetOptions contains the optional parameters for the ProtectedItemsClient.Get method. +type ProtectedItemsClientGetOptions struct { + // OData filter options. + Filter *string +} + +// ProtectionContainerOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerOperationResultsClient.Get +// method. +type ProtectionContainerOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionContainerRefreshOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerRefreshOperationResultsClient.Get +// method. +type ProtectionContainerRefreshOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionContainersClientGetOptions contains the optional parameters for the ProtectionContainersClient.Get method. +type ProtectionContainersClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionContainersClientInquireOptions contains the optional parameters for the ProtectionContainersClient.Inquire method. +type ProtectionContainersClientInquireOptions struct { + // OData filter options. + Filter *string +} + +// ProtectionContainersClientRefreshOptions contains the optional parameters for the ProtectionContainersClient.Refresh method. +type ProtectionContainersClientRefreshOptions struct { + // OData filter options. + Filter *string +} + +// ProtectionContainersClientRegisterOptions contains the optional parameters for the ProtectionContainersClient.Register +// method. +type ProtectionContainersClientRegisterOptions struct { + // placeholder for future optional parameters +} + +// ProtectionContainersClientUnregisterOptions contains the optional parameters for the ProtectionContainersClient.Unregister +// method. +type ProtectionContainersClientUnregisterOptions struct { + // placeholder for future optional parameters +} + +// ProtectionIntentClientCreateOrUpdateOptions contains the optional parameters for the ProtectionIntentClient.CreateOrUpdate +// method. +type ProtectionIntentClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProtectionIntentClientDeleteOptions contains the optional parameters for the ProtectionIntentClient.Delete method. +type ProtectionIntentClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProtectionIntentClientGetOptions contains the optional parameters for the ProtectionIntentClient.Get method. +type ProtectionIntentClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate method. +type ProtectionIntentClientValidateOptions struct { + // placeholder for future optional parameters +} + +// ProtectionPoliciesClientBeginDeleteOptions contains the optional parameters for the ProtectionPoliciesClient.BeginDelete +// method. +type ProtectionPoliciesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ProtectionPoliciesClient.CreateOrUpdate +// method. +type ProtectionPoliciesClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProtectionPoliciesClientGetOptions contains the optional parameters for the ProtectionPoliciesClient.Get method. +type ProtectionPoliciesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionPolicyOperationResultsClientGetOptions contains the optional parameters for the ProtectionPolicyOperationResultsClient.Get +// method. +type ProtectionPolicyOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ProtectionPolicyOperationStatusesClientGetOptions contains the optional parameters for the ProtectionPolicyOperationStatusesClient.Get +// method. +type ProtectionPolicyOperationStatusesClientGetOptions struct { + // placeholder for future optional parameters +} + +// RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. +type RecoveryPointsClientGetOptions struct { + // placeholder for future optional parameters +} + +// RecoveryPointsClientListOptions contains the optional parameters for the RecoveryPointsClient.NewListPager method. +type RecoveryPointsClientListOptions struct { + // OData filter options. + Filter *string +} + +// RecoveryPointsRecommendedForMoveClientListOptions contains the optional parameters for the RecoveryPointsRecommendedForMoveClient.NewListPager +// method. +type RecoveryPointsRecommendedForMoveClientListOptions struct { + // placeholder for future optional parameters +} + +// ResourceGuardProxiesClientGetOptions contains the optional parameters for the ResourceGuardProxiesClient.NewGetPager method. +type ResourceGuardProxiesClientGetOptions struct { + // placeholder for future optional parameters +} + +// ResourceGuardProxyClientDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.Delete method. +type ResourceGuardProxyClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ResourceGuardProxyClientGetOptions contains the optional parameters for the ResourceGuardProxyClient.Get method. +type ResourceGuardProxyClientGetOptions struct { + // placeholder for future optional parameters +} + +// ResourceGuardProxyClientPutOptions contains the optional parameters for the ResourceGuardProxyClient.Put method. +type ResourceGuardProxyClientPutOptions struct { + // placeholder for future optional parameters +} + +// ResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.UnlockDelete +// method. +type ResourceGuardProxyClientUnlockDeleteOptions struct { + // placeholder for future optional parameters +} + +// RestoresClientBeginTriggerOptions contains the optional parameters for the RestoresClient.BeginTrigger method. +type RestoresClientBeginTriggerOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SecurityPINsClientGetOptions contains the optional parameters for the SecurityPINsClient.Get method. +type SecurityPINsClientGetOptions struct { + // security pin request + Parameters *SecurityPinBase +} + +// ValidateOperationClientBeginTriggerOptions contains the optional parameters for the ValidateOperationClient.BeginTrigger +// method. +type ValidateOperationClientBeginTriggerOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ValidateOperationResultsClientGetOptions contains the optional parameters for the ValidateOperationResultsClient.Get method. +type ValidateOperationResultsClientGetOptions struct { + // placeholder for future optional parameters +} + +// ValidateOperationStatusesClientGetOptions contains the optional parameters for the ValidateOperationStatusesClient.Get +// method. +type ValidateOperationStatusesClientGetOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go index 871bf5e7506f..ae110a3dbf57 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/polymorphic_helpers.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -28,7 +27,10 @@ func unmarshalBackupEngineBaseClassification(rawMsg json.RawMessage) (BackupEngi default: b = &BackupEngineBase{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalBackupRequestClassification(rawMsg json.RawMessage) (BackupRequestClassification, error) { @@ -50,7 +52,10 @@ func unmarshalBackupRequestClassification(rawMsg json.RawMessage) (BackupRequest default: b = &BackupRequest{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalILRRequestClassification(rawMsg json.RawMessage) (ILRRequestClassification, error) { @@ -70,7 +75,10 @@ func unmarshalILRRequestClassification(rawMsg json.RawMessage) (ILRRequestClassi default: b = &ILRRequest{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalJobClassification(rawMsg json.RawMessage) (JobClassification, error) { @@ -100,7 +108,10 @@ func unmarshalJobClassification(rawMsg json.RawMessage) (JobClassification, erro default: b = &Job{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalOperationResultInfoBaseClassification(rawMsg json.RawMessage) (OperationResultInfoBaseClassification, error) { @@ -120,7 +131,10 @@ func unmarshalOperationResultInfoBaseClassification(rawMsg json.RawMessage) (Ope default: b = &OperationResultInfoBase{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalOperationStatusExtendedInfoClassification(rawMsg json.RawMessage) (OperationStatusExtendedInfoClassification, error) { @@ -144,7 +158,10 @@ func unmarshalOperationStatusExtendedInfoClassification(rawMsg json.RawMessage) default: b = &OperationStatusExtendedInfo{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectableContainerClassification(rawMsg json.RawMessage) (ProtectableContainerClassification, error) { @@ -164,7 +181,10 @@ func unmarshalProtectableContainerClassification(rawMsg json.RawMessage) (Protec default: b = &ProtectableContainer{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectedItemClassification(rawMsg json.RawMessage) (ProtectedItemClassification, error) { @@ -206,7 +226,10 @@ func unmarshalProtectedItemClassification(rawMsg json.RawMessage) (ProtectedItem default: b = &ProtectedItem{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectionContainerClassification(rawMsg json.RawMessage) (ProtectionContainerClassification, error) { @@ -246,7 +269,10 @@ func unmarshalProtectionContainerClassification(rawMsg json.RawMessage) (Protect default: b = &ProtectionContainer{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectionIntentClassification(rawMsg json.RawMessage) (ProtectionIntentClassification, error) { @@ -272,7 +298,10 @@ func unmarshalProtectionIntentClassification(rawMsg json.RawMessage) (Protection default: b = &ProtectionIntent{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalProtectionPolicyClassification(rawMsg json.RawMessage) (ProtectionPolicyClassification, error) { @@ -300,7 +329,10 @@ func unmarshalProtectionPolicyClassification(rawMsg json.RawMessage) (Protection default: b = &ProtectionPolicy{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRecoveryPointClassification(rawMsg json.RawMessage) (RecoveryPointClassification, error) { @@ -334,7 +366,10 @@ func unmarshalRecoveryPointClassification(rawMsg json.RawMessage) (RecoveryPoint default: b = &RecoveryPoint{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRestoreRequestClassification(rawMsg json.RawMessage) (RestoreRequestClassification, error) { @@ -376,7 +411,10 @@ func unmarshalRestoreRequestClassification(rawMsg json.RawMessage) (RestoreReque default: b = &RestoreRequest{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalRetentionPolicyClassification(rawMsg json.RawMessage) (RetentionPolicyClassification, error) { @@ -396,7 +434,10 @@ func unmarshalRetentionPolicyClassification(rawMsg json.RawMessage) (RetentionPo default: b = &RetentionPolicy{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalSchedulePolicyClassification(rawMsg json.RawMessage) (SchedulePolicyClassification, error) { @@ -420,7 +461,10 @@ func unmarshalSchedulePolicyClassification(rawMsg json.RawMessage) (SchedulePoli default: b = &SchedulePolicy{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalVaultStorageConfigOperationResultResponseClassification(rawMsg json.RawMessage) (VaultStorageConfigOperationResultResponseClassification, error) { @@ -438,7 +482,10 @@ func unmarshalVaultStorageConfigOperationResultResponseClassification(rawMsg jso default: b = &VaultStorageConfigOperationResultResponse{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalWorkloadItemClassification(rawMsg json.RawMessage) (WorkloadItemClassification, error) { @@ -468,7 +515,10 @@ func unmarshalWorkloadItemClassification(rawMsg json.RawMessage) (WorkloadItemCl default: b = &WorkloadItem{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (WorkloadProtectableItemClassification, error) { @@ -485,6 +535,8 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor b = &AzureFileShareProtectableItem{} case "AzureVmWorkloadProtectableItem": b = &AzureVMWorkloadProtectableItem{} + case "HanaHSRContainer": + b = &AzureVMWorkloadSAPHanaHSRProtectableItem{} case "IaaSVMProtectableItem": b = &IaaSVMProtectableItem{} case "Microsoft.ClassicCompute/virtualMachines": @@ -497,8 +549,6 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor b = &AzureVMWorkloadSAPHanaDBInstance{} case "SAPHanaDatabase": b = &AzureVMWorkloadSAPHanaDatabaseProtectableItem{} - case "SAPHanaHSR": - b = &AzureVMWorkloadSAPHanaHSR{} case "SAPHanaSystem": b = &AzureVMWorkloadSAPHanaSystemProtectableItem{} case "SQLAvailabilityGroupContainer": @@ -510,5 +560,8 @@ func unmarshalWorkloadProtectableItemClassification(rawMsg json.RawMessage) (Wor default: b = &WorkloadProtectableItem{} } - return b, json.Unmarshal(rawMsg, b) + if err := json.Unmarshal(rawMsg, b); err != nil { + return nil, err + } + return b, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go index 3f978d1300a6..3b2b2a9cd4ae 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -55,18 +54,21 @@ func NewPrivateEndpointClient(subscriptionID string, credential azcore.TokenCred // - options - PrivateEndpointClientGetOperationStatusOptions contains the optional parameters for the PrivateEndpointClient.GetOperationStatus // method. func (client *PrivateEndpointClient) GetOperationStatus(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, operationID string, options *PrivateEndpointClientGetOperationStatusOptions) (PrivateEndpointClientGetOperationStatusResponse, error) { + var err error req, err := client.getOperationStatusCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, operationID, options) if err != nil { return PrivateEndpointClientGetOperationStatusResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointClientGetOperationStatusResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointClientGetOperationStatusResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointClientGetOperationStatusResponse{}, err } - return client.getOperationStatusHandleResponse(resp) + resp, err := client.getOperationStatusHandleResponse(httpResp) + return resp, err } // getOperationStatusCreateRequest creates the GetOperationStatus request. @@ -97,7 +99,7 @@ func (client *PrivateEndpointClient) getOperationStatusCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_test.go deleted file mode 100644 index 61d832b9a3cc..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpoint_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), - // ID: to.Ptr("0f48183b-0a44-4dca-aec1-bba5daab888a"), - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-02-27T11:59:47.5901592Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go index 79c32de95dec..ef41631846bc 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -59,7 +58,8 @@ func (client *PrivateEndpointConnectionClient) BeginDelete(ctx context.Context, if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -68,20 +68,22 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 func (client *PrivateEndpointConnectionClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -108,7 +110,7 @@ func (client *PrivateEndpointConnectionClient) deleteCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -117,25 +119,28 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - PrivateEndpointConnectionClientGetOptions contains the optional parameters for the PrivateEndpointConnectionClient.Get // method. func (client *PrivateEndpointConnectionClient) Get(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionClientGetOptions) (PrivateEndpointConnectionClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, options) if err != nil { return PrivateEndpointConnectionClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return PrivateEndpointConnectionClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return PrivateEndpointConnectionClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -162,7 +167,7 @@ func (client *PrivateEndpointConnectionClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +185,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -193,7 +198,8 @@ func (client *PrivateEndpointConnectionClient) BeginPut(ctx context.Context, vau if err != nil { return nil, err } - return runtime.NewPoller[PrivateEndpointConnectionClientPutResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[PrivateEndpointConnectionClientPutResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[PrivateEndpointConnectionClientPutResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -202,20 +208,22 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 func (client *PrivateEndpointConnectionClient) put(ctx context.Context, vaultName string, resourceGroupName string, privateEndpointConnectionName string, parameters PrivateEndpointConnectionResource, options *PrivateEndpointConnectionClientBeginPutOptions) (*http.Response, error) { + var err error req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, privateEndpointConnectionName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusCreated) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusCreated) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // putCreateRequest creates the Put request. @@ -242,8 +250,11 @@ func (client *PrivateEndpointConnectionClient) putCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go deleted file mode 100644 index d6cae15bdad5..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/privateendpointconnection_client_example_test.go +++ /dev/null @@ -1,125 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewPrivateEndpointConnectionClient().Get(ctx, "gaallavaultbvtd2msi", "gaallaRG", "gaallatestpe2.5704c932-249a-490b-a142-1396838cd3b", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PrivateEndpointConnectionResource = armrecoveryservicesbackup.PrivateEndpointConnectionResource{ - // Name: to.Ptr("gaallatestpe1.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/privateEndpointConnections"), - // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/gaallaRG/providers/Microsoft.RecoveryServicesBVTD2/vaults/gaallavaultbvtd2msi/privateEndpointConnections/gaallatestpe3.3592346090307038890.backup.5704c932-249a-490b-a142-1396838cd3b"), - // 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), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewPrivateEndpointConnectionClient().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/protectablecontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go index 91d09e5cbad2..037b451bd676 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewProtectableContainersClient(subscriptionID string, credential azcore.Tok // NewListPager - Lists the containers that can be registered to Recovery Services Vault. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewListPager @@ -103,7 +102,7 @@ func (client *ProtectableContainersClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go deleted file mode 100644 index 9e466b8207d1..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectablecontainers_client_example_test.go +++ /dev/null @@ -1,71 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewProtectableContainersClient().NewListPager("testvault", "testRg", "Azure", &armrecoveryservicesbackup.ProtectableContainersClientListOptions{Filter: to.Ptr("backupManagementType eq 'AzureStorage' and workloadType eq 'AzureFileShare'")}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ProtectableContainerResourceList = armrecoveryservicesbackup.ProtectableContainerResourceList{ - // Value: []*armrecoveryservicesbackup.ProtectableContainerResource{ - // { - // Name: to.Ptr("StorageContainer;storage;test-rg;testst"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;storage;test-rg;teststorage"), - // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorage"), - // FriendlyName: to.Ptr("teststorage"), - // HealthStatus: to.Ptr("Healthy"), - // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // }, - // }, - // { - // Name: to.Ptr("StorageContainer;ClassicStorage;test-rg;teststorage"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectableContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.RecoveryServices/vaults/testvault/backupFabrics/Azure/protectableContainers/StorageContainer;ClassicStorage;test-rg;teststorage"), - // Properties: &armrecoveryservicesbackup.AzureStorageProtectableContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-rg/providers/Microsoft.ClassicStorage/storageAccounts/teststorage"), - // FriendlyName: to.Ptr("teststorage"), - // HealthStatus: to.Ptr("Healthy"), - // ProtectableContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go index 93c1d23d36d2..870a77adcd48 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -57,18 +56,21 @@ func NewProtectedItemOperationResultsClient(subscriptionID string, credential az // - options - ProtectedItemOperationResultsClientGetOptions contains the optional parameters for the ProtectedItemOperationResultsClient.Get // method. func (client *ProtectedItemOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string, options *ProtectedItemOperationResultsClientGetOptions) (ProtectedItemOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID, options) if err != nil { return ProtectedItemOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectedItemOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ProtectedItemOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectedItemOperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -107,7 +109,7 @@ func (client *ProtectedItemOperationResultsClient) getCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go deleted file mode 100644 index ef29ad698687..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationresults_client_example_test.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemOperationResultsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go index 07a9da04d79d..9c98800dfcfb 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,7 +48,7 @@ func NewProtectedItemOperationStatusesClient(subscriptionID string, credential a // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -59,18 +58,21 @@ func NewProtectedItemOperationStatusesClient(subscriptionID string, credential a // - options - ProtectedItemOperationStatusesClientGetOptions contains the optional parameters for the ProtectedItemOperationStatusesClient.Get // method. func (client *ProtectedItemOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, operationID string, options *ProtectedItemOperationStatusesClientGetOptions) (ProtectedItemOperationStatusesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationID, options) if err != nil { return ProtectedItemOperationStatusesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectedItemOperationStatusesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectedItemOperationStatusesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectedItemOperationStatusesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -109,7 +111,7 @@ func (client *ProtectedItemOperationStatusesClient) getCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go deleted file mode 100644 index 90de73a5acb7..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditemoperationstatuses_client_example_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemOperationStatusesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusJobExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusJobExtendedInfo"), - // JobID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go index 158bbdbc5a30..636989bfadaf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,7 +48,7 @@ func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCrede // GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -59,18 +58,21 @@ func NewProtectedItemsClient(subscriptionID string, credential azcore.TokenCrede // - options - ProtectedItemsClientCreateOrUpdateOptions contains the optional parameters for the ProtectedItemsClient.CreateOrUpdate // method. func (client *ProtectedItemsClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, parameters ProtectedItemResource, options *ProtectedItemsClientCreateOrUpdateOptions) (ProtectedItemsClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, options) if err != nil { return ProtectedItemsClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectedItemsClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return ProtectedItemsClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ProtectedItemsClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -105,10 +107,13 @@ func (client *ProtectedItemsClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -124,7 +129,7 @@ func (client *ProtectedItemsClient) createOrUpdateHandleResponse(resp *http.Resp // the request, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -132,16 +137,18 @@ func (client *ProtectedItemsClient) createOrUpdateHandleResponse(resp *http.Resp // - protectedItemName - Backed up item to be deleted. // - options - ProtectedItemsClientDeleteOptions contains the optional parameters for the ProtectedItemsClient.Delete method. func (client *ProtectedItemsClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, options *ProtectedItemsClientDeleteOptions) (ProtectedItemsClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, options) if err != nil { return ProtectedItemsClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectedItemsClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ProtectedItemsClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectedItemsClientDeleteResponse{}, err } return ProtectedItemsClientDeleteResponse{}, nil } @@ -178,7 +185,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -188,7 +195,7 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau // call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -196,18 +203,21 @@ func (client *ProtectedItemsClient) deleteCreateRequest(ctx context.Context, vau // - protectedItemName - Backed up item name whose details are to be fetched. // - options - ProtectedItemsClientGetOptions contains the optional parameters for the ProtectedItemsClient.Get method. func (client *ProtectedItemsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, options *ProtectedItemsClientGetOptions) (ProtectedItemsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, options) if err != nil { return ProtectedItemsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectedItemsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectedItemsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectedItemsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -242,7 +252,7 @@ func (client *ProtectedItemsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go deleted file mode 100644 index e7e24a1c6e31..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protecteditems_client_example_test.go +++ /dev/null @@ -1,214 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ClassicCompute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get_getProtectedClassicVirtualMachineDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainer;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSClassicComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainer;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.ClassicCompute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.ClassicCompute/virtualMachines/iaasvm-1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/Compute_ProtectedItem_Get.json -func ExampleProtectedItemsClient_Get_getProtectedVirtualMachineDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().Get(ctx, "PySDKBackupTestRsVault", "PythonSDKBackupTestRg", "Azure", "iaasvmcontainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", "vm;iaasvmcontainerv2;iaasvm-rg;iaasvm-1", &armrecoveryservicesbackup.ProtectedItemsClientGetOptions{Filter: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;iaasvm-rg;iaasvm-1/protectedItems/VM;iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;iaasvm-rg;iaasvm-1"), - // LastRecoveryPoint: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T12:25:32.048723Z"); return t}()), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("iaasvm-1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/providers/Microsoft.Compute/virtualMachines/iaasvm-1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ConfigureProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate_enableProtectionOnAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtected), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/StopProtection.json -func ExampleProtectedItemsClient_CreateOrUpdate_stopProtectionWithRetainDataOnAzureIaasVm() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectedItemsClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", armrecoveryservicesbackup.ProtectedItemResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectedItemResource = armrecoveryservicesbackup.ProtectedItemResource{ - // Name: to.Ptr("VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1/protectedItems/VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSComputeVMProtectedItem{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // ContainerName: to.Ptr("iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/PythonSDKBackupTestRg/providers/Microsoft.RecoveryServices/vaults/PySDKBackupTestRsVault/backupPolicies/testPolicy1"), - // ProtectedItemType: to.Ptr("Microsoft.Compute/virtualMachines"), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // WorkloadType: to.Ptr(armrecoveryservicesbackup.DataSourceTypeVM), - // FriendlyName: to.Ptr("netvmtestv2vm1"), - // HealthStatus: to.Ptr(armrecoveryservicesbackup.HealthStatusPassed), - // LastBackupStatus: to.Ptr("Completed"), - // LastBackupTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-22T12:25:32.048723Z"); return t}()), - // ProtectedItemDataID: to.Ptr("636482643132986882"), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStateProtectionStopped), - // ProtectionStatus: to.Ptr("Healthy"), - // VirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectedItemsClient().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/protectioncontaineroperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go index 9d15a17c4b76..efcf25c1b1ea 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -56,18 +55,21 @@ func NewProtectionContainerOperationResultsClient(subscriptionID string, credent // - options - ProtectionContainerOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerOperationResultsClient.Get // method. func (client *ProtectionContainerOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, operationID string, options *ProtectionContainerOperationResultsClientGetOptions) (ProtectionContainerOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, operationID, options) if err != nil { return ProtectionContainerOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainerOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ProtectionContainerOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainerOperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -102,7 +104,7 @@ func (client *ProtectionContainerOperationResultsClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go deleted file mode 100644 index d18910119166..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontaineroperationresults_client_example_test.go +++ /dev/null @@ -1,77 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionContainerOperationResultsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), - // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), - // FriendlyName: to.Ptr("testSQL"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ - // HostServerName: to.Ptr("testsql"), - // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ - // { - // Type: to.Ptr("sql"), - // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // Status: to.Ptr("Success"), - // }, - // ItemCount: to.Ptr[int64](14), - // }}, - // Status: to.Ptr("Success"), - // }, - // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ - // }, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go index a1163f4e94d9..3e3264ce9a25 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -55,16 +54,18 @@ func NewProtectionContainerRefreshOperationResultsClient(subscriptionID string, // - options - ProtectionContainerRefreshOperationResultsClientGetOptions contains the optional parameters for the ProtectionContainerRefreshOperationResultsClient.Get // method. func (client *ProtectionContainerRefreshOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, operationID string, options *ProtectionContainerRefreshOperationResultsClientGetOptions) (ProtectionContainerRefreshOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, operationID, options) if err != nil { return ProtectionContainerRefreshOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainerRefreshOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted, http.StatusNoContent) { - return ProtectionContainerRefreshOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainerRefreshOperationResultsClientGetResponse{}, err } return ProtectionContainerRefreshOperationResultsClientGetResponse{}, nil } @@ -97,7 +98,7 @@ func (client *ProtectionContainerRefreshOperationResultsClient) getCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go deleted file mode 100644 index 541d76e56340..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainerrefreshoperationresults_client_example_test.go +++ /dev/null @@ -1,35 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainerRefreshOperationResultsClient().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/protectioncontainers_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go index 794b3343e6b4..53bd2fff362a 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -55,18 +54,21 @@ func NewProtectionContainersClient(subscriptionID string, credential azcore.Toke // - options - ProtectionContainersClientGetOptions contains the optional parameters for the ProtectionContainersClient.Get // method. func (client *ProtectionContainersClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientGetOptions) (ProtectionContainersClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { return ProtectionContainersClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainersClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionContainersClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainersClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -97,7 +99,7 @@ func (client *ProtectionContainersClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +117,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -123,16 +125,18 @@ func (client *ProtectionContainersClient) getHandleResponse(resp *http.Response) // - options - ProtectionContainersClientInquireOptions contains the optional parameters for the ProtectionContainersClient.Inquire // method. func (client *ProtectionContainersClient) Inquire(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientInquireOptions) (ProtectionContainersClientInquireResponse, error) { + var err error req, err := client.inquireCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { return ProtectionContainersClientInquireResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainersClientInquireResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ProtectionContainersClientInquireResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainersClientInquireResponse{}, err } return ProtectionContainersClientInquireResponse{}, nil } @@ -165,7 +169,7 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -179,23 +183,25 @@ func (client *ProtectionContainersClient) inquireCreateRequest(ctx context.Conte // GetRefreshOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - ProtectionContainersClientRefreshOptions contains the optional parameters for the ProtectionContainersClient.Refresh // method. func (client *ProtectionContainersClient) Refresh(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, options *ProtectionContainersClientRefreshOptions) (ProtectionContainersClientRefreshResponse, error) { + var err error req, err := client.refreshCreateRequest(ctx, vaultName, resourceGroupName, fabricName, options) if err != nil { return ProtectionContainersClientRefreshResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainersClientRefreshResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return ProtectionContainersClientRefreshResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainersClientRefreshResponse{}, err } return ProtectionContainersClientRefreshResponse{}, nil } @@ -224,7 +230,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -237,7 +243,7 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -246,18 +252,21 @@ func (client *ProtectionContainersClient) refreshCreateRequest(ctx context.Conte // - options - ProtectionContainersClientRegisterOptions contains the optional parameters for the ProtectionContainersClient.Register // method. func (client *ProtectionContainersClient) Register(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, parameters ProtectionContainerResource, options *ProtectionContainersClientRegisterOptions) (ProtectionContainersClientRegisterResponse, error) { + var err error req, err := client.registerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, parameters, options) if err != nil { return ProtectionContainersClientRegisterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainersClientRegisterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return ProtectionContainersClientRegisterResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainersClientRegisterResponse{}, err } - return client.registerHandleResponse(resp) + resp, err := client.registerHandleResponse(httpResp) + return resp, err } // registerCreateRequest creates the Register request. @@ -288,10 +297,13 @@ func (client *ProtectionContainersClient) registerCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // registerHandleResponse handles the Register response. @@ -308,7 +320,7 @@ func (client *ProtectionContainersClient) registerHandleResponse(resp *http.Resp // Operation Result API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -316,16 +328,18 @@ func (client *ProtectionContainersClient) registerHandleResponse(resp *http.Resp // - options - ProtectionContainersClientUnregisterOptions contains the optional parameters for the ProtectionContainersClient.Unregister // method. func (client *ProtectionContainersClient) Unregister(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, options *ProtectionContainersClientUnregisterOptions) (ProtectionContainersClientUnregisterResponse, error) { + var err error req, err := client.unregisterCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, options) if err != nil { return ProtectionContainersClientUnregisterResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionContainersClientUnregisterResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { - return ProtectionContainersClientUnregisterResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectionContainersClientUnregisterResponse{}, err } return ProtectionContainersClientUnregisterResponse{}, nil } @@ -358,7 +372,7 @@ func (client *ProtectionContainersClient) unregisterCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go deleted file mode 100644 index 308680126a15..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectioncontainers_client_example_test.go +++ /dev/null @@ -1,171 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionContainersClient().Get(ctx, "testVault", "testRg", "Azure", "VMAppContainer;Compute;testRG;testSQL", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("VMAppContainer;Compute;testRG;testSQL"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.RecoveryServices/vaults/testVault/backupFabrics/Azure/protectionContainers/VMAppContainer;Compute;testRG;testSQL"), - // Properties: &armrecoveryservicesbackup.AzureVMAppContainerProtectionContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeVMAppContainer), - // FriendlyName: to.Ptr("testSQL"), - // ExtendedInfo: &armrecoveryservicesbackup.AzureWorkloadContainerExtendedInfo{ - // HostServerName: to.Ptr("testsql"), - // InquiryInfo: &armrecoveryservicesbackup.InquiryInfo{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // InquiryDetails: []*armrecoveryservicesbackup.WorkloadInquiryDetails{ - // { - // Type: to.Ptr("sql"), - // InquiryValidation: &armrecoveryservicesbackup.InquiryValidation{ - // ErrorDetail: &armrecoveryservicesbackup.ErrorDetail{ - // Code: to.Ptr("Success"), - // Message: to.Ptr("Not Available"), - // Recommendations: []*string{ - // to.Ptr("Not Available")}, - // }, - // Status: to.Ptr("Success"), - // }, - // ItemCount: to.Ptr[int64](14), - // }}, - // Status: to.Ptr("Success"), - // }, - // NodesList: []*armrecoveryservicesbackup.DistributedNodesInfo{ - // }, - // }, - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.Compute/virtualMachines/testSQL"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionContainersClient().Register(ctx, "swaggertestvault", "SwaggerTestRg", "Azure", "StorageContainer;Storage;SwaggerTestRg;swaggertestsa", armrecoveryservicesbackup.ProtectionContainerResource{ - Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - 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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionContainerResource = armrecoveryservicesbackup.ProtectionContainerResource{ - // Name: to.Ptr("StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupFabrics/Azure/protectionContainers/StorageContainer;Storage;SwaggerTestRg;swaggertestsa"), - // Properties: &armrecoveryservicesbackup.AzureStorageContainer{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureStorage), - // ContainerType: to.Ptr(armrecoveryservicesbackup.ProtectableContainerTypeStorageContainer), - // FriendlyName: to.Ptr("swaggertestsa"), - // HealthStatus: to.Ptr("Healthy"), - // RegistrationStatus: to.Ptr("Registered"), - // AcquireStorageAccountLock: to.Ptr(armrecoveryservicesbackup.AcquireStorageAccountLockAcquire), - // ProtectedItemCount: to.Ptr[int64](0), - // SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/SwaggerTestRg/providers/Microsoft.Storage/storageAccounts/swaggertestsa"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionContainersClient().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/protectionintent_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go index d2cb16ebede4..7ea79a696a81 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -56,18 +55,21 @@ func NewProtectionIntentClient(subscriptionID string, credential azcore.TokenCre // - options - ProtectionIntentClientCreateOrUpdateOptions contains the optional parameters for the ProtectionIntentClient.CreateOrUpdate // method. func (client *ProtectionIntentClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, parameters ProtectionIntentResource, options *ProtectionIntentClientCreateOrUpdateOptions) (ProtectionIntentClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, parameters, options) if err != nil { return ProtectionIntentClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionIntentClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionIntentClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionIntentClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -98,10 +100,13 @@ func (client *ProtectionIntentClient) createOrUpdateCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -116,23 +121,25 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - intentObjectName - Intent to be deleted. // - options - ProtectionIntentClientDeleteOptions contains the optional parameters for the ProtectionIntentClient.Delete method. func (client *ProtectionIntentClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, options *ProtectionIntentClientDeleteOptions) (ProtectionIntentClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, options) if err != nil { return ProtectionIntentClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionIntentClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusNoContent) { - return ProtectionIntentClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ProtectionIntentClientDeleteResponse{}, err } return ProtectionIntentClientDeleteResponse{}, nil } @@ -165,7 +172,7 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() return req, nil } @@ -174,25 +181,28 @@ func (client *ProtectionIntentClient) deleteCreateRequest(ctx context.Context, v // operation, call the GetItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - intentObjectName - Backed up item name whose details are to be fetched. // - options - ProtectionIntentClientGetOptions contains the optional parameters for the ProtectionIntentClient.Get method. func (client *ProtectionIntentClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, intentObjectName string, options *ProtectionIntentClientGetOptions) (ProtectionIntentClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, intentObjectName, options) if err != nil { return ProtectionIntentClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionIntentClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionIntentClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionIntentClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -223,7 +233,7 @@ func (client *ProtectionIntentClient) getCreateRequest(ctx context.Context, vaul return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -244,24 +254,27 @@ func (client *ProtectionIntentClient) getHandleResponse(resp *http.Response) (Pr // 3. Any VM related configuration passed in properties. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - azureRegion - Azure region to hit Api // - parameters - Enable backup validation request on Virtual Machine // - options - ProtectionIntentClientValidateOptions contains the optional parameters for the ProtectionIntentClient.Validate // method. func (client *ProtectionIntentClient) Validate(ctx context.Context, azureRegion string, parameters PreValidateEnableBackupRequest, options *ProtectionIntentClientValidateOptions) (ProtectionIntentClientValidateResponse, error) { + var err error req, err := client.validateCreateRequest(ctx, azureRegion, parameters, options) if err != nil { return ProtectionIntentClientValidateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionIntentClientValidateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionIntentClientValidateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionIntentClientValidateResponse{}, err } - return client.validateHandleResponse(resp) + resp, err := client.validateHandleResponse(httpResp) + return resp, err } // validateCreateRequest creates the Validate request. @@ -280,10 +293,13 @@ func (client *ProtectionIntentClient) validateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // validateHandleResponse handles the Validate response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go deleted file mode 100644 index 6ceb46f839a9..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionintent_client_example_test.go +++ /dev/null @@ -1,137 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.PreValidateEnableBackupResponse = armrecoveryservicesbackup.PreValidateEnableBackupResponse{ - // ContainerName: to.Ptr("iaasvmcontainer;iaasvmcontainerv2;arunaupgrade;upgrade1"), - // ErrorCode: to.Ptr("VirtualMachineAlreadyProtected"), - // ErrorMessage: to.Ptr("Virtual machine with same name and same resource group is already protected. Please select `Disable' choice above for backup and go to backup item corresponding to this VM in the vault"), - // ProtectedItemName: to.Ptr("vm;iaasvmcontainerv2;arunaupgrade;upgrade1"), - // Recommendation: to.Ptr("Please do not enable protection again."), - // Status: to.Ptr(armrecoveryservicesbackup.ValidationStatusFailed), - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().Get(ctx, "myVault", "myRG", "Azure", "249D9B07-D2EF-4202-AA64-65F35418564E", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ - // Name: to.Ptr("249D9B07-D2EF-4202-AA64-65F35418564E"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/249D9B07-D2EF-4202-AA64-65F35418564E"), - // Properties: &armrecoveryservicesbackup.AzureWorkloadContainerAutoProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureWorkload), - // ItemID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupProtectionContainer/VMAppContainer;Compute;testVmName/backupProtectableItems/SQLInstance;MSSQLSERVER"), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureWorkloadContainerAutoProtectionIntent), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionIntentClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionIntentResource = armrecoveryservicesbackup.ProtectionIntentResource{ - // Name: to.Ptr("vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupProtectionIntent"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupFabrics/Azure/backupProtectionIntent/vm;iaasvmcontainerv2;chamsrgtest;chamscandel"), - // Properties: &armrecoveryservicesbackup.AzureResourceProtectionIntent{ - // BackupManagementType: to.Ptr(armrecoveryservicesbackup.BackupManagementTypeAzureIaasVM), - // PolicyID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/myRG/providers/Microsoft.RecoveryServices/vaults/myVault/backupPolicies/myPolicy"), - // ProtectionIntentItemType: to.Ptr(armrecoveryservicesbackup.ProtectionIntentItemTypeAzureResourceItem), - // ProtectionState: to.Ptr(armrecoveryservicesbackup.ProtectionStatusProtected), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewProtectionIntentClient().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/protectionpolicies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go index b6aece86efc5..5b0713541c94 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,7 +47,7 @@ func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenC // fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -56,18 +55,21 @@ func NewProtectionPoliciesClient(subscriptionID string, credential azcore.TokenC // - options - ProtectionPoliciesClientCreateOrUpdateOptions contains the optional parameters for the ProtectionPoliciesClient.CreateOrUpdate // method. func (client *ProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, vaultName string, resourceGroupName string, policyName string, parameters ProtectionPolicyResource, options *ProtectionPoliciesClientCreateOrUpdateOptions) (ProtectionPoliciesClientCreateOrUpdateResponse, error) { + var err error req, err := client.createOrUpdateCreateRequest(ctx, vaultName, resourceGroupName, policyName, parameters, options) if err != nil { return ProtectionPoliciesClientCreateOrUpdateResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionPoliciesClientCreateOrUpdateResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return ProtectionPoliciesClientCreateOrUpdateResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ProtectionPoliciesClientCreateOrUpdateResponse{}, err } - return client.createOrUpdateHandleResponse(resp) + resp, err := client.createOrUpdateHandleResponse(httpResp) + return resp, err } // createOrUpdateCreateRequest creates the CreateOrUpdate request. @@ -94,10 +96,13 @@ func (client *ProtectionPoliciesClient) createOrUpdateCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // createOrUpdateHandleResponse handles the CreateOrUpdate response. @@ -113,7 +118,7 @@ func (client *ProtectionPoliciesClient) createOrUpdateHandleResponse(resp *http. // of the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -125,7 +130,8 @@ func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultNa if err != nil { return nil, err } - return runtime.NewPoller[ProtectionPoliciesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ProtectionPoliciesClientDeleteResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ProtectionPoliciesClientDeleteResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -135,20 +141,22 @@ func (client *ProtectionPoliciesClient) BeginDelete(ctx context.Context, vaultNa // the operation can be fetched using GetProtectionPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 func (client *ProtectionPoliciesClient) deleteOperation(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientBeginDeleteOptions) (*http.Response, error) { + var err error req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, policyName, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // deleteCreateRequest creates the Delete request. @@ -175,7 +183,7 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -185,24 +193,27 @@ func (client *ProtectionPoliciesClient) deleteCreateRequest(ctx context.Context, // Status of the operation can be fetched using GetPolicyOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - ProtectionPoliciesClientGetOptions contains the optional parameters for the ProtectionPoliciesClient.Get method. func (client *ProtectionPoliciesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, options *ProtectionPoliciesClientGetOptions) (ProtectionPoliciesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, options) if err != nil { return ProtectionPoliciesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionPoliciesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionPoliciesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionPoliciesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -229,7 +240,7 @@ func (client *ProtectionPoliciesClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go deleted file mode 100644 index a60528d4fcf7..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicies_client_example_test.go +++ /dev/null @@ -1,1232 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/V2Policy/v2-Get-Policy.json -func ExampleProtectionPoliciesClient_Get_getAzureIaasVmEnhancedProtectionPolicyDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ProtectionPolicies_Get.json -func ExampleProtectionPoliciesClient_Get_getAzureIaasVmProtectionPolicyDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateDailyAzureStorageProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("dailyPolicy2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/dailyPolicy2"), - // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureStorage"), - // ProtectedItemsCount: to.Ptr[int32](0), - // 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); 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:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("UTC"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/V2Policy/IaaS_v2_hourly.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithHourlyBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - InstantRpRetentionRangeInDays: to.Ptr[int32](30), - PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](180), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - Interval: to.Ptr[int32](4), - ScheduleWindowDuration: to.Ptr[int32](16), - ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00Z"); return t }()), - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - }, - TimeZone: to.Ptr("India Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](180), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - // Interval: to.Ptr[int32](4), - // ScheduleWindowDuration: to.Ptr[int32](16), - // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00Z"); return t}()), - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - // }, - // TimeZone: to.Ptr("India Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/V2Policy/IaaS_v2_daily.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateEnhancedAzureVmProtectionPolicyWithDailyBackup() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "v2-daily-sample", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - InstantRpRetentionRangeInDays: to.Ptr[int32](30), - PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](180), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - }, - TimeZone: to.Ptr("India Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("v2-daily-sample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/v2-daily-sample"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // InstantRpRetentionRangeInDays: to.Ptr[int32](30), - // PolicyType: to.Ptr(armrecoveryservicesbackup.IAASVMPolicyTypeV2), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](180), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); 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-12-17T08:00:00+00:00"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicyV2{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicyV2"), - // DailySchedule: &armrecoveryservicesbackup.DailySchedule{ - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeDaily), - // }, - // TimeZone: to.Ptr("India Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Complex.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureVmProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](2), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), - to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), - to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](4), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - }, - RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - TimeZone: to.Ptr("Pacific Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](2), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeMonths), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFirst), - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthThird)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearFebruary), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearNovember)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](4), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeYears), - // }, - // RetentionScheduleFormatType: to.Ptr(armrecoveryservicesbackup.RetentionScheduleFormatWeekly), - // RetentionScheduleWeekly: &armrecoveryservicesbackup.WeeklyRetentionFormat{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // WeeksOfTheMonth: []*armrecoveryservicesbackup.WeekOfMonth{ - // to.Ptr(armrecoveryservicesbackup.WeekOfMonthFourth)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekMonday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekWednesday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekThursday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureWorkload/ProtectionPolicies_CreateOrUpdate_Complex.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateFullAzureWorkloadProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - BackupManagementType: to.Ptr("AzureWorkload"), - Settings: &armrecoveryservicesbackup.Settings{ - Issqlcompression: to.Ptr(false), - TimeZone: to.Ptr("Pacific Standard Time"), - }, - SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - 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.WeekOfMonthSecond)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](2), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), - to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), - to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - 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.WeekOfMonthLast)}, - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - }, - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), - RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](8), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - ScheduleRunTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t }())}, - }, - }, - { - PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](7), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - ScheduleFrequencyInMins: to.Ptr[int32](60), - }, - }}, - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureVMWorkloadProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureWorkload"), - // ProtectedItemsCount: to.Ptr[int32](0), - // Settings: &armrecoveryservicesbackup.Settings{ - // Issqlcompression: to.Ptr(false), - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // SubProtectionPolicy: []*armrecoveryservicesbackup.SubProtectionPolicy{ - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeFull), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // MonthlySchedule: &armrecoveryservicesbackup.MonthlyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // 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.WeekOfMonthSecond)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - // DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](2), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // YearlySchedule: &armrecoveryservicesbackup.YearlyRetentionSchedule{ - // MonthsOfYear: []*armrecoveryservicesbackup.MonthOfYear{ - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJanuary), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearJune), - // to.Ptr(armrecoveryservicesbackup.MonthOfYearDecember)}, - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // 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.WeekOfMonthLast)}, - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday), - // to.Ptr(armrecoveryservicesbackup.DayOfWeekTuesday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeDifferential), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](8), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // ScheduleRunDays: []*armrecoveryservicesbackup.DayOfWeek{ - // to.Ptr(armrecoveryservicesbackup.DayOfWeekFriday)}, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeWeekly), - // ScheduleRunTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T10:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // }, - // { - // PolicyType: to.Ptr(armrecoveryservicesbackup.PolicyTypeLog), - // RetentionPolicy: &armrecoveryservicesbackup.SimpleRetentionPolicy{ - // RetentionPolicyType: to.Ptr("SimpleRetentionPolicy"), - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](7), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.LogSchedulePolicy{ - // SchedulePolicyType: to.Ptr("LogSchedulePolicy"), - // ScheduleFrequencyInMins: to.Ptr[int32](60), - // }, - // }}, - // WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeSQLDataBase), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureStorage/ProtectionPolicies_CreateOrUpdate_Hourly.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateHourlyAzureStorageProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "swaggertestvault", "SwaggerTestRg", "newPolicy2", 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), - }, - }, - 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)}, - }, - }, - WeeklySchedule: &armrecoveryservicesbackup.WeeklyRetentionSchedule{ - DaysOfTheWeek: []*armrecoveryservicesbackup.DayOfWeek{ - to.Ptr(armrecoveryservicesbackup.DayOfWeekSunday)}, - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](12), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeWeeks), - }, - }, - 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)}, - }, - }, - }, - SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - Interval: to.Ptr[int32](4), - ScheduleWindowDuration: to.Ptr[int32](12), - ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00.000Z"); return t }()), - }, - ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - }, - TimeZone: to.Ptr("UTC"), - WorkLoadType: to.Ptr(armrecoveryservicesbackup.WorkloadTypeAzureFileShare), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("newPolicy2"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/swaggertestvault/backupPolicies/newPolicy2"), - // Properties: &armrecoveryservicesbackup.AzureFileShareProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureStorage"), - // ProtectedItemsCount: to.Ptr[int32](0), - // 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-29T20:00:00Z"); 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-29T20:00:00Z"); 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-29T20:00:00Z"); 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-29T20:00:00Z"); return t}())}, - // }, - // }, - // SchedulePolicy: &armrecoveryservicesbackup.SimpleSchedulePolicy{ - // SchedulePolicyType: to.Ptr("SimpleSchedulePolicy"), - // HourlySchedule: &armrecoveryservicesbackup.HourlySchedule{ - // Interval: to.Ptr[int32](4), - // ScheduleWindowDuration: to.Ptr[int32](12), - // ScheduleWindowStartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-09-29T08:00:00Z"); return t}()), - // }, - // ScheduleRunFrequency: to.Ptr(armrecoveryservicesbackup.ScheduleRunTypeHourly), - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("UTC"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/ProtectionPolicies_CreateOrUpdate_Simple.json -func ExampleProtectionPoliciesClient_CreateOrUpdate_createOrUpdateSimpleAzureVmProtectionPolicy() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPoliciesClient().CreateOrUpdate(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", armrecoveryservicesbackup.ProtectionPolicyResource{ - Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - BackupManagementType: to.Ptr("AzureIaasVM"), - RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - Count: to.Ptr[int32](1), - DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - }, - RetentionTimes: []*time.Time{ - to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t }())}, - }, - TimeZone: to.Ptr("Pacific Standard Time"), - }, - }, nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](0), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewProtectionPoliciesClient().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/protectionpolicyoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go index b4bf4e80d651..9bea81250d29 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,7 +46,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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -55,18 +54,21 @@ func NewProtectionPolicyOperationResultsClient(subscriptionID string, credential // - options - ProtectionPolicyOperationResultsClientGetOptions contains the optional parameters for the ProtectionPolicyOperationResultsClient.Get // method. func (client *ProtectionPolicyOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string, options *ProtectionPolicyOperationResultsClientGetOptions) (ProtectionPolicyOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, operationID, options) if err != nil { return ProtectionPolicyOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionPolicyOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionPolicyOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionPolicyOperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -97,7 +99,7 @@ func (client *ProtectionPolicyOperationResultsClient) getCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go deleted file mode 100644 index 532e26fc930d..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationresults_client_example_test.go +++ /dev/null @@ -1,66 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPolicyOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ProtectionPolicyResource = armrecoveryservicesbackup.ProtectionPolicyResource{ - // Name: to.Ptr("testPolicy1"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupPolicies"), - // ID: to.Ptr("/Subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/SwaggerTestRg/providers/Microsoft.RecoveryServices/vaults/NetSDKTestRsVault/backupPolicies/testPolicy1"), - // Properties: &armrecoveryservicesbackup.AzureIaaSVMProtectionPolicy{ - // BackupManagementType: to.Ptr("AzureIaasVM"), - // ProtectedItemsCount: to.Ptr[int32](1), - // RetentionPolicy: &armrecoveryservicesbackup.LongTermRetentionPolicy{ - // RetentionPolicyType: to.Ptr("LongTermRetentionPolicy"), - // DailySchedule: &armrecoveryservicesbackup.DailyRetentionSchedule{ - // RetentionDuration: &armrecoveryservicesbackup.RetentionDuration{ - // Count: to.Ptr[int32](1), - // DurationType: to.Ptr(armrecoveryservicesbackup.RetentionDurationTypeDays), - // }, - // RetentionTimes: []*time.Time{ - // to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T02:00:00Z"); 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, "2018-01-24T02:00:00Z"); return t}())}, - // ScheduleWeeklyFrequency: to.Ptr[int32](0), - // }, - // TimeZone: to.Ptr("Pacific Standard Time"), - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go index 05f02eb41690..7ada67c5e031 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,7 +48,7 @@ func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credentia // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -57,18 +56,21 @@ func NewProtectionPolicyOperationStatusesClient(subscriptionID string, credentia // - options - ProtectionPolicyOperationStatusesClientGetOptions contains the optional parameters for the ProtectionPolicyOperationStatusesClient.Get // method. func (client *ProtectionPolicyOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, policyName string, operationID string, options *ProtectionPolicyOperationStatusesClientGetOptions) (ProtectionPolicyOperationStatusesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, policyName, operationID, options) if err != nil { return ProtectionPolicyOperationStatusesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ProtectionPolicyOperationStatusesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ProtectionPolicyOperationStatusesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ProtectionPolicyOperationStatusesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -99,7 +101,7 @@ func (client *ProtectionPolicyOperationStatusesClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go deleted file mode 100644 index 8121002e44bf..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/protectionpolicyoperationstatuses_client_example_test.go +++ /dev/null @@ -1,52 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewProtectionPolicyOperationStatusesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "testPolicy1", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("GetProtectionPolicyOperationStatus"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.1142968Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusJobsExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusJobsExtendedInfo"), - // FailedJobsError: map[string]*string{ - // }, - // JobIDs: []*string{ - // to.Ptr("00000000-0000-0000-0000-000000000000")}, - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2018-01-24T12:57:32.1142968Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go index f847dcecb23f..63d4e2b43f37 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,7 +47,7 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -57,18 +56,21 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // - recoveryPointID - RecoveryPointID represents the backed up data to be fetched. // - options - RecoveryPointsClientGetOptions contains the optional parameters for the RecoveryPointsClient.Get method. func (client *RecoveryPointsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, fabricName string, containerName string, protectedItemName string, recoveryPointID string, options *RecoveryPointsClientGetOptions) (RecoveryPointsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, options) if err != nil { return RecoveryPointsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return RecoveryPointsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return RecoveryPointsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return RecoveryPointsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -107,7 +109,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, vaultN return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -124,7 +126,7 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco // NewListPager - Lists the backup copies for the backed up item. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -191,7 +193,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, vault return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go deleted file mode 100644 index 1941c7984b63..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypoints_client_example_test.go +++ /dev/null @@ -1,169 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoveryPointsClient().NewListPager("rshvault", "rshhtestmdvmrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", "VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall", &armrecoveryservicesbackup.RecoveryPointsClientListOptions{Filter: nil}) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ - // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ - // { - // Name: to.Ptr("22244821112382"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "Archive": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.4353958Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // }, - // }, - // { - // Name: to.Ptr("24977149827250"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsPrivateAccessEnabledOnAnyDisk: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // AdditionalInfo: to.Ptr("Recovery point cannot be moved to archive tier since it has already been moved."), - // IsReadyForMove: to.Ptr(false), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - // ExtendedInfo: map[string]*string{ - // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), - // }, - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.3317945Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // }}, - // } - } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewRecoveryPointsClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.RecoveryPointResource = armrecoveryservicesbackup.RecoveryPointResource{ - // Name: to.Ptr("26083826328862"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/26083826328862"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsPrivateAccessEnabledOnAnyDisk: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-11-22T22:32:46.6088472Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go index 049250a56a75..9210fc20b990 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewRecoveryPointsRecommendedForMoveClient(subscriptionID string, credential // NewListPager - Lists the recovery points recommended for move to another tier // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 @@ -112,10 +111,13 @@ func (client *RecoveryPointsRecommendedForMoveClient) listCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // listHandleResponse handles the List response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go deleted file mode 100644 index 9605ff28457e..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/recoverypointsrecommendedformove_client_example_test.go +++ /dev/null @@ -1,123 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewRecoveryPointsRecommendedForMoveClient().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() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.RecoveryPointResourceList = armrecoveryservicesbackup.RecoveryPointResourceList{ - // Value: []*armrecoveryservicesbackup.RecoveryPointResource{ - // { - // Name: to.Ptr("22244821112382"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/22244821112382"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusValid), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-21T22:48:25.4353958Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // }, - // }, - // { - // Name: to.Ptr("24977149827250"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupFabrics/protectionContainers/protectedItems/recoveryPoints"), - // ID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rshhtestmdvmrg/providers/Microsoft.RecoveryServices/vaults/rshvault/backupFabrics/Azure/protectionContainers/IaasVMContainer;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/protectedItems/VM;iaasvmcontainerv2;rshhtestmdvmrg;rshmdvmsmall/recoveryPoints/24977149827250"), - // Properties: &armrecoveryservicesbackup.IaasVMRecoveryPoint{ - // ObjectType: to.Ptr("IaasVMRecoveryPoint"), - // IsInstantIlrSessionActive: to.Ptr(false), - // IsManagedVirtualMachine: to.Ptr(true), - // IsSourceVMEncrypted: to.Ptr(false), - // OriginalStorageAccountOption: to.Ptr(false), - // RecoveryPointAdditionalInfo: to.Ptr(""), - // RecoveryPointMoveReadinessInfo: map[string]*armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // "ArchivedRP": &armrecoveryservicesbackup.RecoveryPointMoveReadinessInfo{ - // IsReadyForMove: to.Ptr(true), - // }, - // }, - // RecoveryPointTierDetails: []*armrecoveryservicesbackup.RecoveryPointTierInformationV2{ - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeInstantRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeHardenedRP), - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusDeleted), - // }, - // { - // Type: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierTypeArchivedRP), - // ExtendedInfo: map[string]*string{ - // "RehydratedRPExpiryTime": to.Ptr("2020-12-21T22:48:25.4353958Z"), - // }, - // Status: to.Ptr(armrecoveryservicesbackup.RecoveryPointTierStatusRehydrated), - // }}, - // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-12-20T22:49:44.3317945Z"); return t}()), - // RecoveryPointType: to.Ptr("CrashConsistent"), - // SourceVMStorageType: to.Ptr("NormalStorage"), - // VirtualMachineSize: to.Ptr("Standard_D1"), - // Zones: []*string{ - // to.Ptr("1")}, - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go index 5cf18f7236b9..a8f42ebdd712 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -46,7 +45,7 @@ func NewResourceGuardProxiesClient(subscriptionID string, credential azcore.Toke // NewGetPager - List the ResourceGuardProxies under vault // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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.NewGetPager @@ -99,7 +98,7 @@ func (client *ResourceGuardProxiesClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_test.go deleted file mode 100644 index f70cb9d4f531..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxies_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - pager := clientFactory.NewResourceGuardProxiesClient().NewGetPager("sampleVault", "SampleResourceGroup", nil) - for pager.More() { - page, err := pager.NextPage(ctx) - if err != nil { - log.Fatalf("failed to advance page: %v", err) - } - for _, v := range page.Value { - // You could use page here. We use blank identifier for just demo purposes. - _ = v - } - // If the HTTP response code is 200 as defined in example definition, your page structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // page.ResourceGuardProxyBaseResourceList = armrecoveryservicesbackup.ResourceGuardProxyBaseResourceList{ - // Value: []*armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // { - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // }}, - // } - } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go index c6daf42f9191..6076f5ac66fd 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,22 +46,24 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // method. func (client *ResourceGuardProxyClient) Delete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, options *ResourceGuardProxyClientDeleteOptions) (ResourceGuardProxyClientDeleteResponse, error) { + var err error req, err := client.deleteCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, options) if err != nil { return ResourceGuardProxyClientDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGuardProxyClientDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { - return ResourceGuardProxyClientDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusNoContent) { + err = runtime.NewResponseError(httpResp) + return ResourceGuardProxyClientDeleteResponse{}, err } return ResourceGuardProxyClientDeleteResponse{}, nil } @@ -91,7 +92,7 @@ func (client *ResourceGuardProxyClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -100,23 +101,26 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. func (client *ResourceGuardProxyClient) Get(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, options *ResourceGuardProxyClientGetOptions) (ResourceGuardProxyClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, options) if err != nil { return ResourceGuardProxyClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGuardProxyClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceGuardProxyClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceGuardProxyClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -143,7 +147,7 @@ func (client *ResourceGuardProxyClient) getCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -161,24 +165,27 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - ResourceGuardProxyClientPutOptions contains the optional parameters for the ResourceGuardProxyClient.Put method. func (client *ResourceGuardProxyClient) Put(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters ResourceGuardProxyBaseResource, options *ResourceGuardProxyClientPutOptions) (ResourceGuardProxyClientPutResponse, error) { + var err error req, err := client.putCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, parameters, options) if err != nil { return ResourceGuardProxyClientPutResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGuardProxyClientPutResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceGuardProxyClientPutResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceGuardProxyClientPutResponse{}, err } - return client.putHandleResponse(resp) + resp, err := client.putHandleResponse(httpResp) + return resp, err } // putCreateRequest creates the Put request. @@ -205,10 +212,13 @@ func (client *ResourceGuardProxyClient) putCreateRequest(ctx context.Context, va return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // putHandleResponse handles the Put response. @@ -223,25 +233,28 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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 // - options - ResourceGuardProxyClientUnlockDeleteOptions contains the optional parameters for the ResourceGuardProxyClient.UnlockDelete // method. func (client *ResourceGuardProxyClient) UnlockDelete(ctx context.Context, vaultName string, resourceGroupName string, resourceGuardProxyName string, parameters UnlockDeleteRequest, options *ResourceGuardProxyClientUnlockDeleteOptions) (ResourceGuardProxyClientUnlockDeleteResponse, error) { + var err error req, err := client.unlockDeleteCreateRequest(ctx, vaultName, resourceGroupName, resourceGuardProxyName, parameters, options) if err != nil { return ResourceGuardProxyClientUnlockDeleteResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ResourceGuardProxyClientUnlockDeleteResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ResourceGuardProxyClientUnlockDeleteResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ResourceGuardProxyClientUnlockDeleteResponse{}, err } - return client.unlockDeleteHandleResponse(resp) + resp, err := client.unlockDeleteHandleResponse(httpResp) + return resp, err } // unlockDeleteCreateRequest creates the UnlockDelete request. @@ -268,10 +281,13 @@ func (client *ResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } // unlockDeleteHandleResponse handles the UnlockDelete response. diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go deleted file mode 100644 index 9a37b6664a91..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/resourceguardproxy_client_example_test.go +++ /dev/null @@ -1,145 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().Get(ctx, "sampleVault", "SampleResourceGroup", "swaggerExample", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/resourceguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ResourceGuardProxyBaseResource = armrecoveryservicesbackup.ResourceGuardProxyBaseResource{ - // Name: to.Ptr("swaggerExample"), - // Type: to.Ptr("Microsoft.RecoveryServices/vaults/backupResourceGuardProxies"), - // ID: to.Ptr("/backupmanagement/resources/sampleVault/backupResourceGuardProxies/swaggerExample"), - // Properties: &armrecoveryservicesbackup.ResourceGuardProxyBase{ - // Description: to.Ptr("Please take JIT access before performing any of the critical operation"), - // LastUpdatedTime: to.Ptr("2021-02-11T12:20:47.8210031Z"), - // ResourceGuardOperationDetails: []*armrecoveryservicesbackup.ResourceGuardOperationDetail{ - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/deleteResourceGuardProxyRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/deleteResourceGuardProxyRequests"), - // }, - // { - // DefaultResourceRequest: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew/disableSoftDeleteRequests/default"), - // VaultCriticalOperation: to.Ptr("Microsoft.DataProtection/resourceGuards/disableSoftDeleteRequests"), - // }}, - // ResourceGuardResourceID: to.Ptr("/subscriptions/c999d45b-944f-418c-a0d8-c3fcfd1802c8/resourceGroups/vaultguardRGNew/providers/Microsoft.DataProtection/resourceGuards/VaultGuardTestNew"), - // }, - // } -} - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - _, err = clientFactory.NewResourceGuardProxyClient().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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewResourceGuardProxyClient().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) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.UnlockDeleteResponse = armrecoveryservicesbackup.UnlockDeleteResponse{ - // UnlockDeleteExpiryTime: to.Ptr("2021-02-11T13:12:27.7870742Z"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go index 439ea8cfe97a..5483a7d078be 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/response_types.go @@ -3,14 +3,14 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup // BMSPrepareDataMoveOperationResultClientGetResponse contains the response from method BMSPrepareDataMoveOperationResultClient.Get. type BMSPrepareDataMoveOperationResultClientGetResponse struct { + // Operation result response for Vault Storage Config VaultStorageConfigOperationResultResponseClassification } @@ -26,16 +26,19 @@ func (b *BMSPrepareDataMoveOperationResultClientGetResponse) UnmarshalJSON(data // BackupEnginesClientGetResponse contains the response from method BackupEnginesClient.Get. type BackupEnginesClientGetResponse struct { + // The base backup engine class. All workload specific backup engines derive from this class. BackupEngineBaseResource } // BackupEnginesClientListResponse contains the response from method BackupEnginesClient.NewListPager. type BackupEnginesClientListResponse struct { + // List of BackupEngineBase resources BackupEngineBaseResourceList } // BackupJobsClientListResponse contains the response from method BackupJobsClient.NewListPager. type BackupJobsClientListResponse struct { + // List of Job resources JobResourceList } @@ -46,31 +49,37 @@ type BackupOperationResultsClientGetResponse struct { // BackupOperationStatusesClientGetResponse contains the response from method BackupOperationStatusesClient.Get. type BackupOperationStatusesClientGetResponse struct { + // Operation status. OperationStatus } // BackupPoliciesClientListResponse contains the response from method BackupPoliciesClient.NewListPager. type BackupPoliciesClientListResponse struct { + // List of ProtectionPolicy resources ProtectionPolicyResourceList } // BackupProtectableItemsClientListResponse contains the response from method BackupProtectableItemsClient.NewListPager. type BackupProtectableItemsClientListResponse struct { + // List of WorkloadProtectableItem resources WorkloadProtectableItemResourceList } // BackupProtectedItemsClientListResponse contains the response from method BackupProtectedItemsClient.NewListPager. type BackupProtectedItemsClientListResponse struct { + // List of ProtectedItem resources ProtectedItemResourceList } // BackupProtectionContainersClientListResponse contains the response from method BackupProtectionContainersClient.NewListPager. type BackupProtectionContainersClientListResponse struct { + // List of ProtectionContainer resources ProtectionContainerResourceList } // BackupProtectionIntentClientListResponse contains the response from method BackupProtectionIntentClient.NewListPager. type BackupProtectionIntentClientListResponse struct { + // List of ProtectionIntent resources ProtectionIntentResourceList } @@ -86,6 +95,7 @@ type BackupResourceEncryptionConfigsClientUpdateResponse struct { // BackupResourceStorageConfigsNonCRRClientGetResponse contains the response from method BackupResourceStorageConfigsNonCRRClient.Get. type BackupResourceStorageConfigsNonCRRClientGetResponse struct { + // The resource storage details. BackupResourceConfigResource } @@ -96,36 +106,43 @@ type BackupResourceStorageConfigsNonCRRClientPatchResponse struct { // BackupResourceStorageConfigsNonCRRClientUpdateResponse contains the response from method BackupResourceStorageConfigsNonCRRClient.Update. type BackupResourceStorageConfigsNonCRRClientUpdateResponse struct { + // The resource storage details. BackupResourceConfigResource } // BackupResourceVaultConfigsClientGetResponse contains the response from method BackupResourceVaultConfigsClient.Get. type BackupResourceVaultConfigsClientGetResponse struct { + // Backup resource vault config details. BackupResourceVaultConfigResource } // BackupResourceVaultConfigsClientPutResponse contains the response from method BackupResourceVaultConfigsClient.Put. type BackupResourceVaultConfigsClientPutResponse struct { + // Backup resource vault config details. BackupResourceVaultConfigResource } // BackupResourceVaultConfigsClientUpdateResponse contains the response from method BackupResourceVaultConfigsClient.Update. type BackupResourceVaultConfigsClientUpdateResponse struct { + // Backup resource vault config details. BackupResourceVaultConfigResource } // BackupStatusClientGetResponse contains the response from method BackupStatusClient.Get. type BackupStatusClientGetResponse struct { + // BackupStatus response. BackupStatusResponse } // BackupUsageSummariesClientListResponse contains the response from method BackupUsageSummariesClient.NewListPager. type BackupUsageSummariesClientListResponse struct { + // Backup management usage for vault. BackupManagementUsageList } // BackupWorkloadItemsClientListResponse contains the response from method BackupWorkloadItemsClient.NewListPager. type BackupWorkloadItemsClientListResponse struct { + // List of WorkloadItem resources WorkloadItemResourceList } @@ -146,6 +163,7 @@ type ClientBMSTriggerDataMoveResponse struct { // ClientGetOperationStatusResponse contains the response from method Client.GetOperationStatus. type ClientGetOperationStatusResponse struct { + // Operation status. OperationStatus } @@ -156,16 +174,19 @@ type ClientMoveRecoveryPointResponse struct { // DeletedProtectionContainersClientListResponse contains the response from method DeletedProtectionContainersClient.NewListPager. type DeletedProtectionContainersClientListResponse struct { + // List of ProtectionContainer resources ProtectionContainerResourceList } // ExportJobsOperationResultsClientGetResponse contains the response from method ExportJobsOperationResultsClient.Get. type ExportJobsOperationResultsClientGetResponse struct { + // Base class for operation result info. OperationResultInfoBaseResource } // FeatureSupportClientValidateResponse contains the response from method FeatureSupportClient.Validate. type FeatureSupportClientValidateResponse struct { + // Response for feature support requests for Azure IaasVm AzureVMResourceFeatureSupportResponse } @@ -186,6 +207,7 @@ type JobCancellationsClientTriggerResponse struct { // JobDetailsClientGetResponse contains the response from method JobDetailsClient.Get. type JobDetailsClientGetResponse struct { + // Defines workload agnostic properties for a job. JobResource } @@ -206,11 +228,13 @@ type OperationClientValidateResponse struct { // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // Operations List response which contains list of available APIs. ClientDiscoveryResponse } // PrivateEndpointClientGetOperationStatusResponse contains the response from method PrivateEndpointClient.GetOperationStatus. type PrivateEndpointClientGetOperationStatusResponse struct { + // Operation status. OperationStatus } @@ -221,31 +245,37 @@ type PrivateEndpointConnectionClientDeleteResponse struct { // PrivateEndpointConnectionClientGetResponse contains the response from method PrivateEndpointConnectionClient.Get. type PrivateEndpointConnectionClientGetResponse struct { + // Private Endpoint Connection Response Properties PrivateEndpointConnectionResource } // PrivateEndpointConnectionClientPutResponse contains the response from method PrivateEndpointConnectionClient.BeginPut. type PrivateEndpointConnectionClientPutResponse struct { + // Private Endpoint Connection Response Properties PrivateEndpointConnectionResource } // ProtectableContainersClientListResponse contains the response from method ProtectableContainersClient.NewListPager. type ProtectableContainersClientListResponse struct { + // List of ProtectableContainer resources ProtectableContainerResourceList } // ProtectedItemOperationResultsClientGetResponse contains the response from method ProtectedItemOperationResultsClient.Get. type ProtectedItemOperationResultsClientGetResponse struct { + // Base class for backup items. ProtectedItemResource } // ProtectedItemOperationStatusesClientGetResponse contains the response from method ProtectedItemOperationStatusesClient.Get. type ProtectedItemOperationStatusesClientGetResponse struct { + // Operation status. OperationStatus } // ProtectedItemsClientCreateOrUpdateResponse contains the response from method ProtectedItemsClient.CreateOrUpdate. type ProtectedItemsClientCreateOrUpdateResponse struct { + // Base class for backup items. ProtectedItemResource } @@ -256,11 +286,13 @@ type ProtectedItemsClientDeleteResponse struct { // ProtectedItemsClientGetResponse contains the response from method ProtectedItemsClient.Get. type ProtectedItemsClientGetResponse struct { + // Base class for backup items. ProtectedItemResource } // ProtectionContainerOperationResultsClientGetResponse contains the response from method ProtectionContainerOperationResultsClient.Get. type ProtectionContainerOperationResultsClientGetResponse struct { + // Base class for container with backup items. Containers with specific workloads are derived from this class. ProtectionContainerResource } @@ -271,6 +303,7 @@ type ProtectionContainerRefreshOperationResultsClientGetResponse struct { // ProtectionContainersClientGetResponse contains the response from method ProtectionContainersClient.Get. type ProtectionContainersClientGetResponse struct { + // Base class for container with backup items. Containers with specific workloads are derived from this class. ProtectionContainerResource } @@ -286,6 +319,7 @@ type ProtectionContainersClientRefreshResponse struct { // ProtectionContainersClientRegisterResponse contains the response from method ProtectionContainersClient.Register. type ProtectionContainersClientRegisterResponse struct { + // Base class for container with backup items. Containers with specific workloads are derived from this class. ProtectionContainerResource } @@ -296,6 +330,7 @@ type ProtectionContainersClientUnregisterResponse struct { // ProtectionIntentClientCreateOrUpdateResponse contains the response from method ProtectionIntentClient.CreateOrUpdate. type ProtectionIntentClientCreateOrUpdateResponse struct { + // Base class for backup ProtectionIntent. ProtectionIntentResource } @@ -306,16 +341,19 @@ type ProtectionIntentClientDeleteResponse struct { // ProtectionIntentClientGetResponse contains the response from method ProtectionIntentClient.Get. type ProtectionIntentClientGetResponse struct { + // Base class for backup ProtectionIntent. ProtectionIntentResource } // ProtectionIntentClientValidateResponse contains the response from method ProtectionIntentClient.Validate. type ProtectionIntentClientValidateResponse struct { + // Response contract for enable backup validation request PreValidateEnableBackupResponse } // ProtectionPoliciesClientCreateOrUpdateResponse contains the response from method ProtectionPoliciesClient.CreateOrUpdate. type ProtectionPoliciesClientCreateOrUpdateResponse struct { + // Base class for backup policy. Workload-specific backup policies are derived from this class. ProtectionPolicyResource } @@ -326,36 +364,43 @@ type ProtectionPoliciesClientDeleteResponse struct { // ProtectionPoliciesClientGetResponse contains the response from method ProtectionPoliciesClient.Get. type ProtectionPoliciesClientGetResponse struct { + // Base class for backup policy. Workload-specific backup policies are derived from this class. ProtectionPolicyResource } // ProtectionPolicyOperationResultsClientGetResponse contains the response from method ProtectionPolicyOperationResultsClient.Get. type ProtectionPolicyOperationResultsClientGetResponse struct { + // Base class for backup policy. Workload-specific backup policies are derived from this class. ProtectionPolicyResource } // ProtectionPolicyOperationStatusesClientGetResponse contains the response from method ProtectionPolicyOperationStatusesClient.Get. type ProtectionPolicyOperationStatusesClientGetResponse struct { + // Operation status. OperationStatus } // RecoveryPointsClientGetResponse contains the response from method RecoveryPointsClient.Get. type RecoveryPointsClientGetResponse struct { + // Base class for backup copies. Workload-specific backup copies are derived from this class. RecoveryPointResource } // RecoveryPointsClientListResponse contains the response from method RecoveryPointsClient.NewListPager. type RecoveryPointsClientListResponse struct { + // List of RecoveryPoint resources RecoveryPointResourceList } // RecoveryPointsRecommendedForMoveClientListResponse contains the response from method RecoveryPointsRecommendedForMoveClient.NewListPager. type RecoveryPointsRecommendedForMoveClientListResponse struct { + // List of RecoveryPoint resources RecoveryPointResourceList } // ResourceGuardProxiesClientGetResponse contains the response from method ResourceGuardProxiesClient.NewGetPager. type ResourceGuardProxiesClientGetResponse struct { + // List of ResourceGuardProxyBase resources ResourceGuardProxyBaseResourceList } @@ -376,6 +421,7 @@ type ResourceGuardProxyClientPutResponse struct { // ResourceGuardProxyClientUnlockDeleteResponse contains the response from method ResourceGuardProxyClient.UnlockDelete. type ResourceGuardProxyClientUnlockDeleteResponse struct { + // Response of Unlock Delete API. UnlockDeleteResponse } @@ -386,6 +432,7 @@ type RestoresClientTriggerResponse struct { // SecurityPINsClientGetResponse contains the response from method SecurityPINsClient.Get. type SecurityPINsClientGetResponse struct { + // The token information details. TokenInformation } @@ -401,5 +448,6 @@ type ValidateOperationResultsClientGetResponse struct { // ValidateOperationStatusesClientGetResponse contains the response from method ValidateOperationStatusesClient.Get. type ValidateOperationStatusesClientGetResponse struct { + // Operation status. OperationStatus } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go index 4d6c500d3c47..abc4e2cfec18 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,7 +47,7 @@ func NewRestoresClient(subscriptionID string, credential azcore.TokenCredential, // call, use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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. @@ -63,7 +62,8 @@ func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string if err != nil { return nil, err } - return runtime.NewPoller[RestoresClientTriggerResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[RestoresClientTriggerResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[RestoresClientTriggerResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -73,20 +73,22 @@ func (client *RestoresClient) BeginTrigger(ctx context.Context, vaultName string // use GetProtectedItemOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 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) { + var err error req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointID, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // triggerCreateRequest creates the Trigger request. @@ -125,8 +127,11 @@ func (client *RestoresClient) triggerCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go deleted file mode 100644 index d5675ca07790..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/restores_client_example_test.go +++ /dev/null @@ -1,271 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().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"), - TargetDiskNetworkAccessSettings: &armrecoveryservicesbackup.TargetDiskNetworkAccessSettings{ - TargetDiskAccessID: to.Ptr("/subscriptions/e7a191f5-713c-4bdb-b5e4-cf3dd90230ef/resourceGroups/arpja/providers/Microsoft.Compute/diskAccesses/arpja-diskaccess-ccy"), - TargetDiskNetworkAccessOption: to.Ptr(armrecoveryservicesbackup.TargetDiskNetworkAccessOptionEnablePrivateAccessForAllDisks), - }, - }, - }, 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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().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), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testingRg/providers/Microsoft.Storage/storageAccounts/testAccount"), - }, - 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"), - }, - }, 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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_RestoreDisks_IaasVMRestoreWithRehydrationRequest.json -func ExampleRestoresClient_BeginTrigger_restoreDisksWithIaasVmRestoreWithRehydrationRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ - ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), - CreateNewCloudService: to.Ptr(true), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - 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"), - RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ - RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityStandard), - RehydrationRetentionDuration: to.Ptr("P7D"), - }, - }, - }, 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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().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(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(true), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - 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/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - }, - }, 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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreRequest_IdentityBasedRestoreDetails.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreRequestWithIdentityBasedRestoreDetails() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().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(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - IdentityBasedRestoreDetails: &armrecoveryservicesbackup.IdentityBasedRestoreDetails{ - TargetStorageAccountID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - }, - IdentityInfo: &armrecoveryservicesbackup.IdentityInfo{ - IsSystemAssignedIdentity: to.Ptr(true), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - Region: to.Ptr("southeastasia"), - SourceResourceID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg/providers/Microsoft.Compute/virtualMachines/netvmtestv2vm1"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - }, - }, 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/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-02-01/examples/AzureIaasVm/TriggerRestore_ALR_IaasVMRestoreWithRehydrationRequest.json -func ExampleRestoresClient_BeginTrigger_restoreToNewAzureIaasVmWithIaasVmRestoreWithRehydrationRequest() { - cred, err := azidentity.NewDefaultAzureCredential(nil) - if err != nil { - log.Fatalf("failed to obtain a credential: %v", err) - } - ctx := context.Background() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewRestoresClient().BeginTrigger(ctx, "testVault", "netsdktestrg", "Azure", "IaasVMContainer;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "VM;iaasvmcontainerv2;netsdktestrg;netvmtestv2vm1", "348916168024334", armrecoveryservicesbackup.RestoreRequestResource{ - Properties: &armrecoveryservicesbackup.IaasVMRestoreWithRehydrationRequest{ - ObjectType: to.Ptr("IaasVMRestoreWithRehydrationRequest"), - CreateNewCloudService: to.Ptr(false), - EncryptionDetails: &armrecoveryservicesbackup.EncryptionDetails{ - EncryptionEnabled: to.Ptr(false), - }, - OriginalStorageAccountOption: to.Ptr(false), - RecoveryPointID: to.Ptr("348916168024334"), - RecoveryType: to.Ptr(armrecoveryservicesbackup.RecoveryTypeAlternateLocation), - 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/testRg/providers/Microsoft.Storage/storageAccounts/testingAccount"), - SubnetID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet/subnets/default"), - TargetResourceGroupID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2"), - TargetVirtualMachineID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/netsdktestrg2/providers/Microsoft.Compute/virtualmachines/RSMDALRVM981435"), - VirtualNetworkID: to.Ptr("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testRg/providers/Microsoft.Network/virtualNetworks/testNet"), - RecoveryPointRehydrationInfo: &armrecoveryservicesbackup.RecoveryPointRehydrationInfo{ - RehydrationPriority: to.Ptr(armrecoveryservicesbackup.RehydrationPriorityHigh), - RehydrationRetentionDuration: to.Ptr("P7D"), - }, - }, - }, 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/securitypins_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go index d0af985f185c..1269b315bedf 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,23 +46,26 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. func (client *SecurityPINsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, options *SecurityPINsClientGetOptions) (SecurityPINsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, options) if err != nil { return SecurityPINsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return SecurityPINsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return SecurityPINsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return SecurityPINsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -86,11 +88,14 @@ func (client *SecurityPINsClient) getCreateRequest(ctx context.Context, vaultNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if options != nil && options.Parameters != nil { - return req, runtime.MarshalAsJSON(req, *options.Parameters) + if err := runtime.MarshalAsJSON(req, *options.Parameters); err != nil { + return nil, err + } + return req, nil } return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_test.go deleted file mode 100644 index c7ec89c3015a..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/securitypins_client_example_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. -// DO NOT EDIT. - -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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewSecurityPINsClient().Get(ctx, "SwaggerTest", "SwaggerTestRg", &armrecoveryservicesbackup.SecurityPINsClientGetOptions{Parameters: nil}) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.TokenInformation = armrecoveryservicesbackup.TokenInformation{ - // ExpiryTimeInUTCTicks: to.Ptr[int64](636495150137443100), - // SecurityPIN: to.Ptr("200432"), - // Token: to.Ptr("200432"), - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go index 38bf7b8e0001..da9cc4933c11 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/time_rfc3339.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // 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/validateoperation_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go index de152ec817f6..bdb0317ef0f6 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -48,7 +47,7 @@ func NewValidateOperationClient(subscriptionID string, credential azcore.TokenCr // headers which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 // - 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 @@ -60,7 +59,8 @@ func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultNa if err != nil { return nil, err } - return runtime.NewPoller[ValidateOperationClientTriggerResponse](resp, client.internal.Pipeline(), nil) + poller, err := runtime.NewPoller[ValidateOperationClientTriggerResponse](resp, client.internal.Pipeline(), nil) + return poller, err } else { return runtime.NewPollerFromResumeToken[ValidateOperationClientTriggerResponse](options.ResumeToken, client.internal.Pipeline(), nil) } @@ -70,20 +70,22 @@ func (client *ValidateOperationClient) BeginTrigger(ctx context.Context, vaultNa // which can be tracked using GetValidateOperationResult API. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-02-01 +// Generated from API version 2023-04-01 func (client *ValidateOperationClient) trigger(ctx context.Context, vaultName string, resourceGroupName string, parameters ValidateOperationRequestClassification, options *ValidateOperationClientBeginTriggerOptions) (*http.Response, error) { + var err error req, err := client.triggerCreateRequest(ctx, vaultName, resourceGroupName, parameters, options) if err != nil { return nil, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return nil, err } - if !runtime.HasStatusCode(resp, http.StatusAccepted) { - return nil, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err } - return resp, nil + return httpResp, nil } // triggerCreateRequest creates the Trigger request. @@ -106,8 +108,11 @@ func (client *ValidateOperationClient) triggerCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} - return req, runtime.MarshalAsJSON(req, parameters) + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil } diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go deleted file mode 100644 index 7ddce1c1c641..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperation_client_example_test.go +++ /dev/null @@ -1,59 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - poller, err := clientFactory.NewValidateOperationClient().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/validateoperationresults_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go index 7af14e51996e..b89cda01c805 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -47,25 +46,28 @@ 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - ValidateOperationResultsClientGetOptions contains the optional parameters for the ValidateOperationResultsClient.Get // method. func (client *ValidateOperationResultsClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ValidateOperationResultsClientGetOptions) (ValidateOperationResultsClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return ValidateOperationResultsClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ValidateOperationResultsClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusAccepted) { - return ValidateOperationResultsClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return ValidateOperationResultsClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -92,7 +94,7 @@ func (client *ValidateOperationResultsClient) getCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go deleted file mode 100644 index 35ed6b6bd6f6..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationresults_client_example_test.go +++ /dev/null @@ -1,49 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewValidateOperationResultsClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.ValidateOperationsResponse = armrecoveryservicesbackup.ValidateOperationsResponse{ - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // } -} diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go index 0f93cbf54229..094682be8ece 100644 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go +++ b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client.go @@ -3,9 +3,8 @@ // 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. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. // Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. package armrecoveryservicesbackup @@ -49,25 +48,28 @@ func NewValidateOperationStatusesClient(subscriptionID string, credential azcore // 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 2023-02-01 +// Generated from API version 2023-04-01 // - 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. // - options - ValidateOperationStatusesClientGetOptions contains the optional parameters for the ValidateOperationStatusesClient.Get // method. func (client *ValidateOperationStatusesClient) Get(ctx context.Context, vaultName string, resourceGroupName string, operationID string, options *ValidateOperationStatusesClientGetOptions) (ValidateOperationStatusesClientGetResponse, error) { + var err error req, err := client.getCreateRequest(ctx, vaultName, resourceGroupName, operationID, options) if err != nil { return ValidateOperationStatusesClientGetResponse{}, err } - resp, err := client.internal.Pipeline().Do(req) + httpResp, err := client.internal.Pipeline().Do(req) if err != nil { return ValidateOperationStatusesClientGetResponse{}, err } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return ValidateOperationStatusesClientGetResponse{}, runtime.NewResponseError(resp) + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return ValidateOperationStatusesClientGetResponse{}, err } - return client.getHandleResponse(resp) + resp, err := client.getHandleResponse(httpResp) + return resp, err } // getCreateRequest creates the Get request. @@ -94,7 +96,7 @@ func (client *ValidateOperationStatusesClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-02-01") + reqQP.Set("api-version", "2023-04-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go b/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go deleted file mode 100644 index c4e03af84efa..000000000000 --- a/sdk/resourcemanager/recoveryservices/armrecoveryservicesbackup/validateoperationstatuses_client_example_test.go +++ /dev/null @@ -1,57 +0,0 @@ -//go:build go1.18 -// +build go1.18 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. -// Code generated by Microsoft (R) AutoRest Code Generator. -// Changes may cause incorrect behavior and will be lost if the code is regenerated. -// DO NOT EDIT. - -package 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/v2" -) - -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/a498cae6d1a93f4c33073f0747b93b22815c09b7/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2023-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() - clientFactory, err := armrecoveryservicesbackup.NewClientFactory("", cred, nil) - if err != nil { - log.Fatalf("failed to create client: %v", err) - } - res, err := clientFactory.NewValidateOperationStatusesClient().Get(ctx, "NetSDKTestRsVault", "SwaggerTestRg", "00000000-0000-0000-0000-000000000000", nil) - if err != nil { - log.Fatalf("failed to finish the request: %v", err) - } - // You could use response here. We use blank identifier for just demo purposes. - _ = res - // If the HTTP response code is 200 as defined in example definition, your response structure would look as follows. Please pay attention that all the values in the output are fake values for just demo purposes. - // res.OperationStatus = armrecoveryservicesbackup.OperationStatus{ - // Name: to.Ptr("00000000-0000-0000-0000-000000000000"), - // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), - // ID: to.Ptr("00000000-0000-0000-0000-000000000000"), - // Properties: &armrecoveryservicesbackup.OperationStatusValidateOperationExtendedInfo{ - // ObjectType: to.Ptr("OperationStatusValidateOperationExtendedInfo"), - // ValidateOperationResponse: &armrecoveryservicesbackup.ValidateOperationResponse{ - // ValidationResults: []*armrecoveryservicesbackup.ErrorDetail{ - // { - // Code: to.Ptr("UserErrorCoreCountSubscriptionQuotaReached"), - // Message: to.Ptr("Core Count subscription quota has been reached."), - // Recommendations: []*string{ - // to.Ptr("Contact Azure support to increase the limits.")}, - // }}, - // }, - // }, - // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2017-10-29T06:04:18.207325Z"); return t}()), - // Status: to.Ptr(armrecoveryservicesbackup.OperationStatusValuesSucceeded), - // } -}