diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs index 0b6a3d3a3c94d..71fde8e99f028 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperations.cs @@ -632,10 +632,10 @@ internal BackupInstancesOperations(DataProtectionClient client) /// /// The cancellation token. /// - public async Task> ValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> ValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -2035,7 +2035,7 @@ internal BackupInstancesOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -2082,7 +2082,7 @@ internal BackupInstancesOperations(DataProtectionClient client) tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginValidateRestore", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginValidateForRestore", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -2195,7 +2195,7 @@ internal BackupInstancesOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -2222,7 +2222,7 @@ internal BackupInstancesOperations(DataProtectionClient client) } try { - _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(JsonSerializer.Create(Client.DeserializationSettings)); } catch (JsonException ex) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs index 811cdb7bb7279..a1b6ffdb9073a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupInstancesOperationsExtensions.cs @@ -421,9 +421,9 @@ public static OperationJobExtendedInfo TriggerRestore(this IBackupInstancesOpera /// /// Gets or sets the restore request object. /// - public static OperationJobExtendedInfo ValidateRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) + public static OperationJobExtendedInfo ValidateForRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) { - return operations.ValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); + return operations.ValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); } /// @@ -447,9 +447,9 @@ public static OperationJobExtendedInfo ValidateRestore(this IBackupInstancesOper /// /// The cancellation token. /// - public static async Task ValidateRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task ValidateForRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -769,9 +769,9 @@ public static OperationJobExtendedInfo BeginTriggerRestore(this IBackupInstances /// /// Gets or sets the restore request object. /// - public static OperationJobExtendedInfo BeginValidateRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) + public static OperationJobExtendedInfo BeginValidateForRestore(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject) { - return operations.BeginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); + return operations.BeginValidateForRestoreAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject).GetAwaiter().GetResult(); } /// @@ -795,9 +795,9 @@ public static OperationJobExtendedInfo BeginValidateRestore(this IBackupInstance /// /// The cancellation token. /// - public static async Task BeginValidateRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginValidateForRestoreAsync(this IBackupInstancesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginValidateRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginValidateForRestoreWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, restoreRequestObject, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs index cab2079c5415b..f261279d84196 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperations.cs @@ -463,6 +463,7 @@ internal BackupPoliciesOperations(DataProtectionClient client) /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs index d55ed26c73937..7046f6843383c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupPoliciesOperationsExtensions.cs @@ -124,6 +124,7 @@ public static BaseBackupPolicyResource Get(this IBackupPoliciesOperations operat /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation @@ -146,6 +147,7 @@ public static BaseBackupPolicyResource CreateOrUpdate(this IBackupPoliciesOperat /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs similarity index 89% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs index 578839820c51d..a57c0c2549fb6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// JobOperations operations. + /// BackupVaultOperationResultsOperations operations. /// - internal partial class JobOperations : IServiceOperations, IJobOperations + internal partial class BackupVaultOperationResultsOperations : IServiceOperations, IBackupVaultOperationResultsOperations { /// - /// Initializes a new instance of the JobOperations class. + /// Initializes a new instance of the BackupVaultOperationResultsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class JobOperations : IServiceOperations, /// /// Thrown when a required parameter is null /// - internal JobOperations(DataProtectionClient client) + internal BackupVaultOperationResultsOperations(DataProtectionClient client) { if (client == null) { @@ -50,18 +50,13 @@ internal JobOperations(DataProtectionClient client) /// public DataProtectionClient Client { get; private set; } - /// - /// Gets a job with id in a backup vault - /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// /// /// Headers that will be added to request. @@ -84,27 +79,27 @@ internal JobOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (Client.SubscriptionId == null) + if (vaultName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); } if (resourceGroupName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } - if (vaultName == null) + if (Client.SubscriptionId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (jobId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -113,19 +108,19 @@ internal JobOperations(DataProtectionClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("jobId", jobId); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -224,7 +219,7 @@ internal JobOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -237,7 +232,7 @@ internal JobOperations(DataProtectionClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs similarity index 59% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs index f2faadb5fc68c..4c8ef4e40199f 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultOperationResultsOperationsExtensions.cs @@ -17,53 +17,43 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for JobOperations. + /// Extension methods for BackupVaultOperationResultsOperations. /// - public static partial class JobOperationsExtensions + public static partial class BackupVaultOperationResultsOperationsExtensions { - /// - /// Gets a job with id in a backup vault - /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// - public static AzureBackupJobResource Get(this IJobOperations operations, string resourceGroupName, string vaultName, string jobId) + public static BackupVaultResource Get(this IBackupVaultOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) { - return operations.GetAsync(resourceGroupName, vaultName, jobId).GetAwaiter().GetResult(); + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); } - /// - /// Gets a job with id in a backup vault - /// /// /// The operations group for this extension method. /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// /// /// The cancellation token. /// - public static async Task GetAsync(this IJobOperations operations, string resourceGroupName, string vaultName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IBackupVaultOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs index e9768b0e5e37c..b15138438612a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperations.cs @@ -74,7 +74,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -92,7 +92,7 @@ internal BackupVaultsOperations(DataProtectionClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscription", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInSubscription", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -255,7 +255,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -278,7 +278,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroup", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInResourceGroup", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -830,10 +830,10 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// The cancellation token. /// - public async Task> PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send Request - AzureOperationResponse _response = await BeginPatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -1313,7 +1313,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> BeginPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> BeginUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -1346,7 +1346,7 @@ internal BackupVaultsOperations(DataProtectionClient client) tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BeginPatch", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginUpdate", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -1517,7 +1517,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1532,7 +1532,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInSubscriptionNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInSubscriptionNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; @@ -1690,7 +1690,7 @@ internal BackupVaultsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> GetInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -1705,7 +1705,7 @@ internal BackupVaultsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetResourcesInResourceGroupNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "GetInResourceGroupNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs index 60b269f48c1f1..f4c6667a53505 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/BackupVaultsOperationsExtensions.cs @@ -27,9 +27,9 @@ public static partial class BackupVaultsOperationsExtensions /// /// The operations group for this extension method. /// - public static IPage GetResourcesInSubscription(this IBackupVaultsOperations operations) + public static IPage GetInSubscription(this IBackupVaultsOperations operations) { - return operations.GetResourcesInSubscriptionAsync().GetAwaiter().GetResult(); + return operations.GetInSubscriptionAsync().GetAwaiter().GetResult(); } /// @@ -41,9 +41,9 @@ public static IPage GetResourcesInSubscription(this IBackup /// /// The cancellation token. /// - public static async Task> GetResourcesInSubscriptionAsync(this IBackupVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInSubscriptionAsync(this IBackupVaultsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInSubscriptionWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -58,9 +58,9 @@ public static IPage GetResourcesInSubscription(this IBackup /// /// The name of the resource group where the backup vault is present. /// - public static IPage GetResourcesInResourceGroup(this IBackupVaultsOperations operations, string resourceGroupName) + public static IPage GetInResourceGroup(this IBackupVaultsOperations operations, string resourceGroupName) { - return operations.GetResourcesInResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); + return operations.GetInResourceGroupAsync(resourceGroupName).GetAwaiter().GetResult(); } /// @@ -75,9 +75,9 @@ public static IPage GetResourcesInResourceGroup(this IBacku /// /// The cancellation token. /// - public static async Task> GetResourcesInResourceGroupAsync(this IBackupVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInResourceGroupAsync(this IBackupVaultsOperations operations, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInResourceGroupWithHttpMessagesAsync(resourceGroupName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -222,9 +222,9 @@ public static void Delete(this IBackupVaultsOperations operations, string vaultN /// /// Request body for operation /// - public static BackupVaultResource Patch(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) + public static BackupVaultResource Update(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) { - return operations.PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); } /// @@ -246,9 +246,9 @@ public static BackupVaultResource Patch(this IBackupVaultsOperations operations, /// /// The cancellation token. /// - public static async Task PatchAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task UpdateAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -362,9 +362,9 @@ public static BackupVaultResource BeginCreateOrUpdate(this IBackupVaultsOperatio /// /// Request body for operation /// - public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) + public static BackupVaultResource BeginUpdate(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters) { - return operations.BeginPatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return operations.BeginUpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); } /// @@ -386,9 +386,9 @@ public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operat /// /// The cancellation token. /// - public static async Task BeginPatchAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task BeginUpdateAsync(this IBackupVaultsOperations operations, string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.BeginPatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -403,9 +403,9 @@ public static BackupVaultResource BeginPatch(this IBackupVaultsOperations operat /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetResourcesInSubscriptionNext(this IBackupVaultsOperations operations, string nextPageLink) + public static IPage GetInSubscriptionNext(this IBackupVaultsOperations operations, string nextPageLink) { - return operations.GetResourcesInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.GetInSubscriptionNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -420,9 +420,9 @@ public static IPage GetResourcesInSubscriptionNext(this IBa /// /// The cancellation token. /// - public static async Task> GetResourcesInSubscriptionNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInSubscriptionNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInSubscriptionNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -437,9 +437,9 @@ public static IPage GetResourcesInSubscriptionNext(this IBa /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetResourcesInResourceGroupNext(this IBackupVaultsOperations operations, string nextPageLink) + public static IPage GetInResourceGroupNext(this IBackupVaultsOperations operations, string nextPageLink) { - return operations.GetResourcesInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.GetInResourceGroupNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -454,9 +454,9 @@ public static IPage GetResourcesInResourceGroupNext(this IB /// /// The cancellation token. /// - public static async Task> GetResourcesInResourceGroupNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> GetInResourceGroupNextAsync(this IBackupVaultsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetResourcesInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetInResourceGroupNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs index a82e959b23f54..eece4b822dd9d 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClient.cs @@ -20,8 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection using System.Linq; using System.Net; using System.Net.Http; - using System.Threading; - using System.Threading.Tasks; /// /// Open API 2.0 Specs for Azure Data Protection service @@ -87,9 +85,24 @@ public partial class DataProtectionClient : ServiceClient, public virtual IOperationResultOperations OperationResult { get; private set; } /// - /// Gets the IOperations. + /// Gets the IOperationStatusOperations. /// - public virtual IOperations Operations { get; private set; } + public virtual IOperationStatusOperations OperationStatus { get; private set; } + + /// + /// Gets the IBackupVaultOperationResultsOperations. + /// + public virtual IBackupVaultOperationResultsOperations BackupVaultOperationResults { get; private set; } + + /// + /// Gets the IDataProtectionOperations. + /// + public virtual IDataProtectionOperations DataProtection { get; private set; } + + /// + /// Gets the IDataProtectionOperationsOperations. + /// + public virtual IDataProtectionOperationsOperations DataProtectionOperations { get; private set; } /// /// Gets the IBackupPoliciesOperations. @@ -106,25 +119,15 @@ public partial class DataProtectionClient : ServiceClient, /// public virtual IRecoveryPointsOperations RecoveryPoints { get; private set; } - /// - /// Gets the IRecoveryPointOperations. - /// - public virtual IRecoveryPointOperations RecoveryPoint { get; private set; } - /// /// Gets the IJobsOperations. /// public virtual IJobsOperations Jobs { get; private set; } /// - /// Gets the IFindRestorableTimeRangesOperations. + /// Gets the IRestorableTimeRangesOperations. /// - public virtual IFindRestorableTimeRangesOperations FindRestorableTimeRanges { get; private set; } - - /// - /// Gets the IJobOperations. - /// - public virtual IJobOperations Job { get; private set; } + public virtual IRestorableTimeRangesOperations RestorableTimeRanges { get; private set; } /// /// Gets the IExportJobsOperations. @@ -379,14 +382,15 @@ private void Initialize() { BackupVaults = new BackupVaultsOperations(this); OperationResult = new OperationResultOperations(this); - Operations = new Operations(this); + OperationStatus = new OperationStatusOperations(this); + BackupVaultOperationResults = new BackupVaultOperationResultsOperations(this); + DataProtection = new DataProtectionOperations(this); + DataProtectionOperations = new DataProtectionOperationsOperations(this); BackupPolicies = new BackupPoliciesOperations(this); BackupInstances = new BackupInstancesOperations(this); RecoveryPoints = new RecoveryPointsOperations(this); - RecoveryPoint = new RecoveryPointOperations(this); Jobs = new JobsOperations(this); - FindRestorableTimeRanges = new FindRestorableTimeRangesOperations(this); - Job = new JobOperations(this); + RestorableTimeRanges = new RestorableTimeRangesOperations(this); ExportJobs = new ExportJobsOperations(this); ExportJobsOperationResult = new ExportJobsOperationResultOperations(this); BaseUri = new System.Uri("https://management.azure.com"); @@ -450,600 +454,5 @@ private void Initialize() CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } - /// - /// Gets the operation status for a resource. - /// - /// - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetOperationStatusWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOperationStatus", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> GetOperationResultPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (vaultName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("operationId", operationId); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetOperationResultPatch", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/operationResults/{operationId}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("GET"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - /// - /// Validates if a feature is supported - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when unable to deserialize the response - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// Thrown when a required parameter is null - /// - /// - /// A response object containing the response body and response headers. - /// - public async Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (ApiVersion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.ApiVersion"); - } - if (SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); - } - if (location == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "location"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("location", location); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "CheckFeatureSupport", tracingParameters); - } - // Construct URL - var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport").ToString(); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); - _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); - List _queryParameters = new List(); - if (ApiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); - } - if (_queryParameters.Count > 0) - { - _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); - } - // Create HTTP transport objects - var _httpRequest = new HttpRequestMessage(); - HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new HttpMethod("POST"); - _httpRequest.RequestUri = new System.Uri(_url); - // Set Headers - if (GenerateClientRequestId != null && GenerateClientRequestId.Value) - { - _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); - } - if (AcceptLanguage != null) - { - if (_httpRequest.Headers.Contains("accept-language")) - { - _httpRequest.Headers.Remove("accept-language"); - } - _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); - } - - - if (customHeaders != null) - { - foreach(var _header in customHeaders) - { - if (_httpRequest.Headers.Contains(_header.Key)) - { - _httpRequest.Headers.Remove(_header.Key); - } - _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); - } - } - - // Serialize Request - string _requestContent = null; - if(parameters != null) - { - _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); - _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } - // Set Credentials - if (Credentials != null) - { - cancellationToken.ThrowIfCancellationRequested(); - await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - } - // Send Request - if (_shouldTrace) - { - ServiceClientTracing.SendRequest(_invocationId, _httpRequest); - } - cancellationToken.ThrowIfCancellationRequested(); - _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); - if (_shouldTrace) - { - ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); - } - HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - if (_errorBody != null) - { - ex = new CloudException(_errorBody.Message); - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - if (_shouldTrace) - { - ServiceClientTracing.Error(_invocationId, ex); - } - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw ex; - } - // Create Result - var _result = new AzureOperationResponse(); - _result.Request = _httpRequest; - _result.Response = _httpResponse; - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } - // Deserialize Response - if ((int)_statusCode == 200) - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - try - { - _result.Body = SafeJsonConvert.DeserializeObject(_responseContent, DeserializationSettings); - } - catch (JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs deleted file mode 100644 index ac4e7abcc0d38..0000000000000 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionClientExtensions.cs +++ /dev/null @@ -1,137 +0,0 @@ -// -// 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. -// - -namespace Microsoft.Azure.Management.DataProtection -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for DataProtectionClient. - /// - public static partial class DataProtectionClientExtensions - { - /// - /// Gets the operation status for a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - public static OperationResource GetOperationStatus(this IDataProtectionClient operations, string location, string operationId) - { - return operations.GetOperationStatusAsync(location, operationId).GetAwaiter().GetResult(); - } - - /// - /// Gets the operation status for a resource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetOperationStatusAsync(this IDataProtectionClient operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - public static BackupVaultResource GetOperationResultPatch(this IDataProtectionClient operations, string vaultName, string resourceGroupName, string operationId) - { - return operations.GetOperationResultPatchAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); - } - - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetOperationResultPatchAsync(this IDataProtectionClient operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetOperationResultPatchWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Validates if a feature is supported - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// Feature support request object - /// - public static FeatureValidationResponseBase CheckFeatureSupport(this IDataProtectionClient operations, string location, FeatureValidationRequestBase parameters) - { - return operations.CheckFeatureSupportAsync(location, parameters).GetAwaiter().GetResult(); - } - - /// - /// Validates if a feature is supported - /// - /// - /// The operations group for this extension method. - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// The cancellation token. - /// - public static async Task CheckFeatureSupportAsync(this IDataProtectionClient operations, string location, FeatureValidationRequestBase parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.CheckFeatureSupportWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs new file mode 100644 index 0000000000000..f1bf432b5f204 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperations.cs @@ -0,0 +1,254 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + using System.Net; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + + /// + /// DataProtectionOperations operations. + /// + internal partial class DataProtectionOperations : IServiceOperations, IDataProtectionOperations + { + /// + /// Initializes a new instance of the DataProtectionOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal DataProtectionOperations(DataProtectionClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + Client = client; + } + + /// + /// Gets a reference to the DataProtectionClient + /// + public DataProtectionClient Client { get; private set; } + + /// + /// Validates if a feature is supported + /// + /// + /// + /// + /// Feature support request object + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (location == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "location"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("location", location); + tracingParameters.Add("parameters", parameters); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "CheckFeatureSupport", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/checkFeatureSupport").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, Client.SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs new file mode 100644 index 0000000000000..adc84f8e60795 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsExtensions.cs @@ -0,0 +1,63 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for DataProtectionOperations. + /// + public static partial class DataProtectionOperationsExtensions + { + /// + /// Validates if a feature is supported + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// Feature support request object + /// + public static FeatureValidationResponseBase CheckFeatureSupport(this IDataProtectionOperations operations, string location, FeatureValidationRequestBase parameters) + { + return operations.CheckFeatureSupportAsync(location, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validates if a feature is supported + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// Feature support request object + /// + /// + /// The cancellation token. + /// + public static async Task CheckFeatureSupportAsync(this IDataProtectionOperations operations, string location, FeatureValidationRequestBase parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.CheckFeatureSupportWithHttpMessagesAsync(location, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs similarity index 97% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs index d03fb04abcdcf..b2ac1ee668ee0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Operations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Operations operations. + /// DataProtectionOperationsOperations operations. /// - internal partial class Operations : IServiceOperations, IOperations + internal partial class DataProtectionOperationsOperations : IServiceOperations, IDataProtectionOperationsOperations { /// - /// Initializes a new instance of the Operations class. + /// Initializes a new instance of the DataProtectionOperationsOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class Operations : IServiceOperations, IO /// /// Thrown when a required parameter is null /// - internal Operations(DataProtectionClient client) + internal DataProtectionOperationsOperations(DataProtectionClient client) { if (client == null) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs similarity index 83% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs index d58f9b4ef7903..dac3df49f939f 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/DataProtectionOperationsOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for Operations. + /// Extension methods for DataProtectionOperationsOperations. /// - public static partial class OperationsExtensions + public static partial class DataProtectionOperationsOperationsExtensions { /// /// Returns the list of available operations. @@ -27,7 +27,7 @@ public static partial class OperationsExtensions /// /// The operations group for this extension method. /// - public static IPage List(this IOperations operations) + public static IPage List(this IDataProtectionOperationsOperations operations) { return operations.ListAsync().GetAwaiter().GetResult(); } @@ -41,7 +41,7 @@ public static IPage List(this IOperations oper /// /// The cancellation token. /// - public static async Task> ListAsync(this IOperations operations, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IDataProtectionOperationsOperations operations, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false)) { @@ -58,7 +58,7 @@ public static IPage List(this IOperations oper /// /// The NextLink from the previous successful call to List operation. /// - public static IPage ListNext(this IOperations operations, string nextPageLink) + public static IPage ListNext(this IDataProtectionOperationsOperations operations, string nextPageLink) { return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } @@ -75,7 +75,7 @@ public static IPage ListNext(this IOperations /// /// The cancellation token. /// - public static async Task> ListNextAsync(this IOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IDataProtectionOperationsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs index 3fe682fc7c272..f434be5b79e1e 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupInstancesOperations.cs @@ -279,7 +279,7 @@ public partial interface IBackupInstancesOperations /// /// Thrown when a required parameter is null /// - Task> ValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> ValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Create or update a backup instance in a backup vault /// @@ -483,7 +483,7 @@ public partial interface IBackupInstancesOperations /// /// Thrown when a required parameter is null /// - Task> BeginValidateRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginValidateForRestoreWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupRestoreRequest restoreRequestObject, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Gets a backup instances belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs index 5be8de5bd0f54..df8957ca3e52b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupPoliciesOperations.cs @@ -88,6 +88,7 @@ public partial interface IBackupPoliciesOperations /// The name of the resource group where the backup vault is present. /// /// + /// Name of the policy /// /// /// Request body for operation diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs similarity index 73% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs index 7eda13ba0d92f..471ccec99969b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultOperationResultsOperations.cs @@ -19,22 +19,17 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// JobOperations operations. + /// BackupVaultOperationResultsOperations operations. /// - public partial interface IJobOperations + public partial interface IBackupVaultOperationResultsOperations { - /// - /// Gets a job with id in a backup vault - /// - /// - /// The name of the resource group where the backup vault is present. - /// /// /// The name of the backup vault. /// - /// - /// The Job ID. This is a GUID-formatted string (e.g. - /// 00000000-0000-0000-0000-000000000000). + /// + /// The name of the resource group where the backup vault is present. + /// + /// /// /// /// The headers that will be added to request. @@ -51,6 +46,6 @@ public partial interface IJobOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs index 527a9027c8d39..91cf4a56e14b1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IBackupVaultsOperations.cs @@ -41,7 +41,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInSubscriptionWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a resource group. /// @@ -63,7 +63,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInResourceGroupWithHttpMessagesAsync(string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns a resource belonging to a resource group. /// @@ -168,7 +168,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task> PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// API to check for resource name availability /// @@ -254,7 +254,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task> BeginPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> BeginUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, PatchResourceRequestInput parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a subscription. /// @@ -276,7 +276,7 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInSubscriptionNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns resource collection belonging to a resource group. /// @@ -298,6 +298,6 @@ public partial interface IBackupVaultsOperations /// /// Thrown when a required parameter is null /// - Task>> GetResourcesInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> GetInResourceGroupNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs index f14fca4980d92..cb3374d6f7561 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionClient.cs @@ -14,10 +14,6 @@ namespace Microsoft.Azure.Management.DataProtection using Microsoft.Rest.Azure; using Models; using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; /// /// Open API 2.0 Specs for Azure Data Protection service @@ -84,9 +80,24 @@ public partial interface IDataProtectionClient : System.IDisposable IOperationResultOperations OperationResult { get; } /// - /// Gets the IOperations. + /// Gets the IOperationStatusOperations. /// - IOperations Operations { get; } + IOperationStatusOperations OperationStatus { get; } + + /// + /// Gets the IBackupVaultOperationResultsOperations. + /// + IBackupVaultOperationResultsOperations BackupVaultOperationResults { get; } + + /// + /// Gets the IDataProtectionOperations. + /// + IDataProtectionOperations DataProtection { get; } + + /// + /// Gets the IDataProtectionOperationsOperations. + /// + IDataProtectionOperationsOperations DataProtectionOperations { get; } /// /// Gets the IBackupPoliciesOperations. @@ -103,25 +114,15 @@ public partial interface IDataProtectionClient : System.IDisposable /// IRecoveryPointsOperations RecoveryPoints { get; } - /// - /// Gets the IRecoveryPointOperations. - /// - IRecoveryPointOperations RecoveryPoint { get; } - /// /// Gets the IJobsOperations. /// IJobsOperations Jobs { get; } /// - /// Gets the IFindRestorableTimeRangesOperations. - /// - IFindRestorableTimeRangesOperations FindRestorableTimeRanges { get; } - - /// - /// Gets the IJobOperations. + /// Gets the IRestorableTimeRangesOperations. /// - IJobOperations Job { get; } + IRestorableTimeRangesOperations RestorableTimeRanges { get; } /// /// Gets the IExportJobsOperations. @@ -133,52 +134,5 @@ public partial interface IDataProtectionClient : System.IDisposable /// IExportJobsOperationResultOperations ExportJobsOperationResult { get; } - /// - /// Gets the operation status for a resource. - /// - /// - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> GetOperationStatusWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> GetOperationResultPatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - - /// - /// Validates if a feature is supported - /// - /// - /// - /// - /// Feature support request object - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs similarity index 62% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs index 8709cd2687abc..ee73d59aba452 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperations.cs @@ -19,23 +19,17 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// RecoveryPointOperations operations. + /// DataProtectionOperations operations. /// - public partial interface IRecoveryPointOperations + public partial interface IDataProtectionOperations { /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// Validates if a feature is supported /// - /// - /// The name of the backup vault. + /// /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// + /// + /// Feature support request object /// /// /// The headers that will be added to request. @@ -52,6 +46,6 @@ public partial interface IRecoveryPointOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> CheckFeatureSupportWithHttpMessagesAsync(string location, FeatureValidationRequestBase parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs similarity index 95% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs index dfc6a2ed33c80..fff09d93866e0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IDataProtectionOperationsOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Operations operations. + /// DataProtectionOperationsOperations operations. /// - public partial interface IOperations + public partial interface IDataProtectionOperationsOperations { /// /// Returns the list of available operations. diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs index 934b1eee274a6..3352c7bcbc4f4 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IJobsOperations.cs @@ -49,6 +49,35 @@ public partial interface IJobsOperations /// Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// + /// Gets a job with id in a backup vault + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Returns list of jobs belonging to a backup vault /// /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs new file mode 100644 index 0000000000000..db7168d01c795 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IOperationStatusOperations.cs @@ -0,0 +1,50 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Collections; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + + /// + /// OperationStatusOperations operations. + /// + public partial interface IOperationStatusOperations + { + /// + /// Gets the operation status for a resource. + /// + /// + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs index 6809bf1b3c0f0..795eb564e7921 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRecoveryPointsOperations.cs @@ -57,7 +57,37 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when a required parameter is null /// - Task>> GetListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// /// Returns a list of Recovery Points for a DataSource in a vault. /// @@ -79,6 +109,6 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when a required parameter is null /// - Task>> GetListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs similarity index 77% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs index 8e6b13a111b7a..86522466f5bf9 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IFindRestorableTimeRangesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/IRestorableTimeRangesOperations.cs @@ -19,9 +19,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// FindRestorableTimeRangesOperations operations. + /// RestorableTimeRangesOperations operations. /// - public partial interface IFindRestorableTimeRangesOperations + public partial interface IRestorableTimeRangesOperations { /// /// The name of the backup vault. @@ -29,7 +29,8 @@ public partial interface IFindRestorableTimeRangesOperations /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -49,6 +50,6 @@ public partial interface IFindRestorableTimeRangesOperations /// /// Thrown when a required parameter is null /// - Task> PostWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task> FindWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs index 289fbd1f6bdb9..2b26450c2f50c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperations.cs @@ -246,6 +246,212 @@ internal JobsOperations(DataProtectionClient client) return _result; } + /// + /// Gets a job with id in a backup vault + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (jobId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "jobId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("jobId", jobId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupJobs/{jobId}").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{jobId}", System.Uri.EscapeDataString(jobId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Returns list of jobs belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs index bbee7362fa3d9..c4e6755375436 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/JobsOperationsExtensions.cs @@ -61,6 +61,54 @@ public static IPage List(this IJobsOperations operations } } + /// + /// Gets a job with id in a backup vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + public static AzureBackupJobResource Get(this IJobsOperations operations, string resourceGroupName, string vaultName, string jobId) + { + return operations.GetAsync(resourceGroupName, vaultName, jobId).GetAwaiter().GetResult(); + } + + /// + /// Gets a job with id in a backup vault + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup vault. + /// + /// + /// The Job ID. This is a GUID-formatted string (e.g. + /// 00000000-0000-0000-0000-000000000000). + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IJobsOperations operations, string resourceGroupName, string vaultName, string jobId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// /// Returns list of jobs belonging to a backup vault /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs index b9449c574b3ce..bdeef3022b874 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AbsoluteDeleteOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Delete option with duration /// - [Newtonsoft.Json.JsonObject("AbsoluteDeleteOption")] public partial class AbsoluteDeleteOption : DeleteOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs index 2610f931230e2..34b57086ea748 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AdhocBasedTriggerContext.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Adhoc trigger context /// - [Newtonsoft.Json.JsonObject("AdhocBasedTriggerContext")] public partial class AdhocBasedTriggerContext : TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs index e10e676eb6a77..d66d2250627ab 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupDiscreteRecoveryPoint.cs @@ -21,7 +21,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup discrete RecoveryPoint /// - [Newtonsoft.Json.JsonObject("AzureBackupDiscreteRecoveryPoint")] public partial class AzureBackupDiscreteRecoveryPoint : AzureBackupRecoveryPoint { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs index 8cb683fc578a5..986233b5ec263 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupFindRestorableTimeRangesRequest.cs @@ -36,10 +36,10 @@ public AzureBackupFindRestorableTimeRangesRequest() /// source data store. Possible values include: 'OperationalStore', /// 'VaultStore', 'ArchiveStore' /// Start time for the List Restore Ranges - /// request - /// End time for the List Restore Ranges - /// request - public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, string startTime, string endTime) + /// request. ISO 8601 format. + /// End time for the List Restore Ranges request. + /// ISO 8601 format. + public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, string startTime = default(string), string endTime = default(string)) { SourceDataStoreType = sourceDataStoreType; StartTime = startTime; @@ -60,13 +60,15 @@ public AzureBackupFindRestorableTimeRangesRequest(string sourceDataStoreType, st public string SourceDataStoreType { get; set; } /// - /// Gets or sets start time for the List Restore Ranges request + /// Gets or sets start time for the List Restore Ranges request. ISO + /// 8601 format. /// [JsonProperty(PropertyName = "startTime")] public string StartTime { get; set; } /// - /// Gets or sets end time for the List Restore Ranges request + /// Gets or sets end time for the List Restore Ranges request. ISO 8601 + /// format. /// [JsonProperty(PropertyName = "endTime")] public string EndTime { get; set; } @@ -83,14 +85,6 @@ public virtual void Validate() { throw new ValidationException(ValidationRules.CannotBeNull, "SourceDataStoreType"); } - if (StartTime == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "StartTime"); - } - if (EndTime == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "EndTime"); - } } } } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs index 05f9e5052d31f..df49dcb4d65a0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupParams.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup parameters /// - [Newtonsoft.Json.JsonObject("AzureBackupParams")] public partial class AzureBackupParams : BackupParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs index b645088534477..afecf4f87e8d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPoint.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup recoveryPoint /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryPoint")] public partial class AzureBackupRecoveryPoint { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs index 7b34466b12a80..35b08d7f53bef 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryPointBasedRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup recoveryPoint based restore request /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryPointBasedRestoreRequest")] public partial class AzureBackupRecoveryPointBasedRestoreRequest : AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs index aba88b23dbba5..facb67aca110b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRecoveryTimeBasedRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// AzureBackup RecoveryPointTime Based Restore Request /// - [Newtonsoft.Json.JsonObject("AzureBackupRecoveryTimeBasedRestoreRequest")] public partial class AzureBackupRecoveryTimeBasedRestoreRequest : AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs index 5a075556edd6b..51f4ca15a49d1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup restore request /// - [Newtonsoft.Json.JsonObject("AzureBackupRestoreRequest")] public partial class AzureBackupRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs index f2e642f05511d..2389fa6656173 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRestoreWithRehydrationRequest.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// AzureBackup Restore with Rehydration Request /// - [Newtonsoft.Json.JsonObject("AzureBackupRestoreWithRehydrationRequest")] public partial class AzureBackupRestoreWithRehydrationRequest : AzureBackupRecoveryPointBasedRestoreRequest { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs index d656aa74bc130..11f890c168c2c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureBackupRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure backup rule /// - [Newtonsoft.Json.JsonObject("AzureBackupRule")] public partial class AzureBackupRule : BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs index bd538a47978c6..7cdafb6d372e5 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureOperationalStoreParameters.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Parameters for Operational-Tier DataStore /// - [Newtonsoft.Json.JsonObject("AzureOperationalStoreParameters")] public partial class AzureOperationalStoreParameters : DataStoreParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs index 62553c323ac19..38f0b6ac82693 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/AzureRetentionRule.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Azure retention rule /// - [Newtonsoft.Json.JsonObject("AzureRetentionRule")] public partial class AzureRetentionRule : BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs index 0e6ce7b56625c..8d6841cf0e3e1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupCriteria.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupCriteria base class /// - [Newtonsoft.Json.JsonObject("BackupCriteria")] public partial class BackupCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs similarity index 83% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs index 9aa9032970e72..8e9eeefaa4baa 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateRestoreHeaders.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupInstancesValidateForRestoreHeaders.cs @@ -14,22 +14,22 @@ namespace Microsoft.Azure.Management.DataProtection.Models using System.Linq; /// - /// Defines headers for ValidateRestore operation. + /// Defines headers for ValidateForRestore operation. /// - public partial class BackupInstancesValidateRestoreHeaders + public partial class BackupInstancesValidateForRestoreHeaders { /// /// Initializes a new instance of the - /// BackupInstancesValidateRestoreHeaders class. + /// BackupInstancesValidateForRestoreHeaders class. /// - public BackupInstancesValidateRestoreHeaders() + public BackupInstancesValidateForRestoreHeaders() { CustomInit(); } /// /// Initializes a new instance of the - /// BackupInstancesValidateRestoreHeaders class. + /// BackupInstancesValidateForRestoreHeaders class. /// /// The URL of the resource used to check the /// status of the asynchronous operation. @@ -38,7 +38,7 @@ public BackupInstancesValidateRestoreHeaders() /// Suggested delay to check the status of the /// asynchronous operation. The value is an integer that represents the /// seconds. - public BackupInstancesValidateRestoreHeaders(string location = default(string), string azureAsyncOperation = default(string), int? retryAfter = default(int?)) + public BackupInstancesValidateForRestoreHeaders(string location = default(string), string azureAsyncOperation = default(string), int? retryAfter = default(int?)) { Location = location; AzureAsyncOperation = azureAsyncOperation; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs index 56bb78b6e9bc6..c8b4629b7f85b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupParameters.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupParameters base /// - [Newtonsoft.Json.JsonObject("BackupParameters")] public partial class BackupParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs index b0558098f595d..f8876d262a397 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BackupPolicy.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Rule based backup policy /// - [Newtonsoft.Json.JsonObject("BackupPolicy")] public partial class BackupPolicy : BaseBackupPolicy { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs index 2f22621b62026..751621ac4accf 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BaseBackupPolicy.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BackupPolicy base /// - [Newtonsoft.Json.JsonObject("BaseBackupPolicy")] public partial class BaseBackupPolicy { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs index db86b7704f987..316146a57c071 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/BasePolicyRule.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// BasePolicy Rule /// - [Newtonsoft.Json.JsonObject("BasePolicyRule")] public partial class BasePolicyRule { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs index e3d53b68ed0fa..8d98c16fcb6c6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOnExpiryOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Copy on Expiry Option /// - [Newtonsoft.Json.JsonObject("CopyOnExpiryOption")] public partial class CopyOnExpiryOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs index 1a32dab5f1ae8..189916ad5c0df 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CopyOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Options to copy /// - [Newtonsoft.Json.JsonObject("CopyOption")] public partial class CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs index f0b78ba3e2b36..0420f11540d36 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/CustomCopyOption.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Duration based custom options to copy /// - [Newtonsoft.Json.JsonObject("CustomCopyOption")] public partial class CustomCopyOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs index 76553c1dcb419..650583e52a290 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DataStoreParameters.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Parameters for DataStore /// - [Newtonsoft.Json.JsonObject("DataStoreParameters")] public partial class DataStoreParameters { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs index bf8458939e0cc..d97d270007988 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/DeleteOption.cs @@ -20,7 +20,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Delete Option /// - [Newtonsoft.Json.JsonObject("DeleteOption")] public partial class DeleteOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs index 0e2a8ddc9ff32..d015b787a33d6 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequest.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Base class for feature object /// - [Newtonsoft.Json.JsonObject("FeatureValidationRequest")] public partial class FeatureValidationRequest : FeatureValidationRequestBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs index ac054517cf734..da4a29209e116 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationRequestBase.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Base class for Backup Feature support /// - [Newtonsoft.Json.JsonObject("FeatureValidationRequestBase")] public partial class FeatureValidationRequestBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs index eae5bb3bfd6bc..443b2ab5a6f2a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponse.cs @@ -18,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Feature Validation Response /// - [Newtonsoft.Json.JsonObject("FeatureValidationResponse")] public partial class FeatureValidationResponse : FeatureValidationResponseBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs index 7711ca5f31b19..9897681d1496b 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/FeatureValidationResponseBase.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Base class for Backup Feature support /// - [Newtonsoft.Json.JsonObject("FeatureValidationResponseBase")] public partial class FeatureValidationResponseBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs index f228953b84432..6c05eb881a2ad 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ImmediateCopyOption.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Immediate copy Option /// - [Newtonsoft.Json.JsonObject("ImmediateCopyOption")] public partial class ImmediateCopyOption : CopyOption { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs index d8a76a866db19..2dd889476dfb0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreCriteria.cs @@ -10,13 +10,11 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// /// Class to contain criteria for item level restore /// - [Newtonsoft.Json.JsonObject("ItemLevelRestoreCriteria")] public partial class ItemLevelRestoreCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs index db42316cb86e0..275e4219fa055 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ItemLevelRestoreTargetInfo.cs @@ -19,7 +19,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Restore target info for Item level restore operation /// - [Newtonsoft.Json.JsonObject("ItemLevelRestoreTargetInfo")] public partial class ItemLevelRestoreTargetInfo : RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs index 82a66f47c8399..f6504787ae3fe 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RangeBasedItemLevelRestoreCriteria.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Item Level target info for restore operation /// - [Newtonsoft.Json.JsonObject("RangeBasedItemLevelRestoreCriteria")] public partial class RangeBasedItemLevelRestoreCriteria : ItemLevelRestoreCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs index 664c0974314b4..d7b3e302bce64 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreFilesTargetInfo.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Class encapsulating restore as files target parameters /// - [Newtonsoft.Json.JsonObject("RestoreFilesTargetInfo")] public partial class RestoreFilesTargetInfo : RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs index c4840db162755..33b3e29d358f1 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfo.cs @@ -17,7 +17,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Class encapsulating restore target parameters /// - [Newtonsoft.Json.JsonObject("RestoreTargetInfo")] public partial class RestoreTargetInfo : RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs index 246cf582516fe..24c8eb40f70e4 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/RestoreTargetInfoBase.cs @@ -16,7 +16,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Base class common to RestoreTargetInfo and RestoreFilesTargetInfo /// - [Newtonsoft.Json.JsonObject("RestoreTargetInfoBase")] public partial class RestoreTargetInfoBase { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs index cd03b95da4359..e600d2e12ca4a 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedBackupCriteria.cs @@ -21,7 +21,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Schedule based backup criteria /// - [Newtonsoft.Json.JsonObject("ScheduleBasedBackupCriteria")] public partial class ScheduleBasedBackupCriteria : BackupCriteria { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs index 3df0a4dc7dcb5..329cc882831d8 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/ScheduleBasedTriggerContext.cs @@ -22,7 +22,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Schedule based trigger context /// - [Newtonsoft.Json.JsonObject("ScheduleBasedTriggerContext")] public partial class ScheduleBasedTriggerContext : TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs index 9f60526fbaeee..1819703da9dba 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/Models/TriggerContext.cs @@ -10,7 +10,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models { - using Newtonsoft.Json; using System.Linq; /// @@ -19,7 +18,6 @@ namespace Microsoft.Azure.Management.DataProtection.Models /// /// Trigger context /// - [Newtonsoft.Json.JsonObject("TriggerContext")] public partial class TriggerContext { /// diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs similarity index 77% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs index 5503263391d9e..7941da4424422 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// RecoveryPointOperations operations. + /// OperationStatusOperations operations. /// - internal partial class RecoveryPointOperations : IServiceOperations, IRecoveryPointOperations + internal partial class OperationStatusOperations : IServiceOperations, IOperationStatusOperations { /// - /// Initializes a new instance of the RecoveryPointOperations class. + /// Initializes a new instance of the OperationStatusOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class RecoveryPointOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal RecoveryPointOperations(DataProtectionClient client) + internal OperationStatusOperations(DataProtectionClient client) { if (client == null) { @@ -51,18 +51,11 @@ internal RecoveryPointOperations(DataProtectionClient client) public DataProtectionClient Client { get; private set; } /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// Gets the operation status for a resource. /// - /// - /// The name of the backup vault. + /// /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// + /// /// /// /// Headers that will be added to request. @@ -85,31 +78,23 @@ internal RecoveryPointOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> GetWithHttpMessagesAsync(string location, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); - } - if (resourceGroupName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); - } if (Client.SubscriptionId == null) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (backupInstanceName == null) + if (location == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); + throw new ValidationException(ValidationRules.CannotBeNull, "location"); } - if (recoveryPointId == null) + if (operationId == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; @@ -118,21 +103,17 @@ internal RecoveryPointOperations(DataProtectionClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("backupInstanceName", backupInstanceName); - tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("location", location); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/locations/{location}/operationStatus/{operationId}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); - _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + _url = _url.Replace("{location}", System.Uri.EscapeDataString(location)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); if (Client.ApiVersion != null) { @@ -231,7 +212,7 @@ internal RecoveryPointOperations(DataProtectionClient client) throw ex; } // Create Result - var _result = new AzureOperationResponse(); + var _result = new AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; if (_httpResponse.Headers.Contains("x-ms-request-id")) @@ -244,7 +225,7 @@ internal RecoveryPointOperations(DataProtectionClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); } catch (JsonException ex) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs new file mode 100644 index 0000000000000..a03e197bda736 --- /dev/null +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/OperationStatusOperationsExtensions.cs @@ -0,0 +1,61 @@ +// +// 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. +// + +namespace Microsoft.Azure.Management.DataProtection +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for OperationStatusOperations. + /// + public static partial class OperationStatusOperationsExtensions + { + /// + /// Gets the operation status for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + public static OperationResource Get(this IOperationStatusOperations operations, string location, string operationId) + { + return operations.GetAsync(location, operationId).GetAwaiter().GetResult(); + } + + /// + /// Gets the operation status for a resource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IOperationStatusOperations operations, string location, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(location, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs deleted file mode 100644 index deaab0e43d0f2..0000000000000 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointOperationsExtensions.cs +++ /dev/null @@ -1,75 +0,0 @@ -// -// 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. -// - -namespace Microsoft.Azure.Management.DataProtection -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RecoveryPointOperations. - /// - public static partial class RecoveryPointOperationsExtensions - { - /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// - /// - public static AzureBackupRecoveryPointResource Get(this IRecoveryPointOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId) - { - return operations.GetAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId).GetAwaiter().GetResult(); - } - - /// - /// Gets a Recovery Point using recoveryPointId for a Datasource. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the backup vault. - /// - /// - /// The name of the resource group where the backup vault is present. - /// - /// - /// The name of the backup instance - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IRecoveryPointOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs index fca08f8457fbc..495bb0d4ccbf0 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperations.cs @@ -90,7 +90,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -125,7 +125,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("skipToken", skipToken); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetList", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; @@ -276,6 +276,219 @@ internal RecoveryPointsOperations(DataProtectionClient client) return _result; } + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (Client.SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (backupInstanceName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); + } + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + // Tracing + bool _shouldTrace = ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = ServiceClientTracing.NextInvocationId.ToString(); + Dictionary tracingParameters = new Dictionary(); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("backupInstanceName", backupInstanceName); + tracingParameters.Add("recoveryPointId", recoveryPointId); + tracingParameters.Add("cancellationToken", cancellationToken); + ServiceClientTracing.Enter(_invocationId, this, "Get", tracingParameters); + } + // Construct URL + var _baseUrl = Client.BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/recoveryPoints/{recoveryPointId}").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); + _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); + _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); + List _queryParameters = new List(); + if (Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + // Set Credentials + if (Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + if ((int)_statusCode != 200) + { + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + if (_errorBody != null) + { + ex = new CloudException(_errorBody.Message); + ex.Body = _errorBody; + } + } + catch (JsonException) + { + // Ignore the exception + } + ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + if (_shouldTrace) + { + ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new AzureOperationResponse(); + _result.Request = _httpRequest; + _result.Response = _httpResponse; + if (_httpResponse.Headers.Contains("x-ms-request-id")) + { + _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + } + // Deserialize Response + if ((int)_statusCode == 200) + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + try + { + _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + } + catch (JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + } + /// /// Returns a list of Recovery Points for a DataSource in a vault. /// @@ -303,7 +516,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> GetListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (nextPageLink == null) { @@ -318,7 +531,7 @@ internal RecoveryPointsOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("nextPageLink", nextPageLink); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetListNext", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); } // Construct URL string _url = "{nextLink}"; diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs index f21887bdeadf6..f7bef6b42c2c9 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RecoveryPointsOperationsExtensions.cs @@ -43,9 +43,9 @@ public static partial class RecoveryPointsOperationsExtensions /// /// skipToken Filter. /// - public static IPage GetList(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static IPage List(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) { - return operations.GetListAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.ListAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken).GetAwaiter().GetResult(); } /// @@ -72,9 +72,59 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The cancellation token. /// - public static async Task> GetListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetListWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + public static AzureBackupRecoveryPointResource Get(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId) + { + return operations.GetAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId).GetAwaiter().GetResult(); + } + + /// + /// Gets a Recovery Point using recoveryPointId for a Datasource. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the backup vault. + /// + /// + /// The name of the resource group where the backup vault is present. + /// + /// + /// The name of the backup instance + /// + /// + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, string recoveryPointId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -89,9 +139,9 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The NextLink from the previous successful call to List operation. /// - public static IPage GetListNext(this IRecoveryPointsOperations operations, string nextPageLink) + public static IPage ListNext(this IRecoveryPointsOperations operations, string nextPageLink) { - return operations.GetListNextAsync(nextPageLink).GetAwaiter().GetResult(); + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); } /// @@ -106,9 +156,9 @@ public static IPage GetListNext(this IRecovery /// /// The cancellation token. /// - public static async Task> GetListNextAsync(this IRecoveryPointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task> ListNextAsync(this IRecoveryPointsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.GetListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs similarity index 91% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs index 81c43ee4743be..2357ca365025c 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperations.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// FindRestorableTimeRangesOperations operations. + /// RestorableTimeRangesOperations operations. /// - internal partial class FindRestorableTimeRangesOperations : IServiceOperations, IFindRestorableTimeRangesOperations + internal partial class RestorableTimeRangesOperations : IServiceOperations, IRestorableTimeRangesOperations { /// - /// Initializes a new instance of the FindRestorableTimeRangesOperations class. + /// Initializes a new instance of the RestorableTimeRangesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class FindRestorableTimeRangesOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal FindRestorableTimeRangesOperations(DataProtectionClient client) + internal RestorableTimeRangesOperations(DataProtectionClient client) { if (client == null) { @@ -56,7 +56,8 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -82,7 +83,7 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) /// /// A response object containing the response body and response headers. /// - public async Task> PostWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task> FindWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (Client.ApiVersion == null) { @@ -100,9 +101,9 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - if (backupInstances == null) + if (backupInstanceName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "backupInstances"); + throw new ValidationException(ValidationRules.CannotBeNull, "backupInstanceName"); } if (parameters == null) { @@ -121,18 +122,18 @@ internal FindRestorableTimeRangesOperations(DataProtectionClient client) Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("backupInstances", backupInstances); + tracingParameters.Add("backupInstanceName", backupInstanceName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Post", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "Find", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstances}/findRestorableTimeRanges").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/findRestorableTimeRanges").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - _url = _url.Replace("{backupInstances}", System.Uri.EscapeDataString(backupInstances)); + _url = _url.Replace("{backupInstanceName}", System.Uri.EscapeDataString(backupInstanceName)); List _queryParameters = new List(); if (Client.ApiVersion != null) { diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs similarity index 64% rename from sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs rename to sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs index 2db379e2a90b9..97be9ff2db1e5 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/FindRestorableTimeRangesOperationsExtensions.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/RestorableTimeRangesOperationsExtensions.cs @@ -17,9 +17,9 @@ namespace Microsoft.Azure.Management.DataProtection using System.Threading.Tasks; /// - /// Extension methods for FindRestorableTimeRangesOperations. + /// Extension methods for RestorableTimeRangesOperations. /// - public static partial class FindRestorableTimeRangesOperationsExtensions + public static partial class RestorableTimeRangesOperationsExtensions { /// /// The operations group for this extension method. @@ -30,14 +30,15 @@ public static partial class FindRestorableTimeRangesOperationsExtensions /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation /// - public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFindRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters) + public static AzureBackupFindRestorableTimeRangesResponseResource Find(this IRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters) { - return operations.PostAsync(vaultName, resourceGroupName, backupInstances, parameters).GetAwaiter().GetResult(); + return operations.FindAsync(vaultName, resourceGroupName, backupInstanceName, parameters).GetAwaiter().GetResult(); } /// @@ -49,7 +50,8 @@ public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFin /// /// The name of the resource group where the backup vault is present. /// - /// + /// + /// The name of the backup instance /// /// /// Request body for operation @@ -57,9 +59,9 @@ public static AzureBackupFindRestorableTimeRangesResponseResource Post(this IFin /// /// The cancellation token. /// - public static async Task PostAsync(this IFindRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstances, AzureBackupFindRestorableTimeRangesRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + public static async Task FindAsync(this IRestorableTimeRangesOperations operations, string vaultName, string resourceGroupName, string backupInstanceName, AzureBackupFindRestorableTimeRangesRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.PostWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstances, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.FindWithHttpMessagesAsync(vaultName, resourceGroupName, backupInstanceName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs index 06ed32cdae184..acf488333d7fb 100644 --- a/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs +++ b/sdk/dataprotection/Microsoft.Azure.Management.DataProtection/src/Generated/SdkInfo_DataProtectionClient.cs @@ -21,33 +21,19 @@ public static IEnumerable> ApiInfo_DataProtectionC { new Tuple("DataProtection", "BackupInstances", "2021-01-01"), new Tuple("DataProtection", "BackupPolicies", "2021-01-01"), + new Tuple("DataProtection", "BackupVaultOperationResults", "2021-01-01"), new Tuple("DataProtection", "BackupVaults", "2021-01-01"), - new Tuple("DataProtection", "CheckFeatureSupport", "2021-01-01"), + new Tuple("DataProtection", "DataProtection", "2021-01-01"), + new Tuple("DataProtection", "DataProtectionOperations", "2021-01-01"), new Tuple("DataProtection", "ExportJobs", "2021-01-01"), new Tuple("DataProtection", "ExportJobsOperationResult", "2021-01-01"), - new Tuple("DataProtection", "FindRestorableTimeRanges", "2021-01-01"), - new Tuple("DataProtection", "GetOperationResultPatch", "2021-01-01"), - new Tuple("DataProtection", "GetOperationStatus", "2021-01-01"), - new Tuple("DataProtection", "Job", "2021-01-01"), new Tuple("DataProtection", "Jobs", "2021-01-01"), new Tuple("DataProtection", "OperationResult", "2021-01-01"), - new Tuple("DataProtection", "Operations", "2021-01-01"), - new Tuple("DataProtection", "RecoveryPoint", "2021-01-01"), + new Tuple("DataProtection", "OperationStatus", "2021-01-01"), new Tuple("DataProtection", "RecoveryPoints", "2021-01-01"), + new Tuple("DataProtection", "RestorableTimeRanges", "2021-01-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@2.0.4413"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/dataprotection/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=C:\\One\\github\\mayank\\azure-sdk-for-net\\sdk"; - - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "master"; - public static readonly String GithubCommidId = "e1ab90da9a49c2f22ed2d836332a00a2b12cc4e1"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } -