From b1442ce4506d28990e3226bdf1e27998c926a2cd Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 18 Sep 2023 07:22:10 +0000 Subject: [PATCH] CodeGen from PR 25829 in Azure/azure-rest-api-specs Merge 118cef6e0de5e7fc9fb8b0b665080e78d16324db into def187e2e78d7173d8fdd7f77740dd9719e1dfbf --- ...r.RecoveryServicesBackup.netstandard2.0.cs | 4 +- .../ArmRecoveryServicesBackupModelFactory.cs | 6 ++- .../BackupProtectionContainerCollection.cs | 4 +- .../BackupProtectionContainerResource.cs | 4 +- ...ackupProtectionContainerOperationSource.cs | 40 +++++++++++++++++++ .../BackupStatusResult.Serialization.cs | 22 +++++++++- .../Generated/Models/BackupStatusResult.cs | 10 ++++- .../ProtectionContainersRestOperations.cs | 20 ++-------- .../src/autorest.md | 2 +- 9 files changed, 86 insertions(+), 26 deletions(-) create mode 100644 sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/LongRunningOperation/BackupProtectionContainerOperationSource.cs diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/api/Azure.ResourceManager.RecoveryServicesBackup.netstandard2.0.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/api/Azure.ResourceManager.RecoveryServicesBackup.netstandard2.0.cs index 443bd96cdc8a..c1102f1bb0d0 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/api/Azure.ResourceManager.RecoveryServicesBackup.netstandard2.0.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/api/Azure.ResourceManager.RecoveryServicesBackup.netstandard2.0.cs @@ -555,7 +555,7 @@ public static partial class ArmRecoveryServicesBackupModelFactory public static Azure.ResourceManager.RecoveryServicesBackup.Models.BackupResourceEncryptionConfigExtendedCreateOrUpdateContent BackupResourceEncryptionConfigExtendedCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesBackup.Models.BackupResourceEncryptionConfig properties = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServicesBackup.BackupResourceEncryptionConfigExtendedData BackupResourceEncryptionConfigExtendedData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesBackup.Models.BackupResourceEncryptionConfigExtendedProperties properties = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.RecoveryServicesBackup.BackupResourceVaultConfigData BackupResourceVaultConfigData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesBackup.Models.BackupResourceVaultConfigProperties properties = null, Azure.ETag? eTag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.RecoveryServicesBackup.Models.BackupStatusResult BackupStatusResult(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionStatus? protectionStatus = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionStatus?), Azure.Core.ResourceIdentifier vaultId = null, Azure.ResourceManager.RecoveryServicesBackup.Models.BackupFabricName? fabricName = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupFabricName?), string containerName = null, string protectedItemName = null, string errorCode = null, string errorMessage = null, string policyName = null, string registrationStatus = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesBackup.Models.BackupStatusResult BackupStatusResult(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionStatus? protectionStatus = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionStatus?), Azure.Core.ResourceIdentifier vaultId = null, Azure.ResourceManager.RecoveryServicesBackup.Models.BackupFabricName? fabricName = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupFabricName?), string containerName = null, string protectedItemName = null, string errorCode = null, string errorMessage = null, string policyName = null, string registrationStatus = null, int? protectedItemsCount = default(int?), Azure.ResourceManager.RecoveryServicesBackup.Models.AcquireStorageAccountLock? acquireStorageAccountLock = default(Azure.ResourceManager.RecoveryServicesBackup.Models.AcquireStorageAccountLock?)) { throw null; } public static Azure.ResourceManager.RecoveryServicesBackup.Models.DpmProtectedItem DpmProtectedItem(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupManagementType? backupManagementType = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupManagementType?), Azure.ResourceManager.RecoveryServicesBackup.Models.BackupDataSourceType? workloadType = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupDataSourceType?), string containerName = null, Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.Core.ResourceIdentifier policyId = null, System.DateTimeOffset? lastRecoverOn = default(System.DateTimeOffset?), string backupSetName = null, Azure.ResourceManager.RecoveryServicesBackup.Models.BackupCreateMode? createMode = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupCreateMode?), System.DateTimeOffset? deferredDeletedOn = default(System.DateTimeOffset?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = null, bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, bool? isArchiveEnabled = default(bool?), string policyName = null, int? softDeleteRetentionPeriodInDays = default(int?), string friendlyName = null, string backupEngineName = null, Azure.ResourceManager.RecoveryServicesBackup.Models.ProtectedItemState? protectionState = default(Azure.ResourceManager.RecoveryServicesBackup.Models.ProtectedItemState?), Azure.ResourceManager.RecoveryServicesBackup.Models.DpmProtectedItemExtendedInfo extendedInfo = null) { throw null; } public static Azure.ResourceManager.RecoveryServicesBackup.Models.FileshareProtectedItem FileshareProtectedItem(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupManagementType? backupManagementType = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupManagementType?), Azure.ResourceManager.RecoveryServicesBackup.Models.BackupDataSourceType? workloadType = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupDataSourceType?), string containerName = null, Azure.Core.ResourceIdentifier sourceResourceId = null, Azure.Core.ResourceIdentifier policyId = null, System.DateTimeOffset? lastRecoverOn = default(System.DateTimeOffset?), string backupSetName = null, Azure.ResourceManager.RecoveryServicesBackup.Models.BackupCreateMode? createMode = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupCreateMode?), System.DateTimeOffset? deferredDeletedOn = default(System.DateTimeOffset?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = null, bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IEnumerable resourceGuardOperationRequests = null, bool? isArchiveEnabled = default(bool?), string policyName = null, int? softDeleteRetentionPeriodInDays = default(int?), string friendlyName = null, string protectionStatus = null, Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionState?), string lastBackupStatus = null, System.DateTimeOffset? lastBackupOn = default(System.DateTimeOffset?), System.Collections.Generic.IDictionary kpisHealths = null, Azure.ResourceManager.RecoveryServicesBackup.Models.FileshareProtectedItemExtendedInfo extendedInfo = null) { throw null; } public static Azure.ResourceManager.RecoveryServicesBackup.Models.FileshareProtectedItemExtendedInfo FileshareProtectedItemExtendedInfo(System.DateTimeOffset? oldestRecoverOn = default(System.DateTimeOffset?), int? recoveryPointCount = default(int?), string policyState = null, string resourceState = null, System.DateTimeOffset? resourceStateSyncOn = default(System.DateTimeOffset?)) { throw null; } @@ -1073,12 +1073,14 @@ public BackupStatusContent() { } public partial class BackupStatusResult { internal BackupStatusResult() { } + public Azure.ResourceManager.RecoveryServicesBackup.Models.AcquireStorageAccountLock? AcquireStorageAccountLock { get { throw null; } } public string ContainerName { get { throw null; } } public string ErrorCode { get { throw null; } } public string ErrorMessage { get { throw null; } } public Azure.ResourceManager.RecoveryServicesBackup.Models.BackupFabricName? FabricName { get { throw null; } } public string PolicyName { get { throw null; } } public string ProtectedItemName { get { throw null; } } + public int? ProtectedItemsCount { get { throw null; } } public Azure.ResourceManager.RecoveryServicesBackup.Models.BackupProtectionStatus? ProtectionStatus { get { throw null; } } public string RegistrationStatus { get { throw null; } } public Azure.Core.ResourceIdentifier VaultId { get { throw null; } } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs index fa63151e473e..9c79d5555dfc 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/ArmRecoveryServicesBackupModelFactory.cs @@ -61,10 +61,12 @@ public static PreValidateEnableBackupResult PreValidateEnableBackupResult(Backup /// ErrorMessage in case of intent failed. /// Specifies the policy name which is used for protection. /// Container registration status. + /// Number of protected items. + /// Specifies whether the storage account lock has been acquired or not. /// A new instance for mocking. - public static BackupStatusResult BackupStatusResult(BackupProtectionStatus? protectionStatus = null, ResourceIdentifier vaultId = null, BackupFabricName? fabricName = null, string containerName = null, string protectedItemName = null, string errorCode = null, string errorMessage = null, string policyName = null, string registrationStatus = null) + public static BackupStatusResult BackupStatusResult(BackupProtectionStatus? protectionStatus = null, ResourceIdentifier vaultId = null, BackupFabricName? fabricName = null, string containerName = null, string protectedItemName = null, string errorCode = null, string errorMessage = null, string policyName = null, string registrationStatus = null, int? protectedItemsCount = null, AcquireStorageAccountLock? acquireStorageAccountLock = null) { - return new BackupStatusResult(protectionStatus, vaultId, fabricName, containerName, protectedItemName, errorCode, errorMessage, policyName, registrationStatus); + return new BackupStatusResult(protectionStatus, vaultId, fabricName, containerName, protectedItemName, errorCode, errorMessage, policyName, registrationStatus, protectedItemsCount, acquireStorageAccountLock); } /// Initializes a new instance of VmResourceFeatureSupportResult. diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerCollection.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerCollection.cs index 9bc03b642712..015c7a032cb1 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerCollection.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerCollection.cs @@ -86,7 +86,7 @@ public virtual async Task> Creat try { var response = await _backupProtectionContainerProtectionContainersRestClient.RegisterAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, containerName, data, cancellationToken).ConfigureAwait(false); - var operation = new RecoveryServicesBackupArmOperation(Response.FromValue(new BackupProtectionContainerResource(Client, response), response.GetRawResponse())); + var operation = new RecoveryServicesBackupArmOperation(new BackupProtectionContainerOperationSource(Client), _backupProtectionContainerProtectionContainersClientDiagnostics, Pipeline, _backupProtectionContainerProtectionContainersRestClient.CreateRegisterRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, containerName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -133,7 +133,7 @@ public virtual ArmOperation CreateOrUpdate(Wa try { var response = _backupProtectionContainerProtectionContainersRestClient.Register(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, containerName, data, cancellationToken); - var operation = new RecoveryServicesBackupArmOperation(Response.FromValue(new BackupProtectionContainerResource(Client, response), response.GetRawResponse())); + var operation = new RecoveryServicesBackupArmOperation(new BackupProtectionContainerOperationSource(Client), _backupProtectionContainerProtectionContainersClientDiagnostics, Pipeline, _backupProtectionContainerProtectionContainersRestClient.CreateRegisterRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, fabricName, containerName, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs index 5bf9b31a046a..4d66fc870fe1 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/BackupProtectionContainerResource.cs @@ -313,7 +313,7 @@ public virtual async Task> Updat try { var response = await _backupProtectionContainerProtectionContainersRestClient.RegisterAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); - var operation = new RecoveryServicesBackupArmOperation(Response.FromValue(new BackupProtectionContainerResource(Client, response), response.GetRawResponse())); + var operation = new RecoveryServicesBackupArmOperation(new BackupProtectionContainerOperationSource(Client), _backupProtectionContainerProtectionContainersClientDiagnostics, Pipeline, _backupProtectionContainerProtectionContainersRestClient.CreateRegisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -353,7 +353,7 @@ public virtual ArmOperation Update(WaitUntil try { var response = _backupProtectionContainerProtectionContainersRestClient.Register(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); - var operation = new RecoveryServicesBackupArmOperation(Response.FromValue(new BackupProtectionContainerResource(Client, response), response.GetRawResponse())); + var operation = new RecoveryServicesBackupArmOperation(new BackupProtectionContainerOperationSource(Client), _backupProtectionContainerProtectionContainersClientDiagnostics, Pipeline, _backupProtectionContainerProtectionContainersRestClient.CreateRegisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletion(cancellationToken); return operation; diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/LongRunningOperation/BackupProtectionContainerOperationSource.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/LongRunningOperation/BackupProtectionContainerOperationSource.cs new file mode 100644 index 000000000000..a6011f3c76f9 --- /dev/null +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/LongRunningOperation/BackupProtectionContainerOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.RecoveryServicesBackup +{ + internal class BackupProtectionContainerOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BackupProtectionContainerOperationSource(ArmClient client) + { + _client = client; + } + + BackupProtectionContainerResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = BackupProtectionContainerData.DeserializeBackupProtectionContainerData(document.RootElement); + return new BackupProtectionContainerResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = BackupProtectionContainerData.DeserializeBackupProtectionContainerData(document.RootElement); + return new BackupProtectionContainerResource(_client, data); + } + } +} diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.Serialization.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.Serialization.cs index 9b234d4421b1..001cec2b63e4 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.Serialization.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.Serialization.cs @@ -27,6 +27,8 @@ internal static BackupStatusResult DeserializeBackupStatusResult(JsonElement ele Optional errorMessage = default; Optional policyName = default; Optional registrationStatus = default; + Optional protectedItemsCount = default; + Optional acquireStorageAccountLock = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("protectionStatus"u8)) @@ -86,8 +88,26 @@ internal static BackupStatusResult DeserializeBackupStatusResult(JsonElement ele registrationStatus = property.Value.GetString(); continue; } + if (property.NameEquals("protectedItemsCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectedItemsCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("acquireStorageAccountLock"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + acquireStorageAccountLock = new AcquireStorageAccountLock(property.Value.GetString()); + continue; + } } - return new BackupStatusResult(Optional.ToNullable(protectionStatus), vaultId.Value, Optional.ToNullable(fabricName), containerName.Value, protectedItemName.Value, errorCode.Value, errorMessage.Value, policyName.Value, registrationStatus.Value); + return new BackupStatusResult(Optional.ToNullable(protectionStatus), vaultId.Value, Optional.ToNullable(fabricName), containerName.Value, protectedItemName.Value, errorCode.Value, errorMessage.Value, policyName.Value, registrationStatus.Value, Optional.ToNullable(protectedItemsCount), Optional.ToNullable(acquireStorageAccountLock)); } } } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.cs index b73111b6c62f..7034d0a864ac 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/Models/BackupStatusResult.cs @@ -27,7 +27,9 @@ internal BackupStatusResult() /// ErrorMessage in case of intent failed. /// Specifies the policy name which is used for protection. /// Container registration status. - internal BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceIdentifier vaultId, BackupFabricName? fabricName, string containerName, string protectedItemName, string errorCode, string errorMessage, string policyName, string registrationStatus) + /// Number of protected items. + /// Specifies whether the storage account lock has been acquired or not. + internal BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceIdentifier vaultId, BackupFabricName? fabricName, string containerName, string protectedItemName, string errorCode, string errorMessage, string policyName, string registrationStatus, int? protectedItemsCount, AcquireStorageAccountLock? acquireStorageAccountLock) { ProtectionStatus = protectionStatus; VaultId = vaultId; @@ -38,6 +40,8 @@ internal BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceId ErrorMessage = errorMessage; PolicyName = policyName; RegistrationStatus = registrationStatus; + ProtectedItemsCount = protectedItemsCount; + AcquireStorageAccountLock = acquireStorageAccountLock; } /// Specifies whether the container is registered or not. @@ -58,5 +62,9 @@ internal BackupStatusResult(BackupProtectionStatus? protectionStatus, ResourceId public string PolicyName { get; } /// Container registration status. public string RegistrationStatus { get; } + /// Number of protected items. + public int? ProtectedItemsCount { get; } + /// Specifies whether the storage account lock has been acquired or not. + public AcquireStorageAccountLock? AcquireStorageAccountLock { get; } } } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/RestOperations/ProtectionContainersRestOperations.cs b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/RestOperations/ProtectionContainersRestOperations.cs index 0b9d9189f586..4fec37f0a9d3 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/RestOperations/ProtectionContainersRestOperations.cs +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/Generated/RestOperations/ProtectionContainersRestOperations.cs @@ -172,7 +172,7 @@ internal HttpMessage CreateRegisterRequest(string subscriptionId, string resourc /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public async Task> RegisterAsync(string subscriptionId, string resourceGroupName, string vaultName, string fabricName, string containerName, BackupProtectionContainerData data, CancellationToken cancellationToken = default) + public async Task RegisterAsync(string subscriptionId, string resourceGroupName, string vaultName, string fabricName, string containerName, BackupProtectionContainerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -186,14 +186,8 @@ public async Task> RegisterAsync(string switch (message.Response.Status) { case 200: - { - BackupProtectionContainerData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); - value = BackupProtectionContainerData.DeserializeBackupProtectionContainerData(document.RootElement); - return Response.FromValue(value, message.Response); - } case 202: - return Response.FromValue((BackupProtectionContainerData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -213,7 +207,7 @@ public async Task> RegisterAsync(string /// The cancellation token to use. /// , , , , or is null. /// , , , or is an empty string, and was expected to be non-empty. - public Response Register(string subscriptionId, string resourceGroupName, string vaultName, string fabricName, string containerName, BackupProtectionContainerData data, CancellationToken cancellationToken = default) + public Response Register(string subscriptionId, string resourceGroupName, string vaultName, string fabricName, string containerName, BackupProtectionContainerData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -227,14 +221,8 @@ public Response Register(string subscriptionId, s switch (message.Response.Status) { case 200: - { - BackupProtectionContainerData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream); - value = BackupProtectionContainerData.DeserializeBackupProtectionContainerData(document.RootElement); - return Response.FromValue(value, message.Response); - } case 202: - return Response.FromValue((BackupProtectionContainerData)null, message.Response); + return message.Response; default: throw new RequestFailedException(message.Response); } diff --git a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/autorest.md b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/autorest.md index 059b80575e89..4c97061ce364 100644 --- a/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/autorest.md +++ b/sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup/src/autorest.md @@ -9,7 +9,7 @@ csharp: true library-name: RecoveryServicesBackup namespace: Azure.ResourceManager.RecoveryServicesBackup # tag: package-2023-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/80c21c17b4a7aa57f637ee594f7cfd653255a7e0/specification/recoveryservicesbackup/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/recoveryservicesbackup/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true sample-gen: