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/BackupUsageSummariesCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperations.cs deleted file mode 100644 index 8acf47fb784e..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperations.cs +++ /dev/null @@ -1,265 +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; - - /// - /// BackupUsageSummariesCRROperations operations. - /// - internal partial class BackupUsageSummariesCRROperations : IServiceOperations, IBackupUsageSummariesCRROperations - { - /// - /// Initializes a new instance of the BackupUsageSummariesCRROperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal BackupUsageSummariesCRROperations(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 backup management usage summaries of the 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}/backupUsageSummaries").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; - } - - } -} 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/BackupUsageSummariesCRROperationsExtensions.cs deleted file mode 100644 index e860af79ac3d..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupUsageSummariesCRROperationsExtensions.cs +++ /dev/null @@ -1,82 +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; - - /// - /// Extension methods for BackupUsageSummariesCRROperations. - /// - public static partial class BackupUsageSummariesCRROperationsExtensions - { - /// - /// Fetches the backup management usage summaries of the 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 IEnumerable List(this IBackupUsageSummariesCRROperations operations, string vaultName, string resourceGroupName, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string)) - { - return operations.ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); - } - - /// - /// Fetches the backup management usage summaries of the 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 IBackupUsageSummariesCRROperations 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; - } - } - - } -} 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/CrossRegionRestoreOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperations.cs deleted file mode 100644 index 799720e9a207..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrossRegionRestoreOperations.cs +++ /dev/null @@ -1,251 +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; - - /// - /// CrossRegionRestoreOperations operations. - /// - internal partial class CrossRegionRestoreOperations : IServiceOperations, ICrossRegionRestoreOperations - { - /// - /// Initializes a new instance of the CrossRegionRestoreOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CrossRegionRestoreOperations(RecoveryServicesBackupClient client) - { - if (client == null) - { - throw new System.ArgumentNullException("client"); - } - Client = client; - } - - /// - /// Gets a reference to the RecoveryServicesBackupClient - /// - 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. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore request - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - public async Task TriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) - { - // Send request - AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(azureRegion, 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. - /// - /// - /// Azure region to hit Api - /// - /// - /// resource cross region restore 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 BeginTriggerWithHttpMessagesAsync(string azureRegion, CrossRegionRestoreRequest 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, "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)); - _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 && (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/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/CrrOperationStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperations.cs deleted file mode 100644 index 566e5b8bc387..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/CrrOperationStatusOperations.cs +++ /dev/null @@ -1,239 +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; - - /// - /// CrrOperationStatusOperations operations. - /// - internal partial class CrrOperationStatusOperations : IServiceOperations, ICrrOperationStatusOperations - { - /// - /// Initializes a new instance of the CrrOperationStatusOperations class. - /// - /// - /// Reference to the service client. - /// - /// - /// Thrown when a required parameter is null - /// - internal CrrOperationStatusOperations(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 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, 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}/backupCrrOperationsStatus/{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) - { - 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/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/IBackupProtectedItemsCrrOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsCrrOperations.cs deleted file mode 100644 index f2bcaa778349..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsCrrOperations.cs +++ /dev/null @@ -1,84 +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; - - /// - /// BackupProtectedItemsCrrOperations operations. - /// - public partial interface IBackupProtectedItemsCrrOperations - { - /// - /// 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. - /// - /// - /// 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, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); - /// - /// Provides a pageable list of all items that are backed up within a - /// vault. - /// - /// - /// 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/IBackupUsageSummariesCRROperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesCRROperations.cs deleted file mode 100644 index e60212e5ccff..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupUsageSummariesCRROperations.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 -{ - 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; - - /// - /// BackupUsageSummariesCRROperations operations. - /// - public partial interface IBackupUsageSummariesCRROperations - { - /// - /// Fetches the backup management usage summaries of the 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. - /// - /// - /// 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, ODataQuery odataQuery = default(ODataQuery), string skipToken = default(string), 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/ICrrOperationStatusOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationStatusOperations.cs deleted file mode 100644 index 0dd3bd913393..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ICrrOperationStatusOperations.cs +++ /dev/null @@ -1,48 +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; - - /// - /// CrrOperationStatusOperations operations. - /// - public partial interface ICrrOperationStatusOperations - { - /// - /// 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 unable to deserialize the response - /// - /// - /// 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..2d726dbcc720 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. /// @@ -293,56 +298,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/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/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..aec8807bd9fe 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 @@ -82,10 +82,7 @@ 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)) + 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)) : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUTC, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests) { FriendlyName = friendlyName; @@ -95,7 +92,6 @@ public AzureFileshareProtectedItem() LastBackupTime = lastBackupTime; KpisHealths = kpisHealths; ExtendedInfo = extendedInfo; - HealthStatus = healthStatus; CustomInit(); } @@ -151,13 +147,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/AzureWorkloadRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadRecoveryPoint.cs index 1a2bad40f446..1aa29594b9e5 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 @@ -55,17 +55,17 @@ 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. 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/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/IaasVMRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRecoveryPoint.cs index 8348b84021d8..e81a301b8c05 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 @@ -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. diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs index 7d48a38380b5..96e6719185d5 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreRequest.cs @@ -84,9 +84,7 @@ public IaasVMRestoreRequest() /// be restored. /// Managed Identity information required to /// access customer storage account. - /// IaaS VM workload specific - /// restore details for restores using managed identity. - public IaasVMRestoreRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo), IdentityBasedRestoreDetails identityBasedRestoreDetails = default(IdentityBasedRestoreDetails)) + public IaasVMRestoreRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo)) { RecoveryPointId = recoveryPointId; RecoveryType = recoveryType; @@ -107,7 +105,6 @@ public IaasVMRestoreRequest() DiskEncryptionSetId = diskEncryptionSetId; Zones = zones; IdentityInfo = identityInfo; - IdentityBasedRestoreDetails = identityBasedRestoreDetails; CustomInit(); } @@ -256,12 +253,5 @@ public IaasVMRestoreRequest() [JsonProperty(PropertyName = "identityInfo")] public IdentityInfo IdentityInfo { get; set; } - /// - /// Gets or sets iaaS VM workload specific restore details for restores - /// using managed identity. - /// - [JsonProperty(PropertyName = "identityBasedRestoreDetails")] - public IdentityBasedRestoreDetails IdentityBasedRestoreDetails { get; set; } - } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs index 4e800af6e7ba..208ea4bf2a11 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs @@ -87,12 +87,10 @@ public IaasVMRestoreWithRehydrationRequest() /// be restored. /// Managed Identity information required to /// access customer storage account. - /// IaaS VM workload specific - /// restore details for restores using managed identity. /// RP Rehydration /// Info - public IaasVMRestoreWithRehydrationRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo), IdentityBasedRestoreDetails identityBasedRestoreDetails = default(IdentityBasedRestoreDetails), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) - : base(recoveryPointId, recoveryType, sourceResourceId, targetVirtualMachineId, targetResourceGroupId, storageAccountId, virtualNetworkId, subnetId, targetDomainNameId, region, affinityGroup, createNewCloudService, originalStorageAccountOption, encryptionDetails, restoreDiskLunList, restoreWithManagedDisks, diskEncryptionSetId, zones, identityInfo, identityBasedRestoreDetails) + public IaasVMRestoreWithRehydrationRequest(string recoveryPointId = default(string), string recoveryType = default(string), string sourceResourceId = default(string), string targetVirtualMachineId = default(string), string targetResourceGroupId = default(string), string storageAccountId = default(string), string virtualNetworkId = default(string), string subnetId = default(string), string targetDomainNameId = default(string), string region = default(string), string affinityGroup = default(string), bool? createNewCloudService = default(bool?), bool? originalStorageAccountOption = default(bool?), EncryptionDetails encryptionDetails = default(EncryptionDetails), IList restoreDiskLunList = default(IList), bool? restoreWithManagedDisks = default(bool?), string diskEncryptionSetId = default(string), IList zones = default(IList), IdentityInfo identityInfo = default(IdentityInfo), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryPointId, recoveryType, sourceResourceId, targetVirtualMachineId, targetResourceGroupId, storageAccountId, virtualNetworkId, subnetId, targetDomainNameId, region, affinityGroup, createNewCloudService, originalStorageAccountOption, encryptionDetails, restoreDiskLunList, restoreWithManagedDisks, diskEncryptionSetId, zones, identityInfo) { RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; CustomInit(); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.cs deleted file mode 100644 index c3bd66edb52a..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IdentityBasedRestoreDetails.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.Linq; - - /// - /// IaaS VM workload specific restore details for restores using managed - /// identity - /// - public partial class IdentityBasedRestoreDetails - { - /// - /// Initializes a new instance of the IdentityBasedRestoreDetails - /// class. - /// - public IdentityBasedRestoreDetails() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the IdentityBasedRestoreDetails - /// class. - /// - /// Gets the class type. - /// Fully qualified ARM ID of the - /// target storage account. - public IdentityBasedRestoreDetails(string objectType = default(string), string targetStorageAccountId = default(string)) - { - ObjectType = objectType; - TargetStorageAccountId = targetStorageAccountId; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the class type. - /// - [JsonProperty(PropertyName = "objectType")] - public string ObjectType { get; set; } - - /// - /// Gets or sets fully qualified ARM ID of the target storage account. - /// - [JsonProperty(PropertyName = "targetStorageAccountId")] - public string TargetStorageAccountId { get; set; } - - } -} 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/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/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..5d0c6ba1c689 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. /// @@ -296,56 +301,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. /// @@ -632,17 +587,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-08-01"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true; @@ -711,8 +657,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 +695,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 +715,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 +722,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 +736,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 +979,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 +1003,6 @@ private void Initialize() { parameters.Validate(); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1061,7 +1010,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 +1023,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 +1168,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 +1192,6 @@ private void Initialize() { parameters.Validate(); } - string apiVersion = "2021-08-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1248,7 +1199,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 +1212,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 +1365,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 +1401,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 +1408,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 +1429,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..6fb63310a74e 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,12 +19,9 @@ 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"), @@ -32,21 +29,15 @@ public static IEnumerable> ApiInfo_RecoveryService 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"), @@ -71,9 +62,7 @@ public static IEnumerable> ApiInfo_RecoveryService 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"), @@ -82,16 +71,5 @@ public static IEnumerable> ApiInfo_RecoveryService }.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) {