diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperations.cs deleted file mode 100644 index e43eaf043044..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperations.cs +++ /dev/null @@ -1,247 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// AadPropertiesOperations operations. - /// - internal partial class AadPropertiesOperations : IServiceOperations, IAadPropertiesOperations - { - /// - /// Initializes a new instance of the AadPropertiesOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal AadPropertiesOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Fetches the AAD properties from target region BCM stamp. - /// - /// - /// Azure region to hit Api - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 azureRegion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (azureRegion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); - 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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupAadProperties").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - 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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperationsExtensions.cs deleted file mode 100644 index 29a4693a1035..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/AadPropertiesOperationsExtensions.cs +++ /dev/null @@ -1,66 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for AadPropertiesOperations. - /// - public static partial class AadPropertiesOperationsExtensions - { - /// - /// Fetches the AAD properties from target region BCM stamp. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// OData parameters to apply to the operation. - /// - public static AADPropertiesResource Get(this IAadPropertiesOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.GetAsync(azureRegion, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Fetches the AAD properties from target region BCM stamp. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IAadPropertiesOperations operations, string azureRegion, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs index 7bbdb7dda35b..5d4913bdd700 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BMSPrepareDataMoveOperationResultOperations.cs @@ -85,6 +85,10 @@ internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClien /// 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 (vaultName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); @@ -101,7 +105,6 @@ internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -109,7 +112,6 @@ internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("operationId", operationId); @@ -124,9 +126,9 @@ internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClien _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperations.cs deleted file mode 100644 index 542062e61890..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperations.cs +++ /dev/null @@ -1,248 +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.RecoveryServices.Backup -{ - 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; - - /// - /// BackupCrrJobDetailsOperations operations. - /// - internal partial class BackupCrrJobDetailsOperations : IServiceOperations, IBackupCrrJobDetailsOperations - { - /// - /// Initializes a new instance of the BackupCrrJobDetailsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackupCrrJobDetailsOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Get CRR job details from target region. - /// - /// - /// Azure region to hit Api - /// - /// - /// CRR Job request - /// - /// - /// 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 azureRegion, CrrJobRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (azureRegion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); - tracingParameters.Add("parameters", parameters); - 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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJob").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - 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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperationsExtensions.cs deleted file mode 100644 index 0813fdd5cacd..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobDetailsOperationsExtensions.cs +++ /dev/null @@ -1,65 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BackupCrrJobDetailsOperations. - /// - public static partial class BackupCrrJobDetailsOperationsExtensions - { - /// - /// Get CRR job details from target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// CRR Job request - /// - public static JobResource Get(this IBackupCrrJobDetailsOperations operations, string azureRegion, CrrJobRequest parameters) - { - return operations.GetAsync(azureRegion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Get CRR job details from target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// CRR Job request - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBackupCrrJobDetailsOperations operations, string azureRegion, CrrJobRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperations.cs deleted file mode 100644 index 496418b1e088..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperations.cs +++ /dev/null @@ -1,437 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// BackupCrrJobsOperations operations. - /// - internal partial class BackupCrrJobsOperations : IServiceOperations, IBackupCrrJobsOperations - { - /// - /// Initializes a new instance of the BackupCrrJobsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackupCrrJobsOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// Azure region to hit Api - /// - /// - /// Backup CRR Job request - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - /// - /// 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>> ListWithHttpMessagesAsync(string azureRegion, CrrJobRequest parameters, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (azureRegion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); - } - // Construct URL - var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrJobs").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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; - // 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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperationsExtensions.cs deleted file mode 100644 index feb193b9c9d8..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupCrrJobsOperationsExtensions.cs +++ /dev/null @@ -1,112 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BackupCrrJobsOperations. - /// - public static partial class BackupCrrJobsOperationsExtensions - { - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// Backup CRR Job request - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - public static IPage List(this IBackupCrrJobsOperations operations, string azureRegion, CrrJobRequest parameters, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(azureRegion, parameters, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// Backup CRR Job request - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBackupCrrJobsOperations operations, string azureRegion, CrrJobRequest parameters, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(azureRegion, parameters, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IBackupCrrJobsOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IBackupCrrJobsOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs index 400a84bb6736..822f5cfc137f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupEnginesOperations.cs @@ -91,6 +91,10 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -103,7 +107,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +115,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -134,9 +136,9 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { @@ -309,6 +311,10 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupEngineName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -325,7 +331,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "backupEngineName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -334,7 +339,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("backupEngineName", backupEngineName); @@ -358,9 +362,9 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs index 50684d0c0950..d40858c5223e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs @@ -90,6 +90,10 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -102,7 +106,6 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +114,6 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -133,9 +135,9 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs index 6c93b453f947..72ae92f70f0f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs @@ -89,6 +89,10 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) /// 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 (vaultName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); @@ -105,7 +109,6 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +116,6 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("operationId", operationId); @@ -128,9 +130,9 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs index 86aebe71300a..5fc0eb2d099a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs @@ -91,6 +91,10 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) /// 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 (vaultName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); @@ -107,7 +111,6 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -115,7 +118,6 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("operationId", operationId); @@ -130,9 +132,9 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs index dabe2ac46821..36b1209b1b32 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs @@ -89,6 +89,10 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -101,7 +105,6 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,7 +113,6 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -131,9 +133,9 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs index e2b46a861530..228280dc1748 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs @@ -92,6 +92,10 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -104,7 +108,6 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +116,6 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -135,9 +137,9 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperations.cs deleted file mode 100644 index dac24d06de2a..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperations.cs +++ /dev/null @@ -1,433 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// BackupProtectedItemsCrrOperations operations. - /// - internal partial class BackupProtectedItemsCrrOperations : IServiceOperations, IBackupProtectedItemsCrrOperations - { - /// - /// Initializes a new instance of the BackupProtectedItemsCrrOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackupProtectedItemsCrrOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - /// - /// 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("skipToken", skipToken); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", 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.RecoveryServices/vaults/{vaultName}/backupProtectedItems/").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)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); - } - 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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperationsExtensions.cs deleted file mode 100644 index 0cc9e4ce6aab..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsCrrOperationsExtensions.cs +++ /dev/null @@ -1,114 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BackupProtectedItemsCrrOperations. - /// - public static partial class BackupProtectedItemsCrrOperationsExtensions - { - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - public static IPage List(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IBackupProtectedItemsCrrOperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IBackupProtectedItemsCrrOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Provides a pageable list of all items that are backed up within a vault. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IBackupProtectedItemsCrrOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs index 89280173c2ee..944a3d5027b0 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs @@ -90,6 +90,10 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -102,7 +106,6 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +114,6 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -133,9 +135,9 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs index cf0154b95e21..01ed97d6584e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs @@ -87,6 +87,10 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -99,7 +103,6 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -108,7 +111,6 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -129,9 +131,9 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs index 2b7ffb2cdd69..276b87c0cab8 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionIntentOperations.cs @@ -90,6 +90,10 @@ internal BackupProtectionIntentOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -102,7 +106,6 @@ internal BackupProtectionIntentOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +114,6 @@ internal BackupProtectionIntentOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -133,9 +135,9 @@ internal BackupProtectionIntentOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs index c256e6fc2028..8394b46cc46b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs @@ -83,6 +83,10 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, 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"); @@ -95,7 +99,6 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -116,9 +118,9 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -273,6 +275,10 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient /// public async Task UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, 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"); @@ -289,7 +295,6 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -297,7 +302,6 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -311,9 +315,9 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs index 2932c1bcd207..589e741ffccc 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsNonCRROperations.cs @@ -83,6 +83,10 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, 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"); @@ -95,7 +99,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -116,9 +118,9 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -276,6 +278,10 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie /// public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, 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"); @@ -292,7 +298,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -300,7 +305,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -314,9 +318,9 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -477,6 +481,10 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie /// public async Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, 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"); @@ -493,7 +501,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -501,7 +508,6 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -515,9 +521,9 @@ internal BackupResourceStorageConfigsNonCRROperations(RecoveryServicesBackupClie _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperations.cs deleted file mode 100644 index 7a3a3186fd2d..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperations.cs +++ /dev/null @@ -1,631 +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.RecoveryServices.Backup -{ - 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; - - /// - /// BackupResourceStorageConfigsOperations operations. - /// - internal partial class BackupResourceStorageConfigsOperations : IServiceOperations, IBackupResourceStorageConfigsOperations - { - /// - /// Initializes a new instance of the BackupResourceStorageConfigsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackupResourceStorageConfigsOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Fetches resource storage config. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services 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> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").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)); - 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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Updates vault storage model type. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Update", 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").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)); - 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("PUT"); - _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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Updates vault storage model type. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Patch", 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.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").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)); - 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("PATCH"); - _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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 204) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperationsExtensions.cs deleted file mode 100644 index ae77ed761f1d..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceStorageConfigsOperationsExtensions.cs +++ /dev/null @@ -1,160 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for BackupResourceStorageConfigsOperations. - /// - public static partial class BackupResourceStorageConfigsOperationsExtensions - { - /// - /// Fetches resource storage config. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName) - { - return operations.GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); - } - - /// - /// Fetches resource storage config. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates vault storage model type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) - { - return operations.UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates vault storage model type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// The cancellation token. - /// - public static async Task UpdateAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Updates vault storage model type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - public static void Patch(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) - { - operations.PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Updates vault storage model type. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// The cancellation token. - /// - public static async Task PatchAsync(this IBackupResourceStorageConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs index 883a4c9e4f29..1539936618cc 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceVaultConfigsOperations.cs @@ -83,6 +83,10 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, 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"); @@ -95,7 +99,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -116,9 +118,9 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -276,6 +278,10 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien /// public async Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, 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"); @@ -292,7 +298,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -300,7 +305,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -314,9 +318,9 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -480,6 +484,10 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien /// public async Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, 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"); @@ -496,7 +504,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -504,7 +511,6 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -518,9 +524,9 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs index 31e25354b760..8fe4f52de154 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupStatusOperations.cs @@ -82,6 +82,10 @@ internal BackupStatusOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string azureRegion, BackupStatusRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (azureRegion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); @@ -94,7 +98,6 @@ internal BackupStatusOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -102,7 +105,6 @@ internal BackupStatusOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("azureRegion", azureRegion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -114,9 +116,9 @@ internal BackupStatusOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs index 975e96418779..128be67bac7b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesOperations.cs @@ -90,6 +90,10 @@ internal BackupUsageSummariesOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -102,7 +106,6 @@ internal BackupUsageSummariesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +114,6 @@ internal BackupUsageSummariesOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("skipToken", skipToken); @@ -133,9 +135,9 @@ internal BackupUsageSummariesOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs index 9b53a53b759d..06d072331658 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupWorkloadItemsOperations.cs @@ -98,6 +98,10 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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"); @@ -118,7 +122,6 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -127,7 +130,6 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -153,9 +155,9 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (skipToken != null) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs index 2355c728368a..8ec339518a32 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs @@ -94,6 +94,10 @@ internal BackupsOperations(RecoveryServicesBackupClient client) /// public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, 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"); @@ -122,7 +126,6 @@ internal BackupsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,7 +133,6 @@ internal BackupsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -150,9 +152,9 @@ internal BackupsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperationsExtensions.cs deleted file mode 100644 index 50eb086026ae..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperationsExtensions.cs +++ /dev/null @@ -1,103 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CrossRegionRestoreOperations. - /// - public static partial class CrossRegionRestoreOperationsExtensions - { - /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - public static void Trigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrossRegionRestoreRequest parameters) - { - operations.TriggerAsync(azureRegion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - /// - /// The cancellation token. - /// - public static async Task TriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrossRegionRestoreRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.TriggerWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - public static void BeginTrigger(this ICrossRegionRestoreOperations operations, string azureRegion, CrossRegionRestoreRequest parameters) - { - operations.BeginTriggerAsync(azureRegion, parameters).GetAwaiter().GetResult(); - } - - /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. - /// - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - /// - /// The cancellation token. - /// - public static async Task BeginTriggerAsync(this ICrossRegionRestoreOperations operations, string azureRegion, CrossRegionRestoreRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.BeginTriggerWithHttpMessagesAsync(azureRegion, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperations.cs deleted file mode 100644 index 42b20c3d9351..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperations.cs +++ /dev/null @@ -1,218 +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.RecoveryServices.Backup -{ - 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; - - /// - /// CrrOperationResultsOperations operations. - /// - internal partial class CrrOperationResultsOperations : IServiceOperations, ICrrOperationResultsOperations - { - /// - /// Initializes a new instance of the CrrOperationResultsOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CrrOperationResultsOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Azure region to hit Api - /// - /// - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// 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 azureRegion, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (azureRegion == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); - } - if (Client.SubscriptionId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); - } - if (operationId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); - 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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationResults/{operationId}").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); - _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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(); - } - if (_shouldTrace) - { - ServiceClientTracing.Exit(_invocationId, _result); - } - return _result; - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperationsExtensions.cs deleted file mode 100644 index 41a1489af371..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationResultsOperationsExtensions.cs +++ /dev/null @@ -1,54 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CrrOperationResultsOperations. - /// - public static partial class CrrOperationResultsOperationsExtensions - { - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// - public static void Get(this ICrrOperationResultsOperations operations, string azureRegion, string operationId) - { - operations.GetAsync(azureRegion, operationId).GetAwaiter().GetResult(); - } - - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICrrOperationResultsOperations operations, string azureRegion, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - (await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperationsExtensions.cs deleted file mode 100644 index 19be6b36645b..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperationsExtensions.cs +++ /dev/null @@ -1,57 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for CrrOperationStatusOperations. - /// - public static partial class CrrOperationStatusOperationsExtensions - { - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// - public static OperationStatus Get(this ICrrOperationStatusOperations operations, string azureRegion, string operationId) - { - return operations.GetAsync(azureRegion, operationId).GetAwaiter().GetResult(); - } - - /// - /// The operations group for this extension method. - /// - /// - /// Azure region to hit Api - /// - /// - /// - /// - /// The cancellation token. - /// - public static async Task GetAsync(this ICrrOperationStatusOperations operations, string azureRegion, string operationId, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetWithHttpMessagesAsync(azureRegion, operationId, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs index 93e44ed4421a..bca2e6e8e02c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs @@ -89,6 +89,10 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien /// 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 (vaultName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); @@ -105,7 +109,6 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +116,6 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("operationId", operationId); @@ -128,9 +130,9 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs index be926b406a1d..6850eef7a84f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/FeatureSupportOperations.cs @@ -83,6 +83,10 @@ internal FeatureSupportOperations(RecoveryServicesBackupClient client) /// public async Task> ValidateWithHttpMessagesAsync(string azureRegion, FeatureSupportRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (azureRegion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); @@ -95,7 +99,6 @@ internal FeatureSupportOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal FeatureSupportOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("azureRegion", azureRegion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -115,9 +117,9 @@ internal FeatureSupportOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IAadPropertiesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IAadPropertiesOperations.cs deleted file mode 100644 index d3edd8c01ec0..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IAadPropertiesOperations.cs +++ /dev/null @@ -1,53 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// AadPropertiesOperations operations. - /// - public partial interface IAadPropertiesOperations - { - /// - /// Fetches the AAD properties from target region BCM stamp. - /// - /// - /// Azure region to hit Api - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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 azureRegion, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobDetailsOperations.cs deleted file mode 100644 index eab34e0e0592..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobDetailsOperations.cs +++ /dev/null @@ -1,52 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BackupCrrJobDetailsOperations operations. - /// - public partial interface IBackupCrrJobDetailsOperations - { - /// - /// Get CRR job details from target region. - /// - /// - /// Azure region to hit Api - /// - /// - /// CRR Job request - /// - /// - /// 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 azureRegion, CrrJobRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobsOperations.cs deleted file mode 100644 index 877d6dd9cc46..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupCrrJobsOperations.cs +++ /dev/null @@ -1,81 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BackupCrrJobsOperations operations. - /// - public partial interface IBackupCrrJobsOperations - { - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// Azure region to hit Api - /// - /// - /// Backup CRR Job request - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. - /// - /// - /// 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>> ListWithHttpMessagesAsync(string azureRegion, CrrJobRequest parameters, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Gets the list of CRR jobs from the target region. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsOperations.cs deleted file mode 100644 index b86eb5435ed6..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupResourceStorageConfigsOperations.cs +++ /dev/null @@ -1,108 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// BackupResourceStorageConfigsOperations operations. - /// - public partial interface IBackupResourceStorageConfigsOperations - { - /// - /// Fetches resource storage config. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// 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, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates vault storage model type. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// 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> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Updates vault storage model type. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Vault storage config request - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrossRegionRestoreOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrossRegionRestoreOperations.cs deleted file mode 100644 index 2c1408296693..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrossRegionRestoreOperations.cs +++ /dev/null @@ -1,73 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CrossRegionRestoreOperations operations. - /// - public partial interface ICrossRegionRestoreOperations - { - /// - /// Restores the specified backed up data in a different region as - /// compared to where the data is backed up. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task TriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Restores the specified backed up data in a different region as - /// compared to where the data is backed up. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task BeginTriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationResultsOperations.cs deleted file mode 100644 index 21b64229851d..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationResultsOperations.cs +++ /dev/null @@ -1,45 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// CrrOperationResultsOperations operations. - /// - public partial interface ICrrOperationResultsOperations - { - /// - /// Azure region to hit Api - /// - /// - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - /// - /// Thrown when a required parameter is null - /// - Task GetWithHttpMessagesAsync(string azureRegion, string operationId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsCrrOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsCrrOperations.cs deleted file mode 100644 index 35336ea0155d..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsCrrOperations.cs +++ /dev/null @@ -1,88 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Collections; - using System.Collections.Generic; - using System.Threading; - using System.Threading.Tasks; - - /// - /// RecoveryPointsCrrOperations operations. - /// - public partial interface IRecoveryPointsCrrOperations - { - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the backed up item. - /// - /// - /// Container name associated with the backed up item. - /// - /// - /// Backed up item whose backup copies are to be fetched. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs index 424a6ba65195..2d6874694647 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsOperations.cs @@ -104,48 +104,6 @@ public partial interface IRecoveryPointsOperations /// Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Returns the Access token for communication between BMS and - /// Protection service - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the container. - /// - /// - /// Name of the container. - /// - /// - /// Name of the Protected Item. - /// - /// - /// Recovery Point Id - /// - /// - /// Get Access Token request - /// - /// - /// 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> GetAccessTokenWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, AADPropertiesResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// /// Lists the backup copies for the backed up item. /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs index 1f2b4a87732b..472257ccabf6 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs @@ -49,6 +49,11 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// string SubscriptionId { get; set; } + /// + /// Client Api Version. + /// + string ApiVersion { get; } + /// /// The preferred language for the response. /// @@ -203,6 +208,21 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// IOperationOperations Operation { get; } + /// + /// Gets the IValidateOperationOperations. + /// + IValidateOperationOperations ValidateOperation { get; } + + /// + /// Gets the IValidateOperationResultsOperations. + /// + IValidateOperationResultsOperations ValidateOperationResults { get; } + + /// + /// Gets the IValidateOperationStatusesOperations. + /// + IValidateOperationStatusesOperations ValidateOperationStatuses { get; } + /// /// Gets the IBackupEnginesOperations. /// @@ -293,56 +313,6 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// IResourceGuardProxyOperations ResourceGuardProxy { get; } - /// - /// Gets the IBackupUsageSummariesCRROperations. - /// - IBackupUsageSummariesCRROperations BackupUsageSummariesCRR { get; } - - /// - /// Gets the IAadPropertiesOperations. - /// - IAadPropertiesOperations AadProperties { get; } - - /// - /// Gets the ICrossRegionRestoreOperations. - /// - ICrossRegionRestoreOperations CrossRegionRestore { get; } - - /// - /// Gets the IBackupCrrJobDetailsOperations. - /// - IBackupCrrJobDetailsOperations BackupCrrJobDetails { get; } - - /// - /// Gets the IBackupCrrJobsOperations. - /// - IBackupCrrJobsOperations BackupCrrJobs { get; } - - /// - /// Gets the ICrrOperationResultsOperations. - /// - ICrrOperationResultsOperations CrrOperationResults { get; } - - /// - /// Gets the ICrrOperationStatusOperations. - /// - ICrrOperationStatusOperations CrrOperationStatus { get; } - - /// - /// Gets the IBackupResourceStorageConfigsOperations. - /// - IBackupResourceStorageConfigsOperations BackupResourceStorageConfigs { get; } - - /// - /// Gets the IRecoveryPointsCrrOperations. - /// - IRecoveryPointsCrrOperations RecoveryPointsCrr { get; } - - /// - /// Gets the IBackupProtectedItemsCrrOperations. - /// - IBackupProtectedItemsCrrOperations BackupProtectedItemsCrr { get; } - /// /// Fetches operation status for data move operation on vault /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsCrrOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs similarity index 54% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsCrrOperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs index f2bcaa778349..80c77bb50e78 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsCrrOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationOperations.cs @@ -12,7 +12,6 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup { using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -20,13 +19,14 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// BackupProtectedItemsCrrOperations operations. + /// ValidateOperationOperations operations. /// - public partial interface IBackupProtectedItemsCrrOperations + public partial interface IValidateOperationOperations { /// - /// Provides a pageable list of all items that are backed up within a - /// vault. + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be + /// tracked using GetValidateOperationResult API. /// /// /// The name of the recovery services vault. @@ -35,11 +35,8 @@ public partial interface IBackupProtectedItemsCrrOperations /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. + /// + /// resource validate operation request /// /// /// The headers that will be added to request. @@ -47,22 +44,27 @@ public partial interface IBackupProtectedItemsCrrOperations /// /// 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); /// - /// Provides a pageable list of all items that are backed up within a - /// vault. + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be + /// tracked using GetValidateOperationResult API. /// - /// - /// The NextLink from the previous successful call to List operation. + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request /// /// /// The headers that will be added to request. @@ -70,15 +72,12 @@ public partial interface IBackupProtectedItemsCrrOperations /// /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs similarity index 65% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesCRROperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs index e60212e5ccff..26b982ac7108 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesCRROperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationResultsOperations.cs @@ -12,7 +12,6 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup { using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; using System.Collections; using System.Collections.Generic; @@ -20,12 +19,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// BackupUsageSummariesCRROperations operations. + /// ValidateOperationResultsOperations operations. /// - public partial interface IBackupUsageSummariesCRROperations + public partial interface IValidateOperationResultsOperations { /// - /// Fetches the backup management usage summaries of the vault. + /// Fetches the result of a triggered validate operation. /// /// /// The name of the recovery services vault. @@ -34,11 +33,9 @@ public partial interface IBackupUsageSummariesCRROperations /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. /// /// /// The headers that will be added to request. @@ -46,7 +43,7 @@ public partial interface IBackupUsageSummariesCRROperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -55,6 +52,6 @@ public partial interface IBackupUsageSummariesCRROperations /// /// Thrown when a required parameter is null /// - Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs similarity index 55% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationStatusOperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs index 0dd3bd913393..cc157a42ad9b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationStatusOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IValidateOperationStatusesOperations.cs @@ -19,14 +19,28 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// CrrOperationStatusOperations operations. + /// ValidateOperationStatusesOperations operations. /// - public partial interface ICrrOperationStatusOperations + public partial interface IValidateOperationStatusesOperations { - /// - /// Azure region to hit Api + /// + /// Fetches the status of a triggered validate operation. The status + /// can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the + /// possible states of the operation. + /// If operation has completed, this method returns the list of errors + /// obtained while validating the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. /// /// + /// OperationID represents the operation whose status needs to be + /// fetched. /// /// /// The headers that will be added to request. @@ -34,7 +48,7 @@ public partial interface ICrrOperationStatusOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -43,6 +57,6 @@ public partial interface ICrrOperationStatusOperations /// /// Thrown when a required parameter is null /// - Task> GetWithHttpMessagesAsync(string azureRegion, string operationId, 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs index be045496e522..3d4450b76e3a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ItemLevelRecoveryConnectionsOperations.cs @@ -101,6 +101,10 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli /// public async Task ProvisionWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, 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"); @@ -133,7 +137,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -141,7 +144,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -163,9 +165,9 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -327,6 +329,10 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli /// public async Task RevokeWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, 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"); @@ -355,7 +361,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -363,7 +368,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -384,9 +388,9 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs index 11c2935d3b6c..d0860d8c4e8e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs @@ -85,6 +85,10 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) /// public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, 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"); @@ -101,7 +105,6 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -109,7 +112,6 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); @@ -124,9 +126,9 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs index 93230c457ff3..04b62e89ef0d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs @@ -86,6 +86,10 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, 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"); @@ -102,7 +106,6 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,7 +113,6 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); @@ -125,9 +127,9 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs index 47fd826367d9..bb11e13d4d4e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs @@ -86,6 +86,10 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) /// public async Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, 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"); @@ -106,7 +110,6 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,7 +117,6 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("jobName", jobName); @@ -131,9 +133,9 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs index 39a853bb36b8..5fb8984b9e4d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs @@ -85,6 +85,10 @@ internal JobsOperations(RecoveryServicesBackupClient client) /// public async Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -97,7 +101,6 @@ internal JobsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -106,7 +109,6 @@ internal JobsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -127,9 +129,9 @@ internal JobsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADProperties.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADProperties.cs deleted file mode 100644 index c427544da20f..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADProperties.cs +++ /dev/null @@ -1,70 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class AADProperties - { - /// - /// Initializes a new instance of the AADProperties class. - /// - public AADProperties() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AADProperties class. - /// - public AADProperties(string servicePrincipalClientId = default(string), string tenantId = default(string), string authority = default(string), string audience = default(string), string servicePrincipalObjectId = default(string)) - { - ServicePrincipalClientId = servicePrincipalClientId; - TenantId = tenantId; - Authority = authority; - Audience = audience; - ServicePrincipalObjectId = servicePrincipalObjectId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "servicePrincipalClientId")] - public string ServicePrincipalClientId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "tenantId")] - public string TenantId { get; set; } - - /// - /// - [JsonProperty(PropertyName = "authority")] - public string Authority { get; set; } - - /// - /// - [JsonProperty(PropertyName = "audience")] - public string Audience { get; set; } - - /// - /// - [JsonProperty(PropertyName = "servicePrincipalObjectId")] - public string ServicePrincipalObjectId { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADPropertiesResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADPropertiesResource.cs deleted file mode 100644 index ca0bba27ebb2..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AADPropertiesResource.cs +++ /dev/null @@ -1,60 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class AADPropertiesResource : Resource - { - /// - /// Initializes a new instance of the AADPropertiesResource class. - /// - public AADPropertiesResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the AADPropertiesResource class. - /// - /// Resource Id represents the complete path to the - /// resource. - /// Resource name associated with the - /// resource. - /// Resource type represents the complete path of - /// the form Namespace/ResourceType/ResourceType/... - /// Resource location. - /// Resource tags. - /// Optional ETag. - /// AADPropertiesResource properties - public AADPropertiesResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), AADProperties properties = default(AADProperties)) - : base(id, name, type, location, tags, eTag) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets aADPropertiesResource properties - /// - [JsonProperty(PropertyName = "properties")] - public AADProperties Properties { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs new file mode 100644 index 000000000000..3f7b3c2b8aff --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AcquireStorageAccountLock.cs @@ -0,0 +1,22 @@ +// +// 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.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for AcquireStorageAccountLock. + /// + public static class AcquireStorageAccountLock + { + public const string Acquire = "Acquire"; + public const string NotAcquire = "NotAcquire"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs index b634cff37152..824da1a679d4 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureBackupServerContainer.cs @@ -39,6 +39,8 @@ public AzureBackupServerContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Specifies whether the container is /// re-registrable. /// ID of container. @@ -52,8 +54,8 @@ public AzureBackupServerContainer() /// Protection status of the /// container. /// Extended Info of the container. - public AzureBackupServerContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, canReRegister, containerId, protectedItemCount, dpmAgentVersion, dpmServers, upgradeAvailable, protectionStatus, extendedInfo) + public AzureBackupServerContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, canReRegister, containerId, protectedItemCount, dpmAgentVersion, dpmServers, upgradeAvailable, protectionStatus, extendedInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs index bd60c55c229f..5489504fbc3c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileShareRecoveryPoint.cs @@ -54,29 +54,30 @@ public AzureFileShareRecoveryPoint() partial void CustomInit(); /// - /// Gets type of the backup copy. Specifies whether it is a crash - /// consistent backup or app consistent. + /// Gets or sets type of the backup copy. Specifies whether it is a + /// crash consistent backup or app consistent. /// [JsonProperty(PropertyName = "recoveryPointType")] - public string RecoveryPointType { get; private set; } + public string RecoveryPointType { get; set; } /// - /// Gets time at which this backup copy was created. + /// Gets or sets time at which this backup copy was created. /// [JsonProperty(PropertyName = "recoveryPointTime")] - public System.DateTime? RecoveryPointTime { get; private set; } + public System.DateTime? RecoveryPointTime { get; set; } /// - /// Gets contains Url to the snapshot of fileshare, if applicable + /// Gets or sets contains Url to the snapshot of fileshare, if + /// applicable /// [JsonProperty(PropertyName = "fileShareSnapshotUri")] - public string FileShareSnapshotUri { get; private set; } + public string FileShareSnapshotUri { get; set; } /// - /// Gets contains recovery point size + /// Gets or sets contains recovery point size /// [JsonProperty(PropertyName = "recoveryPointSizeInGB")] - public int? RecoveryPointSizeInGB { get; private set; } + public int? RecoveryPointSizeInGB { get; set; } } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs index b3e1b4ac0664..0b68140c1e37 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureFileshareProtectedItem.cs @@ -68,6 +68,10 @@ public AzureFileshareProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the fileshare /// represented by this backup item. /// Backup status of this backup @@ -82,11 +86,8 @@ public AzureFileshareProtectedItem() /// Health details of different KPIs /// Additional information with this backup /// item. - /// backups running status for this backup - /// item. Possible values include: 'Passed', 'ActionRequired', - /// 'ActionSuggested', 'Invalid' - public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), IDictionary kpisHealths = default(IDictionary), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo), string healthStatus = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), IDictionary kpisHealths = default(IDictionary), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; ProtectionStatus = protectionStatus; @@ -95,7 +96,6 @@ public AzureFileshareProtectedItem() LastBackupTime = lastBackupTime; KpisHealths = kpisHealths; ExtendedInfo = extendedInfo; - HealthStatus = healthStatus; CustomInit(); } @@ -151,13 +151,5 @@ public AzureFileshareProtectedItem() [JsonProperty(PropertyName = "extendedInfo")] public AzureFileshareProtectedItemExtendedInfo ExtendedInfo { get; set; } - /// - /// Gets or sets backups running status for this backup item. Possible - /// values include: 'Passed', 'ActionRequired', 'ActionSuggested', - /// 'Invalid' - /// - [JsonProperty(PropertyName = "healthStatus")] - public string HealthStatus { get; set; } - } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs index e7265c125a08..8730ffa6a92b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMContainer.cs @@ -42,6 +42,8 @@ public AzureIaaSClassicComputeVMContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Fully qualified ARM url of the /// virtual machine represented by this Azure IaaS VM /// container. @@ -49,8 +51,8 @@ public AzureIaaSClassicComputeVMContainer() /// represents a Classic or an Azure Resource Manager VM. /// Resource group name of Recovery /// Services Vault. - public AzureIaaSClassicComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, virtualMachineId, virtualMachineVersion, resourceGroup) + public AzureIaaSClassicComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs index 4fee673c5e8d..fc0d07a25829 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectableItem.cs @@ -44,8 +44,12 @@ public AzureIaaSClassicComputeVMProtectableItem() /// 'Protected', 'ProtectionFailed' /// Fully qualified ARM ID of the /// virtual machine. - public AzureIaaSClassicComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string)) - : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId) + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSClassicComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs index b464e93290d9..e5974333d78a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs @@ -69,6 +69,10 @@ public AzureIaaSClassicComputeVMProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -92,8 +96,8 @@ public AzureIaaSClassicComputeVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) + public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs index b15b74fb0cd2..2bdd6922652a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMContainer.cs @@ -42,6 +42,8 @@ public AzureIaaSComputeVMContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Fully qualified ARM url of the /// virtual machine represented by this Azure IaaS VM /// container. @@ -49,8 +51,8 @@ public AzureIaaSComputeVMContainer() /// represents a Classic or an Azure Resource Manager VM. /// Resource group name of Recovery /// Services Vault. - public AzureIaaSComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, virtualMachineId, virtualMachineVersion, resourceGroup) + public AzureIaaSComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs index 16c663eb1ca8..59ac2c12a87b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectableItem.cs @@ -44,8 +44,12 @@ public AzureIaaSComputeVMProtectableItem() /// 'Protected', 'ProtectionFailed' /// Fully qualified ARM ID of the /// virtual machine. - public AzureIaaSComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string)) - : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId) + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public AzureIaaSComputeVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(backupManagementType, workloadType, friendlyName, protectionState, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs index 81f2df02546f..3f2dcc8302b7 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSComputeVMProtectedItem.cs @@ -69,6 +69,10 @@ public AzureIaaSComputeVMProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -92,8 +96,8 @@ public AzureIaaSComputeVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) + public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs index e20c8236049a..28cf1f9e17e9 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJob.cs @@ -52,7 +52,11 @@ public AzureIaaSVMJob() /// item is a Classic or an Azure Resource Manager VM. /// Additional information for this /// job. - public AzureIaaSVMJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string virtualMachineVersion = default(string), AzureIaaSVMJobExtendedInfo extendedInfo = default(AzureIaaSVMJobExtendedInfo)) + /// Container name of the entity on which + /// the current job is executing. + /// Indicated that whether the job is + /// adhoc(true) or scheduled(false) + public AzureIaaSVMJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string virtualMachineVersion = default(string), AzureIaaSVMJobExtendedInfo extendedInfo = default(AzureIaaSVMJobExtendedInfo), string containerName = default(string), bool? isUserTriggered = default(bool?)) : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) { Duration = duration; @@ -60,6 +64,8 @@ public AzureIaaSVMJob() ErrorDetails = errorDetails; VirtualMachineVersion = virtualMachineVersion; ExtendedInfo = extendedInfo; + ContainerName = containerName; + IsUserTriggered = isUserTriggered; CustomInit(); } @@ -100,5 +106,19 @@ public AzureIaaSVMJob() [JsonProperty(PropertyName = "extendedInfo")] public AzureIaaSVMJobExtendedInfo ExtendedInfo { get; set; } + /// + /// Gets or sets container name of the entity on which the current job + /// is executing. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets indicated that whether the job is adhoc(true) or + /// scheduled(false) + /// + [JsonProperty(PropertyName = "isUserTriggered")] + public bool? IsUserTriggered { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs new file mode 100644 index 000000000000..784ea0361ec1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMJobV2.cs @@ -0,0 +1,114 @@ +// +// 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.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// Azure IaaS VM workload-specific job object. + /// + public partial class AzureIaaSVMJobV2 : Job + { + /// + /// Initializes a new instance of the AzureIaaSVMJobV2 class. + /// + public AzureIaaSVMJobV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the AzureIaaSVMJobV2 class. + /// + /// Friendly name of the entity on + /// which the current job is executing. + /// Backup management type to + /// execute the current job. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// The operation name. + /// Job status. + /// The start time. + /// The end time. + /// ActivityId of job. + /// Gets or sets the state/actions applicable + /// on this job like cancel/retry. + /// Container name of the entity on which + /// the current job is executing. + /// Time elapsed during the execution of this + /// job. + /// Error details on execution of this + /// job. + /// Specifies whether the backup + /// item is a Classic or an Azure Resource Manager VM. + /// Additional information for this + /// job. + public AzureIaaSVMJobV2(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), IList actionsInfo = default(IList), string containerName = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList errorDetails = default(IList), string virtualMachineVersion = default(string), AzureIaaSVMJobExtendedInfo extendedInfo = default(AzureIaaSVMJobExtendedInfo)) + : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) + { + ActionsInfo = actionsInfo; + ContainerName = containerName; + Duration = duration; + ErrorDetails = errorDetails; + VirtualMachineVersion = virtualMachineVersion; + ExtendedInfo = extendedInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets the state/actions applicable on this job like + /// cancel/retry. + /// + [JsonProperty(PropertyName = "actionsInfo")] + public IList ActionsInfo { get; set; } + + /// + /// Gets or sets container name of the entity on which the current job + /// is executing. + /// + [JsonProperty(PropertyName = "containerName")] + public string ContainerName { get; set; } + + /// + /// Gets or sets time elapsed during the execution of this job. + /// + [JsonProperty(PropertyName = "duration")] + public System.TimeSpan? Duration { get; set; } + + /// + /// Gets or sets error details on execution of this job. + /// + [JsonProperty(PropertyName = "errorDetails")] + public IList ErrorDetails { get; set; } + + /// + /// Gets or sets specifies whether the backup item is a Classic or an + /// Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets additional information for this job. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public AzureIaaSVMJobExtendedInfo ExtendedInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs index 7eafb78db2fb..556646ec9781 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureIaaSVMProtectedItem.cs @@ -65,6 +65,10 @@ public AzureIaaSVMProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the VM represented by /// this backup item. /// Fully qualified ARM ID of the @@ -88,8 +92,8 @@ public AzureIaaSVMProtectedItem() /// item. /// Additional information for this backup /// item. - public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), IList healthDetails = default(IList), IDictionary kpisHealths = default(IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; VirtualMachineId = virtualMachineId; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs index c79634001d95..0a150f02a155 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs @@ -41,6 +41,8 @@ public AzureSQLAGWorkloadContainerProtectionContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// ARM ID of the virtual machine /// represented by this Azure Workload Container /// Time stamp when this container was @@ -54,8 +56,8 @@ public AzureSQLAGWorkloadContainerProtectionContainer() /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' /// Re-Do Operation. Possible values /// include: 'Invalid', 'Register', 'Reregister' - public AzureSQLAGWorkloadContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + public AzureSQLAGWorkloadContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs index 92f7f9c25a9d..3c46a7040160 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlContainer.cs @@ -37,8 +37,10 @@ public AzureSqlContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. - public AzureSqlContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + /// Type of the protectable object + /// associated with this container + public AzureSqlContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs index 62b19b97b86d..c9027795bbe9 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureSqlProtectedItem.cs @@ -66,6 +66,10 @@ public AzureSqlProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Internal ID of a backup item. /// Used by Azure SQL Backup engine to contact Recovery /// Services. @@ -74,8 +78,8 @@ public AzureSqlProtectedItem() /// 'ProtectionError', 'ProtectionStopped', 'ProtectionPaused' /// Additional information for this backup /// item. - public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { ProtectedItemDataId = protectedItemDataId; ProtectionState = protectionState; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs index dbc6fb572932..94caacbc496f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageContainer.cs @@ -39,6 +39,8 @@ public AzureStorageContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Fully qualified ARM url. /// Storage account /// version. @@ -46,13 +48,17 @@ public AzureStorageContainer() /// Services Vault. /// Number of items backed up in this /// container. - public AzureStorageContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string sourceResourceId = default(string), string storageAccountVersion = default(string), string resourceGroup = default(string), long? protectedItemCount = default(long?)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + /// Whether storage account + /// lock is to be acquired for this container or not. Possible values + /// include: 'Acquire', 'NotAcquire' + public AzureStorageContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), string storageAccountVersion = default(string), string resourceGroup = default(string), long? protectedItemCount = default(long?), string acquireStorageAccountLock = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { SourceResourceId = sourceResourceId; StorageAccountVersion = storageAccountVersion; ResourceGroup = resourceGroup; ProtectedItemCount = protectedItemCount; + AcquireStorageAccountLock = acquireStorageAccountLock; CustomInit(); } @@ -85,5 +91,13 @@ public AzureStorageContainer() [JsonProperty(PropertyName = "protectedItemCount")] public long? ProtectedItemCount { get; set; } + /// + /// Gets or sets whether storage account lock is to be acquired for + /// this container or not. Possible values include: 'Acquire', + /// 'NotAcquire' + /// + [JsonProperty(PropertyName = "acquireStorageAccountLock")] + public string AcquireStorageAccountLock { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs index 4820892ad5ba..f38b871eeb0b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureStorageJob.cs @@ -55,7 +55,9 @@ public AzureStorageJob() /// account. /// Additional information about the /// job. - public AzureStorageJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string storageAccountName = default(string), string storageAccountVersion = default(string), AzureStorageJobExtendedInfo extendedInfo = default(AzureStorageJobExtendedInfo)) + /// Indicated that whether the job is + /// adhoc(true) or scheduled(false) + public AzureStorageJob(string entityFriendlyName = default(string), string backupManagementType = default(string), string operation = default(string), string status = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string activityId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), IList actionsInfo = default(IList), IList errorDetails = default(IList), string storageAccountName = default(string), string storageAccountVersion = default(string), AzureStorageJobExtendedInfo extendedInfo = default(AzureStorageJobExtendedInfo), bool? isUserTriggered = default(bool?)) : base(entityFriendlyName, backupManagementType, operation, status, startTime, endTime, activityId) { Duration = duration; @@ -64,6 +66,7 @@ public AzureStorageJob() StorageAccountName = storageAccountName; StorageAccountVersion = storageAccountVersion; ExtendedInfo = extendedInfo; + IsUserTriggered = isUserTriggered; CustomInit(); } @@ -110,5 +113,12 @@ public AzureStorageJob() [JsonProperty(PropertyName = "extendedInfo")] public AzureStorageJobExtendedInfo ExtendedInfo { get; set; } + /// + /// Gets or sets indicated that whether the job is adhoc(true) or + /// scheduled(false) + /// + [JsonProperty(PropertyName = "isUserTriggered")] + public bool? IsUserTriggered { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs index c41965e91003..eb5b47f92c7b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVMAppContainerProtectionContainer.cs @@ -41,6 +41,8 @@ public AzureVMAppContainerProtectionContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// ARM ID of the virtual machine /// represented by this Azure Workload Container /// Time stamp when this container was @@ -54,8 +56,8 @@ public AzureVMAppContainerProtectionContainer() /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' /// Re-Do Operation. Possible values /// include: 'Invalid', 'Register', 'Reregister' - public AzureVMAppContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + public AzureVMAppContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs index 7c0a928c27fe..7255fcdf032b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItem.cs @@ -67,6 +67,10 @@ public AzureVmWorkloadProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -96,8 +100,8 @@ public AzureVmWorkloadProtectedItem() /// Additional information for this backup /// item. /// Health details of different KPIs - public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; ServerName = serverName; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs index 32034d0ef6c6..65a8d7ee1e5b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadProtectedItemExtendedInfo.cs @@ -37,11 +37,14 @@ public AzureVmWorkloadProtectedItemExtendedInfo() /// for this backup item. /// Indicates consistency of policy object /// and policy applied to this backup item. - public AzureVmWorkloadProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), string policyState = default(string)) + /// Indicates consistency of policy object + /// and policy applied to this backup item. + public AzureVmWorkloadProtectedItemExtendedInfo(System.DateTime? oldestRecoveryPoint = default(System.DateTime?), int? recoveryPointCount = default(int?), string policyState = default(string), string recoveryModel = default(string)) { OldestRecoveryPoint = oldestRecoveryPoint; RecoveryPointCount = recoveryPointCount; PolicyState = policyState; + RecoveryModel = recoveryModel; CustomInit(); } @@ -70,5 +73,12 @@ public AzureVmWorkloadProtectedItemExtendedInfo() [JsonProperty(PropertyName = "policyState")] public string PolicyState { get; set; } + /// + /// Gets or sets indicates consistency of policy object and policy + /// applied to this backup item. + /// + [JsonProperty(PropertyName = "recoveryModel")] + public string RecoveryModel { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs index e2bdbf1d969d..8056ef7ed245 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs @@ -69,6 +69,10 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -98,8 +102,8 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// Additional information for this backup /// item. /// Health details of different KPIs - public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs index 46c05dd0982b..3112f2899d78 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs @@ -69,6 +69,10 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -98,8 +102,8 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// Additional information for this backup /// item. /// Health details of different KPIs - public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs index 3de664fc2433..7bbf79ddb147 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs @@ -68,6 +68,10 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the DB represented by /// this backup item. /// Host/Cluster Name for instance or @@ -97,8 +101,8 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// Additional information for this backup /// item. /// Health details of different KPIs - public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) + public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), IDictionary kpisHealths = default(IDictionary)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs index 65e56dae96f4..cca4ae003405 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainer.cs @@ -39,6 +39,8 @@ public AzureWorkloadContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// ARM ID of the virtual machine /// represented by this Azure Workload Container /// Time stamp when this container was @@ -52,8 +54,8 @@ public AzureWorkloadContainer() /// 'AzureFileShare', 'SAPHanaDatabase', 'SAPAseDatabase' /// Re-Do Operation. Possible values /// include: 'Invalid', 'Register', 'Reregister' - public AzureWorkloadContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + public AzureWorkloadContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { SourceResourceId = sourceResourceId; LastUpdatedTime = lastUpdatedTime; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs new file mode 100644 index 000000000000..91ac77c6bd1c --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadContainerAutoProtectionIntent.cs @@ -0,0 +1,58 @@ +// +// 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.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Azure workload specific protection intent item. + /// + public partial class AzureWorkloadContainerAutoProtectionIntent : ProtectionIntent + { + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerAutoProtectionIntent class. + /// + public AzureWorkloadContainerAutoProtectionIntent() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadContainerAutoProtectionIntent class. + /// + /// Type of backup management for + /// the backed up item. Possible values include: 'Invalid', + /// 'AzureIaasVM', 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', + /// 'AzureStorage', 'AzureWorkload', 'DefaultBackup' + /// ARM ID of the resource to be backed + /// up. + /// ID of the item which is getting protected, In + /// case of Azure Vm , it is ProtectedItemId + /// ID of the backup policy with which this item + /// is backed up. + /// Backup state of this backup item. + /// Possible values include: 'Invalid', 'NotProtected', 'Protecting', + /// 'Protected', 'ProtectionFailed' + public AzureWorkloadContainerAutoProtectionIntent(string backupManagementType = default(string), string sourceResourceId = default(string), string itemId = default(string), string policyId = default(string), string protectionState = default(string)) + : base(backupManagementType, sourceResourceId, itemId, policyId, protectionState) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs index 76f9509ee0ed..e1b2405cf12d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs @@ -42,7 +42,7 @@ public AzureWorkloadPointInTimeRecoveryPoint() /// Eligibility of RP to /// be moved to another tier /// List of log ranges - public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { TimeRanges = timeRanges; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs index 1a2bad40f446..35558c50b9a8 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs @@ -40,7 +40,7 @@ public AzureWorkloadRecoveryPoint() /// information. /// Eligibility of RP to /// be moved to another tier - public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) { RecoveryPointTimeInUTC = recoveryPointTimeInUTC; Type = type; @@ -55,23 +55,23 @@ public AzureWorkloadRecoveryPoint() partial void CustomInit(); /// - /// Gets UTC time at which recovery point was created + /// Gets or sets UTC time at which recovery point was created /// [JsonProperty(PropertyName = "recoveryPointTimeInUTC")] - public System.DateTime? RecoveryPointTimeInUTC { get; private set; } + public System.DateTime? RecoveryPointTimeInUTC { get; set; } /// - /// Gets type of restore point. Possible values include: 'Invalid', - /// 'Full', 'Log', 'Differential', 'Incremental' + /// Gets or sets type of restore point. Possible values include: + /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' /// [JsonProperty(PropertyName = "type")] - public string Type { get; private set; } + public string Type { get; set; } /// /// Gets or sets recovery point tier information. /// [JsonProperty(PropertyName = "recoveryPointTierDetails")] - public IList RecoveryPointTierDetails { get; set; } + public IList RecoveryPointTierDetails { get; set; } /// /// Gets or sets eligibility of RP to be moved to another tier diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs index 6b755417da25..f46462eedc30 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs @@ -41,7 +41,7 @@ public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() /// Eligibility of RP to /// be moved to another tier /// List of log ranges - public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, timeRanges) { CustomInit(); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs index 8d921ce2b579..28ec04fcb4b7 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs @@ -41,7 +41,7 @@ public AzureWorkloadSAPHanaRecoveryPoint() /// information. /// Eligibility of RP to /// be moved to another tier - public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { CustomInit(); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs index 030f16991d07..1f8071787b13 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs @@ -47,7 +47,7 @@ public AzureWorkloadSQLPointInTimeRecoveryPoint() /// Or when ListRecoveryPoints is called for Log RP only with /// ExtendedInfo query filter /// List of log ranges - public AzureWorkloadSQLPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), IList timeRanges = default(IList)) + public AzureWorkloadSQLPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), IList timeRanges = default(IList)) : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, extendedInfo) { TimeRanges = timeRanges; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs index 7b6d21e0c610..a51438a58e93 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs @@ -47,7 +47,7 @@ public AzureWorkloadSQLRecoveryPoint() /// When a specific recovery point is accessed using GetRecoveryPoint /// Or when ListRecoveryPoints is called for Log RP only with /// ExtendedInfo query filter - public AzureWorkloadSQLRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) + public AzureWorkloadSQLRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { ExtendedInfo = extendedInfo; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs index bb0c7f0be5f8..8dd6ac0c0f2c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPointExtendedInfo.cs @@ -50,16 +50,16 @@ public AzureWorkloadSQLRecoveryPointExtendedInfo() partial void CustomInit(); /// - /// Gets UTC time at which data directory info was captured + /// Gets or sets UTC time at which data directory info was captured /// [JsonProperty(PropertyName = "dataDirectoryTimeInUTC")] - public System.DateTime? DataDirectoryTimeInUTC { get; private set; } + public System.DateTime? DataDirectoryTimeInUTC { get; set; } /// - /// Gets list of data directory paths during restore operation. + /// Gets or sets list of data directory paths during restore operation. /// [JsonProperty(PropertyName = "dataDirectoryPaths")] - public IList DataDirectoryPaths { get; private set; } + public IList DataDirectoryPaths { get; set; } } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSAADPropertiesQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSAADPropertiesQueryObject.cs deleted file mode 100644 index 268ef8831a97..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSAADPropertiesQueryObject.cs +++ /dev/null @@ -1,59 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Filters to list backup items. - /// - public partial class BMSAADPropertiesQueryObject - { - /// - /// Initializes a new instance of the BMSAADPropertiesQueryObject - /// class. - /// - public BMSAADPropertiesQueryObject() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the BMSAADPropertiesQueryObject - /// class. - /// - /// Backup management type for the - /// backed up item. Possible values include: 'Invalid', 'AzureIaasVM', - /// 'MAB', 'DPM', 'AzureBackupServer', 'AzureSql', 'AzureStorage', - /// 'AzureWorkload', 'DefaultBackup' - public BMSAADPropertiesQueryObject(string backupManagementType = default(string)) - { - BackupManagementType = backupManagementType; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets backup management type for the backed up item. - /// Possible values include: 'Invalid', 'AzureIaasVM', 'MAB', 'DPM', - /// 'AzureBackupServer', 'AzureSql', 'AzureStorage', 'AzureWorkload', - /// 'DefaultBackup' - /// - [JsonProperty(PropertyName = "backupManagementType")] - public string BackupManagementType { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs index e0863b7edd33..4c815a334c3e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceConfig.cs @@ -41,12 +41,18 @@ public BackupResourceConfig() /// 'Unlocked' /// Opt in details of Cross Region /// Restore feature. - public BackupResourceConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), bool? crossRegionRestoreFlag = default(bool?)) + /// Vault Dedup state. Possible values + /// include: 'Invalid', 'Enabled', 'Disabled' + /// Vault x-cool state. Possible values + /// include: 'Invalid', 'Enabled', 'Disabled' + public BackupResourceConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), bool? crossRegionRestoreFlag = default(bool?), string dedupState = default(string), string xcoolState = default(string)) { StorageModelType = storageModelType; StorageType = storageType; StorageTypeState = storageTypeState; CrossRegionRestoreFlag = crossRegionRestoreFlag; + DedupState = dedupState; + XcoolState = xcoolState; CustomInit(); } @@ -85,5 +91,19 @@ public BackupResourceConfig() [JsonProperty(PropertyName = "crossRegionRestoreFlag")] public bool? CrossRegionRestoreFlag { get; set; } + /// + /// Gets or sets vault Dedup state. Possible values include: 'Invalid', + /// 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "dedupState")] + public string DedupState { get; set; } + + /// + /// Gets or sets vault x-cool state. Possible values include: + /// 'Invalid', 'Enabled', 'Disabled' + /// + [JsonProperty(PropertyName = "xcoolState")] + public string XcoolState { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs index a1ff3afb6d11..5e45d075836f 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BackupResourceVaultConfig.cs @@ -47,7 +47,9 @@ public BackupResourceVaultConfig() /// Possible values include: 'Invalid', 'Enabled', 'Disabled' /// ResourceGuard /// Operation Requests - public BackupResourceVaultConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), string enhancedSecurityState = default(string), string softDeleteFeatureState = default(string), IList resourceGuardOperationRequests = default(IList)) + /// Is soft delete + /// feature state editable + public BackupResourceVaultConfig(string storageModelType = default(string), string storageType = default(string), string storageTypeState = default(string), string enhancedSecurityState = default(string), string softDeleteFeatureState = default(string), IList resourceGuardOperationRequests = default(IList), bool? isSoftDeleteFeatureStateEditable = default(bool?)) { StorageModelType = storageModelType; StorageType = storageType; @@ -55,6 +57,7 @@ public BackupResourceVaultConfig() EnhancedSecurityState = enhancedSecurityState; SoftDeleteFeatureState = softDeleteFeatureState; ResourceGuardOperationRequests = resourceGuardOperationRequests; + IsSoftDeleteFeatureStateEditable = isSoftDeleteFeatureStateEditable; CustomInit(); } @@ -107,5 +110,11 @@ public BackupResourceVaultConfig() [JsonProperty(PropertyName = "resourceGuardOperationRequests")] public IList ResourceGuardOperationRequests { get; set; } + /// + /// Gets or sets is soft delete feature state editable + /// + [JsonProperty(PropertyName = "isSoftDeleteFeatureStateEditable")] + public bool? IsSoftDeleteFeatureStateEditable { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequest.cs deleted file mode 100644 index c555e80bef31..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequest.cs +++ /dev/null @@ -1,58 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Linq; - - public partial class CrossRegionRestoreRequest - { - /// - /// Initializes a new instance of the CrossRegionRestoreRequest class. - /// - public CrossRegionRestoreRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrossRegionRestoreRequest class. - /// - /// Access details for - /// cross region restore - /// Request object for triggering - /// restore - public CrossRegionRestoreRequest(CrrAccessToken crossRegionRestoreAccessDetails = default(CrrAccessToken), RestoreRequest restoreRequest = default(RestoreRequest)) - { - CrossRegionRestoreAccessDetails = crossRegionRestoreAccessDetails; - RestoreRequest = restoreRequest; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets access details for cross region restore - /// - [JsonProperty(PropertyName = "crossRegionRestoreAccessDetails")] - public CrrAccessToken CrossRegionRestoreAccessDetails { get; set; } - - /// - /// Gets or sets request object for triggering restore - /// - [JsonProperty(PropertyName = "restoreRequest")] - public RestoreRequest RestoreRequest { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequestResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequestResource.cs deleted file mode 100644 index 89eda50cf8bf..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrossRegionRestoreRequestResource.cs +++ /dev/null @@ -1,63 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CrossRegionRestoreRequestResource : Resource - { - /// - /// Initializes a new instance of the CrossRegionRestoreRequestResource - /// class. - /// - public CrossRegionRestoreRequestResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrossRegionRestoreRequestResource - /// class. - /// - /// Resource Id represents the complete path to the - /// resource. - /// Resource name associated with the - /// resource. - /// Resource type represents the complete path of - /// the form Namespace/ResourceType/ResourceType/... - /// Resource location. - /// Resource tags. - /// Optional ETag. - /// CrossRegionRestoreRequestResource - /// properties - public CrossRegionRestoreRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), CrossRegionRestoreRequest properties = default(CrossRegionRestoreRequest)) - : base(id, name, type, location, tags, eTag) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets crossRegionRestoreRequestResource properties - /// - [JsonProperty(PropertyName = "properties")] - public CrossRegionRestoreRequest Properties { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessToken.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessToken.cs deleted file mode 100644 index 5c480ac8a0ff..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessToken.cs +++ /dev/null @@ -1,263 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CrrAccessToken - { - /// - /// Initializes a new instance of the CrrAccessToken class. - /// - public CrrAccessToken() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrrAccessToken class. - /// - /// Access token used for - /// authentication - /// Subscription Id of the source - /// vault - /// Resource Group name of the source - /// vault - /// Resource Name of the source - /// vault - /// Resource Id of the source vault - /// Protected item container - /// id - /// Recovery Point Id - /// Recovery Point Time - /// Container Unique name - /// Container Type - /// Backup Management Type - /// Datasource Type - /// Datasource Friendly Name - /// Datasource Id - /// Datasource Container Unique - /// Name - /// CoordinatorServiceStampId - /// to be used by BCM in restore call - /// CoordinatorServiceStampUri - /// to be used by BCM in restore call - /// ProtectionServiceStampId to - /// be used by BCM in restore call - /// ProtectionServiceStampUri - /// to be used by BCM in restore call - /// Extended Information about - /// the token like FileSpec etc. - /// Recovery point Tier - /// Information - /// Recovery point information: - /// Original SA option - /// Recovery point information: - /// Managed virtual machine - /// Recovery point information: VM - /// size description - /// Active region name of BMS - /// Stamp - public CrrAccessToken(string accessTokenString = default(string), string subscriptionId = default(string), string resourceGroupName = default(string), string resourceName = default(string), string resourceId = default(string), long? protectionContainerId = default(long?), string recoveryPointId = default(string), string recoveryPointTime = default(string), string containerName = default(string), string containerType = default(string), string backupManagementType = default(string), string datasourceType = default(string), string datasourceName = default(string), string datasourceId = default(string), string datasourceContainerName = default(string), string coordinatorServiceStampId = default(string), string coordinatorServiceStampUri = default(string), string protectionServiceStampId = default(string), string protectionServiceStampUri = default(string), string tokenExtendedInformation = default(string), IDictionary rpTierInformation = default(IDictionary), bool? rpOriginalSAOption = default(bool?), bool? rpIsManagedVirtualMachine = default(bool?), string rpVMSizeDescription = default(string), string bMSActiveRegion = default(string)) - { - AccessTokenString = accessTokenString; - SubscriptionId = subscriptionId; - ResourceGroupName = resourceGroupName; - ResourceName = resourceName; - ResourceId = resourceId; - ProtectionContainerId = protectionContainerId; - RecoveryPointId = recoveryPointId; - RecoveryPointTime = recoveryPointTime; - ContainerName = containerName; - ContainerType = containerType; - BackupManagementType = backupManagementType; - DatasourceType = datasourceType; - DatasourceName = datasourceName; - DatasourceId = datasourceId; - DatasourceContainerName = datasourceContainerName; - CoordinatorServiceStampId = coordinatorServiceStampId; - CoordinatorServiceStampUri = coordinatorServiceStampUri; - ProtectionServiceStampId = protectionServiceStampId; - ProtectionServiceStampUri = protectionServiceStampUri; - TokenExtendedInformation = tokenExtendedInformation; - RpTierInformation = rpTierInformation; - RpOriginalSAOption = rpOriginalSAOption; - RpIsManagedVirtualMachine = rpIsManagedVirtualMachine; - RpVMSizeDescription = rpVMSizeDescription; - BMSActiveRegion = bMSActiveRegion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets access token used for authentication - /// - [JsonProperty(PropertyName = "accessTokenString")] - public string AccessTokenString { get; set; } - - /// - /// Gets or sets subscription Id of the source vault - /// - [JsonProperty(PropertyName = "subscriptionId")] - public string SubscriptionId { get; set; } - - /// - /// Gets or sets resource Group name of the source vault - /// - [JsonProperty(PropertyName = "resourceGroupName")] - public string ResourceGroupName { get; set; } - - /// - /// Gets or sets resource Name of the source vault - /// - [JsonProperty(PropertyName = "resourceName")] - public string ResourceName { get; set; } - - /// - /// Gets or sets resource Id of the source vault - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets or sets protected item container id - /// - [JsonProperty(PropertyName = "protectionContainerId")] - public long? ProtectionContainerId { get; set; } - - /// - /// Gets or sets recovery Point Id - /// - [JsonProperty(PropertyName = "recoveryPointId")] - public string RecoveryPointId { get; set; } - - /// - /// Gets or sets recovery Point Time - /// - [JsonProperty(PropertyName = "recoveryPointTime")] - public string RecoveryPointTime { get; set; } - - /// - /// Gets or sets container Unique name - /// - [JsonProperty(PropertyName = "containerName")] - public string ContainerName { get; set; } - - /// - /// Gets or sets container Type - /// - [JsonProperty(PropertyName = "containerType")] - public string ContainerType { get; set; } - - /// - /// Gets or sets backup Management Type - /// - [JsonProperty(PropertyName = "backupManagementType")] - public string BackupManagementType { get; set; } - - /// - /// Gets or sets datasource Type - /// - [JsonProperty(PropertyName = "datasourceType")] - public string DatasourceType { get; set; } - - /// - /// Gets or sets datasource Friendly Name - /// - [JsonProperty(PropertyName = "datasourceName")] - public string DatasourceName { get; set; } - - /// - /// Gets or sets datasource Id - /// - [JsonProperty(PropertyName = "datasourceId")] - public string DatasourceId { get; set; } - - /// - /// Gets or sets datasource Container Unique Name - /// - [JsonProperty(PropertyName = "datasourceContainerName")] - public string DatasourceContainerName { get; set; } - - /// - /// Gets or sets coordinatorServiceStampId to be used by BCM in restore - /// call - /// - [JsonProperty(PropertyName = "coordinatorServiceStampId")] - public string CoordinatorServiceStampId { get; set; } - - /// - /// Gets or sets coordinatorServiceStampUri to be used by BCM in - /// restore call - /// - [JsonProperty(PropertyName = "coordinatorServiceStampUri")] - public string CoordinatorServiceStampUri { get; set; } - - /// - /// Gets or sets protectionServiceStampId to be used by BCM in restore - /// call - /// - [JsonProperty(PropertyName = "protectionServiceStampId")] - public string ProtectionServiceStampId { get; set; } - - /// - /// Gets or sets protectionServiceStampUri to be used by BCM in restore - /// call - /// - [JsonProperty(PropertyName = "protectionServiceStampUri")] - public string ProtectionServiceStampUri { get; set; } - - /// - /// Gets or sets extended Information about the token like FileSpec - /// etc. - /// - [JsonProperty(PropertyName = "tokenExtendedInformation")] - public string TokenExtendedInformation { get; set; } - - /// - /// Gets or sets recovery point Tier Information - /// - [JsonProperty(PropertyName = "rpTierInformation")] - public IDictionary RpTierInformation { get; set; } - - /// - /// Gets or sets recovery point information: Original SA option - /// - [JsonProperty(PropertyName = "rpOriginalSAOption")] - public bool? RpOriginalSAOption { get; set; } - - /// - /// Gets or sets recovery point information: Managed virtual machine - /// - [JsonProperty(PropertyName = "rpIsManagedVirtualMachine")] - public bool? RpIsManagedVirtualMachine { get; set; } - - /// - /// Gets or sets recovery point information: VM size description - /// - [JsonProperty(PropertyName = "rpVMSizeDescription")] - public string RpVMSizeDescription { get; set; } - - /// - /// Gets or sets active region name of BMS Stamp - /// - [JsonProperty(PropertyName = "bMSActiveRegion")] - public string BMSActiveRegion { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessTokenResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessTokenResource.cs deleted file mode 100644 index ce5022c623a7..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrAccessTokenResource.cs +++ /dev/null @@ -1,60 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class CrrAccessTokenResource : Resource - { - /// - /// Initializes a new instance of the CrrAccessTokenResource class. - /// - public CrrAccessTokenResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrrAccessTokenResource class. - /// - /// Resource Id represents the complete path to the - /// resource. - /// Resource name associated with the - /// resource. - /// Resource type represents the complete path of - /// the form Namespace/ResourceType/ResourceType/... - /// Resource location. - /// Resource tags. - /// Optional ETag. - /// CrrAccessTokenResource properties - public CrrAccessTokenResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), CrrAccessToken properties = default(CrrAccessToken)) - : base(id, name, type, location, tags, eTag) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets crrAccessTokenResource properties - /// - [JsonProperty(PropertyName = "properties")] - public CrrAccessToken Properties { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequest.cs deleted file mode 100644 index 4667f8dce228..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequest.cs +++ /dev/null @@ -1,60 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Request object for fetching CRR jobs. - /// - public partial class CrrJobRequest - { - /// - /// Initializes a new instance of the CrrJobRequest class. - /// - public CrrJobRequest() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrrJobRequest class. - /// - /// Entire ARM resource id of the - /// resource - /// Job Name of the job to be fetched - public CrrJobRequest(string resourceId = default(string), string jobName = default(string)) - { - ResourceId = resourceId; - JobName = jobName; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets entire ARM resource id of the resource - /// - [JsonProperty(PropertyName = "resourceId")] - public string ResourceId { get; set; } - - /// - /// Gets or sets job Name of the job to be fetched - /// - [JsonProperty(PropertyName = "jobName")] - public string JobName { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequestResource.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequestResource.cs deleted file mode 100644 index 8d92d0df75da..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/CrrJobRequestResource.cs +++ /dev/null @@ -1,63 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - /// - /// Request object for fetching CRR jobs. - /// - public partial class CrrJobRequestResource : Resource - { - /// - /// Initializes a new instance of the CrrJobRequestResource class. - /// - public CrrJobRequestResource() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the CrrJobRequestResource class. - /// - /// Resource Id represents the complete path to the - /// resource. - /// Resource name associated with the - /// resource. - /// Resource type represents the complete path of - /// the form Namespace/ResourceType/ResourceType/... - /// Resource location. - /// Resource tags. - /// Optional ETag. - /// CrrJobRequestResource properties - public CrrJobRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string eTag = default(string), CrrJobRequest properties = default(CrrJobRequest)) - : base(id, name, type, location, tags, eTag) - { - Properties = properties; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets crrJobRequestResource properties - /// - [JsonProperty(PropertyName = "properties")] - public CrrJobRequest Properties { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs index 22c8e190ba1b..d2ede5aba6b7 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DPMProtectedItem.cs @@ -65,6 +65,10 @@ public DPMProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the managed /// item /// Backup Management server protecting @@ -75,8 +79,8 @@ public DPMProtectedItem() /// 'ProtectionPaused' /// Extended info of the backup /// item. - public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; BackupEngineName = backupEngineName; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs new file mode 100644 index 000000000000..83497ee6a19d --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DedupState.cs @@ -0,0 +1,23 @@ +// +// 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.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for DedupState. + /// + public static class DedupState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs index 32905981e6ad..b2ab6dc3dd51 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/DpmContainer.cs @@ -41,6 +41,8 @@ public DpmContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Specifies whether the container is /// re-registrable. /// ID of container. @@ -54,8 +56,8 @@ public DpmContainer() /// Protection status of the /// container. /// Extended Info of the container. - public DpmContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + public DpmContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), IList dpmServers = default(IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { CanReRegister = canReRegister; ContainerId = containerId; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs index 2bab3b1a8209..ac30869d3551 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ExtendedProperties.cs @@ -31,9 +31,11 @@ public ExtendedProperties() /// /// Extended Properties for Disk /// Exclusion. - public ExtendedProperties(DiskExclusionProperties diskExclusionProperties = default(DiskExclusionProperties)) + /// Linux VM name + public ExtendedProperties(DiskExclusionProperties diskExclusionProperties = default(DiskExclusionProperties), string linuxVmApplicationName = default(string)) { DiskExclusionProperties = diskExclusionProperties; + LinuxVmApplicationName = linuxVmApplicationName; CustomInit(); } @@ -48,5 +50,11 @@ public ExtendedProperties() [JsonProperty(PropertyName = "diskExclusionProperties")] public DiskExclusionProperties DiskExclusionProperties { get; set; } + /// + /// Gets or sets linux VM name + /// + [JsonProperty(PropertyName = "linuxVmApplicationName")] + public string LinuxVmApplicationName { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs index 434c750f2c9e..0eed0b71f321 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericContainer.cs @@ -38,11 +38,13 @@ public GenericContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Name of the container's fabric /// Extended information (not /// returned in List container API calls) - public GenericContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string fabricName = default(string), GenericContainerExtendedInfo extendedInformation = default(GenericContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + public GenericContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string fabricName = default(string), GenericContainerExtendedInfo extendedInformation = default(GenericContainerExtendedInfo)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { FabricName = fabricName; ExtendedInformation = extendedInformation; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs index 54bfaf7f34d1..46c8a5c18c7d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/GenericProtectedItem.cs @@ -65,6 +65,10 @@ public GenericProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of the container. /// Indicates consistency of policy object /// and policy applied to this backup item. @@ -76,8 +80,8 @@ public GenericProtectedItem() /// Loosely coupled (type, value) /// associations (example - parent of a protected item) /// Name of this backup item's fabric. - public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), IDictionary sourceAssociations = default(IDictionary), string fabricName = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), IDictionary sourceAssociations = default(IDictionary), string fabricName = default(string)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; PolicyState = policyState; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs new file mode 100644 index 000000000000..992c429e5121 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/HourlySchedule.cs @@ -0,0 +1,70 @@ +// +// 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.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class HourlySchedule + { + /// + /// Initializes a new instance of the HourlySchedule class. + /// + public HourlySchedule() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the HourlySchedule class. + /// + /// Interval at which backup needs to be + /// triggered. For hourly the value + /// can be 4/6/8/12 + /// To specify start time of the + /// backup window + /// To specify duration of the + /// backup window + public HourlySchedule(int? interval = default(int?), System.DateTime? scheduleWindowStartTime = default(System.DateTime?), int? scheduleWindowDuration = default(int?)) + { + Interval = interval; + ScheduleWindowStartTime = scheduleWindowStartTime; + ScheduleWindowDuration = scheduleWindowDuration; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets interval at which backup needs to be triggered. For + /// hourly the value + /// can be 4/6/8/12 + /// + [JsonProperty(PropertyName = "interval")] + public int? Interval { get; set; } + + /// + /// Gets or sets to specify start time of the backup window + /// + [JsonProperty(PropertyName = "scheduleWindowStartTime")] + public System.DateTime? ScheduleWindowStartTime { get; set; } + + /// + /// Gets or sets to specify duration of the backup window + /// + [JsonProperty(PropertyName = "scheduleWindowDuration")] + public int? ScheduleWindowDuration { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs index 2907332bf10d..e705c87f1ce5 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMContainer.cs @@ -38,6 +38,8 @@ public IaaSVMContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Fully qualified ARM url of the /// virtual machine represented by this Azure IaaS VM /// container. @@ -45,8 +47,8 @@ public IaaSVMContainer() /// represents a Classic or an Azure Resource Manager VM. /// Resource group name of Recovery /// Services Vault. - public IaaSVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + public IaaSVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { VirtualMachineId = virtualMachineId; VirtualMachineVersion = virtualMachineVersion; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs index 5de6b74acb6c..ab9f796b4628 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaaSVMProtectableItem.cs @@ -40,10 +40,16 @@ public IaaSVMProtectableItem() /// 'Protected', 'ProtectionFailed' /// Fully qualified ARM ID of the /// virtual machine. - public IaaSVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string)) + /// Specifies whether the container + /// represents a Classic or an Azure Resource Manager VM. + /// Resource group name of Recovery + /// Services Vault. + public IaaSVMProtectableItem(string backupManagementType = default(string), string workloadType = default(string), string friendlyName = default(string), string protectionState = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) : base(backupManagementType, workloadType, friendlyName, protectionState) { VirtualMachineId = virtualMachineId; + VirtualMachineVersion = virtualMachineVersion; + ResourceGroup = resourceGroup; CustomInit(); } @@ -58,5 +64,18 @@ public IaaSVMProtectableItem() [JsonProperty(PropertyName = "virtualMachineId")] public string VirtualMachineId { get; set; } + /// + /// Gets or sets specifies whether the container represents a Classic + /// or an Azure Resource Manager VM. + /// + [JsonProperty(PropertyName = "virtualMachineVersion")] + public string VirtualMachineVersion { get; set; } + + /// + /// Gets or sets resource group name of Recovery Services Vault. + /// + [JsonProperty(PropertyName = "resourceGroup")] + public string ResourceGroup { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs index 8348b84021d8..6b962001e62d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs @@ -59,7 +59,7 @@ public IaasVMRecoveryPoint() /// backup. Applicable only for zone-pinned Vms /// Eligibility of RP to /// be moved to another tier - public IaasVMRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), string sourceVMStorageType = default(string), bool? isSourceVMEncrypted = default(bool?), KeyAndSecretDetails keyAndSecret = default(KeyAndSecretDetails), bool? isInstantIlrSessionActive = default(bool?), IList recoveryPointTierDetails = default(IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), IList zones = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + public IaasVMRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), string sourceVMStorageType = default(string), bool? isSourceVMEncrypted = default(bool?), KeyAndSecretDetails keyAndSecret = default(KeyAndSecretDetails), bool? isInstantIlrSessionActive = default(bool?), IList recoveryPointTierDetails = default(IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), IList zones = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) { RecoveryPointType = recoveryPointType; RecoveryPointTime = recoveryPointTime; @@ -85,35 +85,36 @@ public IaasVMRecoveryPoint() partial void CustomInit(); /// - /// Gets type of the backup copy. + /// Gets or sets type of the backup copy. /// [JsonProperty(PropertyName = "recoveryPointType")] - public string RecoveryPointType { get; private set; } + public string RecoveryPointType { get; set; } /// - /// Gets time at which this backup copy was created. + /// Gets or sets time at which this backup copy was created. /// [JsonProperty(PropertyName = "recoveryPointTime")] - public System.DateTime? RecoveryPointTime { get; private set; } + public System.DateTime? RecoveryPointTime { get; set; } /// - /// Gets additional information associated with this backup copy. + /// Gets or sets additional information associated with this backup + /// copy. /// [JsonProperty(PropertyName = "recoveryPointAdditionalInfo")] - public string RecoveryPointAdditionalInfo { get; private set; } + public string RecoveryPointAdditionalInfo { get; set; } /// - /// Gets storage type of the VM whose backup copy is created. + /// Gets or sets storage type of the VM whose backup copy is created. /// [JsonProperty(PropertyName = "sourceVMStorageType")] - public string SourceVMStorageType { get; private set; } + public string SourceVMStorageType { get; set; } /// - /// Gets identifies whether the VM was encrypted when the backup copy - /// is created. + /// Gets or sets identifies whether the VM was encrypted when the + /// backup copy is created. /// [JsonProperty(PropertyName = "isSourceVMEncrypted")] - public bool? IsSourceVMEncrypted { get; private set; } + public bool? IsSourceVMEncrypted { get; set; } /// /// Gets or sets required details for recovering an encrypted VM. @@ -133,7 +134,7 @@ public IaasVMRecoveryPoint() /// Gets or sets recovery point tier information. /// [JsonProperty(PropertyName = "recoveryPointTierDetails")] - public IList RecoveryPointTierDetails { get; set; } + public IList RecoveryPointTierDetails { get; set; } /// /// Gets or sets whether VM is with Managed Disks diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs index 3b3d614bbf00..c530394579cb 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabContainer.cs @@ -41,6 +41,8 @@ public MabContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. + /// Type of the protectable object + /// associated with this container /// Can the container be registered one /// more time. /// ContainerID represents the @@ -54,8 +56,8 @@ public MabContainer() /// container. /// Health state of mab /// container. - public MabContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), bool? canReRegister = default(bool?), long? containerId = default(long?), long? protectedItemCount = default(long?), string agentVersion = default(string), MabContainerExtendedInfo extendedInfo = default(MabContainerExtendedInfo), IList mabContainerHealthDetails = default(IList), string containerHealthState = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus) + public MabContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), long? containerId = default(long?), long? protectedItemCount = default(long?), string agentVersion = default(string), MabContainerExtendedInfo extendedInfo = default(MabContainerExtendedInfo), IList mabContainerHealthDetails = default(IList), string containerHealthState = default(string)) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) { CanReRegister = canReRegister; ContainerId = containerId; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs index 9669743c67d1..e4a7acb9c5ff 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MabFileFolderProtectedItem.cs @@ -65,6 +65,10 @@ public MabFileFolderProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection /// Friendly name of this backup /// item. /// Name of the computer associated with @@ -79,8 +83,8 @@ public MabFileFolderProtectedItem() /// deletion in UTC /// Additional information with this backup /// item. - public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectionState = default(string), long? deferredDeleteSyncTimeInUTC = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) + public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectionState = default(string), long? deferredDeleteSyncTimeInUTC = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName) { FriendlyName = friendlyName; ComputerName = computerName; diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusRecoveryPointExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusRecoveryPointExtendedInfo.cs deleted file mode 100644 index 8140ddb34cab..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusRecoveryPointExtendedInfo.cs +++ /dev/null @@ -1,65 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Linq; - - /// - /// Operation status extended info for Updated Recovery Point. - /// - public partial class OperationStatusRecoveryPointExtendedInfo : OperationStatusExtendedInfo - { - /// - /// Initializes a new instance of the - /// OperationStatusRecoveryPointExtendedInfo class. - /// - public OperationStatusRecoveryPointExtendedInfo() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the - /// OperationStatusRecoveryPointExtendedInfo class. - /// - /// Recovery Point info with updated - /// source snapshot URI - /// In case the share is in - /// soft-deleted state, populate this field with deleted backup - /// item - public OperationStatusRecoveryPointExtendedInfo(RecoveryPoint updatedRecoveryPoint = default(RecoveryPoint), string deletedBackupItemVersion = default(string)) - { - UpdatedRecoveryPoint = updatedRecoveryPoint; - DeletedBackupItemVersion = deletedBackupItemVersion; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets or sets recovery Point info with updated source snapshot URI - /// - [JsonProperty(PropertyName = "updatedRecoveryPoint")] - public RecoveryPoint UpdatedRecoveryPoint { get; set; } - - /// - /// Gets or sets in case the share is in soft-deleted state, populate - /// this field with deleted backup item - /// - [JsonProperty(PropertyName = "deletedBackupItemVersion")] - public string DeletedBackupItemVersion { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs new file mode 100644 index 000000000000..a2a722ac3fde --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/OperationStatusValidateOperationExtendedInfo.cs @@ -0,0 +1,54 @@ +// +// 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.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + /// + /// Operation status extended info for ValidateOperation action. + /// + public partial class OperationStatusValidateOperationExtendedInfo : OperationStatusExtendedInfo + { + /// + /// Initializes a new instance of the + /// OperationStatusValidateOperationExtendedInfo class. + /// + public OperationStatusValidateOperationExtendedInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// OperationStatusValidateOperationExtendedInfo class. + /// + /// Gets the validation + /// operation response + public OperationStatusValidateOperationExtendedInfo(ValidateOperationResponse validateOperationResponse = default(ValidateOperationResponse)) + { + ValidateOperationResponse = validateOperationResponse; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets the validation operation response + /// + [JsonProperty(PropertyName = "validateOperationResponse")] + public ValidateOperationResponse ValidateOperationResponse { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs index d4728cfe4ce6..5b3d042654d2 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectedItem.cs @@ -65,7 +65,11 @@ public ProtectedItem() /// ResourceGuardOperationRequests /// on which LAC check will be performed - public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList)) + /// Flag to identify whether datasource + /// is protected in archive + /// Name of the policy used for + /// protection + public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUTC = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), IList resourceGuardOperationRequests = default(IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string)) { BackupManagementType = backupManagementType; WorkloadType = workloadType; @@ -81,6 +85,8 @@ public ProtectedItem() IsDeferredDeleteScheduleUpcoming = isDeferredDeleteScheduleUpcoming; IsRehydrate = isRehydrate; ResourceGuardOperationRequests = resourceGuardOperationRequests; + IsArchiveEnabled = isArchiveEnabled; + PolicyName = policyName; CustomInit(); } @@ -189,5 +195,18 @@ public ProtectedItem() [JsonProperty(PropertyName = "resourceGuardOperationRequests")] public IList ResourceGuardOperationRequests { get; set; } + /// + /// Gets or sets flag to identify whether datasource is protected in + /// archive + /// + [JsonProperty(PropertyName = "isArchiveEnabled")] + public bool? IsArchiveEnabled { get; set; } + + /// + /// Gets or sets name of the policy used for protection + /// + [JsonProperty(PropertyName = "policyName")] + public string PolicyName { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs index 212f6b5a53bc..d00336a7e03a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ProtectionContainer.cs @@ -39,12 +39,15 @@ public ProtectionContainer() /// container with the Recovery Services Vault. /// Status of health of the /// container. - public ProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string)) + /// Type of the protectable object + /// associated with this container + public ProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) { FriendlyName = friendlyName; BackupManagementType = backupManagementType; RegistrationStatus = registrationStatus; HealthStatus = healthStatus; + ProtectableObjectType = protectableObjectType; CustomInit(); } @@ -81,5 +84,12 @@ public ProtectionContainer() [JsonProperty(PropertyName = "healthStatus")] public string HealthStatus { get; set; } + /// + /// Gets or sets type of the protectable object associated with this + /// container + /// + [JsonProperty(PropertyName = "protectableObjectType")] + public string ProtectableObjectType { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs new file mode 100644 index 000000000000..dc3f086fe31b --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformationV2.cs @@ -0,0 +1,53 @@ +// +// 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.RecoveryServices.Backup.Models +{ + using System.Collections; + using System.Collections.Generic; + using System.Linq; + + /// + /// RecoveryPoint Tier Information V2 + /// + public partial class RecoveryPointTierInformationV2 : RecoveryPointTierInformation + { + /// + /// Initializes a new instance of the RecoveryPointTierInformationV2 + /// class. + /// + public RecoveryPointTierInformationV2() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointTierInformationV2 + /// class. + /// + /// Recovery point tier type. Possible values + /// include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// Recovery point tier status. Possible values + /// include: 'Invalid', 'Valid', 'Disabled', 'Deleted', + /// 'Rehydrated' + /// Recovery point tier status. + public RecoveryPointTierInformationV2(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), IDictionary extendedInfo = default(IDictionary)) + : base(type, status, extendedInfo) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs index b17e7c4e92e2..14ff24041a5c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ScheduleRunType.cs @@ -19,5 +19,6 @@ public static class ScheduleRunType public const string Invalid = "Invalid"; public const string Daily = "Daily"; public const string Weekly = "Weekly"; + public const string Hourly = "Hourly"; } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs index 6f26a6c62a82..24fa6f868808 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/SimpleSchedulePolicy.cs @@ -33,18 +33,20 @@ public SimpleSchedulePolicy() /// /// Frequency of the schedule /// operation of this policy. Possible values include: 'Invalid', - /// 'Daily', 'Weekly' + /// 'Daily', 'Weekly', 'Hourly' /// List of days of week this schedule /// has to be run. /// List of times of day this schedule /// has to be run. + /// Hourly Schedule of this Policy /// At every number weeks this /// schedule has to be run. - public SimpleSchedulePolicy(string scheduleRunFrequency = default(string), IList scheduleRunDays = default(IList), IList scheduleRunTimes = default(IList), int? scheduleWeeklyFrequency = default(int?)) + public SimpleSchedulePolicy(string scheduleRunFrequency = default(string), IList scheduleRunDays = default(IList), IList scheduleRunTimes = default(IList), HourlySchedule hourlySchedule = default(HourlySchedule), int? scheduleWeeklyFrequency = default(int?)) { ScheduleRunFrequency = scheduleRunFrequency; ScheduleRunDays = scheduleRunDays; ScheduleRunTimes = scheduleRunTimes; + HourlySchedule = hourlySchedule; ScheduleWeeklyFrequency = scheduleWeeklyFrequency; CustomInit(); } @@ -56,7 +58,7 @@ public SimpleSchedulePolicy() /// /// Gets or sets frequency of the schedule operation of this policy. - /// Possible values include: 'Invalid', 'Daily', 'Weekly' + /// Possible values include: 'Invalid', 'Daily', 'Weekly', 'Hourly' /// [JsonProperty(PropertyName = "scheduleRunFrequency")] public string ScheduleRunFrequency { get; set; } @@ -73,6 +75,12 @@ public SimpleSchedulePolicy() [JsonProperty(PropertyName = "scheduleRunTimes")] public IList ScheduleRunTimes { get; set; } + /// + /// Gets or sets hourly Schedule of this Policy + /// + [JsonProperty(PropertyName = "hourlySchedule")] + public HourlySchedule HourlySchedule { get; set; } + /// /// Gets or sets at every number weeks this schedule has to be run. /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadCrrAccessToken.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadCrrAccessToken.cs deleted file mode 100644 index cc3a386d6909..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/WorkloadCrrAccessToken.cs +++ /dev/null @@ -1,144 +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.RecoveryServices.Backup.Models -{ - using Newtonsoft.Json; - using System.Collections; - using System.Collections.Generic; - using System.Linq; - - public partial class WorkloadCrrAccessToken : CrrAccessToken - { - /// - /// Initializes a new instance of the WorkloadCrrAccessToken class. - /// - public WorkloadCrrAccessToken() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the WorkloadCrrAccessToken class. - /// - /// Access token used for - /// authentication - /// Subscription Id of the source - /// vault - /// Resource Group name of the source - /// vault - /// Resource Name of the source - /// vault - /// Resource Id of the source vault - /// Protected item container - /// id - /// Recovery Point Id - /// Recovery Point Time - /// Container Unique name - /// Container Type - /// Backup Management Type - /// Datasource Type - /// Datasource Friendly Name - /// Datasource Id - /// Datasource Container Unique - /// Name - /// CoordinatorServiceStampId - /// to be used by BCM in restore call - /// CoordinatorServiceStampUri - /// to be used by BCM in restore call - /// ProtectionServiceStampId to - /// be used by BCM in restore call - /// ProtectionServiceStampUri - /// to be used by BCM in restore call - /// Extended Information about - /// the token like FileSpec etc. - /// Recovery point Tier - /// Information - /// Recovery point information: - /// Original SA option - /// Recovery point information: - /// Managed virtual machine - /// Recovery point information: VM - /// size description - /// Active region name of BMS - /// Stamp - /// Container Id - /// Policy Name - /// Policy Id - public WorkloadCrrAccessToken(string accessTokenString = default(string), string subscriptionId = default(string), string resourceGroupName = default(string), string resourceName = default(string), string resourceId = default(string), long? protectionContainerId = default(long?), string recoveryPointId = default(string), string recoveryPointTime = default(string), string containerName = default(string), string containerType = default(string), string backupManagementType = default(string), string datasourceType = default(string), string datasourceName = default(string), string datasourceId = default(string), string datasourceContainerName = default(string), string coordinatorServiceStampId = default(string), string coordinatorServiceStampUri = default(string), string protectionServiceStampId = default(string), string protectionServiceStampUri = default(string), string tokenExtendedInformation = default(string), IDictionary rpTierInformation = default(IDictionary), bool? rpOriginalSAOption = default(bool?), bool? rpIsManagedVirtualMachine = default(bool?), string rpVMSizeDescription = default(string), string bMSActiveRegion = default(string), string protectableObjectUniqueName = default(string), string protectableObjectFriendlyName = default(string), string protectableObjectWorkloadType = default(string), string protectableObjectProtectionState = default(string), string protectableObjectContainerHostOsName = default(string), string protectableObjectParentLogicalContainerName = default(string), string containerId = default(string), string policyName = default(string), string policyId = default(string)) - : base(accessTokenString, subscriptionId, resourceGroupName, resourceName, resourceId, protectionContainerId, recoveryPointId, recoveryPointTime, containerName, containerType, backupManagementType, datasourceType, datasourceName, datasourceId, datasourceContainerName, coordinatorServiceStampId, coordinatorServiceStampUri, protectionServiceStampId, protectionServiceStampUri, tokenExtendedInformation, rpTierInformation, rpOriginalSAOption, rpIsManagedVirtualMachine, rpVMSizeDescription, bMSActiveRegion) - { - ProtectableObjectUniqueName = protectableObjectUniqueName; - ProtectableObjectFriendlyName = protectableObjectFriendlyName; - ProtectableObjectWorkloadType = protectableObjectWorkloadType; - ProtectableObjectProtectionState = protectableObjectProtectionState; - ProtectableObjectContainerHostOsName = protectableObjectContainerHostOsName; - ProtectableObjectParentLogicalContainerName = protectableObjectParentLogicalContainerName; - ContainerId = containerId; - PolicyName = policyName; - PolicyId = policyId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// - [JsonProperty(PropertyName = "protectableObjectUniqueName")] - public string ProtectableObjectUniqueName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectableObjectFriendlyName")] - public string ProtectableObjectFriendlyName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectableObjectWorkloadType")] - public string ProtectableObjectWorkloadType { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectableObjectProtectionState")] - public string ProtectableObjectProtectionState { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectableObjectContainerHostOsName")] - public string ProtectableObjectContainerHostOsName { get; set; } - - /// - /// - [JsonProperty(PropertyName = "protectableObjectParentLogicalContainerName")] - public string ProtectableObjectParentLogicalContainerName { get; set; } - - /// - /// Gets or sets container Id - /// - [JsonProperty(PropertyName = "containerId")] - public string ContainerId { get; set; } - - /// - /// Gets or sets policy Name - /// - [JsonProperty(PropertyName = "policyName")] - public string PolicyName { get; set; } - - /// - /// Gets or sets policy Id - /// - [JsonProperty(PropertyName = "policyId")] - public string PolicyId { get; set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs new file mode 100644 index 000000000000..ad291f75db70 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/XcoolState.cs @@ -0,0 +1,23 @@ +// +// 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.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for XcoolState. + /// + public static class XcoolState + { + public const string Invalid = "Invalid"; + public const string Enabled = "Enabled"; + public const string Disabled = "Disabled"; + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs index b896bbe583a1..bdd0d7478de2 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/OperationOperations.cs @@ -87,6 +87,10 @@ internal OperationOperations(RecoveryServicesBackupClient client) /// public async Task> ValidateWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, 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"); @@ -103,7 +107,6 @@ internal OperationOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +114,6 @@ internal OperationOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -125,9 +127,9 @@ internal OperationOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs index 07ab7a66b3e3..8fcf9ee3a356 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Operations.cs @@ -65,12 +65,21 @@ internal Operations(RecoveryServicesBackupClient client) /// /// 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>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - string apiVersion = "2021-08-01"; + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -78,7 +87,6 @@ internal Operations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); } @@ -86,9 +94,9 @@ internal Operations(RecoveryServicesBackupClient client) var _baseUrl = Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "providers/Microsoft.RecoveryServices/operations").ToString(); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs index e99574d67f37..ddfee88600a1 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs @@ -86,6 +86,10 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, 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"); @@ -102,7 +106,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,7 +113,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -125,9 +127,9 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -345,6 +347,10 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client /// public async Task> BeginPutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, 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"); @@ -365,7 +371,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -373,7 +378,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -389,9 +393,9 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -575,6 +579,10 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client /// public async Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, 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"); @@ -591,7 +599,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -599,7 +606,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -614,9 +620,9 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs index 9ff6b781cee9..3693642013b0 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointOperations.cs @@ -89,6 +89,10 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) /// public async Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, 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"); @@ -109,7 +113,6 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -117,7 +120,6 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -134,9 +136,9 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs index b707e15070a9..182d62bc66e5 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectableContainersOperations.cs @@ -89,6 +89,10 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -105,7 +109,6 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,7 +117,6 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -137,9 +139,9 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs index 1dc619b5441f..2b55708dd71e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs @@ -96,6 +96,10 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, 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"); @@ -124,7 +128,6 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -132,7 +135,6 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -153,9 +155,9 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs index 8911125bc735..70ad6042349b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs @@ -100,6 +100,10 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, 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"); @@ -128,7 +132,6 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -136,7 +139,6 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -157,9 +159,9 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs index 1b7d66d18d62..12e1054f69cd 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs @@ -98,6 +98,10 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -122,7 +126,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -131,7 +134,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -158,9 +160,9 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -335,6 +337,10 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, 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"); @@ -363,7 +369,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -371,7 +376,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -391,9 +395,9 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -567,6 +571,10 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, 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"); @@ -591,7 +599,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -599,7 +606,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -618,9 +624,9 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs index b70fefd20b65..bd46e2530e0d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs @@ -93,6 +93,10 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, 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"); @@ -117,7 +121,6 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -125,7 +128,6 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -144,9 +146,9 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs index 6a9bde305422..88c4a58053da 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs @@ -88,6 +88,10 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa /// public async Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, 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"); @@ -108,7 +112,6 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,7 +119,6 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -133,9 +135,9 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs index c37a09da92e7..bb00cd47dbcd 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs @@ -91,6 +91,10 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, 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"); @@ -111,7 +115,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +122,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -136,9 +138,9 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -310,6 +312,10 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// public async Task> RegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, 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"); @@ -334,7 +340,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -342,7 +347,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -360,9 +364,9 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -535,6 +539,10 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// public async Task UnregisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, 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"); @@ -555,7 +563,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -563,7 +570,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -580,9 +586,9 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -734,6 +740,10 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// public async Task InquireWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -754,7 +764,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -763,7 +772,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -788,9 +796,9 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -938,6 +946,10 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// public async Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -954,7 +966,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -963,7 +974,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -986,9 +996,9 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs index 3179259cf5f7..6bf6f535276e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionIntentOperations.cs @@ -85,6 +85,10 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) /// public async Task> ValidateWithHttpMessagesAsync(string azureRegion, PreValidateEnableBackupRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (azureRegion == null) { throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); @@ -97,7 +101,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -105,7 +108,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("azureRegion", azureRegion); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); @@ -117,9 +119,9 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -293,6 +295,10 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, 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"); @@ -313,7 +319,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "intentObjectName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -321,7 +326,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -338,9 +342,9 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -510,6 +514,10 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, 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"); @@ -534,7 +542,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -542,7 +549,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -560,9 +566,9 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -731,6 +737,10 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) /// public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, 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"); @@ -751,7 +761,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "intentObjectName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -759,7 +768,6 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -776,9 +784,9 @@ internal ProtectionIntentOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs index 2789b45a6636..7748c907902a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs @@ -89,6 +89,10 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, 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"); @@ -105,7 +109,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -113,7 +116,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); @@ -128,9 +130,9 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -298,6 +300,10 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// public async Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, 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"); @@ -318,7 +324,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -326,7 +331,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); @@ -342,9 +346,9 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -540,6 +544,10 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// public async Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, 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"); @@ -556,7 +564,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -564,7 +571,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); @@ -579,9 +585,9 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs index 772215917e98..18438d7f80e8 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs @@ -90,6 +90,10 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, 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"); @@ -110,7 +114,6 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -118,7 +121,6 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); @@ -135,9 +137,9 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs index c83974227d40..fc7276a29f7b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs @@ -95,6 +95,10 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, 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"); @@ -115,7 +119,6 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -123,7 +126,6 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("policyName", policyName); @@ -140,9 +142,9 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperations.cs deleted file mode 100644 index 52010229e202..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperations.cs +++ /dev/null @@ -1,452 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - 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; - - /// - /// RecoveryPointsCrrOperations operations. - /// - internal partial class RecoveryPointsCrrOperations : IServiceOperations, IRecoveryPointsCrrOperations - { - /// - /// Initializes a new instance of the RecoveryPointsCrrOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal RecoveryPointsCrrOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - public RecoveryServicesBackupClient Client { get; private set; } - - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the backed up item. - /// - /// - /// Container name associated with the backed up item. - /// - /// - /// Backed up item whose backup copies are to be fetched. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (fabricName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); - } - if (containerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); - } - if (protectedItemName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("fabricName", fabricName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("protectedItemName", protectedItemName); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", 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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/").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("{fabricName}", System.Uri.EscapeDataString(fabricName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); - List _queryParameters = new List(); - if (odataQuery != null) - { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - 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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// 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>> ListNextWithHttpMessagesAsync(string nextPageLink, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - if (nextPageLink == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "nextPageLink"); - } - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("nextPageLink", nextPageLink); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); - } - // Construct URL - string _url = "{nextLink}"; - _url = _url.Replace("{nextLink}", nextPageLink); - List _queryParameters = new List(); - 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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperationsExtensions.cs deleted file mode 100644 index d92fd9e88fe9..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsCrrOperationsExtensions.cs +++ /dev/null @@ -1,126 +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.RecoveryServices.Backup -{ - using Microsoft.Rest; - using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; - using Models; - using System.Threading; - using System.Threading.Tasks; - - /// - /// Extension methods for RecoveryPointsCrrOperations. - /// - public static partial class RecoveryPointsCrrOperationsExtensions - { - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the backed up item. - /// - /// - /// Container name associated with the backed up item. - /// - /// - /// Backed up item whose backup copies are to be fetched. - /// - /// - /// OData parameters to apply to the operation. - /// - public static IPage List(this IRecoveryPointsCrrOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery)) - { - return operations.ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery).GetAwaiter().GetResult(); - } - - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the backed up item. - /// - /// - /// Container name associated with the backed up item. - /// - /// - /// Backed up item whose backup copies are to be fetched. - /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListAsync(this IRecoveryPointsCrrOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - public static IPage ListNext(this IRecoveryPointsCrrOperations operations, string nextPageLink) - { - return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); - } - - /// - /// Lists the backup copies for the backed up item. - /// - /// - /// The operations group for this extension method. - /// - /// - /// The NextLink from the previous successful call to List operation. - /// - /// - /// The cancellation token. - /// - public static async Task> ListNextAsync(this IRecoveryPointsCrrOperations operations, string nextPageLink, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs index dcfdf0dda731..e8296da72d87 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs @@ -96,6 +96,10 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ODataQuery odataQuery = default(ODataQuery), 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"); @@ -120,7 +124,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +132,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -156,9 +158,9 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) _queryParameters.Add(_odataFilter); } } - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -333,6 +335,10 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, 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"); @@ -361,7 +367,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -369,7 +374,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -390,9 +394,9 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -519,247 +523,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) return _result; } - /// - /// Returns the Access token for communication between BMS and Protection - /// service - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the container. - /// - /// - /// Name of the container. - /// - /// - /// Name of the Protected Item. - /// - /// - /// Recovery Point Id - /// - /// - /// Get Access Token request - /// - /// - /// 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> GetAccessTokenWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, AADPropertiesResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - 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 (fabricName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); - } - if (containerName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); - } - if (protectedItemName == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); - } - if (recoveryPointId == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); - } - if (parameters == null) - { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); - } - string apiVersion = "2018-12-20"; - // Tracing - bool _shouldTrace = ServiceClientTracing.IsEnabled; - string _invocationId = null; - if (_shouldTrace) - { - _invocationId = ServiceClientTracing.NextInvocationId.ToString(); - Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("vaultName", vaultName); - tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("fabricName", fabricName); - tracingParameters.Add("containerName", containerName); - tracingParameters.Add("protectedItemName", protectedItemName); - tracingParameters.Add("recoveryPointId", recoveryPointId); - tracingParameters.Add("parameters", parameters); - tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "GetAccessToken", 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.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/accessToken").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("{fabricName}", System.Uri.EscapeDataString(fabricName)); - _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); - _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); - _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); - 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 (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); - } - System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; - cancellationToken.ThrowIfCancellationRequested(); - string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 400) - { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); - try - { - _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); - if (_errorBody != null) - { - ex.Body = _errorBody; - } - } - catch (JsonException) - { - // Ignore the exception - } - ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); - ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - 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; - } - /// /// Lists the backup copies for the backed up item. /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs index 1e15c66ef9f2..e6ecbe1a9930 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperationsExtensions.cs @@ -160,80 +160,6 @@ public static RecoveryPointResource Get(this IRecoveryPointsOperations operation } } - /// - /// Returns the Access token for communication between BMS and Protection - /// service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the container. - /// - /// - /// Name of the container. - /// - /// - /// Name of the Protected Item. - /// - /// - /// Recovery Point Id - /// - /// - /// Get Access Token request - /// - public static CrrAccessTokenResource GetAccessToken(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, AADPropertiesResource parameters) - { - return operations.GetAccessTokenAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); - } - - /// - /// Returns the Access token for communication between BMS and Protection - /// service - /// - /// - /// The operations group for this extension method. - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Fabric name associated with the container. - /// - /// - /// Name of the container. - /// - /// - /// Name of the Protected Item. - /// - /// - /// Recovery Point Id - /// - /// - /// Get Access Token request - /// - /// - /// The cancellation token. - /// - public static async Task GetAccessTokenAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, AADPropertiesResource parameters, CancellationToken cancellationToken = default(CancellationToken)) - { - using (var _result = await operations.GetAccessTokenWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)) - { - return _result.Body; - } - } - /// /// Lists the backup copies for the backed up item. /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs index 43fdd86a2c26..1874446773da 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs @@ -92,6 +92,10 @@ internal RecoveryPointsRecommendedForMoveOperations(RecoveryServicesBackupClient /// public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, 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"); @@ -120,7 +124,6 @@ internal RecoveryPointsRecommendedForMoveOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,7 +131,6 @@ internal RecoveryPointsRecommendedForMoveOperations(RecoveryServicesBackupClient { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -148,9 +150,9 @@ internal RecoveryPointsRecommendedForMoveOperations(RecoveryServicesBackupClient _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs index 03fafa4311da..1a0fd7622c22 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs @@ -53,6 +53,11 @@ public partial class RecoveryServicesBackupClient : ServiceClient public string SubscriptionId { get; set; } + /// + /// Client Api Version. + /// + public string ApiVersion { get; private set; } + /// /// The preferred language for the response. /// @@ -206,6 +211,21 @@ public partial class RecoveryServicesBackupClient : ServiceClient public virtual IOperationOperations Operation { get; private set; } + /// + /// Gets the IValidateOperationOperations. + /// + public virtual IValidateOperationOperations ValidateOperation { get; private set; } + + /// + /// Gets the IValidateOperationResultsOperations. + /// + public virtual IValidateOperationResultsOperations ValidateOperationResults { get; private set; } + + /// + /// Gets the IValidateOperationStatusesOperations. + /// + public virtual IValidateOperationStatusesOperations ValidateOperationStatuses { get; private set; } + /// /// Gets the IBackupEnginesOperations. /// @@ -296,56 +316,6 @@ public partial class RecoveryServicesBackupClient : ServiceClient public virtual IResourceGuardProxyOperations ResourceGuardProxy { get; private set; } - /// - /// Gets the IBackupUsageSummariesCRROperations. - /// - public virtual IBackupUsageSummariesCRROperations BackupUsageSummariesCRR { get; private set; } - - /// - /// Gets the IAadPropertiesOperations. - /// - public virtual IAadPropertiesOperations AadProperties { get; private set; } - - /// - /// Gets the ICrossRegionRestoreOperations. - /// - public virtual ICrossRegionRestoreOperations CrossRegionRestore { get; private set; } - - /// - /// Gets the IBackupCrrJobDetailsOperations. - /// - public virtual IBackupCrrJobDetailsOperations BackupCrrJobDetails { get; private set; } - - /// - /// Gets the IBackupCrrJobsOperations. - /// - public virtual IBackupCrrJobsOperations BackupCrrJobs { get; private set; } - - /// - /// Gets the ICrrOperationResultsOperations. - /// - public virtual ICrrOperationResultsOperations CrrOperationResults { get; private set; } - - /// - /// Gets the ICrrOperationStatusOperations. - /// - public virtual ICrrOperationStatusOperations CrrOperationStatus { get; private set; } - - /// - /// Gets the IBackupResourceStorageConfigsOperations. - /// - public virtual IBackupResourceStorageConfigsOperations BackupResourceStorageConfigs { get; private set; } - - /// - /// Gets the IRecoveryPointsCrrOperations. - /// - public virtual IRecoveryPointsCrrOperations RecoveryPointsCrr { get; private set; } - - /// - /// Gets the IBackupProtectedItemsCrrOperations. - /// - public virtual IBackupProtectedItemsCrrOperations BackupProtectedItemsCrr { get; private set; } - /// /// Initializes a new instance of the RecoveryServicesBackupClient class. /// @@ -614,6 +584,9 @@ private void Initialize() Jobs = new JobsOperations(this); BackupProtectedItems = new BackupProtectedItemsOperations(this); Operation = new OperationOperations(this); + ValidateOperation = new ValidateOperationOperations(this); + ValidateOperationResults = new ValidateOperationResultsOperations(this); + ValidateOperationStatuses = new ValidateOperationStatusesOperations(this); BackupEngines = new BackupEnginesOperations(this); ProtectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsOperations(this); ProtectableContainers = new ProtectableContainersOperations(this); @@ -632,17 +605,8 @@ private void Initialize() RecoveryPointsRecommendedForMove = new RecoveryPointsRecommendedForMoveOperations(this); ResourceGuardProxies = new ResourceGuardProxiesOperations(this); ResourceGuardProxy = new ResourceGuardProxyOperations(this); - BackupUsageSummariesCRR = new BackupUsageSummariesCRROperations(this); - AadProperties = new AadPropertiesOperations(this); - CrossRegionRestore = new CrossRegionRestoreOperations(this); - BackupCrrJobDetails = new BackupCrrJobDetailsOperations(this); - BackupCrrJobs = new BackupCrrJobsOperations(this); - CrrOperationResults = new CrrOperationResultsOperations(this); - CrrOperationStatus = new CrrOperationStatusOperations(this); - BackupResourceStorageConfigs = new BackupResourceStorageConfigsOperations(this); - RecoveryPointsCrr = new RecoveryPointsCrrOperations(this); - BackupProtectedItemsCrr = new BackupProtectedItemsCrrOperations(this); BaseUri = new System.Uri("https://management.azure.com"); + ApiVersion = "2021-10-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -711,8 +675,6 @@ private void Initialize() DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("workloadItemType")); SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("protectableItemType")); DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("protectableItemType")); - SerializationSettings.Converters.Add(new PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new PolymorphicDeserializeJsonConverter("objectType")); CustomInitialize(); DeserializationSettings.Converters.Add(new CloudErrorJsonConverter()); } @@ -751,6 +713,10 @@ private void Initialize() /// public async Task> GetOperationStatusWithHttpMessagesAsync(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"); @@ -767,7 +733,6 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -775,7 +740,6 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("operationId", operationId); @@ -790,9 +754,9 @@ private void Initialize() _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1033,6 +997,10 @@ private void Initialize() /// public async Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, 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"); @@ -1053,7 +1021,6 @@ private void Initialize() { parameters.Validate(); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1061,7 +1028,6 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -1075,9 +1041,9 @@ private void Initialize() _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1220,6 +1186,10 @@ private void Initialize() /// public async Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, 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"); @@ -1240,7 +1210,6 @@ private void Initialize() { parameters.Validate(); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1248,7 +1217,6 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -1262,9 +1230,9 @@ private void Initialize() _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { @@ -1415,6 +1383,10 @@ private void Initialize() /// public async Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, 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"); @@ -1447,7 +1419,6 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1455,7 +1426,6 @@ private void Initialize() { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -1477,9 +1447,9 @@ private void Initialize() _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); List _queryParameters = new List(); - if (apiVersion != null) + if (ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs index 28d6e131c4b5..8bb17fd88505 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxiesOperations.cs @@ -83,6 +83,10 @@ internal ResourceGuardProxiesOperations(RecoveryServicesBackupClient client) /// public async Task>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, 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"); @@ -95,7 +99,6 @@ internal ResourceGuardProxiesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -103,7 +106,6 @@ internal ResourceGuardProxiesOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -116,9 +118,9 @@ internal ResourceGuardProxiesOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs index c872765e3042..bf785a122791 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ResourceGuardProxyOperations.cs @@ -86,6 +86,10 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, 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"); @@ -102,7 +106,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,7 +113,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -125,9 +127,9 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -290,6 +292,10 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) /// public async Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, 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"); @@ -306,7 +312,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -314,7 +319,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -329,9 +333,9 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -490,6 +494,10 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) /// public async Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, 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"); @@ -506,7 +514,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "resourceGuardProxyName"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -514,7 +521,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -529,9 +535,9 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -678,6 +684,10 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) /// public async Task> UnlockDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, UnlockDeleteRequest parameters, 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"); @@ -698,7 +708,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -706,7 +715,6 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -722,9 +730,9 @@ internal ResourceGuardProxyOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs index 1264c44d9b74..58cede79686d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperations.cs @@ -137,6 +137,10 @@ internal RestoresOperations(RecoveryServicesBackupClient client) /// public async Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, 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"); @@ -169,7 +173,6 @@ internal RestoresOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -177,7 +180,6 @@ internal RestoresOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); @@ -199,9 +201,9 @@ internal RestoresOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); _url = _url.Replace("{recoveryPointId}", System.Uri.EscapeDataString(recoveryPointId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs index aa57fcbe7dba..b155e603fdcb 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SdkInfo_RecoveryServicesBackupClient.cs @@ -19,79 +19,60 @@ public static IEnumerable> ApiInfo_RecoveryService { return new Tuple[] { - new Tuple("RecoveryServices", "AadProperties", "2018-12-20"), - new Tuple("RecoveryServices", "BMSPrepareDataMove", "2021-08-01"), - new Tuple("RecoveryServices", "BMSPrepareDataMoveOperationResult", "2021-08-01"), - new Tuple("RecoveryServices", "BMSTriggerDataMove", "2021-08-01"), - new Tuple("RecoveryServices", "BackupCrrJobDetails", "2018-12-20"), - new Tuple("RecoveryServices", "BackupCrrJobs", "2018-12-20"), - new Tuple("RecoveryServices", "BackupEngines", "2021-08-01"), - new Tuple("RecoveryServices", "BackupJobs", "2021-08-01"), - new Tuple("RecoveryServices", "BackupOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "BackupOperationStatuses", "2021-08-01"), - new Tuple("RecoveryServices", "BackupPolicies", "2021-08-01"), - new Tuple("RecoveryServices", "BackupProtectableItems", "2021-08-01"), - new Tuple("RecoveryServices", "BackupProtectedItems", "2021-08-01"), - new Tuple("RecoveryServices", "BackupProtectedItemsCrr", "2018-12-20"), - new Tuple("RecoveryServices", "BackupProtectionContainers", "2021-08-01"), - new Tuple("RecoveryServices", "BackupProtectionIntent", "2021-08-01"), - new Tuple("RecoveryServices", "BackupResourceEncryptionConfigs", "2021-08-01"), - new Tuple("RecoveryServices", "BackupResourceStorageConfigs", "2018-12-20"), - new Tuple("RecoveryServices", "BackupResourceStorageConfigsNonCRR", "2021-08-01"), - new Tuple("RecoveryServices", "BackupResourceVaultConfigs", "2021-08-01"), - new Tuple("RecoveryServices", "BackupStatus", "2021-08-01"), - new Tuple("RecoveryServices", "BackupUsageSummaries", "2021-08-01"), - new Tuple("RecoveryServices", "BackupUsageSummariesCRR", "2018-12-20"), - new Tuple("RecoveryServices", "BackupWorkloadItems", "2021-08-01"), - new Tuple("RecoveryServices", "Backups", "2021-08-01"), - new Tuple("RecoveryServices", "CrossRegionRestore", "2018-12-20"), - new Tuple("RecoveryServices", "CrrOperationResults", "2018-12-20"), - new Tuple("RecoveryServices", "CrrOperationStatus", "2018-12-20"), - new Tuple("RecoveryServices", "ExportJobsOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "FeatureSupport", "2021-08-01"), - new Tuple("RecoveryServices", "GetOperationStatus", "2021-08-01"), - new Tuple("RecoveryServices", "ItemLevelRecoveryConnections", "2021-08-01"), - new Tuple("RecoveryServices", "JobCancellations", "2021-08-01"), - new Tuple("RecoveryServices", "JobDetails", "2021-08-01"), - new Tuple("RecoveryServices", "JobOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "Jobs", "2021-08-01"), - new Tuple("RecoveryServices", "MoveRecoveryPoint", "2021-08-01"), - new Tuple("RecoveryServices", "Operation", "2021-08-01"), - new Tuple("RecoveryServices", "Operations", "2021-08-01"), - new Tuple("RecoveryServices", "PrivateEndpoint", "2021-08-01"), - new Tuple("RecoveryServices", "PrivateEndpointConnection", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectableContainers", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectedItemOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectedItemOperationStatuses", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectedItems", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionContainerOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionContainerRefreshOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionContainers", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionIntent", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionPolicies", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionPolicyOperationResults", "2021-08-01"), - new Tuple("RecoveryServices", "ProtectionPolicyOperationStatuses", "2021-08-01"), - new Tuple("RecoveryServices", "RecoveryPoints", "2018-12-20"), - new Tuple("RecoveryServices", "RecoveryPoints", "2021-08-01"), - new Tuple("RecoveryServices", "RecoveryPointsCrr", "2018-12-20"), - new Tuple("RecoveryServices", "RecoveryPointsRecommendedForMove", "2021-08-01"), - new Tuple("RecoveryServices", "ResourceGuardProxies", "2021-08-01"), - new Tuple("RecoveryServices", "ResourceGuardProxy", "2021-08-01"), - new Tuple("RecoveryServices", "Restores", "2021-08-01"), - new Tuple("RecoveryServices", "SecurityPINs", "2021-08-01"), + new Tuple("RecoveryServices", "BMSPrepareDataMove", "2021-10-01"), + new Tuple("RecoveryServices", "BMSPrepareDataMoveOperationResult", "2021-10-01"), + new Tuple("RecoveryServices", "BMSTriggerDataMove", "2021-10-01"), + new Tuple("RecoveryServices", "BackupEngines", "2021-10-01"), + new Tuple("RecoveryServices", "BackupJobs", "2021-10-01"), + new Tuple("RecoveryServices", "BackupOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "BackupOperationStatuses", "2021-10-01"), + new Tuple("RecoveryServices", "BackupPolicies", "2021-10-01"), + new Tuple("RecoveryServices", "BackupProtectableItems", "2021-10-01"), + new Tuple("RecoveryServices", "BackupProtectedItems", "2021-10-01"), + new Tuple("RecoveryServices", "BackupProtectionContainers", "2021-10-01"), + new Tuple("RecoveryServices", "BackupProtectionIntent", "2021-10-01"), + new Tuple("RecoveryServices", "BackupResourceEncryptionConfigs", "2021-10-01"), + new Tuple("RecoveryServices", "BackupResourceStorageConfigsNonCRR", "2021-10-01"), + new Tuple("RecoveryServices", "BackupResourceVaultConfigs", "2021-10-01"), + new Tuple("RecoveryServices", "BackupStatus", "2021-10-01"), + new Tuple("RecoveryServices", "BackupUsageSummaries", "2021-10-01"), + new Tuple("RecoveryServices", "BackupWorkloadItems", "2021-10-01"), + new Tuple("RecoveryServices", "Backups", "2021-10-01"), + new Tuple("RecoveryServices", "ExportJobsOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "FeatureSupport", "2021-10-01"), + new Tuple("RecoveryServices", "GetOperationStatus", "2021-10-01"), + new Tuple("RecoveryServices", "ItemLevelRecoveryConnections", "2021-10-01"), + new Tuple("RecoveryServices", "JobCancellations", "2021-10-01"), + new Tuple("RecoveryServices", "JobDetails", "2021-10-01"), + new Tuple("RecoveryServices", "JobOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "Jobs", "2021-10-01"), + new Tuple("RecoveryServices", "MoveRecoveryPoint", "2021-10-01"), + new Tuple("RecoveryServices", "Operation", "2021-10-01"), + new Tuple("RecoveryServices", "Operations", "2021-10-01"), + new Tuple("RecoveryServices", "PrivateEndpoint", "2021-10-01"), + new Tuple("RecoveryServices", "PrivateEndpointConnection", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectableContainers", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationStatuses", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectedItems", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionContainerOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionContainerRefreshOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionContainers", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionIntent", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionPolicies", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationStatuses", "2021-10-01"), + new Tuple("RecoveryServices", "RecoveryPoints", "2021-10-01"), + new Tuple("RecoveryServices", "RecoveryPointsRecommendedForMove", "2021-10-01"), + new Tuple("RecoveryServices", "ResourceGuardProxies", "2021-10-01"), + new Tuple("RecoveryServices", "ResourceGuardProxy", "2021-10-01"), + new Tuple("RecoveryServices", "Restores", "2021-10-01"), + new Tuple("RecoveryServices", "SecurityPINs", "2021-10-01"), + new Tuple("RecoveryServices", "ValidateOperation", "2021-10-01"), + new Tuple("RecoveryServices", "ValidateOperationResults", "2021-10-01"), + new Tuple("RecoveryServices", "ValidateOperationStatuses", "2021-10-01"), }.AsEnumerable(); } } - // BEGIN: Code Generation Metadata Section - public static readonly String AutoRestVersion = "v2"; - public static readonly String AutoRestBootStrapperVersion = "autorest@3.3.2"; - public static readonly String AutoRestCmdExecuted = "cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/main/specification/recoveryservicesbackup/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\\SDK\\azure-sdk-for-net\\sdk"; - public static readonly String GithubForkName = "Azure"; - public static readonly String GithubBranchName = "main"; - public static readonly String GithubCommidId = "e5b604e04e917bc2b0c9673449491b89edb09211"; - public static readonly String CodeGenerationErrors = ""; - public static readonly String GithubRepoName = "azure-rest-api-specs"; - // END: Code Generation Metadata Section } } - diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs index d0cc3039c7a1..c582fd1219e2 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/SecurityPINsOperations.cs @@ -86,6 +86,10 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) /// public async Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, IList resourceGuardOperationRequests = default(IList), 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"); @@ -98,7 +102,6 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2021-08-01"; SecurityPinBase parameters = default(SecurityPinBase); if (resourceGuardOperationRequests != null) { @@ -112,7 +115,6 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); @@ -126,9 +128,9 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs similarity index 71% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs index 799720e9a207..3e0eac628c61 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// CrossRegionRestoreOperations operations. + /// ValidateOperationOperations operations. /// - internal partial class CrossRegionRestoreOperations : IServiceOperations, ICrossRegionRestoreOperations + internal partial class ValidateOperationOperations : IServiceOperations, IValidateOperationOperations { /// - /// Initializes a new instance of the CrossRegionRestoreOperations class. + /// Initializes a new instance of the ValidateOperationOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class CrossRegionRestoreOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) + internal ValidateOperationOperations(RecoveryServicesBackupClient client) { if (client == null) { @@ -51,14 +51,19 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) public RecoveryServicesBackupClient Client { get; private set; } /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. /// - /// - /// Azure region to hit Api + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. /// /// - /// resource cross region restore request + /// resource validate operation request /// /// /// The headers that will be added to request. @@ -66,22 +71,27 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - public async Task TriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { // Send request - AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(azureRegion, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// - /// Restores the specified backed up data in a different region as compared to - /// where the data is backed up. + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. /// - /// - /// Azure region to hit Api + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. /// /// - /// resource cross region restore request + /// resource validate operation request /// /// /// Headers that will be added to request. @@ -89,7 +99,7 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,11 +111,19 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async Task BeginTriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, ValidateOperationRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - if (azureRegion == null) + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (Client.SubscriptionId == null) { @@ -115,7 +133,6 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2018-12-20"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -123,21 +140,22 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); ServiceClientTracing.Enter(_invocationId, this, "BeginTrigger", tracingParameters); } // Construct URL var _baseUrl = Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrossRegionRestore").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupTriggerValidateOperation").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)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -203,15 +221,16 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,6 +240,10 @@ internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) } 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); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs new file mode 100644 index 000000000000..5e856dfdc011 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationOperationsExtensions.cs @@ -0,0 +1,123 @@ +// +// 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.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidateOperationOperations. + /// + public static partial class ValidateOperationOperationsExtensions + { + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + public static void Trigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters) + { + operations.TriggerAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The cancellation token. + /// + public static async Task TriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + public static void BeginTrigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters) + { + operations.BeginTriggerAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Validate operation for specified backed up item in the form of an + /// asynchronous operation. Returns tracking headers which can be tracked using + /// GetValidateOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// resource validate operation request + /// + /// + /// The cancellation token. + /// + public static async Task BeginTriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, ValidateOperationRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs similarity index 78% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs index 8acf47fb784e..afe3c735c98a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperations.cs @@ -12,7 +12,6 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup { using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; using Newtonsoft.Json; using System.Collections; @@ -24,12 +23,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// BackupUsageSummariesCRROperations operations. + /// ValidateOperationResultsOperations operations. /// - internal partial class BackupUsageSummariesCRROperations : IServiceOperations, IBackupUsageSummariesCRROperations + internal partial class ValidateOperationResultsOperations : IServiceOperations, IValidateOperationResultsOperations { /// - /// Initializes a new instance of the BackupUsageSummariesCRROperations class. + /// Initializes a new instance of the ValidateOperationResultsOperations class. /// /// /// Reference to the service client. @@ -37,7 +36,7 @@ internal partial class BackupUsageSummariesCRROperations : IServiceOperations /// Thrown when a required parameter is null /// - internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) + internal ValidateOperationResultsOperations(RecoveryServicesBackupClient client) { if (client == null) { @@ -52,7 +51,7 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) public RecoveryServicesBackupClient Client { get; private set; } /// - /// Fetches the backup management usage summaries of the vault. + /// Fetches the result of a triggered validate operation. /// /// /// The name of the recovery services vault. @@ -61,11 +60,9 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. /// /// /// Headers that will be added to request. @@ -73,7 +70,7 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -88,8 +85,12 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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 (vaultName == null) { throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); @@ -102,7 +103,10 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2018-12-20"; + if (operationId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); + } // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,36 +114,23 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("apiVersion", apiVersion); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); - tracingParameters.Add("skipToken", skipToken); + tracingParameters.Add("operationId", operationId); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters); + 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.RecoveryServices/vaults/{vaultName}/backupUsageSummaries").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationResults/{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(Client.SubscriptionId)); + _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (odataQuery != null) + if (Client.ApiVersion != null) { - var _odataFilter = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_odataFilter)) - { - _queryParameters.Add(_odataFilter); - } - } - if (apiVersion != null) - { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); - } - if (skipToken != null) - { - _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -199,15 +190,16 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -217,6 +209,10 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient client) } 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); @@ -229,7 +225,7 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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")) @@ -242,7 +238,7 @@ internal BackupUsageSummariesCRROperations(RecoveryServicesBackupClient 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/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs similarity index 51% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperationsExtensions.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs index e860af79ac3d..68101acce37b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperationsExtensions.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationResultsOperationsExtensions.cs @@ -12,20 +12,17 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup { using Microsoft.Rest; using Microsoft.Rest.Azure; - using Microsoft.Rest.Azure.OData; using Models; - using System.Collections; - using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; /// - /// Extension methods for BackupUsageSummariesCRROperations. + /// Extension methods for ValidateOperationResultsOperations. /// - public static partial class BackupUsageSummariesCRROperationsExtensions + public static partial class ValidateOperationResultsOperationsExtensions { /// - /// Fetches the backup management usage summaries of the vault. + /// Fetches the result of a triggered validate operation. /// /// /// The operations group for this extension method. @@ -37,19 +34,17 @@ public static partial class BackupUsageSummariesCRROperationsExtensions /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// OData parameters to apply to the operation. + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. /// - /// - /// skipToken Filter. - /// - public static IEnumerable List(this IBackupUsageSummariesCRROperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) + public static ValidateOperationsResponse Get(this IValidateOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) { - return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); } /// - /// Fetches the backup management usage summaries of the vault. + /// Fetches the result of a triggered validate operation. /// /// /// The operations group for this extension method. @@ -61,18 +56,16 @@ public static partial class BackupUsageSummariesCRROperationsExtensions /// The name of the resource group where the recovery services vault is /// present. /// - /// - /// OData parameters to apply to the operation. - /// - /// - /// skipToken Filter. + /// + /// OperationID which represents the operation whose result needs to be + /// fetched. /// /// /// The cancellation token. /// - public static async Task> ListAsync(this IBackupUsageSummariesCRROperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), CancellationToken cancellationToken = default(CancellationToken)) + public static async Task GetAsync(this IValidateOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs similarity index 75% rename from sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperations.cs rename to sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs index 566e5b8bc387..2266d550b4a1 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperations.cs @@ -23,12 +23,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using System.Threading.Tasks; /// - /// CrrOperationStatusOperations operations. + /// ValidateOperationStatusesOperations operations. /// - internal partial class CrrOperationStatusOperations : IServiceOperations, ICrrOperationStatusOperations + internal partial class ValidateOperationStatusesOperations : IServiceOperations, IValidateOperationStatusesOperations { /// - /// Initializes a new instance of the CrrOperationStatusOperations class. + /// Initializes a new instance of the ValidateOperationStatusesOperations class. /// /// /// Reference to the service client. @@ -36,7 +36,7 @@ internal partial class CrrOperationStatusOperations : IServiceOperations /// Thrown when a required parameter is null /// - internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) + internal ValidateOperationStatusesOperations(RecoveryServicesBackupClient client) { if (client == null) { @@ -50,10 +50,23 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) /// public RecoveryServicesBackupClient Client { get; private set; } - /// - /// Azure region to hit Api + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. /// /// + /// OperationID represents the operation whose status needs to be fetched. /// /// /// Headers that will be added to request. @@ -61,7 +74,7 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -76,11 +89,19 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async Task> GetWithHttpMessagesAsync(string azureRegion, string operationId, 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 (azureRegion == null) + if (Client.ApiVersion == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (vaultName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "azureRegion"); + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); } if (Client.SubscriptionId == null) { @@ -90,7 +111,6 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2018-12-20"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -98,22 +118,23 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) { _invocationId = ServiceClientTracing.NextInvocationId.ToString(); Dictionary tracingParameters = new Dictionary(); - tracingParameters.Add("apiVersion", apiVersion); - tracingParameters.Add("azureRegion", azureRegion); + tracingParameters.Add("vaultName", vaultName); + 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}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupCrrOperationsStatus/{operationId}").ToString(); - _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperationsStatuses/{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(Client.SubscriptionId)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); List _queryParameters = new List(); - if (apiVersion != null) + if (Client.ApiVersion != null) { - _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion))); } if (_queryParameters.Count > 0) { @@ -175,13 +196,14 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { + ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -191,6 +213,10 @@ internal CrrOperationStatusOperations(RecoveryServicesBackupClient client) } 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); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs new file mode 100644 index 000000000000..0b87a6dc00e6 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ValidateOperationStatusesOperationsExtensions.cs @@ -0,0 +1,83 @@ +// +// 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.RecoveryServices.Backup +{ + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for ValidateOperationStatusesOperations. + /// + public static partial class ValidateOperationStatusesOperationsExtensions + { + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + public static OperationStatus Get(this IValidateOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId) + { + return operations.GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches the status of a triggered validate operation. The status can be in + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// OperationID represents the operation whose status needs to be fetched. + /// + /// + /// The cancellation token. + /// + public static async Task GetAsync(this IValidateOperationStatusesOperations operations, string vaultName, string resourceGroupName, string operationId, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + } +}