diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md index 13fa27544da2..b8a7421b98ca 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md +++ b/sdk/resourcemanager/dataprotection/armdataprotection/CHANGELOG.md @@ -1,5 +1,43 @@ # Release History +## 3.0.0 (2023-12-22) +### Breaking Changes + +- Type of `BaseResourceProperties.ObjectType` has been changed from `*string` to `*ResourcePropertiesObjectType` + +### Features Added + +- New enum type `RecoveryPointCompletionState` with values `RecoveryPointCompletionStateCompleted`, `RecoveryPointCompletionStatePartial` +- New enum type `ResourcePropertiesObjectType` with values `ResourcePropertiesObjectTypeDefaultResourceProperties` +- New function `*BackupInstancesClient.BeginTriggerCrossRegionRestore(context.Context, string, string, CrossRegionRestoreRequestObject, *BackupInstancesClientBeginTriggerCrossRegionRestoreOptions) (*runtime.Poller[BackupInstancesClientTriggerCrossRegionRestoreResponse], error)` +- New function `*BackupInstancesClient.BeginValidateCrossRegionRestore(context.Context, string, string, ValidateCrossRegionRestoreRequestObject, *BackupInstancesClientBeginValidateCrossRegionRestoreOptions) (*runtime.Poller[BackupInstancesClientValidateCrossRegionRestoreResponse], error)` +- New function `*ClientFactory.NewFetchCrossRegionRestoreJobClient() *FetchCrossRegionRestoreJobClient` +- New function `*ClientFactory.NewFetchCrossRegionRestoreJobsClient() *FetchCrossRegionRestoreJobsClient` +- New function `*ClientFactory.NewFetchSecondaryRecoveryPointsClient() *FetchSecondaryRecoveryPointsClient` +- New function `*DefaultResourceProperties.GetBaseResourceProperties() *BaseResourceProperties` +- New function `NewFetchCrossRegionRestoreJobClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FetchCrossRegionRestoreJobClient, error)` +- New function `*FetchCrossRegionRestoreJobClient.Get(context.Context, string, string, CrossRegionRestoreJobRequest, *FetchCrossRegionRestoreJobClientGetOptions) (FetchCrossRegionRestoreJobClientGetResponse, error)` +- New function `NewFetchCrossRegionRestoreJobsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FetchCrossRegionRestoreJobsClient, error)` +- New function `*FetchCrossRegionRestoreJobsClient.NewListPager(string, string, CrossRegionRestoreJobsRequest, *FetchCrossRegionRestoreJobsClientListOptions) *runtime.Pager[FetchCrossRegionRestoreJobsClientListResponse]` +- New function `NewFetchSecondaryRecoveryPointsClient(string, azcore.TokenCredential, *arm.ClientOptions) (*FetchSecondaryRecoveryPointsClient, error)` +- New function `*FetchSecondaryRecoveryPointsClient.NewListPager(string, string, FetchSecondaryRPsRequestParameters, *FetchSecondaryRecoveryPointsClientListOptions) *runtime.Pager[FetchSecondaryRecoveryPointsClientListResponse]` +- New function `*KubernetesClusterVaultTierRestoreCriteria.GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria` +- New struct `CrossRegionRestoreDetails` +- New struct `CrossRegionRestoreJobRequest` +- New struct `CrossRegionRestoreJobsRequest` +- New struct `CrossRegionRestoreRequestObject` +- New struct `DefaultResourceProperties` +- New struct `ErrorDetail` +- New struct `ErrorResponse` +- New struct `FetchSecondaryRPsRequestParameters` +- New struct `KubernetesClusterVaultTierRestoreCriteria` +- New struct `UserFacingWarningDetail` +- New struct `ValidateCrossRegionRestoreRequestObject` +- New field `RecoveryPointState` in struct `AzureBackupDiscreteRecoveryPoint` +- New field `ReplicatedRegions` in struct `BackupVault` +- New field `WarningDetails` in struct `JobExtendedInfo` + + ## 2.4.0 (2023-11-24) ### Features Added diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md b/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md index 71cd2114e16b..a55273222419 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md +++ b/sdk/resourcemanager/dataprotection/armdataprotection/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 2.4.0 -tag: package-2023-05 +module-version: 3.0.0 +tag: package-2023-11 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client.go index f35ef1aba5f6..d7c73c0f8132 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client.go @@ -46,7 +46,7 @@ func NewBackupInstancesClient(subscriptionID string, credential azcore.TokenCred // BeginAdhocBackup - Trigger adhoc backup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -60,7 +60,8 @@ func (client *BackupInstancesClient) BeginAdhocBackup(ctx context.Context, resou return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientAdhocBackupResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -73,7 +74,7 @@ func (client *BackupInstancesClient) BeginAdhocBackup(ctx context.Context, resou // AdhocBackup - Trigger adhoc backup // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) adhocBackup(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters TriggerBackupRequest, options *BackupInstancesClientBeginAdhocBackupOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginAdhocBackup" @@ -119,7 +120,7 @@ func (client *BackupInstancesClient) adhocBackupCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -131,7 +132,7 @@ func (client *BackupInstancesClient) adhocBackupCreateRequest(ctx context.Contex // BeginCreateOrUpdate - Create or update a backup instance in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -158,7 +159,7 @@ func (client *BackupInstancesClient) BeginCreateOrUpdate(ctx context.Context, re // CreateOrUpdate - Create or update a backup instance in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) createOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters BackupInstanceResource, options *BackupInstancesClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginCreateOrUpdate" @@ -204,7 +205,7 @@ func (client *BackupInstancesClient) createOrUpdateCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -216,7 +217,7 @@ func (client *BackupInstancesClient) createOrUpdateCreateRequest(ctx context.Con // BeginDelete - Delete a backup instance in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -242,7 +243,7 @@ func (client *BackupInstancesClient) BeginDelete(ctx context.Context, resourceGr // Delete - Delete a backup instance in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) deleteOperation(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *BackupInstancesClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginDelete" @@ -288,7 +289,7 @@ func (client *BackupInstancesClient) deleteCreateRequest(ctx context.Context, re return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -297,7 +298,7 @@ func (client *BackupInstancesClient) deleteCreateRequest(ctx context.Context, re // Get - Gets a backup instance with name in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -348,7 +349,7 @@ func (client *BackupInstancesClient) getCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -366,7 +367,7 @@ func (client *BackupInstancesClient) getHandleResponse(resp *http.Response) (Bac // GetBackupInstanceOperationResult - Get result of backup instance creation operation // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -422,7 +423,7 @@ func (client *BackupInstancesClient) getBackupInstanceOperationResultCreateReque return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -439,7 +440,7 @@ func (client *BackupInstancesClient) getBackupInstanceOperationResultHandleRespo // NewListPager - Gets a backup instances belonging to a backup vault // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupInstancesClientListOptions contains the optional parameters for the BackupInstancesClient.NewListPager @@ -487,7 +488,7 @@ func (client *BackupInstancesClient) listCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -505,7 +506,7 @@ func (client *BackupInstancesClient) listHandleResponse(resp *http.Response) (Ba // BeginResumeBackups - This operation will resume backups for backup instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -531,7 +532,7 @@ func (client *BackupInstancesClient) BeginResumeBackups(ctx context.Context, res // ResumeBackups - This operation will resume backups for backup instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) resumeBackups(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *BackupInstancesClientBeginResumeBackupsOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginResumeBackups" @@ -577,7 +578,7 @@ func (client *BackupInstancesClient) resumeBackupsCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -586,7 +587,7 @@ func (client *BackupInstancesClient) resumeBackupsCreateRequest(ctx context.Cont // BeginResumeProtection - This operation will resume protection for a stopped backup instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -612,7 +613,7 @@ func (client *BackupInstancesClient) BeginResumeProtection(ctx context.Context, // ResumeProtection - This operation will resume protection for a stopped backup instance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) resumeProtection(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *BackupInstancesClientBeginResumeProtectionOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginResumeProtection" @@ -658,7 +659,7 @@ func (client *BackupInstancesClient) resumeProtectionCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -667,7 +668,7 @@ func (client *BackupInstancesClient) resumeProtectionCreateRequest(ctx context.C // BeginStopProtection - This operation will stop protection of a backup instance and data will be held forever // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -693,7 +694,7 @@ func (client *BackupInstancesClient) BeginStopProtection(ctx context.Context, re // StopProtection - This operation will stop protection of a backup instance and data will be held forever // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) stopProtection(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *BackupInstancesClientBeginStopProtectionOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginStopProtection" @@ -739,7 +740,7 @@ func (client *BackupInstancesClient) stopProtectionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -749,7 +750,7 @@ func (client *BackupInstancesClient) stopProtectionCreateRequest(ctx context.Con // (except latest Recovery point, which will be retained forever) // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -776,7 +777,7 @@ func (client *BackupInstancesClient) BeginSuspendBackups(ctx context.Context, re // latest Recovery point, which will be retained forever) // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) suspendBackups(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *BackupInstancesClientBeginSuspendBackupsOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginSuspendBackups" @@ -822,7 +823,7 @@ func (client *BackupInstancesClient) suspendBackupsCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -832,7 +833,7 @@ func (client *BackupInstancesClient) suspendBackupsCreateRequest(ctx context.Con // will bring backup instance to valid state // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -860,7 +861,7 @@ func (client *BackupInstancesClient) BeginSyncBackupInstance(ctx context.Context // bring backup instance to valid state // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) syncBackupInstance(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters SyncBackupInstanceRequest, options *BackupInstancesClientBeginSyncBackupInstanceOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginSyncBackupInstance" @@ -906,7 +907,88 @@ func (client *BackupInstancesClient) syncBackupInstanceCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginTriggerCrossRegionRestore - Triggers Cross Region Restore for BackupInstance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The name of the Azure region. +// - parameters - Request body for trigger CRR operation +// - options - BackupInstancesClientBeginTriggerCrossRegionRestoreOptions contains the optional parameters for the BackupInstancesClient.BeginTriggerCrossRegionRestore +// method. +func (client *BackupInstancesClient) BeginTriggerCrossRegionRestore(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreRequestObject, options *BackupInstancesClientBeginTriggerCrossRegionRestoreOptions) (*runtime.Poller[BackupInstancesClientTriggerCrossRegionRestoreResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.triggerCrossRegionRestore(ctx, resourceGroupName, location, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientTriggerCrossRegionRestoreResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupInstancesClientTriggerCrossRegionRestoreResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// TriggerCrossRegionRestore - Triggers Cross Region Restore for BackupInstance. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01 +func (client *BackupInstancesClient) triggerCrossRegionRestore(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreRequestObject, options *BackupInstancesClientBeginTriggerCrossRegionRestoreOptions) (*http.Response, error) { + var err error + const operationName = "BackupInstancesClient.BeginTriggerCrossRegionRestore" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.triggerCrossRegionRestoreCreateRequest(ctx, resourceGroupName, location, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// triggerCrossRegionRestoreCreateRequest creates the TriggerCrossRegionRestore request. +func (client *BackupInstancesClient) triggerCrossRegionRestoreCreateRequest(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreRequestObject, options *BackupInstancesClientBeginTriggerCrossRegionRestoreOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/crossRegionRestore" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -918,7 +1000,7 @@ func (client *BackupInstancesClient) syncBackupInstanceCreateRequest(ctx context // BeginTriggerRehydrate - rehydrate recovery point for restore for a BackupInstance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -945,7 +1027,7 @@ func (client *BackupInstancesClient) BeginTriggerRehydrate(ctx context.Context, // TriggerRehydrate - rehydrate recovery point for restore for a BackupInstance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) triggerRehydrate(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters AzureBackupRehydrationRequest, options *BackupInstancesClientBeginTriggerRehydrateOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginTriggerRehydrate" @@ -991,7 +1073,7 @@ func (client *BackupInstancesClient) triggerRehydrateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1003,7 +1085,7 @@ func (client *BackupInstancesClient) triggerRehydrateCreateRequest(ctx context.C // BeginTriggerRestore - Triggers restore for a BackupInstance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -1017,7 +1099,8 @@ func (client *BackupInstancesClient) BeginTriggerRestore(ctx context.Context, re return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientTriggerRestoreResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1030,7 +1113,7 @@ func (client *BackupInstancesClient) BeginTriggerRestore(ctx context.Context, re // TriggerRestore - Triggers restore for a BackupInstance // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) triggerRestore(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters AzureBackupRestoreRequestClassification, options *BackupInstancesClientBeginTriggerRestoreOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginTriggerRestore" @@ -1076,7 +1159,88 @@ func (client *BackupInstancesClient) triggerRestoreCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// BeginValidateCrossRegionRestore - Validates whether Cross Region Restore can be triggered for DataSource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The name of the Azure region. +// - parameters - Request body for operation +// - options - BackupInstancesClientBeginValidateCrossRegionRestoreOptions contains the optional parameters for the BackupInstancesClient.BeginValidateCrossRegionRestore +// method. +func (client *BackupInstancesClient) BeginValidateCrossRegionRestore(ctx context.Context, resourceGroupName string, location string, parameters ValidateCrossRegionRestoreRequestObject, options *BackupInstancesClientBeginValidateCrossRegionRestoreOptions) (*runtime.Poller[BackupInstancesClientValidateCrossRegionRestoreResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.validateCrossRegionRestore(ctx, resourceGroupName, location, parameters, options) + if err != nil { + return nil, err + } + poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientValidateCrossRegionRestoreResponse]{ + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), + }) + return poller, err + } else { + return runtime.NewPollerFromResumeToken(options.ResumeToken, client.internal.Pipeline(), &runtime.NewPollerFromResumeTokenOptions[BackupInstancesClientValidateCrossRegionRestoreResponse]{ + Tracer: client.internal.Tracer(), + }) + } +} + +// ValidateCrossRegionRestore - Validates whether Cross Region Restore can be triggered for DataSource. +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01 +func (client *BackupInstancesClient) validateCrossRegionRestore(ctx context.Context, resourceGroupName string, location string, parameters ValidateCrossRegionRestoreRequestObject, options *BackupInstancesClientBeginValidateCrossRegionRestoreOptions) (*http.Response, error) { + var err error + const operationName = "BackupInstancesClient.BeginValidateCrossRegionRestore" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.validateCrossRegionRestoreCreateRequest(ctx, resourceGroupName, location, parameters, options) + if err != nil { + return nil, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return nil, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK, http.StatusAccepted) { + err = runtime.NewResponseError(httpResp) + return nil, err + } + return httpResp, nil +} + +// validateCrossRegionRestoreCreateRequest creates the ValidateCrossRegionRestore request. +func (client *BackupInstancesClient) validateCrossRegionRestoreCreateRequest(ctx context.Context, resourceGroupName string, location string, parameters ValidateCrossRegionRestoreRequestObject, options *BackupInstancesClientBeginValidateCrossRegionRestoreOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/validateCrossRegionRestore" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1088,7 +1252,7 @@ func (client *BackupInstancesClient) triggerRestoreCreateRequest(ctx context.Con // BeginValidateForBackup - Validate whether adhoc backup will be successful or not // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - parameters - Request body for operation @@ -1101,7 +1265,8 @@ func (client *BackupInstancesClient) BeginValidateForBackup(ctx context.Context, return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientValidateForBackupResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1114,7 +1279,7 @@ func (client *BackupInstancesClient) BeginValidateForBackup(ctx context.Context, // ValidateForBackup - Validate whether adhoc backup will be successful or not // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) validateForBackup(ctx context.Context, resourceGroupName string, vaultName string, parameters ValidateForBackupRequest, options *BackupInstancesClientBeginValidateForBackupOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginValidateForBackup" @@ -1156,7 +1321,7 @@ func (client *BackupInstancesClient) validateForBackupCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1168,7 +1333,7 @@ func (client *BackupInstancesClient) validateForBackupCreateRequest(ctx context. // BeginValidateForRestore - Validates if Restore can be triggered for a DataSource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -1182,7 +1347,8 @@ func (client *BackupInstancesClient) BeginValidateForRestore(ctx context.Context return nil, err } poller, err := runtime.NewPoller(resp, client.internal.Pipeline(), &runtime.NewPollerOptions[BackupInstancesClientValidateForRestoreResponse]{ - Tracer: client.internal.Tracer(), + FinalStateVia: runtime.FinalStateViaLocation, + Tracer: client.internal.Tracer(), }) return poller, err } else { @@ -1195,7 +1361,7 @@ func (client *BackupInstancesClient) BeginValidateForRestore(ctx context.Context // ValidateForRestore - Validates if Restore can be triggered for a DataSource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupInstancesClient) validateForRestore(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters ValidateRestoreRequestObject, options *BackupInstancesClientBeginValidateForRestoreOptions) (*http.Response, error) { var err error const operationName = "BackupInstancesClient.BeginValidateForRestore" @@ -1241,7 +1407,7 @@ func (client *BackupInstancesClient) validateForRestoreCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go index 90073849c4d8..f1c03deee0f8 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupinstances_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ListBackupInstances.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ListBackupInstances.json func ExampleBackupInstancesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -84,7 +84,7 @@ func ExampleBackupInstancesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/GetBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/GetBackupInstance.json func ExampleBackupInstancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -142,7 +142,7 @@ func ExampleBackupInstancesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/PutBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/PutBackupInstance.json func ExampleBackupInstancesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -257,7 +257,7 @@ func ExampleBackupInstancesClient_BeginCreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/DeleteBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/DeleteBackupInstance.json func ExampleBackupInstancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -278,7 +278,7 @@ func ExampleBackupInstancesClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/TriggerBackup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/TriggerBackup.json func ExampleBackupInstancesClient_BeginAdhocBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -313,7 +313,7 @@ func ExampleBackupInstancesClient_BeginAdhocBackup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ValidateForBackup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ValidateForBackup.json func ExampleBackupInstancesClient_BeginValidateForBackup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -374,7 +374,7 @@ func ExampleBackupInstancesClient_BeginValidateForBackup() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/GetBackupInstanceOperationResult.json func ExampleBackupInstancesClient_GetBackupInstanceOperationResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -429,7 +429,145 @@ func ExampleBackupInstancesClient_GetBackupInstanceOperationResult() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/TriggerRehydrate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CrossRegionRestore/TriggerCrossRegionRestore.json +func ExampleBackupInstancesClient_BeginTriggerCrossRegionRestore() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdataprotection.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupInstancesClient().BeginTriggerCrossRegionRestore(ctx, "000pikumar", "EastAsia", armdataprotection.CrossRegionRestoreRequestObject{ + CrossRegionRestoreDetails: &armdataprotection.CrossRegionRestoreDetails{ + SourceBackupInstanceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1"), + SourceRegion: to.Ptr("east asia"), + }, + RestoreRequestObject: &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ + ObjectType: to.Ptr("AzureBackupRecoveryPointBasedRestoreRequest"), + RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ + ObjectType: to.Ptr("RestoreTargetInfo"), + RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), + RestoreLocation: to.Ptr("southeastasia"), + DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ + ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), + SecretStoreResource: &armdataprotection.SecretStoreResource{ + SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), + URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), + }, + }, + DatasourceInfo: &armdataprotection.Datasource{ + DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ObjectType: to.Ptr("Datasource"), + ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb"), + ResourceLocation: to.Ptr(""), + ResourceName: to.Ptr("targetdb"), + ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ResourceURI: to.Ptr(""), + }, + DatasourceSetInfo: &armdataprotection.DatasourceSet{ + DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ObjectType: to.Ptr("DatasourceSet"), + ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), + ResourceLocation: to.Ptr(""), + ResourceName: to.Ptr("viveksipgtest"), + ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), + ResourceURI: to.Ptr(""), + }, + }, + SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), + SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), + RecoveryPointID: to.Ptr("hardcodedRP"), + }, + }, 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.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ + // ObjectType: to.Ptr("OperationJobExtendedInfo"), + // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CrossRegionRestore/ValidateCrossRegionRestore.json +func ExampleBackupInstancesClient_BeginValidateCrossRegionRestore() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdataprotection.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + poller, err := clientFactory.NewBackupInstancesClient().BeginValidateCrossRegionRestore(ctx, "000pikumar", "EastAsia", armdataprotection.ValidateCrossRegionRestoreRequestObject{ + CrossRegionRestoreDetails: &armdataprotection.CrossRegionRestoreDetails{ + SourceBackupInstanceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/000pikumar/providers/Microsoft.DataProtection/backupVaults/PratikPrivatePreviewVault1/BackupInstances/harshitbi1"), + SourceRegion: to.Ptr("east asia"), + }, + RestoreRequestObject: &armdataprotection.AzureBackupRecoveryPointBasedRestoreRequest{ + ObjectType: to.Ptr("AzureBackupRecoveryPointBasedRestoreRequest"), + RestoreTargetInfo: &armdataprotection.RestoreTargetInfo{ + ObjectType: to.Ptr("RestoreTargetInfo"), + RecoveryOption: to.Ptr(armdataprotection.RecoveryOptionFailIfExists), + RestoreLocation: to.Ptr("southeastasia"), + DatasourceAuthCredentials: &armdataprotection.SecretStoreBasedAuthCredentials{ + ObjectType: to.Ptr("SecretStoreBasedAuthCredentials"), + SecretStoreResource: &armdataprotection.SecretStoreResource{ + SecretStoreType: to.Ptr(armdataprotection.SecretStoreTypeAzureKeyVault), + URI: to.Ptr("https://samplevault.vault.azure.net/secrets/credentials"), + }, + }, + DatasourceInfo: &armdataprotection.Datasource{ + DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ObjectType: to.Ptr("Datasource"), + ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/targetdb"), + ResourceLocation: to.Ptr(""), + ResourceName: to.Ptr("targetdb"), + ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ResourceURI: to.Ptr(""), + }, + DatasourceSetInfo: &armdataprotection.DatasourceSet{ + DatasourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + ObjectType: to.Ptr("DatasourceSet"), + ResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest"), + ResourceLocation: to.Ptr(""), + ResourceName: to.Ptr("viveksipgtest"), + ResourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers"), + ResourceURI: to.Ptr(""), + }, + }, + SourceDataStoreType: to.Ptr(armdataprotection.SourceDataStoreTypeVaultStore), + SourceResourceID: to.Ptr("/subscriptions/f75d8d8b-6735-4697-82e1-1a7a3ff0d5d4/resourceGroups/viveksipgtest/providers/Microsoft.DBforPostgreSQL/servers/viveksipgtest/databases/testdb"), + RecoveryPointID: to.Ptr("hardcodedRP"), + }, + }, 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.OperationJobExtendedInfo = armdataprotection.OperationJobExtendedInfo{ + // ObjectType: to.Ptr("OperationJobExtendedInfo"), + // JobID: to.Ptr("c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/TriggerRehydrate.json func ExampleBackupInstancesClient_BeginTriggerRehydrate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -454,7 +592,7 @@ func ExampleBackupInstancesClient_BeginTriggerRehydrate() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/TriggerRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/TriggerRestore.json func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -517,7 +655,7 @@ func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestore() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/TriggerRestoreAsFiles.json func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreAsFiles() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -560,7 +698,7 @@ func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreAsFiles() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/TriggerRestoreWithRehydration.json func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreWithRehydration() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -618,7 +756,7 @@ func ExampleBackupInstancesClient_BeginTriggerRestore_triggerRestoreWithRehydrat // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ResumeBackups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ResumeBackups.json func ExampleBackupInstancesClient_BeginResumeBackups() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -639,7 +777,7 @@ func ExampleBackupInstancesClient_BeginResumeBackups() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ResumeProtection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ResumeProtection.json func ExampleBackupInstancesClient_BeginResumeProtection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -660,7 +798,7 @@ func ExampleBackupInstancesClient_BeginResumeProtection() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/StopProtection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/StopProtection.json func ExampleBackupInstancesClient_BeginStopProtection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -681,7 +819,7 @@ func ExampleBackupInstancesClient_BeginStopProtection() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/SuspendBackups.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/SuspendBackups.json func ExampleBackupInstancesClient_BeginSuspendBackups() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -702,7 +840,7 @@ func ExampleBackupInstancesClient_BeginSuspendBackups() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/SyncBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/SyncBackupInstance.json func ExampleBackupInstancesClient_BeginSyncBackupInstance() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -725,7 +863,7 @@ func ExampleBackupInstancesClient_BeginSyncBackupInstance() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ValidateRestore.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ValidateRestore.json func ExampleBackupInstancesClient_BeginValidateForRestore() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client.go index 653db7c8f06c..17c4033addc3 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client.go @@ -46,7 +46,7 @@ func NewBackupPoliciesClient(subscriptionID string, credential azcore.TokenCrede // CreateOrUpdate - Creates or Updates a backup policy belonging to a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupPolicyName - Name of the policy @@ -99,7 +99,7 @@ func (client *BackupPoliciesClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *BackupPoliciesClient) createOrUpdateHandleResponse(resp *http.Resp // Delete - Deletes a backup policy belonging to a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupPoliciesClientDeleteOptions contains the optional parameters for the BackupPoliciesClient.Delete method. @@ -169,7 +169,7 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -178,7 +178,7 @@ func (client *BackupPoliciesClient) deleteCreateRequest(ctx context.Context, res // Get - Gets a backup policy belonging to a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupPoliciesClientGetOptions contains the optional parameters for the BackupPoliciesClient.Get method. @@ -228,7 +228,7 @@ func (client *BackupPoliciesClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -245,7 +245,7 @@ func (client *BackupPoliciesClient) getHandleResponse(resp *http.Response) (Back // NewListPager - Returns list of backup policies belonging to a backup vault // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupPoliciesClientListOptions contains the optional parameters for the BackupPoliciesClient.NewListPager method. @@ -292,7 +292,7 @@ func (client *BackupPoliciesClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go index 8df22872009f..2edad741d01a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backuppolicies_client_example_test.go @@ -17,10 +17,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/PolicyCRUD/ListBackupPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/PolicyCRUD/ListBackupPolicy.json func ExampleBackupPoliciesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -135,7 +135,7 @@ func ExampleBackupPoliciesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/PolicyCRUD/GetBackupPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/PolicyCRUD/GetBackupPolicy.json func ExampleBackupPoliciesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -242,7 +242,7 @@ func ExampleBackupPoliciesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/PolicyCRUD/CreateOrUpdateBackupPolicy.json func ExampleBackupPoliciesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -430,7 +430,7 @@ func ExampleBackupPoliciesClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/PolicyCRUD/DeleteBackupPolicy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/PolicyCRUD/DeleteBackupPolicy.json func ExampleBackupPoliciesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client.go index d11ab19fa191..0ee1a1acd1d4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client.go @@ -47,7 +47,7 @@ func NewBackupVaultOperationResultsClient(subscriptionID string, credential azco // Get - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupVaultOperationResultsClientGetOptions contains the optional parameters for the BackupVaultOperationResultsClient.Get @@ -98,7 +98,7 @@ func (client *BackupVaultOperationResultsClient) getCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go index 6b0ae60efce5..09245672d32d 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaultoperationresults_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/GetOperationResultPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/GetOperationResultPatch.json func ExampleBackupVaultOperationResultsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client.go index 60175ae2878f..58bedb505621 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client.go @@ -46,7 +46,7 @@ func NewBackupVaultsClient(subscriptionID string, credential azcore.TokenCredent // CheckNameAvailability - API to check for resource name availability // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - location - The location in which uniqueness will be verified. // - parameters - Check name availability request @@ -94,7 +94,7 @@ func (client *BackupVaultsClient) checkNameAvailabilityCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -115,7 +115,7 @@ func (client *BackupVaultsClient) checkNameAvailabilityHandleResponse(resp *http // BeginCreateOrUpdate - Creates or updates a BackupVault resource belonging to a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - parameters - Request body for operation @@ -141,7 +141,7 @@ func (client *BackupVaultsClient) BeginCreateOrUpdate(ctx context.Context, resou // CreateOrUpdate - Creates or updates a BackupVault resource belonging to a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupVaultsClient) createOrUpdate(ctx context.Context, resourceGroupName string, vaultName string, parameters BackupVaultResource, options *BackupVaultsClientBeginCreateOrUpdateOptions) (*http.Response, error) { var err error const operationName = "BackupVaultsClient.BeginCreateOrUpdate" @@ -183,7 +183,7 @@ func (client *BackupVaultsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -195,7 +195,7 @@ func (client *BackupVaultsClient) createOrUpdateCreateRequest(ctx context.Contex // BeginDelete - Deletes a BackupVault resource from the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupVaultsClientBeginDeleteOptions contains the optional parameters for the BackupVaultsClient.BeginDelete @@ -220,7 +220,7 @@ func (client *BackupVaultsClient) BeginDelete(ctx context.Context, resourceGroup // Delete - Deletes a BackupVault resource from the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupVaultsClient) deleteOperation(ctx context.Context, resourceGroupName string, vaultName string, options *BackupVaultsClientBeginDeleteOptions) (*http.Response, error) { var err error const operationName = "BackupVaultsClient.BeginDelete" @@ -262,7 +262,7 @@ func (client *BackupVaultsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -271,7 +271,7 @@ func (client *BackupVaultsClient) deleteCreateRequest(ctx context.Context, resou // Get - Returns a resource belonging to a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - BackupVaultsClientGetOptions contains the optional parameters for the BackupVaultsClient.Get method. @@ -317,7 +317,7 @@ func (client *BackupVaultsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -334,7 +334,7 @@ func (client *BackupVaultsClient) getHandleResponse(resp *http.Response) (Backup // NewGetInResourceGroupPager - Returns resource collection belonging to a resource group. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - BackupVaultsClientGetInResourceGroupOptions contains the optional parameters for the BackupVaultsClient.NewGetInResourceGroupPager // method. @@ -377,7 +377,7 @@ func (client *BackupVaultsClient) getInResourceGroupCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -394,7 +394,7 @@ func (client *BackupVaultsClient) getInResourceGroupHandleResponse(resp *http.Re // NewGetInSubscriptionPager - Returns resource collection belonging to a subscription. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - options - BackupVaultsClientGetInSubscriptionOptions contains the optional parameters for the BackupVaultsClient.NewGetInSubscriptionPager // method. func (client *BackupVaultsClient) NewGetInSubscriptionPager(options *BackupVaultsClientGetInSubscriptionOptions) *runtime.Pager[BackupVaultsClientGetInSubscriptionResponse] { @@ -432,7 +432,7 @@ func (client *BackupVaultsClient) getInSubscriptionCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -450,7 +450,7 @@ func (client *BackupVaultsClient) getInSubscriptionHandleResponse(resp *http.Res // BeginUpdate - Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - parameters - Request body for operation @@ -476,7 +476,7 @@ func (client *BackupVaultsClient) BeginUpdate(ctx context.Context, resourceGroup // Update - Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *BackupVaultsClient) update(ctx context.Context, resourceGroupName string, vaultName string, parameters PatchResourceRequestInput, options *BackupVaultsClientBeginUpdateOptions) (*http.Response, error) { var err error const operationName = "BackupVaultsClient.BeginUpdate" @@ -518,7 +518,7 @@ func (client *BackupVaultsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go index 258872b9c5ec..a4d641f3e5d9 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/backupvaults_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/GetBackupVaultsInSubscription.json func ExampleBackupVaultsClient_NewGetInSubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -110,7 +110,7 @@ func ExampleBackupVaultsClient_NewGetInSubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/GetBackupVaultsInResourceGroup.json func ExampleBackupVaultsClient_NewGetInResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -209,7 +209,7 @@ func ExampleBackupVaultsClient_NewGetInResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/GetBackupVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/GetBackupVault.json func ExampleBackupVaultsClient_Get_getBackupVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -266,7 +266,7 @@ func ExampleBackupVaultsClient_Get_getBackupVault() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/GetBackupVaultWithMSI.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/GetBackupVaultWithMSI.json func ExampleBackupVaultsClient_Get_getBackupVaultWithMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -320,7 +320,7 @@ func ExampleBackupVaultsClient_Get_getBackupVaultWithMsi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/PutBackupVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/PutBackupVault.json func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVault() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -412,7 +412,7 @@ func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVault() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/PutBackupVaultWithMSI.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/PutBackupVaultWithMSI.json func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVaultWithMsi() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -506,7 +506,7 @@ func ExampleBackupVaultsClient_BeginCreateOrUpdate_createBackupVaultWithMsi() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/DeleteBackupVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/DeleteBackupVault.json func ExampleBackupVaultsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -527,7 +527,7 @@ func ExampleBackupVaultsClient_BeginDelete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/PatchBackupVault.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/PatchBackupVault.json func ExampleBackupVaultsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -584,7 +584,7 @@ func ExampleBackupVaultsClient_BeginUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/VaultCRUD/CheckBackupVaultsNameAvailability.json func ExampleBackupVaultsClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/client.go b/sdk/resourcemanager/dataprotection/armdataprotection/client.go index e838472e3142..4426c0dc1d21 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/client.go @@ -46,7 +46,7 @@ func NewClient(subscriptionID string, credential azcore.TokenCredential, options // CheckFeatureSupport - Validates if a feature is supported // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - parameters - Feature support request object // - options - ClientCheckFeatureSupportOptions contains the optional parameters for the Client.CheckFeatureSupport method. func (client *Client) CheckFeatureSupport(ctx context.Context, location string, parameters FeatureValidationRequestBaseClassification, options *ClientCheckFeatureSupportOptions) (ClientCheckFeatureSupportResponse, error) { @@ -87,7 +87,7 @@ func (client *Client) checkFeatureSupportCreateRequest(ctx context.Context, loca return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go index 86b0a330a23d..19cce2d622da 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/CheckfeatureSupport.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CheckfeatureSupport.json func ExampleClient_CheckFeatureSupport() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/client_factory.go b/sdk/resourcemanager/dataprotection/armdataprotection/client_factory.go index 20c1103919e5..923b2f8d9b59 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/client_factory.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/client_factory.go @@ -91,6 +91,24 @@ func (c *ClientFactory) NewExportJobsOperationResultClient() *ExportJobsOperatio return subClient } +// NewFetchCrossRegionRestoreJobClient creates a new instance of FetchCrossRegionRestoreJobClient. +func (c *ClientFactory) NewFetchCrossRegionRestoreJobClient() *FetchCrossRegionRestoreJobClient { + subClient, _ := NewFetchCrossRegionRestoreJobClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewFetchCrossRegionRestoreJobsClient creates a new instance of FetchCrossRegionRestoreJobsClient. +func (c *ClientFactory) NewFetchCrossRegionRestoreJobsClient() *FetchCrossRegionRestoreJobsClient { + subClient, _ := NewFetchCrossRegionRestoreJobsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + +// NewFetchSecondaryRecoveryPointsClient creates a new instance of FetchSecondaryRecoveryPointsClient. +func (c *ClientFactory) NewFetchSecondaryRecoveryPointsClient() *FetchSecondaryRecoveryPointsClient { + subClient, _ := NewFetchSecondaryRecoveryPointsClient(c.subscriptionID, c.credential, c.options) + return subClient +} + // NewJobsClient creates a new instance of JobsClient. func (c *ClientFactory) NewJobsClient() *JobsClient { subClient, _ := NewJobsClient(c.subscriptionID, c.credential, c.options) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/constants.go b/sdk/resourcemanager/dataprotection/armdataprotection/constants.go index 9f3d65815769..fdc7cfd40496 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/constants.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/constants.go @@ -10,7 +10,7 @@ package armdataprotection const ( moduleName = "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection" - moduleVersion = "v2.4.0" + moduleVersion = "v3.0.0" ) type AbsoluteMarker string @@ -345,6 +345,23 @@ func PossibleRecoveryOptionValues() []RecoveryOption { } } +// RecoveryPointCompletionState - Specifies recovery point completeness. Partial (i.e., only some of the intended items were +// backed up), or Completed (i.e., ALL intended items were backed up). +type RecoveryPointCompletionState string + +const ( + RecoveryPointCompletionStateCompleted RecoveryPointCompletionState = "Completed" + RecoveryPointCompletionStatePartial RecoveryPointCompletionState = "Partial" +) + +// PossibleRecoveryPointCompletionStateValues returns the possible values for the RecoveryPointCompletionState const type. +func PossibleRecoveryPointCompletionStateValues() []RecoveryPointCompletionState { + return []RecoveryPointCompletionState{ + RecoveryPointCompletionStateCompleted, + RecoveryPointCompletionStatePartial, + } +} + // RehydrationPriority - Priority to be used for rehydration. Values High or Standard type RehydrationPriority string @@ -416,6 +433,20 @@ func PossibleResourceMoveStateValues() []ResourceMoveState { } } +// ResourcePropertiesObjectType - Type of the specific object - used for deserializing +type ResourcePropertiesObjectType string + +const ( + ResourcePropertiesObjectTypeDefaultResourceProperties ResourcePropertiesObjectType = "DefaultResourceProperties" +) + +// PossibleResourcePropertiesObjectTypeValues returns the possible values for the ResourcePropertiesObjectType const type. +func PossibleResourcePropertiesObjectTypeValues() []ResourcePropertiesObjectType { + return []ResourcePropertiesObjectType{ + ResourcePropertiesObjectTypeDefaultResourceProperties, + } +} + // RestoreSourceDataStoreType - Gets or sets the type of the source data store. type RestoreSourceDataStoreType string diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client.go index 8471de3da995..e074440a91f9 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client.go @@ -46,7 +46,7 @@ func NewDeletedBackupInstancesClient(subscriptionID string, credential azcore.To // Get - Gets a deleted backup instance with name in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the deleted backup instance @@ -98,7 +98,7 @@ func (client *DeletedBackupInstancesClient) getCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -115,7 +115,7 @@ func (client *DeletedBackupInstancesClient) getHandleResponse(resp *http.Respons // NewListPager - Gets deleted backup instances belonging to a backup vault // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - DeletedBackupInstancesClientListOptions contains the optional parameters for the DeletedBackupInstancesClient.NewListPager @@ -163,7 +163,7 @@ func (client *DeletedBackupInstancesClient) listCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -181,7 +181,7 @@ func (client *DeletedBackupInstancesClient) listHandleResponse(resp *http.Respon // BeginUndelete - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the deleted backup instance @@ -207,7 +207,7 @@ func (client *DeletedBackupInstancesClient) BeginUndelete(ctx context.Context, r // Undelete - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *DeletedBackupInstancesClient) undelete(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, options *DeletedBackupInstancesClientBeginUndeleteOptions) (*http.Response, error) { var err error const operationName = "DeletedBackupInstancesClient.BeginUndelete" @@ -253,7 +253,7 @@ func (client *DeletedBackupInstancesClient) undeleteCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go index 570fc2e6f478..bdf1f6ed20d9 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/deletedbackupinstances_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/DeletedBackupInstanceOperations/ListDeletedBackupInstances.json func ExampleDeletedBackupInstancesClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -85,7 +85,7 @@ func ExampleDeletedBackupInstancesClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/DeletedBackupInstanceOperations/GetDeletedBackupInstance.json func ExampleDeletedBackupInstancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -145,7 +145,7 @@ func ExampleDeletedBackupInstancesClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/DeletedBackupInstanceOperations/UndeleteDeletedBackupInstance.json func ExampleDeletedBackupInstancesClient_BeginUndelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go index 460cc4514e6f..98c8699acb3c 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client.go @@ -46,7 +46,7 @@ func NewDppResourceGuardProxyClient(subscriptionID string, credential azcore.Tok // CreateOrUpdate - Creates or Updates a ResourceGuardProxy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - resourceGuardProxyName - name of the resource guard proxy @@ -99,7 +99,7 @@ func (client *DppResourceGuardProxyClient) createOrUpdateCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -120,7 +120,7 @@ func (client *DppResourceGuardProxyClient) createOrUpdateHandleResponse(resp *ht // Delete - Deletes the ResourceGuardProxy // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - resourceGuardProxyName - name of the resource guard proxy @@ -171,7 +171,7 @@ func (client *DppResourceGuardProxyClient) deleteCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -180,7 +180,7 @@ func (client *DppResourceGuardProxyClient) deleteCreateRequest(ctx context.Conte // Get - Returns the ResourceGuardProxy object associated with the vault, and that matches the name in the request // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - resourceGuardProxyName - name of the resource guard proxy @@ -232,7 +232,7 @@ func (client *DppResourceGuardProxyClient) getCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -249,7 +249,7 @@ func (client *DppResourceGuardProxyClient) getHandleResponse(resp *http.Response // NewListPager - Returns the list of ResourceGuardProxies associated with the vault // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - DppResourceGuardProxyClientListOptions contains the optional parameters for the DppResourceGuardProxyClient.NewListPager @@ -297,7 +297,7 @@ func (client *DppResourceGuardProxyClient) listCreateRequest(ctx context.Context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -315,7 +315,7 @@ func (client *DppResourceGuardProxyClient) listHandleResponse(resp *http.Respons // UnlockDelete - UnlockDelete call for ResourceGuardProxy, executed before one can delete it // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - resourceGuardProxyName - name of the resource guard proxy @@ -368,7 +368,7 @@ func (client *DppResourceGuardProxyClient) unlockDeleteCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client_example_test.go index aa51eb9f6a5e..6b12ab7226a3 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/dppresourceguardproxy_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json func ExampleDppResourceGuardProxyClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -65,7 +65,7 @@ func ExampleDppResourceGuardProxyClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json func ExampleDppResourceGuardProxyClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -104,7 +104,7 @@ func ExampleDppResourceGuardProxyClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json func ExampleDppResourceGuardProxyClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -147,7 +147,7 @@ func ExampleDppResourceGuardProxyClient_CreateOrUpdate() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json func ExampleDppResourceGuardProxyClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -164,7 +164,7 @@ func ExampleDppResourceGuardProxyClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json func ExampleDppResourceGuardProxyClient_UnlockDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client.go index 1a5ace162438..01656e3ad197 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client.go @@ -46,7 +46,7 @@ func NewExportJobsClient(subscriptionID string, credential azcore.TokenCredentia // BeginTrigger - Triggers export of jobs and returns an OperationID to track. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - ExportJobsClientBeginTriggerOptions contains the optional parameters for the ExportJobsClient.BeginTrigger method. @@ -71,7 +71,7 @@ func (client *ExportJobsClient) BeginTrigger(ctx context.Context, resourceGroupN // Trigger - Triggers export of jobs and returns an OperationID to track. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 func (client *ExportJobsClient) trigger(ctx context.Context, resourceGroupName string, vaultName string, options *ExportJobsClientBeginTriggerOptions) (*http.Response, error) { var err error const operationName = "ExportJobsClient.BeginTrigger" @@ -113,7 +113,7 @@ func (client *ExportJobsClient) triggerCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go index a32b697c436a..5a672fe9e030 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobs_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/JobCRUD/TriggerExportJobs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/JobCRUD/TriggerExportJobs.json func ExampleExportJobsClient_BeginTrigger() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client.go index 33743c4310c7..2ac6b3afd18a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client.go @@ -48,7 +48,7 @@ func NewExportJobsOperationResultClient(subscriptionID string, credential azcore // jobs in JSON serialized format. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - operationID - OperationID which represents the export job. @@ -100,7 +100,7 @@ func (client *ExportJobsOperationResultClient) getCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go index 77bf9c1d347a..4eb33b355eb2 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/exportjobsoperationresult_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/JobCRUD/GetExportJobsOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/JobCRUD/GetExportJobsOperationResult.json func ExampleExportJobsOperationResultClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupinstances_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupinstances_server.go index ec850a16678c..29876430dc56 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupinstances_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupinstances_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" @@ -68,6 +68,10 @@ type BackupInstancesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginSyncBackupInstance func(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters armdataprotection.SyncBackupInstanceRequest, options *armdataprotection.BackupInstancesClientBeginSyncBackupInstanceOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientSyncBackupInstanceResponse], errResp azfake.ErrorResponder) + // BeginTriggerCrossRegionRestore is the fake for method BackupInstancesClient.BeginTriggerCrossRegionRestore + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginTriggerCrossRegionRestore func(ctx context.Context, resourceGroupName string, location string, parameters armdataprotection.CrossRegionRestoreRequestObject, options *armdataprotection.BackupInstancesClientBeginTriggerCrossRegionRestoreOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerCrossRegionRestoreResponse], errResp azfake.ErrorResponder) + // BeginTriggerRehydrate is the fake for method BackupInstancesClient.BeginTriggerRehydrate // HTTP status codes to indicate success: http.StatusAccepted, http.StatusNoContent BeginTriggerRehydrate func(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters armdataprotection.AzureBackupRehydrationRequest, options *armdataprotection.BackupInstancesClientBeginTriggerRehydrateOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRehydrateResponse], errResp azfake.ErrorResponder) @@ -76,6 +80,10 @@ type BackupInstancesServer struct { // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginTriggerRestore func(ctx context.Context, resourceGroupName string, vaultName string, backupInstanceName string, parameters armdataprotection.AzureBackupRestoreRequestClassification, options *armdataprotection.BackupInstancesClientBeginTriggerRestoreOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRestoreResponse], errResp azfake.ErrorResponder) + // BeginValidateCrossRegionRestore is the fake for method BackupInstancesClient.BeginValidateCrossRegionRestore + // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted + BeginValidateCrossRegionRestore func(ctx context.Context, resourceGroupName string, location string, parameters armdataprotection.ValidateCrossRegionRestoreRequestObject, options *armdataprotection.BackupInstancesClientBeginValidateCrossRegionRestoreOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateCrossRegionRestoreResponse], errResp azfake.ErrorResponder) + // BeginValidateForBackup is the fake for method BackupInstancesClient.BeginValidateForBackup // HTTP status codes to indicate success: http.StatusOK, http.StatusAccepted BeginValidateForBackup func(ctx context.Context, resourceGroupName string, vaultName string, parameters armdataprotection.ValidateForBackupRequest, options *armdataprotection.BackupInstancesClientBeginValidateForBackupOptions) (resp azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForBackupResponse], errResp azfake.ErrorResponder) @@ -90,40 +98,44 @@ type BackupInstancesServer struct { // azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewBackupInstancesServerTransport(srv *BackupInstancesServer) *BackupInstancesServerTransport { return &BackupInstancesServerTransport{ - srv: srv, - beginAdhocBackup: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientAdhocBackupResponse]](), - beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientCreateOrUpdateResponse]](), - beginDelete: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientDeleteResponse]](), - newListPager: newTracker[azfake.PagerResponder[armdataprotection.BackupInstancesClientListResponse]](), - beginResumeBackups: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeBackupsResponse]](), - beginResumeProtection: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeProtectionResponse]](), - beginStopProtection: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientStopProtectionResponse]](), - beginSuspendBackups: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSuspendBackupsResponse]](), - beginSyncBackupInstance: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSyncBackupInstanceResponse]](), - beginTriggerRehydrate: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRehydrateResponse]](), - beginTriggerRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRestoreResponse]](), - beginValidateForBackup: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForBackupResponse]](), - beginValidateForRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForRestoreResponse]](), + srv: srv, + beginAdhocBackup: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientAdhocBackupResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armdataprotection.BackupInstancesClientListResponse]](), + beginResumeBackups: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeBackupsResponse]](), + beginResumeProtection: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeProtectionResponse]](), + beginStopProtection: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientStopProtectionResponse]](), + beginSuspendBackups: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSuspendBackupsResponse]](), + beginSyncBackupInstance: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSyncBackupInstanceResponse]](), + beginTriggerCrossRegionRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerCrossRegionRestoreResponse]](), + beginTriggerRehydrate: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRehydrateResponse]](), + beginTriggerRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRestoreResponse]](), + beginValidateCrossRegionRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateCrossRegionRestoreResponse]](), + beginValidateForBackup: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForBackupResponse]](), + beginValidateForRestore: newTracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForRestoreResponse]](), } } // BackupInstancesServerTransport connects instances of armdataprotection.BackupInstancesClient to instances of BackupInstancesServer. // Don't use this type directly, use NewBackupInstancesServerTransport instead. type BackupInstancesServerTransport struct { - srv *BackupInstancesServer - beginAdhocBackup *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientAdhocBackupResponse]] - beginCreateOrUpdate *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientCreateOrUpdateResponse]] - beginDelete *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientDeleteResponse]] - newListPager *tracker[azfake.PagerResponder[armdataprotection.BackupInstancesClientListResponse]] - beginResumeBackups *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeBackupsResponse]] - beginResumeProtection *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeProtectionResponse]] - beginStopProtection *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientStopProtectionResponse]] - beginSuspendBackups *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSuspendBackupsResponse]] - beginSyncBackupInstance *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSyncBackupInstanceResponse]] - beginTriggerRehydrate *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRehydrateResponse]] - beginTriggerRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRestoreResponse]] - beginValidateForBackup *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForBackupResponse]] - beginValidateForRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForRestoreResponse]] + srv *BackupInstancesServer + beginAdhocBackup *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientAdhocBackupResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armdataprotection.BackupInstancesClientListResponse]] + beginResumeBackups *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeBackupsResponse]] + beginResumeProtection *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientResumeProtectionResponse]] + beginStopProtection *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientStopProtectionResponse]] + beginSuspendBackups *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSuspendBackupsResponse]] + beginSyncBackupInstance *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientSyncBackupInstanceResponse]] + beginTriggerCrossRegionRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerCrossRegionRestoreResponse]] + beginTriggerRehydrate *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRehydrateResponse]] + beginTriggerRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientTriggerRestoreResponse]] + beginValidateCrossRegionRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateCrossRegionRestoreResponse]] + beginValidateForBackup *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForBackupResponse]] + beginValidateForRestore *tracker[azfake.PollerResponder[armdataprotection.BackupInstancesClientValidateForRestoreResponse]] } // Do implements the policy.Transporter interface for BackupInstancesServerTransport. @@ -160,10 +172,14 @@ func (b *BackupInstancesServerTransport) Do(req *http.Request) (*http.Response, resp, err = b.dispatchBeginSuspendBackups(req) case "BackupInstancesClient.BeginSyncBackupInstance": resp, err = b.dispatchBeginSyncBackupInstance(req) + case "BackupInstancesClient.BeginTriggerCrossRegionRestore": + resp, err = b.dispatchBeginTriggerCrossRegionRestore(req) case "BackupInstancesClient.BeginTriggerRehydrate": resp, err = b.dispatchBeginTriggerRehydrate(req) case "BackupInstancesClient.BeginTriggerRestore": resp, err = b.dispatchBeginTriggerRestore(req) + case "BackupInstancesClient.BeginValidateCrossRegionRestore": + resp, err = b.dispatchBeginValidateCrossRegionRestore(req) case "BackupInstancesClient.BeginValidateForBackup": resp, err = b.dispatchBeginValidateForBackup(req) case "BackupInstancesClient.BeginValidateForRestore": @@ -694,6 +710,54 @@ func (b *BackupInstancesServerTransport) dispatchBeginSyncBackupInstance(req *ht return resp, nil } +func (b *BackupInstancesServerTransport) dispatchBeginTriggerCrossRegionRestore(req *http.Request) (*http.Response, error) { + if b.srv.BeginTriggerCrossRegionRestore == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginTriggerCrossRegionRestore not implemented")} + } + beginTriggerCrossRegionRestore := b.beginTriggerCrossRegionRestore.get(req) + if beginTriggerCrossRegionRestore == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataProtection/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/crossRegionRestore` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdataprotection.CrossRegionRestoreRequestObject](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginTriggerCrossRegionRestore(req.Context(), resourceGroupNameParam, locationParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginTriggerCrossRegionRestore = &respr + b.beginTriggerCrossRegionRestore.add(req, beginTriggerCrossRegionRestore) + } + + resp, err := server.PollerResponderNext(beginTriggerCrossRegionRestore, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginTriggerCrossRegionRestore.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginTriggerCrossRegionRestore) { + b.beginTriggerCrossRegionRestore.remove(req) + } + + return resp, nil +} + func (b *BackupInstancesServerTransport) dispatchBeginTriggerRehydrate(req *http.Request) (*http.Response, error) { if b.srv.BeginTriggerRehydrate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginTriggerRehydrate not implemented")} @@ -802,6 +866,54 @@ func (b *BackupInstancesServerTransport) dispatchBeginTriggerRestore(req *http.R return resp, nil } +func (b *BackupInstancesServerTransport) dispatchBeginValidateCrossRegionRestore(req *http.Request) (*http.Response, error) { + if b.srv.BeginValidateCrossRegionRestore == nil { + return nil, &nonRetriableError{errors.New("fake for method BeginValidateCrossRegionRestore not implemented")} + } + beginValidateCrossRegionRestore := b.beginValidateCrossRegionRestore.get(req) + if beginValidateCrossRegionRestore == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataProtection/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/validateCrossRegionRestore` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdataprotection.ValidateCrossRegionRestoreRequestObject](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + respr, errRespr := b.srv.BeginValidateCrossRegionRestore(req.Context(), resourceGroupNameParam, locationParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + beginValidateCrossRegionRestore = &respr + b.beginValidateCrossRegionRestore.add(req, beginValidateCrossRegionRestore) + } + + resp, err := server.PollerResponderNext(beginValidateCrossRegionRestore, req) + if err != nil { + return nil, err + } + + if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + b.beginValidateCrossRegionRestore.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} + } + if !server.PollerResponderMore(beginValidateCrossRegionRestore) { + b.beginValidateCrossRegionRestore.remove(req) + } + + return resp, nil +} + func (b *BackupInstancesServerTransport) dispatchBeginValidateForBackup(req *http.Request) (*http.Response, error) { if b.srv.BeginValidateForBackup == nil { return nil, &nonRetriableError{errors.New("fake for method BeginValidateForBackup not implemented")} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backuppolicies_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backuppolicies_server.go index 3f17e723affa..4946ca547bcc 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backuppolicies_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backuppolicies_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaultoperationresults_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaultoperationresults_server.go index ddc02308aca2..3c3ed1447052 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaultoperationresults_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaultoperationresults_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaults_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaults_server.go index 24ed16ab18a6..6336a7b04c7c 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaults_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/backupvaults_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/deletedbackupinstances_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/deletedbackupinstances_server.go index cab8f23d38da..a934bc486e0f 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/deletedbackupinstances_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/deletedbackupinstances_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/dppresourceguardproxy_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/dppresourceguardproxy_server.go index 1fb98618e4e0..0ea82e8c7423 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/dppresourceguardproxy_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/dppresourceguardproxy_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobs_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobs_server.go index e8f65e96b728..51fcecdd9afe 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobs_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobs_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobsoperationresult_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobsoperationresult_server.go index 7ea5fe7f4cc9..710227b6c1cc 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobsoperationresult_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/exportjobsoperationresult_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejob_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejob_server.go new file mode 100644 index 000000000000..198cb288abca --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejob_server.go @@ -0,0 +1,104 @@ +//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 fake + +import ( + "context" + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" + "net/http" + "net/url" + "regexp" +) + +// FetchCrossRegionRestoreJobServer is a fake server for instances of the armdataprotection.FetchCrossRegionRestoreJobClient type. +type FetchCrossRegionRestoreJobServer struct { + // Get is the fake for method FetchCrossRegionRestoreJobClient.Get + // HTTP status codes to indicate success: http.StatusOK + Get func(ctx context.Context, resourceGroupName string, location string, parameters armdataprotection.CrossRegionRestoreJobRequest, options *armdataprotection.FetchCrossRegionRestoreJobClientGetOptions) (resp azfake.Responder[armdataprotection.FetchCrossRegionRestoreJobClientGetResponse], errResp azfake.ErrorResponder) +} + +// NewFetchCrossRegionRestoreJobServerTransport creates a new instance of FetchCrossRegionRestoreJobServerTransport with the provided implementation. +// The returned FetchCrossRegionRestoreJobServerTransport instance is connected to an instance of armdataprotection.FetchCrossRegionRestoreJobClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFetchCrossRegionRestoreJobServerTransport(srv *FetchCrossRegionRestoreJobServer) *FetchCrossRegionRestoreJobServerTransport { + return &FetchCrossRegionRestoreJobServerTransport{srv: srv} +} + +// FetchCrossRegionRestoreJobServerTransport connects instances of armdataprotection.FetchCrossRegionRestoreJobClient to instances of FetchCrossRegionRestoreJobServer. +// Don't use this type directly, use NewFetchCrossRegionRestoreJobServerTransport instead. +type FetchCrossRegionRestoreJobServerTransport struct { + srv *FetchCrossRegionRestoreJobServer +} + +// Do implements the policy.Transporter interface for FetchCrossRegionRestoreJobServerTransport. +func (f *FetchCrossRegionRestoreJobServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FetchCrossRegionRestoreJobClient.Get": + resp, err = f.dispatchGet(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FetchCrossRegionRestoreJobServerTransport) dispatchGet(req *http.Request) (*http.Response, error) { + if f.srv.Get == nil { + return nil, &nonRetriableError{errors.New("fake for method Get not implemented")} + } + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataProtection/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fetchCrossRegionRestoreJob` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + body, err := server.UnmarshalRequestAsJSON[armdataprotection.CrossRegionRestoreJobRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + respr, errRespr := f.srv.Get(req.Context(), resourceGroupNameParam, locationParam, body, nil) + if respErr := server.GetError(errRespr, req); respErr != nil { + return nil, respErr + } + respContent := server.GetResponseContent(respr) + if !contains([]int{http.StatusOK}, respContent.HTTPStatus) { + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", respContent.HTTPStatus)} + } + resp, err := server.MarshalResponseAsJSON(respContent, server.GetResponse(respr).AzureBackupJobResource, req) + if err != nil { + return nil, err + } + return resp, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejobs_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejobs_server.go new file mode 100644 index 000000000000..1c311e6e97c5 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchcrossregionrestorejobs_server.go @@ -0,0 +1,128 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" + "net/http" + "net/url" + "regexp" +) + +// FetchCrossRegionRestoreJobsServer is a fake server for instances of the armdataprotection.FetchCrossRegionRestoreJobsClient type. +type FetchCrossRegionRestoreJobsServer struct { + // NewListPager is the fake for method FetchCrossRegionRestoreJobsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, location string, parameters armdataprotection.CrossRegionRestoreJobsRequest, options *armdataprotection.FetchCrossRegionRestoreJobsClientListOptions) (resp azfake.PagerResponder[armdataprotection.FetchCrossRegionRestoreJobsClientListResponse]) +} + +// NewFetchCrossRegionRestoreJobsServerTransport creates a new instance of FetchCrossRegionRestoreJobsServerTransport with the provided implementation. +// The returned FetchCrossRegionRestoreJobsServerTransport instance is connected to an instance of armdataprotection.FetchCrossRegionRestoreJobsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFetchCrossRegionRestoreJobsServerTransport(srv *FetchCrossRegionRestoreJobsServer) *FetchCrossRegionRestoreJobsServerTransport { + return &FetchCrossRegionRestoreJobsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armdataprotection.FetchCrossRegionRestoreJobsClientListResponse]](), + } +} + +// FetchCrossRegionRestoreJobsServerTransport connects instances of armdataprotection.FetchCrossRegionRestoreJobsClient to instances of FetchCrossRegionRestoreJobsServer. +// Don't use this type directly, use NewFetchCrossRegionRestoreJobsServerTransport instead. +type FetchCrossRegionRestoreJobsServerTransport struct { + srv *FetchCrossRegionRestoreJobsServer + newListPager *tracker[azfake.PagerResponder[armdataprotection.FetchCrossRegionRestoreJobsClientListResponse]] +} + +// Do implements the policy.Transporter interface for FetchCrossRegionRestoreJobsServerTransport. +func (f *FetchCrossRegionRestoreJobsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FetchCrossRegionRestoreJobsClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FetchCrossRegionRestoreJobsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataProtection/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fetchCrossRegionRestoreJobs` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + body, err := server.UnmarshalRequestAsJSON[armdataprotection.CrossRegionRestoreJobsRequest](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + var options *armdataprotection.FetchCrossRegionRestoreJobsClientListOptions + if filterParam != nil { + options = &armdataprotection.FetchCrossRegionRestoreJobsClientListOptions{ + Filter: filterParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, locationParam, body, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdataprotection.FetchCrossRegionRestoreJobsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchsecondaryrecoverypoints_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchsecondaryrecoverypoints_server.go new file mode 100644 index 000000000000..ce3deca7743b --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/fetchsecondaryrecoverypoints_server.go @@ -0,0 +1,134 @@ +//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 fake + +import ( + "errors" + "fmt" + azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" + "net/http" + "net/url" + "regexp" +) + +// FetchSecondaryRecoveryPointsServer is a fake server for instances of the armdataprotection.FetchSecondaryRecoveryPointsClient type. +type FetchSecondaryRecoveryPointsServer struct { + // NewListPager is the fake for method FetchSecondaryRecoveryPointsClient.NewListPager + // HTTP status codes to indicate success: http.StatusOK + NewListPager func(resourceGroupName string, location string, parameters armdataprotection.FetchSecondaryRPsRequestParameters, options *armdataprotection.FetchSecondaryRecoveryPointsClientListOptions) (resp azfake.PagerResponder[armdataprotection.FetchSecondaryRecoveryPointsClientListResponse]) +} + +// NewFetchSecondaryRecoveryPointsServerTransport creates a new instance of FetchSecondaryRecoveryPointsServerTransport with the provided implementation. +// The returned FetchSecondaryRecoveryPointsServerTransport instance is connected to an instance of armdataprotection.FetchSecondaryRecoveryPointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. +func NewFetchSecondaryRecoveryPointsServerTransport(srv *FetchSecondaryRecoveryPointsServer) *FetchSecondaryRecoveryPointsServerTransport { + return &FetchSecondaryRecoveryPointsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armdataprotection.FetchSecondaryRecoveryPointsClientListResponse]](), + } +} + +// FetchSecondaryRecoveryPointsServerTransport connects instances of armdataprotection.FetchSecondaryRecoveryPointsClient to instances of FetchSecondaryRecoveryPointsServer. +// Don't use this type directly, use NewFetchSecondaryRecoveryPointsServerTransport instead. +type FetchSecondaryRecoveryPointsServerTransport struct { + srv *FetchSecondaryRecoveryPointsServer + newListPager *tracker[azfake.PagerResponder[armdataprotection.FetchSecondaryRecoveryPointsClientListResponse]] +} + +// Do implements the policy.Transporter interface for FetchSecondaryRecoveryPointsServerTransport. +func (f *FetchSecondaryRecoveryPointsServerTransport) Do(req *http.Request) (*http.Response, error) { + rawMethod := req.Context().Value(runtime.CtxAPINameKey{}) + method, ok := rawMethod.(string) + if !ok { + return nil, nonRetriableError{errors.New("unable to dispatch request, missing value for CtxAPINameKey")} + } + + var resp *http.Response + var err error + + switch method { + case "FetchSecondaryRecoveryPointsClient.NewListPager": + resp, err = f.dispatchNewListPager(req) + default: + err = fmt.Errorf("unhandled API %s", method) + } + + if err != nil { + return nil, err + } + + return resp, nil +} + +func (f *FetchSecondaryRecoveryPointsServerTransport) dispatchNewListPager(req *http.Request) (*http.Response, error) { + if f.srv.NewListPager == nil { + return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} + } + newListPager := f.newListPager.get(req) + if newListPager == nil { + const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft\.DataProtection/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/fetchSecondaryRecoveryPoints` + regex := regexp.MustCompile(regexStr) + matches := regex.FindStringSubmatch(req.URL.EscapedPath()) + if matches == nil || len(matches) < 3 { + return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) + } + qp := req.URL.Query() + body, err := server.UnmarshalRequestAsJSON[armdataprotection.FetchSecondaryRPsRequestParameters](req) + if err != nil { + return nil, err + } + resourceGroupNameParam, err := url.PathUnescape(matches[regex.SubexpIndex("resourceGroupName")]) + if err != nil { + return nil, err + } + locationParam, err := url.PathUnescape(matches[regex.SubexpIndex("location")]) + if err != nil { + return nil, err + } + filterUnescaped, err := url.QueryUnescape(qp.Get("$filter")) + if err != nil { + return nil, err + } + filterParam := getOptional(filterUnescaped) + skipTokenUnescaped, err := url.QueryUnescape(qp.Get("$skipToken")) + if err != nil { + return nil, err + } + skipTokenParam := getOptional(skipTokenUnescaped) + var options *armdataprotection.FetchSecondaryRecoveryPointsClientListOptions + if filterParam != nil || skipTokenParam != nil { + options = &armdataprotection.FetchSecondaryRecoveryPointsClientListOptions{ + Filter: filterParam, + SkipToken: skipTokenParam, + } + } + resp := f.srv.NewListPager(resourceGroupNameParam, locationParam, body, options) + newListPager = &resp + f.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armdataprotection.FetchSecondaryRecoveryPointsClientListResponse, createLink func() string) { + page.NextLink = to.Ptr(createLink()) + }) + } + resp, err := server.PagerResponderNext(newListPager, req) + if err != nil { + return nil, err + } + if !contains([]int{http.StatusOK}, resp.StatusCode) { + f.newListPager.remove(req) + return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} + } + if !server.PagerResponderMore(newListPager) { + f.newListPager.remove(req) + } + return resp, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/jobs_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/jobs_server.go index 628d1ef633c6..11226bacd85e 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/jobs_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/jobs_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationresult_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationresult_server.go index a0aad3e64261..43c3e9f6f38b 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationresult_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationresult_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operations_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operations_server.go index 5f4d8f1cafe1..2cc8388afb57 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operations_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operations_server.go @@ -15,7 +15,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" ) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatus_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatus_server.go index 58d3fd477637..726c390e01a0 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatus_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatus_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusbackupvaultcontext_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusbackupvaultcontext_server.go index 2882d69b48d8..24d7a20f3bf5 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusbackupvaultcontext_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusbackupvaultcontext_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusresourcegroupcontext_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusresourcegroupcontext_server.go index 4fae784f7d8f..411d884dbe6c 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusresourcegroupcontext_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/operationstatusresourcegroupcontext_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/polymorphic_helpers.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/polymorphic_helpers.go index 6fa90c166be8..9da1e2abead5 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/polymorphic_helpers.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/polymorphic_helpers.go @@ -10,7 +10,7 @@ package fake import ( "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) func unmarshalAzureBackupRestoreRequestClassification(rawMsg json.RawMessage) (armdataprotection.AzureBackupRestoreRequestClassification, error) { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/recoverypoints_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/recoverypoints_server.go index c2f142113a27..8bc14dcf1d52 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/recoverypoints_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/recoverypoints_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/resourceguards_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/resourceguards_server.go index eb4acbc676ee..afcaa88b5f0a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/resourceguards_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/resourceguards_server.go @@ -16,7 +16,7 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" "github.com/Azure/azure-sdk-for-go/sdk/azcore/to" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/restorabletimeranges_server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/restorabletimeranges_server.go index c8f21f2662f8..3674462780f0 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/restorabletimeranges_server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/restorabletimeranges_server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/server.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/server.go index af070c21e012..93e8bb3580e5 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/server.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/server.go @@ -15,7 +15,7 @@ import ( azfake "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake" "github.com/Azure/azure-sdk-for-go/sdk/azcore/fake/server" "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" "net/http" "net/url" "regexp" diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fake/server_factory.go b/sdk/resourcemanager/dataprotection/armdataprotection/fake/server_factory.go index 33a6b56628a0..d4a5333845fd 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/fake/server_factory.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fake/server_factory.go @@ -28,6 +28,9 @@ type ServerFactory struct { DppResourceGuardProxyServer DppResourceGuardProxyServer ExportJobsServer ExportJobsServer ExportJobsOperationResultServer ExportJobsOperationResultServer + FetchCrossRegionRestoreJobServer FetchCrossRegionRestoreJobServer + FetchCrossRegionRestoreJobsServer FetchCrossRegionRestoreJobsServer + FetchSecondaryRecoveryPointsServer FetchSecondaryRecoveryPointsServer JobsServer JobsServer OperationResultServer OperationResultServer OperationStatusBackupVaultContextServer OperationStatusBackupVaultContextServer @@ -62,6 +65,9 @@ type ServerFactoryTransport struct { trDppResourceGuardProxyServer *DppResourceGuardProxyServerTransport trExportJobsServer *ExportJobsServerTransport trExportJobsOperationResultServer *ExportJobsOperationResultServerTransport + trFetchCrossRegionRestoreJobServer *FetchCrossRegionRestoreJobServerTransport + trFetchCrossRegionRestoreJobsServer *FetchCrossRegionRestoreJobsServerTransport + trFetchSecondaryRecoveryPointsServer *FetchSecondaryRecoveryPointsServerTransport trJobsServer *JobsServerTransport trOperationResultServer *OperationResultServerTransport trOperationStatusBackupVaultContextServer *OperationStatusBackupVaultContextServerTransport @@ -125,6 +131,21 @@ func (s *ServerFactoryTransport) Do(req *http.Request) (*http.Response, error) { return NewExportJobsOperationResultServerTransport(&s.srv.ExportJobsOperationResultServer) }) resp, err = s.trExportJobsOperationResultServer.Do(req) + case "FetchCrossRegionRestoreJobClient": + initServer(s, &s.trFetchCrossRegionRestoreJobServer, func() *FetchCrossRegionRestoreJobServerTransport { + return NewFetchCrossRegionRestoreJobServerTransport(&s.srv.FetchCrossRegionRestoreJobServer) + }) + resp, err = s.trFetchCrossRegionRestoreJobServer.Do(req) + case "FetchCrossRegionRestoreJobsClient": + initServer(s, &s.trFetchCrossRegionRestoreJobsServer, func() *FetchCrossRegionRestoreJobsServerTransport { + return NewFetchCrossRegionRestoreJobsServerTransport(&s.srv.FetchCrossRegionRestoreJobsServer) + }) + resp, err = s.trFetchCrossRegionRestoreJobsServer.Do(req) + case "FetchSecondaryRecoveryPointsClient": + initServer(s, &s.trFetchSecondaryRecoveryPointsServer, func() *FetchSecondaryRecoveryPointsServerTransport { + return NewFetchSecondaryRecoveryPointsServerTransport(&s.srv.FetchSecondaryRecoveryPointsServer) + }) + resp, err = s.trFetchSecondaryRecoveryPointsServer.Do(req) case "JobsClient": initServer(s, &s.trJobsServer, func() *JobsServerTransport { return NewJobsServerTransport(&s.srv.JobsServer) }) resp, err = s.trJobsServer.Do(req) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client.go new file mode 100644 index 000000000000..d267ad651f03 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client.go @@ -0,0 +1,113 @@ +//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 armdataprotection + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// FetchCrossRegionRestoreJobClient contains the methods for the FetchCrossRegionRestoreJob group. +// Don't use this type directly, use NewFetchCrossRegionRestoreJobClient() instead. +type FetchCrossRegionRestoreJobClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFetchCrossRegionRestoreJobClient creates a new instance of FetchCrossRegionRestoreJobClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFetchCrossRegionRestoreJobClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FetchCrossRegionRestoreJobClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FetchCrossRegionRestoreJobClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// Get - Fetches the Cross Region Restore Job +// If the operation fails it returns an *azcore.ResponseError type. +// +// Generated from API version 2023-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The name of the Azure region. +// - parameters - Request body for operation +// - options - FetchCrossRegionRestoreJobClientGetOptions contains the optional parameters for the FetchCrossRegionRestoreJobClient.Get +// method. +func (client *FetchCrossRegionRestoreJobClient) Get(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreJobRequest, options *FetchCrossRegionRestoreJobClientGetOptions) (FetchCrossRegionRestoreJobClientGetResponse, error) { + var err error + const operationName = "FetchCrossRegionRestoreJobClient.Get" + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, operationName) + ctx, endSpan := runtime.StartSpan(ctx, operationName, client.internal.Tracer(), nil) + defer func() { endSpan(err) }() + req, err := client.getCreateRequest(ctx, resourceGroupName, location, parameters, options) + if err != nil { + return FetchCrossRegionRestoreJobClientGetResponse{}, err + } + httpResp, err := client.internal.Pipeline().Do(req) + if err != nil { + return FetchCrossRegionRestoreJobClientGetResponse{}, err + } + if !runtime.HasStatusCode(httpResp, http.StatusOK) { + err = runtime.NewResponseError(httpResp) + return FetchCrossRegionRestoreJobClientGetResponse{}, err + } + resp, err := client.getHandleResponse(httpResp) + return resp, err +} + +// getCreateRequest creates the Get request. +func (client *FetchCrossRegionRestoreJobClient) getCreateRequest(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreJobRequest, options *FetchCrossRegionRestoreJobClientGetOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJob" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-01") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// getHandleResponse handles the Get response. +func (client *FetchCrossRegionRestoreJobClient) getHandleResponse(resp *http.Response) (FetchCrossRegionRestoreJobClientGetResponse, error) { + result := FetchCrossRegionRestoreJobClientGetResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureBackupJobResource); err != nil { + return FetchCrossRegionRestoreJobClientGetResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client_example_test.go new file mode 100644 index 000000000000..4d87ede30880 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejob_client_example_test.go @@ -0,0 +1,86 @@ +//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 armdataprotection_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/dataprotection/armdataprotection/v3" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CrossRegionRestore/FetchCrossRegionRestoreJob.json +func ExampleFetchCrossRegionRestoreJobClient_Get() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdataprotection.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + res, err := clientFactory.NewFetchCrossRegionRestoreJobClient().Get(ctx, "BugBash1", "west us", armdataprotection.CrossRegionRestoreJobRequest{ + JobID: to.Ptr("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + SourceBackupVaultID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11"), + SourceRegion: to.Ptr("east us"), + }, 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.AzureBackupJobResource = armdataprotection.AzureBackupJobResource{ + // Name: to.Ptr("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), + // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // Properties: &armdataprotection.AzureBackupJob{ + // ActivityID: to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), + // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb2"), + // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/28460a9d-707a-45f3-ace6-b16284c2900e"), + // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb2"), + // DataSourceLocation: to.Ptr("east us"), + // DataSourceName: to.Ptr("bugbashdb2"), + // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), + // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + // Duration: to.Ptr("00:00:00"), + // ExtendedInfo: &armdataprotection.JobExtendedInfo{ + // AdditionalDetails: map[string]*string{ + // "PolicyRuleName": to.Ptr("BackupWeekly"), + // "RetentionTag": to.Ptr("Default"), + // "TaskId": to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), + // }, + // SubTasks: []*armdataprotection.JobSubTask{ + // { + // TaskID: to.Ptr[int32](1), + // TaskName: to.Ptr("Trigger Backup"), + // TaskStatus: to.Ptr("Started"), + // }}, + // }, + // IsUserTriggered: to.Ptr(false), + // Operation: to.Ptr("Backup"), + // OperationCategory: to.Ptr("Backup"), + // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetdailypolicy"), + // PolicyName: to.Ptr("jakavetdailypolicy"), + // ProgressEnabled: to.Ptr(false), + // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), + // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T03:00:03.760Z"); return t}()), + // Status: to.Ptr("Started"), + // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // SupportedActions: []*string{ + // }, + // VaultName: to.Ptr("BugBashVaultForCCYv11"), + // }, + // } +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client.go new file mode 100644 index 000000000000..17da70e988f6 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client.go @@ -0,0 +1,116 @@ +//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 armdataprotection + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// FetchCrossRegionRestoreJobsClient contains the methods for the FetchCrossRegionRestoreJobs group. +// Don't use this type directly, use NewFetchCrossRegionRestoreJobsClient() instead. +type FetchCrossRegionRestoreJobsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFetchCrossRegionRestoreJobsClient creates a new instance of FetchCrossRegionRestoreJobsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFetchCrossRegionRestoreJobsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FetchCrossRegionRestoreJobsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FetchCrossRegionRestoreJobsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Fetches list of Cross Region Restore job belonging to the vault +// +// Generated from API version 2023-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The name of the Azure region. +// - parameters - Request body for operation +// - options - FetchCrossRegionRestoreJobsClientListOptions contains the optional parameters for the FetchCrossRegionRestoreJobsClient.NewListPager +// method. +func (client *FetchCrossRegionRestoreJobsClient) NewListPager(resourceGroupName string, location string, parameters CrossRegionRestoreJobsRequest, options *FetchCrossRegionRestoreJobsClientListOptions) *runtime.Pager[FetchCrossRegionRestoreJobsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FetchCrossRegionRestoreJobsClientListResponse]{ + More: func(page FetchCrossRegionRestoreJobsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FetchCrossRegionRestoreJobsClientListResponse) (FetchCrossRegionRestoreJobsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FetchCrossRegionRestoreJobsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, location, parameters, options) + }, nil) + if err != nil { + return FetchCrossRegionRestoreJobsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FetchCrossRegionRestoreJobsClient) listCreateRequest(ctx context.Context, resourceGroupName string, location string, parameters CrossRegionRestoreJobsRequest, options *FetchCrossRegionRestoreJobsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchCrossRegionRestoreJobs" + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FetchCrossRegionRestoreJobsClient) listHandleResponse(resp *http.Response) (FetchCrossRegionRestoreJobsClientListResponse, error) { + result := FetchCrossRegionRestoreJobsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureBackupJobResourceList); err != nil { + return FetchCrossRegionRestoreJobsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client_example_test.go new file mode 100644 index 000000000000..cb4d38a461b9 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchcrossregionrestorejobs_client_example_test.go @@ -0,0 +1,171 @@ +//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 armdataprotection_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/dataprotection/armdataprotection/v3" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CrossRegionRestore/FetchCrossRegionRestoreJobs.json +func ExampleFetchCrossRegionRestoreJobsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdataprotection.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFetchCrossRegionRestoreJobsClient().NewListPager("BugBash1", "east us", armdataprotection.CrossRegionRestoreJobsRequest{ + SourceBackupVaultID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11"), + SourceRegion: to.Ptr("east us"), + }, &armdataprotection.FetchCrossRegionRestoreJobsClientListOptions{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.AzureBackupJobResourceList = armdataprotection.AzureBackupJobResourceList{ + // Value: []*armdataprotection.AzureBackupJobResource{ + // { + // Name: to.Ptr("8989416e-7573-4836-8cf1-0e90954f1002"), + // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), + // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/8989416e-7573-4836-8cf1-0e90954f1002"), + // Properties: &armdataprotection.AzureBackupJob{ + // ActivityID: to.Ptr("932925c4-3d81-4550-8105-c7f7b0a934c5"), + // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb4"), + // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/3048870f-b1b7-44c4-b078-368da3fd000e"), + // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb4"), + // DataSourceLocation: to.Ptr("centraluseuap"), + // DataSourceName: to.Ptr("bugbashdb4"), + // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), + // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + // Duration: to.Ptr("00:00:00"), + // IsUserTriggered: to.Ptr(false), + // Operation: to.Ptr("Backup"), + // OperationCategory: to.Ptr("Backup"), + // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy2"), + // PolicyName: to.Ptr("jakavetPolicy2"), + // ProgressEnabled: to.Ptr(false), + // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), + // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-16T05:00:08.174Z"); return t}()), + // Status: to.Ptr("Started"), + // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // SupportedActions: []*string{ + // }, + // VaultName: to.Ptr("BugBashVaultForCCYv11"), + // }, + // }, + // { + // Name: to.Ptr("ad218c05-242a-47c2-b7b7-c16bd0f8870c"), + // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), + // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/ad218c05-242a-47c2-b7b7-c16bd0f8870c"), + // Properties: &armdataprotection.AzureBackupJob{ + // ActivityID: to.Ptr("b4f32e03-ded0-46fc-9afc-91853878efcd"), + // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb5"), + // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/943c60db-c033-4d93-bb00-66048474e00e"), + // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb5"), + // DataSourceLocation: to.Ptr("centraluseuap"), + // DataSourceName: to.Ptr("bugbashdb5"), + // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), + // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + // Duration: to.Ptr("00:00:00"), + // IsUserTriggered: to.Ptr(false), + // Operation: to.Ptr("Backup"), + // OperationCategory: to.Ptr("Backup"), + // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy3"), + // PolicyName: to.Ptr("jakavetPolicy3"), + // ProgressEnabled: to.Ptr(false), + // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), + // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-16T18:00:03.666Z"); return t}()), + // Status: to.Ptr("Started"), + // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // SupportedActions: []*string{ + // }, + // VaultName: to.Ptr("BugBashVaultForCCYv11"), + // }, + // }, + // { + // Name: to.Ptr("3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), + // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/3c60cb49-63e8-4b21-b9bd-26277b3fdfae"), + // Properties: &armdataprotection.AzureBackupJob{ + // ActivityID: to.Ptr("c4344fb4-7c11-43a4-8307-7ae7c7fb09b9"), + // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb2"), + // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/28460a9d-707a-45f3-ace6-b16284c2900e"), + // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb2"), + // DataSourceLocation: to.Ptr("centraluseuap"), + // DataSourceName: to.Ptr("bugbashdb2"), + // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), + // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + // Duration: to.Ptr("00:00:00"), + // IsUserTriggered: to.Ptr(false), + // Operation: to.Ptr("Backup"), + // OperationCategory: to.Ptr("Backup"), + // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetdailypolicy"), + // PolicyName: to.Ptr("jakavetdailypolicy"), + // ProgressEnabled: to.Ptr(false), + // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), + // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T03:00:03.760Z"); return t}()), + // Status: to.Ptr("Started"), + // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // SupportedActions: []*string{ + // }, + // VaultName: to.Ptr("BugBashVaultForCCYv11"), + // }, + // }, + // { + // Name: to.Ptr("43252662-1b43-44fd-a856-0055665cb097"), + // Type: to.Ptr("Microsoft.DataProtection/Backupvaults/backupJobs"), + // ID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/Backupvaults/BugBashVaultForCCYv11/backupJobs/43252662-1b43-44fd-a856-0055665cb097"), + // Properties: &armdataprotection.AzureBackupJob{ + // ActivityID: to.Ptr("94052cf1-a47f-4c1b-93e7-79e07b2bd008-Tue Mar 17 2021 11:11:48 GMT+0530 (India Standard Time)-Ibz"), + // BackupInstanceFriendlyName: to.Ptr("mabtestingccybasicv11\\bugbashdb3"), + // BackupInstanceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupInstances/0b247869-b8be-4885-b832-8ac4cdf5b00e"), + // DataSourceID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/DppPostgresTestingCcy/providers/Microsoft.DBforPostgreSQL/servers/mabtestingccybasicv11/databases/bugbashdb3"), + // DataSourceLocation: to.Ptr("centraluseuap"), + // DataSourceName: to.Ptr("bugbashdb3"), + // DataSourceSetName: to.Ptr("mabtestingccybasicv11"), + // DataSourceType: to.Ptr("Microsoft.DBforPostgreSQL/servers/databases"), + // Duration: to.Ptr("00:02:11.9724387"), + // EndTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T11:14:02.531Z"); return t}()), + // IsUserTriggered: to.Ptr(true), + // Operation: to.Ptr("Backup"), + // OperationCategory: to.Ptr("Backup"), + // PolicyID: to.Ptr("/subscriptions/62b829ee-7936-40c9-a1c9-47a93f9f3965/resourceGroups/BugBash1/providers/Microsoft.DataProtection/backupVaults/BugBashVaultForCCYv11/backupPolicies/jakavetPolicy1"), + // PolicyName: to.Ptr("jakavetPolicy1"), + // ProgressEnabled: to.Ptr(false), + // SourceResourceGroup: to.Ptr("DppPostgresTestingCcy"), + // SourceSubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // StartTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2021-03-17T11:11:50.559Z"); return t}()), + // Status: to.Ptr("Succeeded"), + // SubscriptionID: to.Ptr("62b829ee-7936-40c9-a1c9-47a93f9f3965"), + // SupportedActions: []*string{ + // to.Ptr("")}, + // VaultName: to.Ptr("BugBashVaultForCCYv11"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client.go new file mode 100644 index 000000000000..4d84662244b5 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client.go @@ -0,0 +1,120 @@ +//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 armdataprotection + +import ( + "context" + "errors" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "net/http" + "net/url" + "strings" +) + +// FetchSecondaryRecoveryPointsClient contains the methods for the FetchSecondaryRecoveryPoints group. +// Don't use this type directly, use NewFetchSecondaryRecoveryPointsClient() instead. +type FetchSecondaryRecoveryPointsClient struct { + internal *arm.Client + subscriptionID string +} + +// NewFetchSecondaryRecoveryPointsClient creates a new instance of FetchSecondaryRecoveryPointsClient with the specified values. +// - subscriptionID - The ID of the target subscription. The value must be an UUID. +// - credential - used to authorize requests. Usually a credential from azidentity. +// - options - pass nil to accept the default values. +func NewFetchSecondaryRecoveryPointsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*FetchSecondaryRecoveryPointsClient, error) { + cl, err := arm.NewClient(moduleName, moduleVersion, credential, options) + if err != nil { + return nil, err + } + client := &FetchSecondaryRecoveryPointsClient{ + subscriptionID: subscriptionID, + internal: cl, + } + return client, nil +} + +// NewListPager - Returns a list of Secondary Recovery Points for a DataSource in a vault, that can be used for Cross Region +// Restore. +// +// Generated from API version 2023-11-01 +// - resourceGroupName - The name of the resource group. The name is case insensitive. +// - location - The name of the Azure region. +// - parameters - Request body for operation +// - options - FetchSecondaryRecoveryPointsClientListOptions contains the optional parameters for the FetchSecondaryRecoveryPointsClient.NewListPager +// method. +func (client *FetchSecondaryRecoveryPointsClient) NewListPager(resourceGroupName string, location string, parameters FetchSecondaryRPsRequestParameters, options *FetchSecondaryRecoveryPointsClientListOptions) *runtime.Pager[FetchSecondaryRecoveryPointsClientListResponse] { + return runtime.NewPager(runtime.PagingHandler[FetchSecondaryRecoveryPointsClientListResponse]{ + More: func(page FetchSecondaryRecoveryPointsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 + }, + Fetcher: func(ctx context.Context, page *FetchSecondaryRecoveryPointsClientListResponse) (FetchSecondaryRecoveryPointsClientListResponse, error) { + ctx = context.WithValue(ctx, runtime.CtxAPINameKey{}, "FetchSecondaryRecoveryPointsClient.NewListPager") + nextLink := "" + if page != nil { + nextLink = *page.NextLink + } + resp, err := runtime.FetcherForNextLink(ctx, client.internal.Pipeline(), nextLink, func(ctx context.Context) (*policy.Request, error) { + return client.listCreateRequest(ctx, resourceGroupName, location, parameters, options) + }, nil) + if err != nil { + return FetchSecondaryRecoveryPointsClientListResponse{}, err + } + return client.listHandleResponse(resp) + }, + Tracer: client.internal.Tracer(), + }) +} + +// listCreateRequest creates the List request. +func (client *FetchSecondaryRecoveryPointsClient) listCreateRequest(ctx context.Context, resourceGroupName string, location string, parameters FetchSecondaryRPsRequestParameters, options *FetchSecondaryRecoveryPointsClientListOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/locations/{location}/fetchSecondaryRecoveryPoints" + if client.subscriptionID == "" { + return nil, errors.New("parameter client.subscriptionID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{subscriptionId}", url.PathEscape(client.subscriptionID)) + if resourceGroupName == "" { + return nil, errors.New("parameter resourceGroupName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{resourceGroupName}", url.PathEscape(resourceGroupName)) + if location == "" { + return nil, errors.New("parameter location cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{location}", url.PathEscape(location)) + req, err := runtime.NewRequest(ctx, http.MethodPost, runtime.JoinPaths(client.internal.Endpoint(), urlPath)) + if err != nil { + return nil, err + } + reqQP := req.Raw().URL.Query() + reqQP.Set("api-version", "2023-11-01") + if options != nil && options.Filter != nil { + reqQP.Set("$filter", *options.Filter) + } + if options != nil && options.SkipToken != nil { + reqQP.Set("$skipToken", *options.SkipToken) + } + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header["Accept"] = []string{"application/json"} + if err := runtime.MarshalAsJSON(req, parameters); err != nil { + return nil, err + } + return req, nil +} + +// listHandleResponse handles the List response. +func (client *FetchSecondaryRecoveryPointsClient) listHandleResponse(resp *http.Response) (FetchSecondaryRecoveryPointsClientListResponse, error) { + result := FetchSecondaryRecoveryPointsClientListResponse{} + if err := runtime.UnmarshalAsJSON(resp, &result.AzureBackupRecoveryPointResourceList); err != nil { + return FetchSecondaryRecoveryPointsClientListResponse{}, err + } + return result, nil +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client_example_test.go new file mode 100644 index 000000000000..9227c59c00c3 --- /dev/null +++ b/sdk/resourcemanager/dataprotection/armdataprotection/fetchsecondaryrecoverypoints_client_example_test.go @@ -0,0 +1,101 @@ +//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 armdataprotection_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/dataprotection/armdataprotection/v3" +) + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/CrossRegionRestore/FetchSecondaryRPs.json +func ExampleFetchSecondaryRecoveryPointsClient_NewListPager() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + } + ctx := context.Background() + clientFactory, err := armdataprotection.NewClientFactory("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + } + pager := clientFactory.NewFetchSecondaryRecoveryPointsClient().NewListPager("000pikumar", "WestUS", armdataprotection.FetchSecondaryRPsRequestParameters{ + SourceBackupInstanceID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34"), + SourceRegion: to.Ptr("EastUS"), + }, &armdataprotection.FetchSecondaryRecoveryPointsClientListOptions{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.AzureBackupRecoveryPointResourceList = armdataprotection.AzureBackupRecoveryPointResourceList{ + // Value: []*armdataprotection.AzureBackupRecoveryPointResource{ + // { + // Name: to.Ptr("7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5e35"), + // Type: to.Ptr("microsoft.dataprotection/backupvaults/backupInstances/recoveryPoints"), + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34/recoveryPoints/7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), + // Properties: &armdataprotection.AzureBackupDiscreteRecoveryPoint{ + // ObjectType: to.Ptr("AzureBackupDiscreteRecoveryPoint"), + // ExpiryTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2023-03-01T13:00:00.000Z"); return t}()), + // FriendlyName: to.Ptr("panbha4"), + // RecoveryPointDataStoresDetails: []*armdataprotection.RecoveryPointDataStoreDetails{ + // { + // Type: to.Ptr("Snapshot"), + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // ID: to.Ptr("0ff03512-b333-4509-a6c7-12164c8b1dce"), + // MetaData: to.Ptr("123456"), + // }, + // { + // Type: to.Ptr("BackupStorage"), + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // ID: to.Ptr("5d8cfd30-722e-4bab-85f6-4a9d01ffc6f1"), + // MetaData: to.Ptr("123456"), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // RecoveryPointType: to.Ptr("Full"), + // }, + // }, + // { + // Name: to.Ptr("7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), + // Type: to.Ptr("microsoft.dataprotection/backupvaults/backupInstances/recoveryPoints"), + // ID: to.Ptr("/subscriptions/04cf684a-d41f-4550-9f70-7708a3a2283b/resourceGroups/HelloTest/providers/Microsoft.DataProtection/backupVaults/HelloTestVault/backupInstances/653213d-c5b3-44f6-a0d9-db3c4f9d8e34/recoveryPoints/7fb2cddd-c5b3-44f6-a0d9-db3c4f9d5f25"), + // Properties: &armdataprotection.AzureBackupDiscreteRecoveryPoint{ + // ObjectType: to.Ptr("AzureBackupDiscreteRecoveryPoint"), + // FriendlyName: to.Ptr("panbha4"), + // RecoveryPointDataStoresDetails: []*armdataprotection.RecoveryPointDataStoreDetails{ + // { + // Type: to.Ptr("Snapshot"), + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // ID: to.Ptr("808cfd30-722e-4bab-85f6-4a9d01ffc6f2"), + // MetaData: to.Ptr("123456"), + // }, + // { + // Type: to.Ptr("BackupStorage"), + // CreationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // ID: to.Ptr("798cfd30-722e-4bab-85f6-4a9d01ffc6f3"), + // MetaData: to.Ptr("123456"), + // }}, + // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), + // RecoveryPointType: to.Ptr("Full"), + // }, + // }}, + // } + } +} diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod index 8323f71f5feb..aa8ac8ac5b78 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.mod +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.mod @@ -1,10 +1,11 @@ -module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2 +module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3 go 1.18 require ( github.com/Azure/azure-sdk-for-go/sdk/azcore v1.9.0 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 + github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2 v2.4.0 ) require ( diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum index 7985f1da436f..103f7bc7887f 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/go.sum +++ b/sdk/resourcemanager/dataprotection/armdataprotection/go.sum @@ -4,6 +4,8 @@ github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0 h1:BMAjVKJM0U/CYF27gA0ZM github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.4.0/go.mod h1:1fXstnBMas5kzG+S3q8UoJcmyU6nUeunJcMDHcRYHhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0 h1:d81/ng9rET2YqdVkVwkb6EXeRrLJIwyGnJcAlAWKwhs= github.com/Azure/azure-sdk-for-go/sdk/internal v1.5.0/go.mod h1:s4kgfzA0covAXNicZHDMN58jExvcng2mC/DepXiF1EI= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2 v2.4.0 h1:FaeGze9Jb68rw4DAHTuA7pNHOU43kMLe1hFgg5VXQsQ= +github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2 v2.4.0/go.mod h1:VYwros1l9KigmAY7/DnDsKI+Zs1ugXjCec2KnoGyN1k= github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1 h1:WpB/QDNLpMw72xHJc34BNNykqSOeEJDAWkhf0u12/Jk= github.com/AzureAD/microsoft-authentication-library-for-go v1.1.1/go.mod h1:wP83P5OoQ5p6ip3ScPr0BAq0BvuPAvacpEuSzyouqAI= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/interfaces.go b/sdk/resourcemanager/dataprotection/armdataprotection/interfaces.go index 85de148de6ae..9156f01015dd 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/interfaces.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/interfaces.go @@ -94,7 +94,7 @@ type BasePolicyRuleClassification interface { // BaseResourcePropertiesClassification provides polymorphic access to related types. // Call the interface's GetBaseResourceProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *BaseResourceProperties +// - *BaseResourceProperties, *DefaultResourceProperties type BaseResourcePropertiesClassification interface { // GetBaseResourceProperties returns the BaseResourceProperties content of the underlying type. GetBaseResourceProperties() *BaseResourceProperties @@ -148,8 +148,8 @@ type FeatureValidationResponseBaseClassification interface { // ItemLevelRestoreCriteriaClassification provides polymorphic access to related types. // Call the interface's GetItemLevelRestoreCriteria() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: -// - *ItemLevelRestoreCriteria, *ItemPathBasedRestoreCriteria, *KubernetesClusterRestoreCriteria, *KubernetesPVRestoreCriteria, -// - *KubernetesStorageClassRestoreCriteria, *RangeBasedItemLevelRestoreCriteria +// - *ItemLevelRestoreCriteria, *ItemPathBasedRestoreCriteria, *KubernetesClusterRestoreCriteria, *KubernetesClusterVaultTierRestoreCriteria, +// - *KubernetesPVRestoreCriteria, *KubernetesStorageClassRestoreCriteria, *RangeBasedItemLevelRestoreCriteria type ItemLevelRestoreCriteriaClassification interface { // GetItemLevelRestoreCriteria returns the ItemLevelRestoreCriteria content of the underlying type. GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client.go index 0676ff0e64a0..33356aefed42 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client.go @@ -46,7 +46,7 @@ func NewJobsClient(subscriptionID string, credential azcore.TokenCredential, opt // Get - Gets a job with id in a backup vault // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - jobID - The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). @@ -97,7 +97,7 @@ func (client *JobsClient) getCreateRequest(ctx context.Context, resourceGroupNam return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -114,7 +114,7 @@ func (client *JobsClient) getHandleResponse(resp *http.Response) (JobsClientGetR // NewListPager - Returns list of jobs belonging to a backup vault // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - JobsClientListOptions contains the optional parameters for the JobsClient.NewListPager method. @@ -161,7 +161,7 @@ func (client *JobsClient) listCreateRequest(ctx context.Context, resourceGroupNa return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go index c0d98fbf4043..3a084fc02e84 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/jobs_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/JobCRUD/ListJobs.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/JobCRUD/ListJobs.json func ExampleJobsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -166,7 +166,7 @@ func ExampleJobsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/JobCRUD/GetJob.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/JobCRUD/GetJob.json func ExampleJobsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/models.go b/sdk/resourcemanager/dataprotection/armdataprotection/models.go index 8b7cf3e29105..483ac27da525 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/models.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/models.go @@ -84,9 +84,13 @@ type AzureBackupDiscreteRecoveryPoint struct { PolicyVersion *string RecoveryPointDataStoresDetails []*RecoveryPointDataStoreDetails RecoveryPointID *string - RecoveryPointType *string - RetentionTagName *string - RetentionTagVersion *string + + // Specifies recovery point completeness. Partial (i.e., only some of the intended items were backed up), or Completed (i.e., + // ALL intended items were backed up). + RecoveryPointState *RecoveryPointCompletionState + RecoveryPointType *string + RetentionTagName *string + RetentionTagVersion *string // READ-ONLY ExpiryTime *time.Time @@ -689,6 +693,9 @@ type BackupVault struct { // Monitoring Settings MonitoringSettings *MonitoringSettings + // List of replicated regions for Backup Vault + ReplicatedRegions []*string + // Security Settings SecuritySettings *SecuritySettings @@ -801,7 +808,7 @@ func (b *BasePolicyRule) GetBasePolicyRule() *BasePolicyRule { return b } // BaseResourceProperties - Properties which are specific to datasource/datasourceSets type BaseResourceProperties struct { // REQUIRED; Type of the specific object - used for deserializing - ObjectType *string + ObjectType *ResourcePropertiesObjectType } // GetBaseResourceProperties implements the BaseResourcePropertiesClassification interface for type BaseResourceProperties. @@ -932,6 +939,45 @@ type CopyOption struct { // GetCopyOption implements the CopyOptionClassification interface for type CopyOption. func (c *CopyOption) GetCopyOption() *CopyOption { return c } +// CrossRegionRestoreDetails - Cross Region Restore details +type CrossRegionRestoreDetails struct { + // REQUIRED + SourceBackupInstanceID *string + + // REQUIRED + SourceRegion *string +} + +// CrossRegionRestoreJobRequest - Details of CRR Job to be fetched +type CrossRegionRestoreJobRequest struct { + // REQUIRED + JobID *string + + // REQUIRED + SourceBackupVaultID *string + + // REQUIRED + SourceRegion *string +} + +// CrossRegionRestoreJobsRequest - Details of Backup Vault for which CRR Jobs are to be fetched +type CrossRegionRestoreJobsRequest struct { + // REQUIRED + SourceBackupVaultID *string + + // REQUIRED + SourceRegion *string +} + +// CrossRegionRestoreRequestObject - Cross Region Restore Request Object +type CrossRegionRestoreRequestObject struct { + // REQUIRED; Cross region restore details. + CrossRegionRestoreDetails *CrossRegionRestoreDetails + + // REQUIRED; Gets or sets the restore request object. + RestoreRequestObject AzureBackupRestoreRequestClassification +} + type CrossRegionRestoreSettings struct { // CrossRegionRestore state State *CrossRegionRestoreState @@ -1045,6 +1091,19 @@ type Day struct { IsLast *bool } +// DefaultResourceProperties - Default source properties +type DefaultResourceProperties struct { + // REQUIRED; Type of the specific object - used for deserializing + ObjectType *ResourcePropertiesObjectType +} + +// GetBaseResourceProperties implements the BaseResourcePropertiesClassification interface for type DefaultResourceProperties. +func (d *DefaultResourceProperties) GetBaseResourceProperties() *BaseResourceProperties { + return &BaseResourceProperties{ + ObjectType: d.ObjectType, + } +} + // DeleteOption - Delete Option type DeleteOption struct { // REQUIRED; Duration of deletion after given timespan @@ -1311,6 +1370,31 @@ type ErrorAdditionalInfo struct { Type *string } +// ErrorDetail - The error detail. +type ErrorDetail struct { + // READ-ONLY; The error additional info. + AdditionalInfo []*ErrorAdditionalInfo + + // READ-ONLY; The error code. + Code *string + + // READ-ONLY; The error details. + Details []*ErrorDetail + + // READ-ONLY; The error message. + Message *string + + // READ-ONLY; The error target. + Target *string +} + +// ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. +// (This also follows the OData error response format.). +type ErrorResponse struct { + // The error object. + Error *ErrorDetail +} + // ExportJobsResult - The result for export jobs containing blob details. type ExportJobsResult struct { // READ-ONLY; SAS key to access the blob. @@ -1394,6 +1478,16 @@ func (f *FeatureValidationResponseBase) GetFeatureValidationResponseBase() *Feat return f } +// FetchSecondaryRPsRequestParameters - Information about BI whose secondary RecoveryPoints are requested Source region and +// BI ARM path +type FetchSecondaryRPsRequestParameters struct { + // ARM Path of BackupInstance + SourceBackupInstanceID *string + + // Source region in which BackupInstance is located + SourceRegion *string +} + type IdentityDetails struct { // Specifies if the BI is protected by System Identity. UseSystemAssignedIdentity *bool @@ -1520,6 +1614,9 @@ type JobExtendedInfo struct { // READ-ONLY; Details of the Target Recovery Point TargetRecoverPoint *RestoreJobRecoveryPointDetails + + // READ-ONLY; A List, detailing the warnings related to the job + WarningDetails []*UserFacingWarningDetail } // JobSubTask - Details of Job's Sub Task @@ -1624,6 +1721,60 @@ func (k *KubernetesClusterRestoreCriteria) GetItemLevelRestoreCriteria() *ItemLe } } +// KubernetesClusterVaultTierRestoreCriteria - kubernetes Cluster Backup target info for restore operation from vault +type KubernetesClusterVaultTierRestoreCriteria struct { + // REQUIRED; Gets or sets the include cluster resources property. This property if enabled will include cluster scope resources + // during restore from vault. + IncludeClusterScopeResources *bool + + // REQUIRED; Type of the specific object - used for deserializing + ObjectType *string + + // Gets or sets the Conflict Policy property. This property sets policy during conflict of resources during restore from vault. + ConflictPolicy *ExistingResourcePolicy + + // Gets or sets the exclude namespaces property. This property sets the namespaces to be excluded during restore from vault. + ExcludedNamespaces []*string + + // Gets or sets the exclude resource types property. This property sets the resource types to be excluded during restore from + // vault. + ExcludedResourceTypes []*string + + // Gets or sets the include namespaces property. This property sets the namespaces to be included during restore from vault. + IncludedNamespaces []*string + + // Gets or sets the include resource types property. This property sets the resource types to be included during restore from + // vault. + IncludedResourceTypes []*string + + // Gets or sets the LabelSelectors property. This property sets the resource with such label selectors to be included during + // restore from vault. + LabelSelectors []*string + + // Gets or sets the Namespace Mappings property. This property sets if namespace needs to be change during restore from vault. + NamespaceMappings map[string]*string + + // Gets or sets the PV (Persistent Volume) Restore Mode property. This property sets whether volumes needs to be restored + // from vault. + PersistentVolumeRestoreMode *PersistentVolumeRestoreMode + + // Gets or sets the restore hook references. This property sets the hook reference to be executed during restore from vault. + RestoreHookReferences []*NamespacedNameResource + + // Gets or sets the staging RG Id for creating staging disks and snapshots during restore from vault. + StagingResourceGroupID *string + + // Gets or sets the staging Storage Account Id for creating backup extension object store data during restore from vault. + StagingStorageAccountID *string +} + +// GetItemLevelRestoreCriteria implements the ItemLevelRestoreCriteriaClassification interface for type KubernetesClusterVaultTierRestoreCriteria. +func (k *KubernetesClusterVaultTierRestoreCriteria) GetItemLevelRestoreCriteria() *ItemLevelRestoreCriteria { + return &ItemLevelRestoreCriteria{ + ObjectType: k.ObjectType, + } +} + // KubernetesPVRestoreCriteria - Item Level kubernetes persistent volume target info for restore operation type KubernetesPVRestoreCriteria struct { // REQUIRED; Type of the specific object - used for deserializing @@ -1691,7 +1842,7 @@ type OperationJobExtendedInfo struct { // REQUIRED; This property will be used as the discriminator for deciding the specific types in the polymorphic chain of types. ObjectType *string - // Arm Id of the job created for this operation. + // Name or Arm Id of the job created for this operation. JobID *string } @@ -2307,6 +2458,24 @@ type UserFacingError struct { Target *string } +// UserFacingWarningDetail - Warning object used by layers that have access to localized content, and propagate that to user +type UserFacingWarningDetail struct { + // REQUIRED; Error details for the warning. + Warning *UserFacingError + + // Name of resource for which warning is raised. + ResourceName *string +} + +// ValidateCrossRegionRestoreRequestObject - Cross Region Restore Request Object +type ValidateCrossRegionRestoreRequestObject struct { + // REQUIRED; Cross region restore details. + CrossRegionRestoreDetails *CrossRegionRestoreDetails + + // REQUIRED; Gets or sets the restore request object. + RestoreRequestObject AzureBackupRestoreRequestClassification +} + // ValidateForBackupRequest - Validate for backup request type ValidateForBackupRequest struct { // REQUIRED; Backup Instance diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go b/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go index ce47ae8f9ae7..68cc66e9cd7a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/models_serde.go @@ -200,6 +200,7 @@ func (a AzureBackupDiscreteRecoveryPoint) MarshalJSON() ([]byte, error) { populate(objectMap, "policyVersion", a.PolicyVersion) populate(objectMap, "recoveryPointDataStoresDetails", a.RecoveryPointDataStoresDetails) populate(objectMap, "recoveryPointId", a.RecoveryPointID) + populate(objectMap, "recoveryPointState", a.RecoveryPointState) populateDateTimeRFC3339(objectMap, "recoveryPointTime", a.RecoveryPointTime) populate(objectMap, "recoveryPointType", a.RecoveryPointType) populate(objectMap, "retentionTagName", a.RetentionTagName) @@ -237,6 +238,9 @@ func (a *AzureBackupDiscreteRecoveryPoint) UnmarshalJSON(data []byte) error { case "recoveryPointId": err = unpopulate(val, "RecoveryPointID", &a.RecoveryPointID) delete(rawMsg, key) + case "recoveryPointState": + err = unpopulate(val, "RecoveryPointState", &a.RecoveryPointState) + delete(rawMsg, key) case "recoveryPointTime": err = unpopulateDateTimeRFC3339(val, "RecoveryPointTime", &a.RecoveryPointTime) delete(rawMsg, key) @@ -1448,6 +1452,7 @@ func (b BackupVault) MarshalJSON() ([]byte, error) { populate(objectMap, "isVaultProtectedByResourceGuard", b.IsVaultProtectedByResourceGuard) populate(objectMap, "monitoringSettings", b.MonitoringSettings) populate(objectMap, "provisioningState", b.ProvisioningState) + populate(objectMap, "replicatedRegions", b.ReplicatedRegions) populate(objectMap, "resourceMoveDetails", b.ResourceMoveDetails) populate(objectMap, "resourceMoveState", b.ResourceMoveState) populate(objectMap, "secureScore", b.SecureScore) @@ -1477,6 +1482,9 @@ func (b *BackupVault) UnmarshalJSON(data []byte) error { case "provisioningState": err = unpopulate(val, "ProvisioningState", &b.ProvisioningState) delete(rawMsg, key) + case "replicatedRegions": + err = unpopulate(val, "ReplicatedRegions", &b.ReplicatedRegions) + delete(rawMsg, key) case "resourceMoveDetails": err = unpopulate(val, "ResourceMoveDetails", &b.ResourceMoveDetails) delete(rawMsg, key) @@ -2106,6 +2114,134 @@ func (c *CopyOption) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type CrossRegionRestoreDetails. +func (c CrossRegionRestoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceBackupInstanceId", c.SourceBackupInstanceID) + populate(objectMap, "sourceRegion", c.SourceRegion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CrossRegionRestoreDetails. +func (c *CrossRegionRestoreDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceBackupInstanceId": + err = unpopulate(val, "SourceBackupInstanceID", &c.SourceBackupInstanceID) + delete(rawMsg, key) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &c.SourceRegion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CrossRegionRestoreJobRequest. +func (c CrossRegionRestoreJobRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "jobId", c.JobID) + populate(objectMap, "sourceBackupVaultId", c.SourceBackupVaultID) + populate(objectMap, "sourceRegion", c.SourceRegion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CrossRegionRestoreJobRequest. +func (c *CrossRegionRestoreJobRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "jobId": + err = unpopulate(val, "JobID", &c.JobID) + delete(rawMsg, key) + case "sourceBackupVaultId": + err = unpopulate(val, "SourceBackupVaultID", &c.SourceBackupVaultID) + delete(rawMsg, key) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &c.SourceRegion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CrossRegionRestoreJobsRequest. +func (c CrossRegionRestoreJobsRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceBackupVaultId", c.SourceBackupVaultID) + populate(objectMap, "sourceRegion", c.SourceRegion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CrossRegionRestoreJobsRequest. +func (c *CrossRegionRestoreJobsRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceBackupVaultId": + err = unpopulate(val, "SourceBackupVaultID", &c.SourceBackupVaultID) + delete(rawMsg, key) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &c.SourceRegion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type CrossRegionRestoreRequestObject. +func (c CrossRegionRestoreRequestObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "crossRegionRestoreDetails", c.CrossRegionRestoreDetails) + populate(objectMap, "restoreRequestObject", c.RestoreRequestObject) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CrossRegionRestoreRequestObject. +func (c *CrossRegionRestoreRequestObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "crossRegionRestoreDetails": + err = unpopulate(val, "CrossRegionRestoreDetails", &c.CrossRegionRestoreDetails) + delete(rawMsg, key) + case "restoreRequestObject": + c.RestoreRequestObject, err = unmarshalAzureBackupRestoreRequestClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", c, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type CrossRegionRestoreSettings. func (c CrossRegionRestoreSettings) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -2394,6 +2530,33 @@ func (d *Day) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type DefaultResourceProperties. +func (d DefaultResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + objectMap["objectType"] = ResourcePropertiesObjectTypeDefaultResourceProperties + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DefaultResourceProperties. +func (d *DefaultResourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "objectType": + err = unpopulate(val, "ObjectType", &d.ObjectType) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", d, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type DeleteOption. func (d DeleteOption) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3085,6 +3248,76 @@ func (e *ErrorAdditionalInfo) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorDetail. +func (e *ErrorDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "additionalInfo": + err = unpopulate(val, "AdditionalInfo", &e.AdditionalInfo) + delete(rawMsg, key) + case "code": + err = unpopulate(val, "Code", &e.Code) + delete(rawMsg, key) + case "details": + err = unpopulate(val, "Details", &e.Details) + delete(rawMsg, key) + case "message": + err = unpopulate(val, "Message", &e.Message) + delete(rawMsg, key) + case "target": + err = unpopulate(val, "Target", &e.Target) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorResponse. +func (e ErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "error", e.Error) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ErrorResponse. +func (e *ErrorResponse) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "error": + err = unpopulate(val, "Error", &e.Error) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", e, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ExportJobsResult. func (e ExportJobsResult) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3279,6 +3512,37 @@ func (f *FeatureValidationResponseBase) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type FetchSecondaryRPsRequestParameters. +func (f FetchSecondaryRPsRequestParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "sourceBackupInstanceId", f.SourceBackupInstanceID) + populate(objectMap, "sourceRegion", f.SourceRegion) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type FetchSecondaryRPsRequestParameters. +func (f *FetchSecondaryRPsRequestParameters) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "sourceBackupInstanceId": + err = unpopulate(val, "SourceBackupInstanceID", &f.SourceBackupInstanceID) + delete(rawMsg, key) + case "sourceRegion": + err = unpopulate(val, "SourceRegion", &f.SourceRegion) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", f, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type IdentityDetails. func (i IdentityDetails) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -3526,6 +3790,7 @@ func (j JobExtendedInfo) MarshalJSON() ([]byte, error) { populate(objectMap, "sourceRecoverPoint", j.SourceRecoverPoint) populate(objectMap, "subTasks", j.SubTasks) populate(objectMap, "targetRecoverPoint", j.TargetRecoverPoint) + populate(objectMap, "warningDetails", j.WarningDetails) return json.Marshal(objectMap) } @@ -3559,6 +3824,9 @@ func (j *JobExtendedInfo) UnmarshalJSON(data []byte) error { case "targetRecoverPoint": err = unpopulate(val, "TargetRecoverPoint", &j.TargetRecoverPoint) delete(rawMsg, key) + case "warningDetails": + err = unpopulate(val, "WarningDetails", &j.WarningDetails) + delete(rawMsg, key) } if err != nil { return fmt.Errorf("unmarshalling type %T: %v", j, err) @@ -3736,6 +4004,81 @@ func (k *KubernetesClusterRestoreCriteria) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type KubernetesClusterVaultTierRestoreCriteria. +func (k KubernetesClusterVaultTierRestoreCriteria) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "conflictPolicy", k.ConflictPolicy) + populate(objectMap, "excludedNamespaces", k.ExcludedNamespaces) + populate(objectMap, "excludedResourceTypes", k.ExcludedResourceTypes) + populate(objectMap, "includeClusterScopeResources", k.IncludeClusterScopeResources) + populate(objectMap, "includedNamespaces", k.IncludedNamespaces) + populate(objectMap, "includedResourceTypes", k.IncludedResourceTypes) + populate(objectMap, "labelSelectors", k.LabelSelectors) + populate(objectMap, "namespaceMappings", k.NamespaceMappings) + objectMap["objectType"] = "KubernetesClusterVaultTierRestoreCriteria" + populate(objectMap, "persistentVolumeRestoreMode", k.PersistentVolumeRestoreMode) + populate(objectMap, "restoreHookReferences", k.RestoreHookReferences) + populate(objectMap, "stagingResourceGroupId", k.StagingResourceGroupID) + populate(objectMap, "stagingStorageAccountId", k.StagingStorageAccountID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type KubernetesClusterVaultTierRestoreCriteria. +func (k *KubernetesClusterVaultTierRestoreCriteria) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "conflictPolicy": + err = unpopulate(val, "ConflictPolicy", &k.ConflictPolicy) + delete(rawMsg, key) + case "excludedNamespaces": + err = unpopulate(val, "ExcludedNamespaces", &k.ExcludedNamespaces) + delete(rawMsg, key) + case "excludedResourceTypes": + err = unpopulate(val, "ExcludedResourceTypes", &k.ExcludedResourceTypes) + delete(rawMsg, key) + case "includeClusterScopeResources": + err = unpopulate(val, "IncludeClusterScopeResources", &k.IncludeClusterScopeResources) + delete(rawMsg, key) + case "includedNamespaces": + err = unpopulate(val, "IncludedNamespaces", &k.IncludedNamespaces) + delete(rawMsg, key) + case "includedResourceTypes": + err = unpopulate(val, "IncludedResourceTypes", &k.IncludedResourceTypes) + delete(rawMsg, key) + case "labelSelectors": + err = unpopulate(val, "LabelSelectors", &k.LabelSelectors) + delete(rawMsg, key) + case "namespaceMappings": + err = unpopulate(val, "NamespaceMappings", &k.NamespaceMappings) + delete(rawMsg, key) + case "objectType": + err = unpopulate(val, "ObjectType", &k.ObjectType) + delete(rawMsg, key) + case "persistentVolumeRestoreMode": + err = unpopulate(val, "PersistentVolumeRestoreMode", &k.PersistentVolumeRestoreMode) + delete(rawMsg, key) + case "restoreHookReferences": + err = unpopulate(val, "RestoreHookReferences", &k.RestoreHookReferences) + delete(rawMsg, key) + case "stagingResourceGroupId": + err = unpopulate(val, "StagingResourceGroupID", &k.StagingResourceGroupID) + delete(rawMsg, key) + case "stagingStorageAccountId": + err = unpopulate(val, "StagingStorageAccountID", &k.StagingStorageAccountID) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", k, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type KubernetesPVRestoreCriteria. func (k KubernetesPVRestoreCriteria) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) @@ -5585,6 +5928,68 @@ func (u *UserFacingError) UnmarshalJSON(data []byte) error { return nil } +// MarshalJSON implements the json.Marshaller interface for type UserFacingWarningDetail. +func (u UserFacingWarningDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "resourceName", u.ResourceName) + populate(objectMap, "warning", u.Warning) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserFacingWarningDetail. +func (u *UserFacingWarningDetail) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "resourceName": + err = unpopulate(val, "ResourceName", &u.ResourceName) + delete(rawMsg, key) + case "warning": + err = unpopulate(val, "Warning", &u.Warning) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", u, err) + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ValidateCrossRegionRestoreRequestObject. +func (v ValidateCrossRegionRestoreRequestObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]any) + populate(objectMap, "crossRegionRestoreDetails", v.CrossRegionRestoreDetails) + populate(objectMap, "restoreRequestObject", v.RestoreRequestObject) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ValidateCrossRegionRestoreRequestObject. +func (v *ValidateCrossRegionRestoreRequestObject) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + for key, val := range rawMsg { + var err error + switch key { + case "crossRegionRestoreDetails": + err = unpopulate(val, "CrossRegionRestoreDetails", &v.CrossRegionRestoreDetails) + delete(rawMsg, key) + case "restoreRequestObject": + v.RestoreRequestObject, err = unmarshalAzureBackupRestoreRequestClassification(val) + delete(rawMsg, key) + } + if err != nil { + return fmt.Errorf("unmarshalling type %T: %v", v, err) + } + } + return nil +} + // MarshalJSON implements the json.Marshaller interface for type ValidateForBackupRequest. func (v ValidateForBackupRequest) MarshalJSON() ([]byte, error) { objectMap := make(map[string]any) diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client.go index fa3f6b7daf2e..b5020e688f0b 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client.go @@ -47,7 +47,7 @@ func NewOperationResultClient(subscriptionID string, credential azcore.TokenCred // Get - Gets the operation result for a resource // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - options - OperationResultClientGetOptions contains the optional parameters for the OperationResultClient.Get method. func (client *OperationResultClient) Get(ctx context.Context, operationID string, location string, options *OperationResultClientGetOptions) (OperationResultClientGetResponse, error) { var err error @@ -91,7 +91,7 @@ func (client *OperationResultClient) getCreateRequest(ctx context.Context, opera return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go index db14d242e2f1..513490a7b777 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationresult_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/GetOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/GetOperationResult.json func ExampleOperationResultClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/operations_client.go index 753c6a363db0..4fd9921fbd2a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operations_client.go @@ -39,7 +39,7 @@ func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientO // NewListPager - Returns the list of available operations. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-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]{ @@ -72,7 +72,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go index 3bbf7ecbfd92..bcd0716efbab 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operations_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/Operations/List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/Operations/List.json func ExampleOperationsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client.go index 35aac4b9f0be..91de9a434577 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client.go @@ -46,7 +46,7 @@ func NewOperationStatusClient(subscriptionID string, credential azcore.TokenCred // Get - Gets the operation status for a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - options - OperationStatusClientGetOptions contains the optional parameters for the OperationStatusClient.Get method. func (client *OperationStatusClient) Get(ctx context.Context, location string, operationID string, options *OperationStatusClientGetOptions) (OperationStatusClientGetResponse, error) { var err error @@ -90,7 +90,7 @@ func (client *OperationStatusClient) getCreateRequest(ctx context.Context, locat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go index 3d35e15b392c..5bd13ac1ba43 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatus_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/GetOperationStatus.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/GetOperationStatus.json func ExampleOperationStatusClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client.go index cdbe15943cec..345ac40303a3 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client.go @@ -46,7 +46,7 @@ func NewOperationStatusBackupVaultContextClient(subscriptionID string, credentia // Get - Gets the operation status for an operation over a BackupVault's context. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - options - OperationStatusBackupVaultContextClientGetOptions contains the optional parameters for the OperationStatusBackupVaultContextClient.Get @@ -97,7 +97,7 @@ func (client *OperationStatusBackupVaultContextClient) getCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go index 568f62506625..061737e1f8b4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusbackupvaultcontext_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/GetOperationStatusVaultContext.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/GetOperationStatusVaultContext.json func ExampleOperationStatusBackupVaultContextClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client.go index f61d3e3bbb62..f6d960a1bb37 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client.go @@ -46,7 +46,7 @@ func NewOperationStatusResourceGroupContextClient(subscriptionID string, credent // Get - Gets the operation status for an operation over a ResourceGroup's context. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - OperationStatusResourceGroupContextClientGetOptions contains the optional parameters for the OperationStatusResourceGroupContextClient.Get // method. @@ -92,7 +92,7 @@ func (client *OperationStatusResourceGroupContextClient) getCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go index e65a8502ca6a..cc9f0cb6c74e 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/operationstatusresourcegroupcontext_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/GetOperationStatusRGContext.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/GetOperationStatusRGContext.json func ExampleOperationStatusResourceGroupContextClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/options.go b/sdk/resourcemanager/dataprotection/armdataprotection/options.go index d54123a15734..05fa61803a1a 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/options.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/options.go @@ -63,6 +63,13 @@ type BackupInstancesClientBeginSyncBackupInstanceOptions struct { ResumeToken string } +// BackupInstancesClientBeginTriggerCrossRegionRestoreOptions contains the optional parameters for the BackupInstancesClient.BeginTriggerCrossRegionRestore +// method. +type BackupInstancesClientBeginTriggerCrossRegionRestoreOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BackupInstancesClientBeginTriggerRehydrateOptions contains the optional parameters for the BackupInstancesClient.BeginTriggerRehydrate // method. type BackupInstancesClientBeginTriggerRehydrateOptions struct { @@ -77,6 +84,13 @@ type BackupInstancesClientBeginTriggerRestoreOptions struct { ResumeToken string } +// BackupInstancesClientBeginValidateCrossRegionRestoreOptions contains the optional parameters for the BackupInstancesClient.BeginValidateCrossRegionRestore +// method. +type BackupInstancesClientBeginValidateCrossRegionRestoreOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + // BackupInstancesClientBeginValidateForBackupOptions contains the optional parameters for the BackupInstancesClient.BeginValidateForBackup // method. type BackupInstancesClientBeginValidateForBackupOptions struct { @@ -239,6 +253,29 @@ type ExportJobsOperationResultClientGetOptions struct { // placeholder for future optional parameters } +// FetchCrossRegionRestoreJobClientGetOptions contains the optional parameters for the FetchCrossRegionRestoreJobClient.Get +// method. +type FetchCrossRegionRestoreJobClientGetOptions struct { + // placeholder for future optional parameters +} + +// FetchCrossRegionRestoreJobsClientListOptions contains the optional parameters for the FetchCrossRegionRestoreJobsClient.NewListPager +// method. +type FetchCrossRegionRestoreJobsClientListOptions struct { + // OData filter options. + Filter *string +} + +// FetchSecondaryRecoveryPointsClientListOptions contains the optional parameters for the FetchSecondaryRecoveryPointsClient.NewListPager +// method. +type FetchSecondaryRecoveryPointsClientListOptions struct { + // OData filter options. + Filter *string + + // skipToken Filter. + SkipToken *string +} + // JobsClientGetOptions contains the optional parameters for the JobsClient.Get method. type JobsClientGetOptions struct { // placeholder for future optional parameters diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/polymorphic_helpers.go b/sdk/resourcemanager/dataprotection/armdataprotection/polymorphic_helpers.go index faec6956823c..33cf03d3a3b4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/polymorphic_helpers.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/polymorphic_helpers.go @@ -253,6 +253,8 @@ func unmarshalBaseResourcePropertiesClassification(rawMsg json.RawMessage) (Base } var b BaseResourcePropertiesClassification switch m["objectType"] { + case string(ResourcePropertiesObjectTypeDefaultResourceProperties): + b = &DefaultResourceProperties{} default: b = &BaseResourceProperties{} } @@ -383,6 +385,8 @@ func unmarshalItemLevelRestoreCriteriaClassification(rawMsg json.RawMessage) (It b = &ItemPathBasedRestoreCriteria{} case "KubernetesClusterRestoreCriteria": b = &KubernetesClusterRestoreCriteria{} + case "KubernetesClusterVaultTierRestoreCriteria": + b = &KubernetesClusterVaultTierRestoreCriteria{} case "KubernetesPVRestoreCriteria": b = &KubernetesPVRestoreCriteria{} case "KubernetesStorageClassRestoreCriteria": diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client.go index ed0d465f4f9d..61cdc1c550bd 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client.go @@ -46,7 +46,7 @@ func NewRecoveryPointsClient(subscriptionID string, credential azcore.TokenCrede // Get - Gets a Recovery Point using recoveryPointId for a Datasource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -101,7 +101,7 @@ func (client *RecoveryPointsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -118,7 +118,7 @@ func (client *RecoveryPointsClient) getHandleResponse(resp *http.Response) (Reco // NewListPager - Returns a list of Recovery Points for a DataSource in a vault. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -170,7 +170,7 @@ func (client *RecoveryPointsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go index 10d7061e3554..f8e60fb00606 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/recoverypoints_client_example_test.go @@ -14,10 +14,10 @@ import ( "log" "github.com/Azure/azure-sdk-for-go/sdk/azidentity" - "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/ListRecoveryPoints.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/ListRecoveryPoints.json func ExampleRecoveryPointsClient_NewListPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -64,6 +64,7 @@ func ExampleRecoveryPointsClient_NewListPager() { // ID: to.Ptr("5d8cfd30-722e-4bab-85f6-4a9d01ffc6f1"), // MetaData: to.Ptr("123456"), // }}, + // RecoveryPointState: to.Ptr(armdataprotection.RecoveryPointCompletionStateCompleted), // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), // RecoveryPointType: to.Ptr("Full"), // }, @@ -88,6 +89,7 @@ func ExampleRecoveryPointsClient_NewListPager() { // ID: to.Ptr("798cfd30-722e-4bab-85f6-4a9d01ffc6f3"), // MetaData: to.Ptr("123456"), // }}, + // RecoveryPointState: to.Ptr(armdataprotection.RecoveryPointCompletionStateCompleted), // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), // RecoveryPointType: to.Ptr("Full"), // }, @@ -96,7 +98,7 @@ func ExampleRecoveryPointsClient_NewListPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/GetRecoveryPoint.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/GetRecoveryPoint.json func ExampleRecoveryPointsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -134,6 +136,7 @@ func ExampleRecoveryPointsClient_Get() { // ID: to.Ptr("5d8cfd30-722e-4bab-85f6-4a9d01ffc6f1"), // MetaData: to.Ptr("123456"), // }}, + // RecoveryPointState: to.Ptr(armdataprotection.RecoveryPointCompletionStateCompleted), // RecoveryPointTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2019-03-01T13:00:00.000Z"); return t}()), // RecoveryPointType: to.Ptr("Full"), // }, diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client.go index 950747306ac2..6f585cbc6307 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client.go @@ -46,7 +46,7 @@ func NewResourceGuardsClient(subscriptionID string, credential azcore.TokenCrede // Delete - Deletes a ResourceGuard resource from the resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceGuardsName - The name of ResourceGuard // - options - ResourceGuardsClientDeleteOptions contains the optional parameters for the ResourceGuardsClient.Delete method. @@ -91,7 +91,7 @@ func (client *ResourceGuardsClient) deleteCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -100,7 +100,7 @@ func (client *ResourceGuardsClient) deleteCreateRequest(ctx context.Context, res // Get - Returns a ResourceGuard belonging to a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceGuardsName - The name of ResourceGuard // - options - ResourceGuardsClientGetOptions contains the optional parameters for the ResourceGuardsClient.Get method. @@ -146,7 +146,7 @@ func (client *ResourceGuardsClient) getCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -164,7 +164,7 @@ func (client *ResourceGuardsClient) getHandleResponse(resp *http.Response) (Reso // NewGetBackupSecurityPINRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetBackupSecurityPINRequestsObjectsOptions contains the optional parameters for the ResourceGuardsClient.NewGetBackupSecurityPINRequestsObjectsPager // method. @@ -211,7 +211,7 @@ func (client *ResourceGuardsClient) getBackupSecurityPINRequestsObjectsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -230,7 +230,7 @@ func (client *ResourceGuardsClient) getBackupSecurityPINRequestsObjectsHandleRes // by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultBackupSecurityPINRequestsObjectOptions contains the optional parameters for the // ResourceGuardsClient.GetDefaultBackupSecurityPINRequestsObject method. @@ -280,7 +280,7 @@ func (client *ResourceGuardsClient) getDefaultBackupSecurityPINRequestsObjectCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -299,7 +299,7 @@ func (client *ResourceGuardsClient) getDefaultBackupSecurityPINRequestsObjectHan // protected by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultDeleteProtectedItemRequestsObjectOptions contains the optional parameters for the // ResourceGuardsClient.GetDefaultDeleteProtectedItemRequestsObject method. @@ -349,7 +349,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteProtectedItemRequestsObjectC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -368,7 +368,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteProtectedItemRequestsObjectH // protected by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultDeleteResourceGuardProxyRequestsObjectOptions contains the optional parameters // for the ResourceGuardsClient.GetDefaultDeleteResourceGuardProxyRequestsObject method. @@ -418,7 +418,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteResourceGuardProxyRequestsOb return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -437,7 +437,7 @@ func (client *ResourceGuardsClient) getDefaultDeleteResourceGuardProxyRequestsOb // by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultDisableSoftDeleteRequestsObjectOptions contains the optional parameters for the // ResourceGuardsClient.GetDefaultDisableSoftDeleteRequestsObject method. @@ -487,7 +487,7 @@ func (client *ResourceGuardsClient) getDefaultDisableSoftDeleteRequestsObjectCre return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -506,7 +506,7 @@ func (client *ResourceGuardsClient) getDefaultDisableSoftDeleteRequestsObjectHan // protected by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultUpdateProtectedItemRequestsObjectOptions contains the optional parameters for the // ResourceGuardsClient.GetDefaultUpdateProtectedItemRequestsObject method. @@ -556,7 +556,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectedItemRequestsObjectC return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -575,7 +575,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectedItemRequestsObjectH // protected by the given ResourceGuard resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDefaultUpdateProtectionPolicyRequestsObjectOptions contains the optional parameters for // the ResourceGuardsClient.GetDefaultUpdateProtectionPolicyRequestsObject method. @@ -625,7 +625,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectionPolicyRequestsObje return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -643,7 +643,7 @@ func (client *ResourceGuardsClient) getDefaultUpdateProtectionPolicyRequestsObje // NewGetDeleteProtectedItemRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDeleteProtectedItemRequestsObjectsOptions contains the optional parameters for the ResourceGuardsClient.NewGetDeleteProtectedItemRequestsObjectsPager // method. @@ -690,7 +690,7 @@ func (client *ResourceGuardsClient) getDeleteProtectedItemRequestsObjectsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -708,7 +708,7 @@ func (client *ResourceGuardsClient) getDeleteProtectedItemRequestsObjectsHandleR // NewGetDeleteResourceGuardProxyRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDeleteResourceGuardProxyRequestsObjectsOptions contains the optional parameters for the // ResourceGuardsClient.NewGetDeleteResourceGuardProxyRequestsObjectsPager method. @@ -755,7 +755,7 @@ func (client *ResourceGuardsClient) getDeleteResourceGuardProxyRequestsObjectsCr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -773,7 +773,7 @@ func (client *ResourceGuardsClient) getDeleteResourceGuardProxyRequestsObjectsHa // NewGetDisableSoftDeleteRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetDisableSoftDeleteRequestsObjectsOptions contains the optional parameters for the ResourceGuardsClient.NewGetDisableSoftDeleteRequestsObjectsPager // method. @@ -820,7 +820,7 @@ func (client *ResourceGuardsClient) getDisableSoftDeleteRequestsObjectsCreateReq return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -837,7 +837,7 @@ func (client *ResourceGuardsClient) getDisableSoftDeleteRequestsObjectsHandleRes // NewGetResourcesInResourceGroupPager - Returns ResourceGuards collection belonging to a ResourceGroup. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetResourcesInResourceGroupOptions contains the optional parameters for the ResourceGuardsClient.NewGetResourcesInResourceGroupPager // method. @@ -880,7 +880,7 @@ func (client *ResourceGuardsClient) getResourcesInResourceGroupCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -897,7 +897,7 @@ func (client *ResourceGuardsClient) getResourcesInResourceGroupHandleResponse(re // NewGetResourcesInSubscriptionPager - Returns ResourceGuards collection belonging to a subscription. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - options - ResourceGuardsClientGetResourcesInSubscriptionOptions contains the optional parameters for the ResourceGuardsClient.NewGetResourcesInSubscriptionPager // method. func (client *ResourceGuardsClient) NewGetResourcesInSubscriptionPager(options *ResourceGuardsClientGetResourcesInSubscriptionOptions) *runtime.Pager[ResourceGuardsClientGetResourcesInSubscriptionResponse] { @@ -935,7 +935,7 @@ func (client *ResourceGuardsClient) getResourcesInSubscriptionCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -953,7 +953,7 @@ func (client *ResourceGuardsClient) getResourcesInSubscriptionHandleResponse(res // NewGetUpdateProtectedItemRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetUpdateProtectedItemRequestsObjectsOptions contains the optional parameters for the ResourceGuardsClient.NewGetUpdateProtectedItemRequestsObjectsPager // method. @@ -1000,7 +1000,7 @@ func (client *ResourceGuardsClient) getUpdateProtectedItemRequestsObjectsCreateR return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1018,7 +1018,7 @@ func (client *ResourceGuardsClient) getUpdateProtectedItemRequestsObjectsHandleR // NewGetUpdateProtectionPolicyRequestsObjectsPager - Returns collection of operation request objects for a critical operation // protected by the given ResourceGuard resource. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - options - ResourceGuardsClientGetUpdateProtectionPolicyRequestsObjectsOptions contains the optional parameters for the // ResourceGuardsClient.NewGetUpdateProtectionPolicyRequestsObjectsPager method. @@ -1065,7 +1065,7 @@ func (client *ResourceGuardsClient) getUpdateProtectionPolicyRequestsObjectsCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} return req, nil @@ -1083,7 +1083,7 @@ func (client *ResourceGuardsClient) getUpdateProtectionPolicyRequestsObjectsHand // Patch - Updates a ResourceGuard resource belonging to a resource group. For example, updating tags for a resource. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceGuardsName - The name of ResourceGuard // - parameters - Request body for operation @@ -1130,7 +1130,7 @@ func (client *ResourceGuardsClient) patchCreateRequest(ctx context.Context, reso return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { @@ -1151,7 +1151,7 @@ func (client *ResourceGuardsClient) patchHandleResponse(resp *http.Response) (Re // Put - Creates or updates a ResourceGuard resource belonging to a resource group. // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - resourceGuardsName - The name of ResourceGuard // - parameters - Request body for operation @@ -1198,7 +1198,7 @@ func (client *ResourceGuardsClient) putCreateRequest(ctx context.Context, resour return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go index f91551beb6f3..8132f436f2f2 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/resourceguards_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetResourceGuardsInSubscription.json func ExampleResourceGuardsClient_NewGetResourcesInSubscriptionPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -71,7 +71,7 @@ func ExampleResourceGuardsClient_NewGetResourcesInSubscriptionPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetResourceGuardsInResourceGroup.json func ExampleResourceGuardsClient_NewGetResourcesInResourceGroupPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -124,7 +124,7 @@ func ExampleResourceGuardsClient_NewGetResourcesInResourceGroupPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/PutResourceGuard.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/PutResourceGuard.json func ExampleResourceGuardsClient_Put() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -174,7 +174,7 @@ func ExampleResourceGuardsClient_Put() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetResourceGuard.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetResourceGuard.json func ExampleResourceGuardsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -219,7 +219,7 @@ func ExampleResourceGuardsClient_Get() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/DeleteResourceGuard.json func ExampleResourceGuardsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -236,7 +236,7 @@ func ExampleResourceGuardsClient_Delete() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/PatchResourceGuard.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/PatchResourceGuard.json func ExampleResourceGuardsClient_Patch() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -283,7 +283,7 @@ func ExampleResourceGuardsClient_Patch() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListDisableSoftDeleteRequests.json func ExampleResourceGuardsClient_NewGetDisableSoftDeleteRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -316,7 +316,7 @@ func ExampleResourceGuardsClient_NewGetDisableSoftDeleteRequestsObjectsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListDeleteResourceGuardProxyRequests.json func ExampleResourceGuardsClient_NewGetDeleteResourceGuardProxyRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -349,7 +349,7 @@ func ExampleResourceGuardsClient_NewGetDeleteResourceGuardProxyRequestsObjectsPa } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListBackupSecurityPINRequests.json func ExampleResourceGuardsClient_NewGetBackupSecurityPINRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -382,7 +382,7 @@ func ExampleResourceGuardsClient_NewGetBackupSecurityPINRequestsObjectsPager() { } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListDeleteProtectedItemRequests.json func ExampleResourceGuardsClient_NewGetDeleteProtectedItemRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -415,7 +415,7 @@ func ExampleResourceGuardsClient_NewGetDeleteProtectedItemRequestsObjectsPager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListUpdateProtectionPolicyRequests.json func ExampleResourceGuardsClient_NewGetUpdateProtectionPolicyRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -448,7 +448,7 @@ func ExampleResourceGuardsClient_NewGetUpdateProtectionPolicyRequestsObjectsPage } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/ListUpdateProtectedItemRequests.json func ExampleResourceGuardsClient_NewGetUpdateProtectedItemRequestsObjectsPager() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -481,7 +481,7 @@ func ExampleResourceGuardsClient_NewGetUpdateProtectedItemRequestsObjectsPager() } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultDisableSoftDeleteRequests.json func ExampleResourceGuardsClient_GetDefaultDisableSoftDeleteRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -506,7 +506,7 @@ func ExampleResourceGuardsClient_GetDefaultDisableSoftDeleteRequestsObject() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultDeleteResourceGuardProxyRequests.json func ExampleResourceGuardsClient_GetDefaultDeleteResourceGuardProxyRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -531,7 +531,7 @@ func ExampleResourceGuardsClient_GetDefaultDeleteResourceGuardProxyRequestsObjec // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultBackupSecurityPINRequests.json func ExampleResourceGuardsClient_GetDefaultBackupSecurityPINRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -556,7 +556,7 @@ func ExampleResourceGuardsClient_GetDefaultBackupSecurityPINRequestsObject() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultDeleteProtectedItemRequests.json func ExampleResourceGuardsClient_GetDefaultDeleteProtectedItemRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -581,7 +581,7 @@ func ExampleResourceGuardsClient_GetDefaultDeleteProtectedItemRequestsObject() { // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectionPolicyRequests.json func ExampleResourceGuardsClient_GetDefaultUpdateProtectionPolicyRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { @@ -606,7 +606,7 @@ func ExampleResourceGuardsClient_GetDefaultUpdateProtectionPolicyRequestsObject( // } } -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/ResourceGuardCRUD/GetDefaultUpdateProtectedItemRequests.json func ExampleResourceGuardsClient_GetDefaultUpdateProtectedItemRequestsObject() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go b/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go index 6b9ae0c3e2f5..eb48bd5bc14f 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/response_types.go @@ -68,6 +68,12 @@ type BackupInstancesClientSyncBackupInstanceResponse struct { // placeholder for future response values } +// BackupInstancesClientTriggerCrossRegionRestoreResponse contains the response from method BackupInstancesClient.BeginTriggerCrossRegionRestore. +type BackupInstancesClientTriggerCrossRegionRestoreResponse struct { + // Operation Job Extended Info + OperationJobExtendedInfo +} + // BackupInstancesClientTriggerRehydrateResponse contains the response from method BackupInstancesClient.BeginTriggerRehydrate. type BackupInstancesClientTriggerRehydrateResponse struct { // placeholder for future response values @@ -79,6 +85,12 @@ type BackupInstancesClientTriggerRestoreResponse struct { OperationJobExtendedInfo } +// BackupInstancesClientValidateCrossRegionRestoreResponse contains the response from method BackupInstancesClient.BeginValidateCrossRegionRestore. +type BackupInstancesClientValidateCrossRegionRestoreResponse struct { + // Operation Job Extended Info + OperationJobExtendedInfo +} + // BackupInstancesClientValidateForBackupResponse contains the response from method BackupInstancesClient.BeginValidateForBackup. type BackupInstancesClientValidateForBackupResponse struct { // Operation Job Extended Info @@ -243,6 +255,24 @@ type ExportJobsOperationResultClientGetResponse struct { ExportJobsResult } +// FetchCrossRegionRestoreJobClientGetResponse contains the response from method FetchCrossRegionRestoreJobClient.Get. +type FetchCrossRegionRestoreJobClientGetResponse struct { + // AzureBackup Job Resource Class + AzureBackupJobResource +} + +// FetchCrossRegionRestoreJobsClientListResponse contains the response from method FetchCrossRegionRestoreJobsClient.NewListPager. +type FetchCrossRegionRestoreJobsClientListResponse struct { + // List of AzureBackup Job resources + AzureBackupJobResourceList +} + +// FetchSecondaryRecoveryPointsClientListResponse contains the response from method FetchSecondaryRecoveryPointsClient.NewListPager. +type FetchSecondaryRecoveryPointsClientListResponse struct { + // Azure backup recoveryPoint resource list + AzureBackupRecoveryPointResourceList +} + // JobsClientGetResponse contains the response from method JobsClient.Get. type JobsClientGetResponse struct { // AzureBackup Job Resource Class diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client.go b/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client.go index 45f2dc3893a6..ae5aba916be7 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client.go @@ -46,7 +46,7 @@ func NewRestorableTimeRangesClient(subscriptionID string, credential azcore.Toke // Find - // If the operation fails it returns an *azcore.ResponseError type. // -// Generated from API version 2023-05-01 +// Generated from API version 2023-11-01 // - resourceGroupName - The name of the resource group. The name is case insensitive. // - vaultName - The name of the backup vault. // - backupInstanceName - The name of the backup instance. @@ -99,7 +99,7 @@ func (client *RestorableTimeRangesClient) findCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2023-05-01") + reqQP.Set("api-version", "2023-11-01") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header["Accept"] = []string{"application/json"} if err := runtime.MarshalAsJSON(req, parameters); err != nil { diff --git a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go b/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go index 19f3bad3a09a..5d455fd8b1c4 100644 --- a/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go +++ b/sdk/resourcemanager/dataprotection/armdataprotection/restorabletimeranges_client_example_test.go @@ -15,10 +15,10 @@ import ( "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/dataprotection/armdataprotection/v2" + "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/dataprotection/armdataprotection/v3" ) -// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/c53808ba54beef57059371708f1fa6949a11a280/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-05-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/blob/b8c74fd80b415fa1ebb6fa787d454694c39e0fd5/specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-11-01/examples/BackupInstanceOperations/FindRestorableTimeRanges.json func ExampleRestorableTimeRangesClient_Find() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil {