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 5fd5d1afb701..8e6dcec3adf9 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 @@ -101,7 +101,7 @@ internal BMSPrepareDataMoveOperationResultOperations(RecoveryServicesBackupClien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 92fa6e2386ef..c7b98b90229f 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 @@ -74,7 +74,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -103,7 +103,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -121,7 +121,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) } // 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}/backupEngines").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines").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)); @@ -202,14 +202,13 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -219,10 +218,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -292,7 +287,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -325,7 +320,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "backupEngineName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -344,7 +339,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) } // 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}/backupEngines/{backupEngineName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEngines/{backupEngineName}").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)); @@ -426,14 +421,13 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -443,10 +437,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -504,7 +494,7 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -600,14 +590,13 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -617,10 +606,6 @@ internal BackupEnginesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupJobsOperations.cs index 1c9c0130e47e..fa18ae9533ff 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 @@ -73,7 +73,7 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -102,7 +102,7 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -120,7 +120,7 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) } // 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}/backupJobs").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs").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)); @@ -201,14 +201,13 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -218,10 +217,6 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -278,7 +273,7 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -374,14 +369,13 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -391,10 +385,6 @@ internal BackupJobsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationResultsOperations.cs index 882bbf0b709a..be5e6aa28e49 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 @@ -75,7 +75,7 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -122,7 +122,7 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) } // 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}/backupOperationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -192,14 +192,13 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,10 +208,6 @@ internal BackupOperationResultsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupOperationStatusesOperations.cs index 8d065c4f951f..2b4323d347c3 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 @@ -74,7 +74,7 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -107,7 +107,7 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -124,7 +124,7 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) } // 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}/backupOperations/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupOperations/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -194,14 +194,13 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +210,6 @@ internal BackupOperationStatusesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupPoliciesOperations.cs index b0c5b62574eb..d4e6ab0f634d 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 @@ -72,7 +72,7 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -118,7 +118,7 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) } // 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}/backupPolicies").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies").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)); @@ -195,14 +195,13 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +211,6 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -274,7 +269,7 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -370,14 +365,13 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -387,10 +381,6 @@ internal BackupPoliciesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectableItemsOperations.cs index 733366b083d5..23a4bc5cc8fc 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 @@ -75,7 +75,7 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -104,7 +104,7 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -122,7 +122,7 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) } // 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}/backupProtectableItems").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectableItems").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)); @@ -203,14 +203,13 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -220,10 +219,6 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -282,7 +277,7 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -378,14 +373,13 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -395,10 +389,6 @@ internal BackupProtectableItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectedItemsOperations.cs index 52a7a0b14d95..4fcaf2788e7f 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 @@ -73,7 +73,7 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -102,7 +102,7 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -120,7 +120,7 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) } // 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(); + 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)); @@ -201,14 +201,13 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -218,10 +217,6 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -278,7 +273,7 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -374,14 +369,13 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -391,10 +385,6 @@ internal BackupProtectedItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupProtectionContainersOperations.cs index 0c71fc4cf3d1..7e2a2d4d0f2f 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 @@ -70,7 +70,7 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -99,7 +99,7 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -116,7 +116,7 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien } // 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}/backupProtectionContainers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionContainers").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)); @@ -193,14 +193,13 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -210,10 +209,6 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -270,7 +265,7 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -366,14 +361,13 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -383,10 +377,6 @@ internal BackupProtectionContainersOperations(RecoveryServicesBackupClient clien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupResourceEncryptionConfigsOperations.cs index ecf960a15707..1510b5277661 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 @@ -95,7 +95,7 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -289,7 +289,7 @@ internal BackupResourceEncryptionConfigsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; 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 68233f916b46..6fa1a2f690fa 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 @@ -95,7 +95,7 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -292,7 +292,7 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -496,7 +496,7 @@ internal BackupResourceVaultConfigsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = 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 1b1e3b538320..d319ab869091 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 @@ -81,7 +81,7 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -118,7 +118,7 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -138,7 +138,7 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) } // 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}/items").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/items").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)); @@ -221,14 +221,13 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -238,10 +237,6 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -300,7 +295,7 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -396,14 +391,13 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -413,10 +407,6 @@ internal BackupWorkloadItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/BackupsOperations.cs index 7b0e5e6fd4a2..807e563f8b9e 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 @@ -80,7 +80,7 @@ internal BackupsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -122,7 +122,7 @@ internal BackupsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -142,7 +142,7 @@ internal BackupsOperations(RecoveryServicesBackupClient client) } // 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}/backup").ToString(); + 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}/backup").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)); @@ -220,14 +220,13 @@ internal BackupsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -237,10 +236,6 @@ internal BackupsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ExportJobsOperationResultsOperations.cs index 580b6090629e..6722a56cffe7 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 @@ -72,7 +72,7 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -122,7 +122,7 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien } // 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}/backupJobs/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -192,14 +192,13 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,10 +208,6 @@ internal ExportJobsOperationResultsOperations(RecoveryServicesBackupClient clien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs index d4655c357583..5755628ba4e9 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupEnginesOperations.cs @@ -47,7 +47,7 @@ public partial interface IBackupEnginesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -83,7 +83,7 @@ public partial interface IBackupEnginesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,7 +106,7 @@ public partial interface IBackupEnginesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs index 5b1d7af253dd..868e05c3fa2a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupJobsOperations.cs @@ -46,7 +46,7 @@ public partial interface IBackupJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -68,7 +68,7 @@ public partial interface IBackupJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs index be5b3099a3ac..dfd5d9f690d2 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationResultsOperations.cs @@ -48,7 +48,7 @@ public partial interface IBackupOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs index f514a80af475..9a04842fad82 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupOperationStatusesOperations.cs @@ -47,7 +47,7 @@ public partial interface IBackupOperationStatusesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs index 0b5734870718..967b791be58b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupPoliciesOperations.cs @@ -45,7 +45,7 @@ public partial interface IBackupPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -69,7 +69,7 @@ public partial interface IBackupPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs index 94e07cee74b6..f39ccd746304 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectableItemsOperations.cs @@ -48,7 +48,7 @@ public partial interface IBackupProtectableItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -72,7 +72,7 @@ public partial interface IBackupProtectableItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs index 457b5e1a0528..ce512fc4e504 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectedItemsOperations.cs @@ -47,7 +47,7 @@ public partial interface IBackupProtectedItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -70,7 +70,7 @@ public partial interface IBackupProtectedItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs index 716c158c6620..04bfbba923bf 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupProtectionContainersOperations.cs @@ -43,7 +43,7 @@ public partial interface IBackupProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -65,7 +65,7 @@ public partial interface IBackupProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs index 74bdb3563556..22a66921d571 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupWorkloadItemsOperations.cs @@ -54,7 +54,7 @@ public partial interface IBackupWorkloadItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -78,7 +78,7 @@ public partial interface IBackupWorkloadItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs index c152e3cd8a35..64e7d12e0ac4 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IBackupsOperations.cs @@ -53,7 +53,7 @@ public partial interface IBackupsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs index ad084fd7013c..8d05b3c8b10d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IExportJobsOperationResultsOperations.cs @@ -45,7 +45,7 @@ public partial interface IExportJobsOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs index 770a73544040..bbbc38c051e1 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IItemLevelRecoveryConnectionsOperations.cs @@ -60,7 +60,7 @@ public partial interface IItemLevelRecoveryConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -100,7 +100,7 @@ public partial interface IItemLevelRecoveryConnectionsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs index 4eccb07fd16b..e961ca45f207 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobCancellationsOperations.cs @@ -44,7 +44,7 @@ public partial interface IJobCancellationsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs index 4b9d658775ab..186ec12dbebd 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobDetailsOperations.cs @@ -42,7 +42,7 @@ public partial interface IJobDetailsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs index 12b9a3436927..b8d9af31239b 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobOperationResultsOperations.cs @@ -46,7 +46,7 @@ public partial interface IJobOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs index f228dcdf6e5e..5a6c68759b0a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IJobsOperations.cs @@ -44,7 +44,7 @@ public partial interface IJobsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs index 178ed8961c01..daa82a406c4e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IOperationOperations.cs @@ -43,7 +43,7 @@ public partial interface IOperationOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs index 3b0d0dac9ad9..ea2d595a35f2 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IPrivateEndpointConnectionOperations.cs @@ -75,7 +75,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -135,7 +135,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -165,7 +165,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs index cb141bd9cf19..ae0e74962875 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectableContainersOperations.cs @@ -46,7 +46,7 @@ public partial interface IProtectableContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -69,7 +69,7 @@ public partial interface IProtectableContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs index e20249fe28b2..d7f28c0f4a30 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationResultsOperations.cs @@ -52,7 +52,7 @@ public partial interface IProtectedItemOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs index 55f73b091aa0..5c4e99932095 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemOperationStatusesOperations.cs @@ -57,7 +57,7 @@ public partial interface IProtectedItemOperationStatusesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs index 2ec2ff0b561c..0f107b4dbff5 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectedItemsOperations.cs @@ -54,7 +54,7 @@ public partial interface IProtectedItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -95,7 +95,7 @@ public partial interface IProtectedItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -132,7 +132,7 @@ public partial interface IProtectedItemsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs index 77f9daec1509..d1d073636417 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerOperationResultsOperations.cs @@ -49,7 +49,7 @@ public partial interface IProtectionContainerOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs index 92fc918f3bbf..858b61323a8d 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainerRefreshOperationResultsOperations.cs @@ -47,7 +47,7 @@ public partial interface IProtectionContainerRefreshOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs index 6fefb5551645..90b1670dcbcc 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionContainersOperations.cs @@ -47,7 +47,7 @@ public partial interface IProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -85,7 +85,7 @@ public partial interface IProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -121,7 +121,7 @@ public partial interface IProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -157,7 +157,7 @@ public partial interface IProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -189,7 +189,7 @@ public partial interface IProtectionContainersOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs index f816e1096525..8dcfff20dace 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPoliciesOperations.cs @@ -45,7 +45,7 @@ public partial interface IProtectionPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -79,7 +79,7 @@ public partial interface IProtectionPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -111,7 +111,7 @@ public partial interface IProtectionPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -140,7 +140,7 @@ public partial interface IProtectionPoliciesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs index 06c0549fe83e..7ea9a14e93d8 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationResultsOperations.cs @@ -46,7 +46,7 @@ public partial interface IProtectionPolicyOperationResultsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs index 0a9ae300d3a3..5e7e321e3bc6 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IProtectionPolicyOperationStatusesOperations.cs @@ -51,7 +51,7 @@ public partial interface IProtectionPolicyOperationStatusesOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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..986597eef655 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 @@ -52,7 +52,7 @@ public partial interface IRecoveryPointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -93,7 +93,7 @@ public partial interface IRecoveryPointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -157,7 +157,7 @@ public partial interface IRecoveryPointsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs new file mode 100644 index 000000000000..f976a3c6e4e4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryPointsRecommendedForMoveOperations.cs @@ -0,0 +1,84 @@ +// +// 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; + + /// + /// RecoveryPointsRecommendedForMoveOperations operations. + /// + public partial interface IRecoveryPointsRecommendedForMoveOperations + { + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// 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/IRecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRecoveryServicesBackupClient.cs index caf5b20110a7..3bd92ffc82b0 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 @@ -243,6 +243,11 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// ISecurityPINsOperations SecurityPINs { get; } + /// + /// Gets the IRecoveryPointsRecommendedForMoveOperations. + /// + IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; } + /// /// Gets the IAadPropertiesOperations. /// @@ -380,6 +385,56 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// /// Triggers Data Move Operation on target vault /// @@ -401,5 +456,34 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs index 2512fe932f92..5381baeeaf31 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/IRestoresOperations.cs @@ -57,12 +57,53 @@ public partial interface IRestoresOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// /// Thrown when a required parameter is null /// Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); + /// + /// Restores the specified backed up data. This is an asynchronous + /// operation. To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// 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 items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be + /// restored. + /// + /// + /// resource 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 vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)); } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs index 69daf6684fcb..109aead78969 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ISecurityPINsOperations.cs @@ -39,7 +39,7 @@ public partial interface ISecurityPINsOperations /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// 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 363717be4f54..5a3f407b4a7c 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 @@ -87,7 +87,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -133,7 +133,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -154,7 +154,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli } // 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}/provisionInstantItemRecovery").ToString(); + 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}/provisionInstantItemRecovery").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)); @@ -233,14 +233,13 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -250,10 +249,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -313,7 +308,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -355,7 +350,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli { throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -375,7 +370,7 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli } // 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}/revokeInstantItemRecovery").ToString(); + 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}/revokeInstantItemRecovery").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)); @@ -448,14 +443,13 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -465,10 +459,6 @@ internal ItemLevelRecoveryConnectionsOperations(RecoveryServicesBackupClient cli } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobCancellationsOperations.cs index 7095e50a219d..f612c722bab1 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 @@ -71,7 +71,7 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -101,7 +101,7 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -118,7 +118,7 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) } // 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}/backupJobs/{jobName}/cancel").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/cancel").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)); @@ -188,14 +188,13 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -205,10 +204,6 @@ internal JobCancellationsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobDetailsOperations.cs index 0ad98a81ec4b..31749b6cbfd1 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 @@ -69,7 +69,7 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -102,7 +102,7 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "jobName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +119,7 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) } // 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}/backupJobs/{jobName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}").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)); @@ -189,14 +189,13 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -206,10 +205,6 @@ internal JobDetailsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobOperationResultsOperations.cs index d3bd34b68e36..db7758e08204 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 @@ -72,7 +72,7 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -106,7 +106,7 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -124,7 +124,7 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) } // 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}/backupJobs/{jobName}/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobs/{jobName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -195,14 +195,13 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +211,6 @@ internal JobOperationResultsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/JobsOperations.cs index b27cb5fb3fd2..cf3e3cb79a18 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 @@ -71,7 +71,7 @@ internal JobsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -97,7 +97,7 @@ internal JobsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,7 +114,7 @@ internal JobsOperations(RecoveryServicesBackupClient client) } // 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}/backupJobsExport").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupJobsExport").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)); @@ -191,14 +191,13 @@ internal JobsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -208,10 +207,6 @@ internal JobsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs index f84fe1896382..76f9509ee0ed 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs @@ -37,9 +37,13 @@ public AzureWorkloadPointInTimeRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier /// List of log ranges - public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList timeRanges = default(IList)) - : base(recoveryPointTimeInUTC, type) + public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { TimeRanges = timeRanges; CustomInit(); 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 42685a154ae6..1a2bad40f446 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 @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -34,10 +36,16 @@ public AzureWorkloadRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' - public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string)) + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) { RecoveryPointTimeInUTC = recoveryPointTimeInUTC; Type = type; + RecoveryPointTierDetails = recoveryPointTierDetails; + RecoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; CustomInit(); } @@ -59,5 +67,17 @@ public AzureWorkloadRecoveryPoint() [JsonProperty(PropertyName = "type")] public string Type { get; private set; } + /// + /// Gets or sets recovery point tier information. + /// + [JsonProperty(PropertyName = "recoveryPointTierDetails")] + public IList RecoveryPointTierDetails { get; set; } + + /// + /// Gets or sets eligibility of RP to be moved to another tier + /// + [JsonProperty(PropertyName = "recoveryPointMoveReadinessInfo")] + public IDictionary RecoveryPointMoveReadinessInfo { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs index 6eb65e572a6f..6b755417da25 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs @@ -36,9 +36,13 @@ public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier /// List of log ranges - public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList timeRanges = default(IList)) - : base(recoveryPointTimeInUTC, type, timeRanges) + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, timeRanges) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..a7ee5cdfa05a --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs @@ -0,0 +1,69 @@ +// +// 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; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest : AzureWorkloadSAPHanaPointInTimeRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// PointInTime value + /// RP Rehydration + /// Info + public AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), System.DateTime? pointInTime = default(System.DateTime?), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, pointInTime) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs index 58388dd32502..8d921ce2b579 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs @@ -10,6 +10,8 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -35,8 +37,12 @@ public AzureWorkloadSAPHanaRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' - public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string)) - : base(recoveryPointTimeInUTC, type) + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier + public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { CustomInit(); } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..1d025ff50fb1 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs @@ -0,0 +1,68 @@ +// +// 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; + + /// + /// AzureWorkload SAP Hana-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSAPHanaRestoreWithRehydrateRequest : AzureWorkloadSAPHanaRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSAPHanaRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSAPHanaRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// RP Rehydration + /// Info + public AzureWorkloadSAPHanaRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs index bbfc9a7f100b..030f16991d07 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs @@ -37,14 +37,18 @@ public AzureWorkloadSQLPointInTimeRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier /// Extended Info that provides data /// directory details. Will be populated in two cases: /// When a specific recovery point is accessed using GetRecoveryPoint /// Or when ListRecoveryPoints is called for Log RP only with /// ExtendedInfo query filter /// List of log ranges - public AzureWorkloadSQLPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), IList timeRanges = default(IList)) - : base(recoveryPointTimeInUTC, type, extendedInfo) + public AzureWorkloadSQLPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), IList timeRanges = default(IList)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, extendedInfo) { TimeRanges = timeRanges; CustomInit(); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..9b1a5cc844c7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs @@ -0,0 +1,76 @@ +// +// 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; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest : AzureWorkloadSQLPointInTimeRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + /// PointInTime value + /// RP Rehydration + /// Info + public AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList), System.DateTime? pointInTime = default(System.DateTime?), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, shouldUseAlternateTargetLocation, isNonRecoverable, alternateDirectoryPaths, pointInTime) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs index d4d42822d980..7b6d21e0c610 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -36,13 +38,17 @@ public AzureWorkloadSQLRecoveryPoint() /// point was created /// Type of restore point. Possible values include: /// 'Invalid', 'Full', 'Log', 'Differential', 'Incremental' + /// Recovery point tier + /// information. + /// Eligibility of RP to + /// be moved to another tier /// Extended Info that provides data /// directory details. Will be populated in two cases: /// When a specific recovery point is accessed using GetRecoveryPoint /// Or when ListRecoveryPoints is called for Log RP only with /// ExtendedInfo query filter - public AzureWorkloadSQLRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) - : base(recoveryPointTimeInUTC, type) + public AzureWorkloadSQLRecoveryPoint(System.DateTime? recoveryPointTimeInUTC = default(System.DateTime?), string type = default(string), IList recoveryPointTierDetails = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) + : base(recoveryPointTimeInUTC, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo) { ExtendedInfo = extendedInfo; CustomInit(); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs new file mode 100644 index 000000000000..fb64162f18e2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs @@ -0,0 +1,75 @@ +// +// 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; + + /// + /// AzureWorkload SQL-specific restore with integrated rehydration of + /// recovery point + /// + public partial class AzureWorkloadSQLRestoreWithRehydrateRequest : AzureWorkloadSQLRestoreRequest + { + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRestoreWithRehydrateRequest class. + /// + public AzureWorkloadSQLRestoreWithRehydrateRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// AzureWorkloadSQLRestoreWithRehydrateRequest class. + /// + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM on + /// which workload that was running is being recovered. + /// Workload specific property bag. + /// Details of target database + /// Defines whether the current recovery + /// mode is file restore or database restore. Possible values include: + /// 'Invalid', 'FileRecovery', 'WorkloadRecovery' + /// Default option set + /// to true. If this is set to false, alternate data directory must be + /// provided + /// SQL specific property where user can + /// chose to set no-recovery when restore operation is tried + /// Data directory + /// details + /// RP Rehydration + /// Info + public AzureWorkloadSQLRestoreWithRehydrateRequest(string recoveryType = default(string), string sourceResourceId = default(string), IDictionary propertyBag = default(IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), bool? shouldUseAlternateTargetLocation = default(bool?), bool? isNonRecoverable = default(bool?), IList alternateDirectoryPaths = default(IList), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryType, sourceResourceId, propertyBag, targetInfo, recoveryMode, shouldUseAlternateTargetLocation, isNonRecoverable, alternateDirectoryPaths) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs index 1d7390150ca3..49bd970a4025 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/BMSRPQueryObject.cs @@ -38,12 +38,15 @@ public BMSRPQueryObject() /// 'FullAndDifferential', 'All', 'Incremental' /// In Get Recovery Point, it tells whether /// extended information about recovery point is asked. - public BMSRPQueryObject(System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), string restorePointQueryType = default(string), bool? extendedInfo = default(bool?)) + /// Whether the RP can be moved to + /// another tier + public BMSRPQueryObject(System.DateTime? startDate = default(System.DateTime?), System.DateTime? endDate = default(System.DateTime?), string restorePointQueryType = default(string), bool? extendedInfo = default(bool?), bool? moveReadyRPOnly = default(bool?)) { StartDate = startDate; EndDate = endDate; RestorePointQueryType = restorePointQueryType; ExtendedInfo = extendedInfo; + MoveReadyRPOnly = moveReadyRPOnly; CustomInit(); } @@ -79,5 +82,11 @@ public BMSRPQueryObject() [JsonProperty(PropertyName = "extendedInfo")] public bool? ExtendedInfo { get; set; } + /// + /// Gets or sets whether the RP can be moved to another tier + /// + [JsonProperty(PropertyName = "moveReadyRPOnly")] + public bool? MoveReadyRPOnly { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponse.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponse.cs deleted file mode 100644 index 838e8f530486..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponse.cs +++ /dev/null @@ -1,90 +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; - - /// - /// Error Response - /// - /// - /// Common error response for all Azure Resource Manager APIs to return - /// error details for failed operations. (This also follows the OData error - /// response format.) - /// - public partial class ErrorResponse - { - /// - /// Initializes a new instance of the ErrorResponse class. - /// - public ErrorResponse() - { - CustomInit(); - } - - /// - /// Initializes a new instance of the ErrorResponse class. - /// - /// The error code. - /// The error message. - /// The error target. - /// The error details. - /// The error additional info. - public ErrorResponse(string code = default(string), string message = default(string), string target = default(string), IList details = default(IList), IList additionalInfo = default(IList)) - { - Code = code; - Message = message; - Target = target; - Details = details; - AdditionalInfo = additionalInfo; - CustomInit(); - } - - /// - /// An initialization method that performs custom operations like setting defaults - /// - partial void CustomInit(); - - /// - /// Gets the error code. - /// - [JsonProperty(PropertyName = "code")] - public string Code { get; private set; } - - /// - /// Gets the error message. - /// - [JsonProperty(PropertyName = "message")] - public string Message { get; private set; } - - /// - /// Gets the error target. - /// - [JsonProperty(PropertyName = "target")] - public string Target { get; private set; } - - /// - /// Gets the error details. - /// - [JsonProperty(PropertyName = "details")] - public IList Details { get; private set; } - - /// - /// Gets the error additional info. - /// - [JsonProperty(PropertyName = "additionalInfo")] - public IList AdditionalInfo { get; private set; } - - } -} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponseException.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponseException.cs deleted file mode 100644 index 1499843598a9..000000000000 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ErrorResponseException.cs +++ /dev/null @@ -1,62 +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 Microsoft.Rest; - - /// - /// Exception thrown for an invalid response with ErrorResponse - /// information. - /// - public partial class ErrorResponseException : RestException - { - /// - /// Gets information about the associated HTTP request. - /// - public HttpRequestMessageWrapper Request { get; set; } - - /// - /// Gets information about the associated HTTP response. - /// - public HttpResponseMessageWrapper Response { get; set; } - - /// - /// Gets or sets the body object. - /// - public ErrorResponse Body { get; set; } - - /// - /// Initializes a new instance of the ErrorResponseException class. - /// - public ErrorResponseException() - { - } - - /// - /// Initializes a new instance of the ErrorResponseException class. - /// - /// The exception message. - public ErrorResponseException(string message) - : this(message, null) - { - } - - /// - /// Initializes a new instance of the ErrorResponseException class. - /// - /// The exception message. - /// Inner exception. - public ErrorResponseException(string message, System.Exception innerException) - : base(message, innerException) - { - } - } -} 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 285c55532601..8348b84021d8 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 @@ -57,7 +57,9 @@ public IaasVMRecoveryPoint() /// configuration /// Identifies the zone of the VM at the time of /// backup. Applicable only for zone-pinned Vms - public IaasVMRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), string sourceVMStorageType = default(string), bool? isSourceVMEncrypted = default(bool?), KeyAndSecretDetails keyAndSecret = default(KeyAndSecretDetails), bool? isInstantIlrSessionActive = default(bool?), IList recoveryPointTierDetails = default(IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), IList zones = default(IList)) + /// Eligibility of RP to + /// be moved to another tier + public IaasVMRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), string sourceVMStorageType = default(string), bool? isSourceVMEncrypted = default(bool?), KeyAndSecretDetails keyAndSecret = default(KeyAndSecretDetails), bool? isInstantIlrSessionActive = default(bool?), IList recoveryPointTierDetails = default(IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), IList zones = default(IList), IDictionary recoveryPointMoveReadinessInfo = default(IDictionary)) { RecoveryPointType = recoveryPointType; RecoveryPointTime = recoveryPointTime; @@ -73,6 +75,7 @@ public IaasVMRecoveryPoint() OsType = osType; RecoveryPointDiskConfiguration = recoveryPointDiskConfiguration; Zones = zones; + RecoveryPointMoveReadinessInfo = recoveryPointMoveReadinessInfo; CustomInit(); } @@ -169,5 +172,11 @@ public IaasVMRecoveryPoint() [JsonProperty(PropertyName = "zones")] public IList Zones { get; set; } + /// + /// Gets or sets eligibility of RP to be moved to another tier + /// + [JsonProperty(PropertyName = "recoveryPointMoveReadinessInfo")] + public IDictionary RecoveryPointMoveReadinessInfo { 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 new file mode 100644 index 000000000000..a847db90b0c5 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs @@ -0,0 +1,109 @@ +// +// 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; + + /// + /// IaaS VM workload-specific restore with integrated rehydration of + /// recovery point. + /// + public partial class IaasVMRestoreWithRehydrationRequest : IaasVMRestoreRequest + { + /// + /// Initializes a new instance of the + /// IaasVMRestoreWithRehydrationRequest class. + /// + public IaasVMRestoreWithRehydrationRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// IaasVMRestoreWithRehydrationRequest class. + /// + /// ID of the backup copy to be + /// recovered. + /// Type of this recovery. Possible values + /// include: 'Invalid', 'OriginalLocation', 'AlternateLocation', + /// 'RestoreDisks', 'Offline' + /// Fully qualified ARM ID of the VM + /// which is being recovered. + /// This is the complete ARM Id of + /// the VM that will be created. + /// For e.g. + /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} + /// This is the ARM Id of the + /// resource group that you want to create for this Virtual machine and + /// other artifacts. + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg} + /// Fully qualified ARM ID of the + /// storage account to which the VM has to be restored. + /// This is the virtual network Id of + /// the vnet that will be attached to the virtual machine. + /// User will be validated for join action permissions in the linked + /// access. + /// Subnet ID, is the subnet ID associated with + /// the to be restored VM. For Classic VMs it would be + /// {VnetID}/Subnet/{SubnetName} and, for the Azure Resource Manager + /// VMs it would be ARM resource ID used to represent + /// the subnet. + /// Fully qualified ARM ID of the + /// domain name to be associated to the VM being restored. This applies + /// only to Classic + /// Virtual Machines. + /// Region in which the virtual machine is + /// restored. + /// Affinity group associated to VM to be + /// restored. Used only for Classic Compute Virtual Machines. + /// Should a new cloud service be + /// created while restoring the VM. If this is false, VM will be + /// restored to the same + /// cloud service as it was at the time of backup. + /// Original Storage Account + /// Option + /// Details needed if the VM was + /// encrypted at the time of backup. + /// List of Disk LUNs for partial + /// restore + /// Flag to denote of an + /// Unmanaged disk VM should be restored with Managed disks. + /// DiskEncryptionSet's ID - needed + /// if the VM needs to be encrypted at rest during restore with + /// customer managed key. + /// Target zone where the VM and its disks should + /// be restored. + /// 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), RecoveryPointRehydrationInfo recoveryPointRehydrationInfo = default(RecoveryPointRehydrationInfo)) + : base(recoveryPointId, recoveryType, sourceResourceId, targetVirtualMachineId, targetResourceGroupId, storageAccountId, virtualNetworkId, subnetId, targetDomainNameId, region, affinityGroup, createNewCloudService, originalStorageAccountOption, encryptionDetails, restoreDiskLunList, restoreWithManagedDisks, diskEncryptionSetId, zones) + { + RecoveryPointRehydrationInfo = recoveryPointRehydrationInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets RP Rehydration Info + /// + [JsonProperty(PropertyName = "recoveryPointRehydrationInfo")] + public RecoveryPointRehydrationInfo RecoveryPointRehydrationInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs new file mode 100644 index 000000000000..b6b295f0e4a2 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/ListRecoveryPointsRecommendedForMoveRequest.cs @@ -0,0 +1,64 @@ +// +// 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; + + /// + /// ListRecoveryPointsRecommendedForMoveRequest Request + /// + public partial class ListRecoveryPointsRecommendedForMoveRequest + { + /// + /// Initializes a new instance of the + /// ListRecoveryPointsRecommendedForMoveRequest class. + /// + public ListRecoveryPointsRecommendedForMoveRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the + /// ListRecoveryPointsRecommendedForMoveRequest class. + /// + /// Gets the class type. + /// List of Recovery Points excluded from + /// Move + public ListRecoveryPointsRecommendedForMoveRequest(string objectType = default(string), IList excludedRPList = default(IList)) + { + ObjectType = objectType; + ExcludedRPList = excludedRPList; + 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 list of Recovery Points excluded from Move + /// + [JsonProperty(PropertyName = "excludedRPList")] + public IList ExcludedRPList { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs new file mode 100644 index 000000000000..3935a72b0349 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/MoveRPAcrossTiersRequest.cs @@ -0,0 +1,70 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class MoveRPAcrossTiersRequest + { + /// + /// Initializes a new instance of the MoveRPAcrossTiersRequest class. + /// + public MoveRPAcrossTiersRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MoveRPAcrossTiersRequest class. + /// + /// Gets the class type. + /// Source tier from where RP needs to be + /// moved. Possible values include: 'Invalid', 'InstantRP', + /// 'HardenedRP', 'ArchivedRP' + /// Target tier where RP needs to be + /// moved. Possible values include: 'Invalid', 'InstantRP', + /// 'HardenedRP', 'ArchivedRP' + public MoveRPAcrossTiersRequest(string objectType = default(string), RecoveryPointTierType? sourceTierType = default(RecoveryPointTierType?), RecoveryPointTierType? targetTierType = default(RecoveryPointTierType?)) + { + ObjectType = objectType; + SourceTierType = sourceTierType; + TargetTierType = targetTierType; + 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 source tier from where RP needs to be moved. Possible + /// values include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// + [JsonProperty(PropertyName = "sourceTierType")] + public RecoveryPointTierType? SourceTierType { get; set; } + + /// + /// Gets or sets target tier where RP needs to be moved. Possible + /// values include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' + /// + [JsonProperty(PropertyName = "targetTierType")] + public RecoveryPointTierType? TargetTierType { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs new file mode 100644 index 000000000000..11498a86a7f4 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointMoveReadinessInfo.cs @@ -0,0 +1,54 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using Newtonsoft.Json; + using System.Linq; + + public partial class RecoveryPointMoveReadinessInfo + { + /// + /// Initializes a new instance of the RecoveryPointMoveReadinessInfo + /// class. + /// + public RecoveryPointMoveReadinessInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointMoveReadinessInfo + /// class. + /// + public RecoveryPointMoveReadinessInfo(bool? isReadyForMove = default(bool?), string additionalInfo = default(string)) + { + IsReadyForMove = isReadyForMove; + AdditionalInfo = additionalInfo; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// + [JsonProperty(PropertyName = "isReadyForMove")] + public bool? IsReadyForMove { get; set; } + + /// + /// + [JsonProperty(PropertyName = "additionalInfo")] + public string AdditionalInfo { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs new file mode 100644 index 000000000000..57ec81a187a7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointRehydrationInfo.cs @@ -0,0 +1,66 @@ +// +// 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; + + /// + /// RP Rehydration Info + /// + public partial class RecoveryPointRehydrationInfo + { + /// + /// Initializes a new instance of the RecoveryPointRehydrationInfo + /// class. + /// + public RecoveryPointRehydrationInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointRehydrationInfo + /// class. + /// + /// How long the rehydrated + /// RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// Rehydration Priority. Possible + /// values include: 'Standard', 'High' + public RecoveryPointRehydrationInfo(string rehydrationRetentionDuration = default(string), string rehydrationPriority = default(string)) + { + RehydrationRetentionDuration = rehydrationRetentionDuration; + RehydrationPriority = rehydrationPriority; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + /// + /// Gets or sets how long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" + /// + [JsonProperty(PropertyName = "rehydrationRetentionDuration")] + public string RehydrationRetentionDuration { get; set; } + + /// + /// Gets or sets rehydration Priority. Possible values include: + /// 'Standard', 'High' + /// + [JsonProperty(PropertyName = "rehydrationPriority")] + public string RehydrationPriority { get; set; } + + } +} diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs index 06f6088dd65b..17ee9be8d5f7 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierInformation.cs @@ -11,6 +11,8 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { using Newtonsoft.Json; + using System.Collections; + using System.Collections.Generic; using System.Linq; /// @@ -32,13 +34,16 @@ public RecoveryPointTierInformation() /// class. /// /// Recovery point tier type. Possible values - /// include: 'Invalid', 'InstantRP', 'HardenedRP' + /// include: 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' /// Recovery point tier status. Possible values - /// include: 'Invalid', 'Valid', 'Disabled', 'Deleted' - public RecoveryPointTierInformation(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?)) + /// include: 'Invalid', 'Valid', 'Disabled', 'Deleted', + /// 'Rehydrated' + /// Recovery point tier status. + public RecoveryPointTierInformation(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), IDictionary extendedInfo = default(IDictionary)) { Type = type; Status = status; + ExtendedInfo = extendedInfo; CustomInit(); } @@ -49,17 +54,23 @@ public RecoveryPointTierInformation() /// /// Gets or sets recovery point tier type. Possible values include: - /// 'Invalid', 'InstantRP', 'HardenedRP' + /// 'Invalid', 'InstantRP', 'HardenedRP', 'ArchivedRP' /// [JsonProperty(PropertyName = "type")] public RecoveryPointTierType? Type { get; set; } /// /// Gets or sets recovery point tier status. Possible values include: - /// 'Invalid', 'Valid', 'Disabled', 'Deleted' + /// 'Invalid', 'Valid', 'Disabled', 'Deleted', 'Rehydrated' /// [JsonProperty(PropertyName = "status")] public RecoveryPointTierStatus? Status { get; set; } + /// + /// Gets or sets recovery point tier status. + /// + [JsonProperty(PropertyName = "extendedInfo")] + public IDictionary ExtendedInfo { get; set; } + } } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs index 60d7705f4f26..9b061be0214c 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierStatus.cs @@ -28,7 +28,9 @@ public enum RecoveryPointTierStatus [EnumMember(Value = "Disabled")] Disabled, [EnumMember(Value = "Deleted")] - Deleted + Deleted, + [EnumMember(Value = "Rehydrated")] + Rehydrated } internal static class RecoveryPointTierStatusEnumExtension { @@ -49,6 +51,8 @@ internal static string ToSerializedValue(this RecoveryPointTierStatus value) return "Disabled"; case RecoveryPointTierStatus.Deleted: return "Deleted"; + case RecoveryPointTierStatus.Rehydrated: + return "Rehydrated"; } return null; } @@ -65,6 +69,8 @@ internal static string ToSerializedValue(this RecoveryPointTierStatus value) return RecoveryPointTierStatus.Disabled; case "Deleted": return RecoveryPointTierStatus.Deleted; + case "Rehydrated": + return RecoveryPointTierStatus.Rehydrated; } return null; } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs index 4a2a192f82dc..8f4110892e4e 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RecoveryPointTierType.cs @@ -26,7 +26,9 @@ public enum RecoveryPointTierType [EnumMember(Value = "InstantRP")] InstantRP, [EnumMember(Value = "HardenedRP")] - HardenedRP + HardenedRP, + [EnumMember(Value = "ArchivedRP")] + ArchivedRP } internal static class RecoveryPointTierTypeEnumExtension { @@ -45,6 +47,8 @@ internal static string ToSerializedValue(this RecoveryPointTierType value) return "InstantRP"; case RecoveryPointTierType.HardenedRP: return "HardenedRP"; + case RecoveryPointTierType.ArchivedRP: + return "ArchivedRP"; } return null; } @@ -59,6 +63,8 @@ internal static string ToSerializedValue(this RecoveryPointTierType value) return RecoveryPointTierType.InstantRP; case "HardenedRP": return RecoveryPointTierType.HardenedRP; + case "ArchivedRP": + return RecoveryPointTierType.ArchivedRP; } return null; } diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs new file mode 100644 index 000000000000..2293fff697f7 --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/Models/RehydrationPriority.cs @@ -0,0 +1,22 @@ +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for +// license information. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is +// regenerated. +// + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + + /// + /// Defines values for RehydrationPriority. + /// + public static class RehydrationPriority + { + public const string Standard = "Standard"; + public const string High = "High"; + } +} 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 90e99b70ce93..f251e81ae622 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 @@ -70,7 +70,7 @@ internal OperationOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -103,7 +103,7 @@ internal OperationOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -120,7 +120,7 @@ internal OperationOperations(RecoveryServicesBackupClient client) } // 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}/backupValidateOperation").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupValidateOperation").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)); @@ -195,14 +195,13 @@ internal OperationOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +211,6 @@ internal OperationOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/PrivateEndpointConnectionOperations.cs index ff884a3dfb64..d5c09f50e6b5 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 @@ -102,7 +102,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -119,7 +119,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client } // 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}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").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)); @@ -328,7 +328,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -365,7 +365,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -383,7 +383,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client } // 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}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").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)); @@ -459,14 +459,13 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -476,10 +475,6 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -561,7 +556,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -591,7 +586,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client { throw new ValidationException(ValidationRules.CannotBeNull, "privateEndpointConnectionName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -608,7 +603,7 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client } // 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}/privateEndpointConnections/{privateEndpointConnectionName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}").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)); @@ -678,11 +673,11 @@ internal PrivateEndpointConnectionOperations(RecoveryServicesBackupClient client string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - ErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; 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 9f38ce3143db..7448879eab5c 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 @@ -109,7 +109,7 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -127,7 +127,7 @@ internal PrivateEndpointOperations(RecoveryServicesBackupClient client) } // 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}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}/operationsStatus/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); 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 78b3490e61de..3370eee33479 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 @@ -72,7 +72,7 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -123,7 +123,7 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) } // 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}/protectableContainers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectableContainers").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)); @@ -201,14 +201,13 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -218,10 +217,6 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -278,7 +273,7 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -374,14 +369,13 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -391,10 +385,6 @@ internal ProtectableContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationResultsOperations.cs index c14f1090f389..d57b096e6714 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 @@ -79,7 +79,7 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -124,7 +124,7 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -144,7 +144,7 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl } // 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}/operationResults/{operationId}").ToString(); + 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}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -217,14 +217,13 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -234,10 +233,6 @@ internal ProtectedItemOperationResultsOperations(RecoveryServicesBackupClient cl } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemOperationStatusesOperations.cs index 4b0242dffa9f..0a0e32143ed9 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 @@ -83,7 +83,7 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -128,7 +128,7 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -148,7 +148,7 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c } // 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}/operationsStatus/{operationId}").ToString(); + 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}/operationsStatus/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -221,14 +221,13 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -238,10 +237,6 @@ internal ProtectedItemOperationStatusesOperations(RecoveryServicesBackupClient c } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectedItemsOperations.cs index f3c0c3341252..7107b02dfb80 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 @@ -81,7 +81,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -122,7 +122,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -142,7 +142,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + 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}").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)); @@ -222,14 +222,13 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -239,10 +238,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -318,7 +313,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -363,7 +358,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -383,7 +378,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + 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}").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)); @@ -461,14 +456,13 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -478,10 +472,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -553,7 +543,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -591,7 +581,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -610,7 +600,7 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + 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}").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)); @@ -680,16 +670,15 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -699,10 +688,6 @@ internal ProtectedItemsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerOperationResultsOperations.cs index a95ff9338240..6fa01f8c9c80 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 @@ -76,7 +76,7 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -117,7 +117,7 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -136,7 +136,7 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli } // 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}/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -208,14 +208,13 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -225,10 +224,6 @@ internal ProtectionContainerOperationResultsOperations(RecoveryServicesBackupCli } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainerRefreshOperationResultsOperations.cs index f40c68ed6ea7..491bf76f32c7 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 @@ -74,7 +74,7 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -108,7 +108,7 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -126,7 +126,7 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa } // 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}/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -197,14 +197,13 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa string _responseContent = null; if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -214,10 +213,6 @@ internal ProtectionContainerRefreshOperationResultsOperations(RecoveryServicesBa } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionContainersOperations.cs index 271eb1a36ae8..714cad29db8a 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 @@ -74,7 +74,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -111,7 +111,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -129,7 +129,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").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)); @@ -200,14 +200,13 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -217,10 +216,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -293,7 +288,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -334,7 +329,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -353,7 +348,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").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)); @@ -430,14 +425,13 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -447,10 +441,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -521,7 +511,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -555,7 +545,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -573,7 +563,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}").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)); @@ -642,16 +632,15 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -661,10 +650,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -720,7 +705,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -754,7 +739,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -773,7 +758,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } // 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}/inquire").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/inquire").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)); @@ -852,14 +837,13 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -869,10 +853,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -924,7 +904,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -954,7 +934,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -972,7 +952,7 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } // 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}/refreshContainers").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/refreshContainers").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)); @@ -1050,14 +1030,13 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1067,10 +1046,6 @@ internal ProtectionContainersOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPoliciesOperations.cs index 13d68c365983..fa9571ab6ece 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 @@ -72,7 +72,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -105,7 +105,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -122,7 +122,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } // 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}/backupPolicies/{policyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").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)); @@ -192,14 +192,13 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,10 +208,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -281,7 +276,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -318,7 +313,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -336,7 +331,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } // 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}/backupPolicies/{policyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").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)); @@ -412,14 +407,13 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -429,10 +423,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -526,7 +516,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -556,7 +546,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "policyName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -573,7 +563,7 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } // 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}/backupPolicies/{policyName}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}").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)); @@ -643,14 +633,13 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -660,10 +649,6 @@ internal ProtectionPoliciesOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationResultsOperations.cs index 5016cde9961e..adfdb94898a3 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 @@ -73,7 +73,7 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -110,7 +110,7 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -128,7 +128,7 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient } // 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}/backupPolicies/{policyName}/operationResults/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operationResults/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -199,14 +199,13 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +215,6 @@ internal ProtectionPolicyOperationResultsOperations(RecoveryServicesBackupClient } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/ProtectionPolicyOperationStatusesOperations.cs index efcb131ae5ca..471c4ac8a9f8 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 @@ -78,7 +78,7 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -115,7 +115,7 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -133,7 +133,7 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien } // 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}/backupPolicies/{policyName}/operations/{operationId}").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupPolicies/{policyName}/operations/{operationId}").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId)); @@ -204,14 +204,13 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +220,6 @@ internal ProtectionPolicyOperationStatusesOperations(RecoveryServicesBackupClien } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsOperations.cs index c1ea84cfc177..5593b33cc079 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 @@ -79,7 +79,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -120,7 +120,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -140,7 +140,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) } // 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(); + 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)); @@ -220,14 +220,13 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -237,10 +236,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -316,7 +311,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -361,7 +356,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -381,7 +376,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) } // 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}").ToString(); + 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}").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)); @@ -454,14 +449,13 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -471,10 +465,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); @@ -772,7 +762,7 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -868,14 +858,13 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -885,10 +874,6 @@ internal RecoveryPointsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs new file mode 100644 index 000000000000..c22bac83f85e --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperations.cs @@ -0,0 +1,450 @@ +// +// 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; + + /// + /// RecoveryPointsRecommendedForMoveOperations operations. + /// + internal partial class RecoveryPointsRecommendedForMoveOperations : IServiceOperations, IRecoveryPointsRecommendedForMoveOperations + { + /// + /// Initializes a new instance of the RecoveryPointsRecommendedForMoveOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal RecoveryPointsRecommendedForMoveOperations(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 recovery points recommended for move to another tier + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move 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>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest 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 (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-01-01"; + // 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("parameters", parameters); + 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}/recoveryPointsRecommendedForMove").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 (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; + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// 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/RecoveryPointsRecommendedForMoveOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs new file mode 100644 index 000000000000..ca53509a3ebc --- /dev/null +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs @@ -0,0 +1,119 @@ +// +// 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 RecoveryPointsRecommendedForMoveOperations. + /// + public static partial class RecoveryPointsRecommendedForMoveOperationsExtensions + { + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + public static IPage List(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters) + { + return operations.ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// List Recovery points Recommended for Move Request + /// + /// + /// The cancellation token. + /// + public static async Task> ListAsync(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ListRecoveryPointsRecommendedForMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static IPage ListNext(this IRecoveryPointsRecommendedForMoveOperations operations, string nextPageLink) + { + return operations.ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Lists the recovery points recommended for move to another tier + /// + /// + /// 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 IRecoveryPointsRecommendedForMoveOperations 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/RecoveryServicesBackupClient.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClient.cs index bfae9499e511..56388194844e 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 @@ -246,6 +246,11 @@ public partial class RecoveryServicesBackupClient : ServiceClient public virtual ISecurityPINsOperations SecurityPINs { get; private set; } + /// + /// Gets the IRecoveryPointsRecommendedForMoveOperations. + /// + public virtual IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; private set; } + /// /// Gets the IAadPropertiesOperations. /// @@ -597,6 +602,7 @@ private void Initialize() BackupProtectableItems = new BackupProtectableItemsOperations(this); BackupProtectionContainers = new BackupProtectionContainersOperations(this); SecurityPINs = new SecurityPINsOperations(this); + RecoveryPointsRecommendedForMove = new RecoveryPointsRecommendedForMoveOperations(this); AadProperties = new AadPropertiesOperations(this); CrossRegionRestore = new CrossRegionRestoreOperations(this); BackupCrrJobDetails = new BackupCrrJobDetailsOperations(this); @@ -737,7 +743,7 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "operationId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -884,6 +890,92 @@ private void Initialize() return _result; } + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Triggers Data Move Operation on target vault + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Trigger data move request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginMoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Prepares source vault for Data Move operation /// @@ -915,7 +1007,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + public async Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { if (vaultName == null) { @@ -937,7 +1029,7 @@ private void Initialize() { parameters.Validate(); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -950,7 +1042,7 @@ private void Initialize() tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "BMSPrepareDataMove", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginBMSPrepareDataMove", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; @@ -1085,20 +1177,181 @@ private void Initialize() /// Trigger data move request /// /// - /// The headers that will be added to request. + /// Headers that will be added to request. /// /// /// The cancellation token. /// - public async Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + /// + /// 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 BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) { - // Send request - AzureOperationResponse _response = await BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); - return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + if (vaultName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "vaultName"); + } + if (resourceGroupName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (SubscriptionId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + if (parameters != null) + { + parameters.Validate(); + } + string apiVersion = "2021-01-01"; + // 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, "BeginBMSTriggerDataMove", tracingParameters); + } + // Construct URL + var _baseUrl = BaseUri.AbsoluteUri; + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove").ToString(); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + List _queryParameters = new List(); + if (apiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(apiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new HttpRequestMessage(); + HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (GenerateClientRequestId != null && GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", AcceptLanguage); + } + + + if (customHeaders != null) + { + foreach(var _header in customHeaders) + { + if (_httpRequest.Headers.Contains(_header.Key)) + { + _httpRequest.Headers.Remove(_header.Key); + } + _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value); + } + } + + // Serialize Request + string _requestContent = null; + if(parameters != null) + { + _requestContent = SafeJsonConvert.SerializeObject(parameters, SerializationSettings); + _httpRequest.Content = new StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + 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 = SafeJsonConvert.DeserializeObject(_responseContent, 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; } /// - /// Triggers Data Move Operation on target vault + /// Move recovery point from one datastore to another store. /// /// /// The name of the recovery services vault. @@ -1107,8 +1360,16 @@ private void Initialize() /// The name of the resource group where the recovery services vault is /// present. /// + /// + /// + /// + /// + /// + /// + /// + /// /// - /// Trigger data move request + /// Move Resource Across Tiers Request /// /// /// Headers that will be added to request. @@ -1128,7 +1389,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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 (vaultName == null) { @@ -1142,15 +1403,27 @@ private void Initialize() { throw new ValidationException(ValidationRules.CannotBeNull, "this.SubscriptionId"); } - if (parameters == null) + if (fabricName == null) { - throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + throw new ValidationException(ValidationRules.CannotBeNull, "fabricName"); } - if (parameters != null) + if (containerName == null) { - parameters.Validate(); + throw new ValidationException(ValidationRules.CannotBeNull, "containerName"); + } + if (protectedItemName == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "protectedItemName"); } - string apiVersion = "2020-12-01"; + if (recoveryPointId == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "recoveryPointId"); + } + if (parameters == null) + { + throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); + } + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -1161,16 +1434,24 @@ private void Initialize() 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, "BeginBMSTriggerDataMove", tracingParameters); + ServiceClientTracing.Enter(_invocationId, this, "BeginMoveRecoveryPoint", tracingParameters); } // Construct URL var _baseUrl = BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove").ToString(); + 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}/move").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(SubscriptionId)); + _url = _url.Replace("{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) { @@ -1240,7 +1521,7 @@ private void Initialize() System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202) { var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs index 64a98ef0db44..c6bbee1b4b0a 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RecoveryServicesBackupClientExtensions.cs @@ -157,6 +157,112 @@ public static void BMSTriggerDataMove(this IRecoveryServicesBackupClient operati (await operations.BMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + public static void MoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + { + operations.MoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The cancellation token. + /// + public static async Task MoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.MoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + public static void BeginBMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters) + { + operations.BeginBMSPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + } + + /// + /// Prepares source vault for Data Move operation + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Prepare data move request + /// + /// + /// The cancellation token. + /// + public static async Task BeginBMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// /// Triggers Data Move Operation on target vault /// @@ -202,5 +308,66 @@ public static void BeginBMSTriggerDataMove(this IRecoveryServicesBackupClient op (await operations.BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + public static void BeginMoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + { + operations.BeginMoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// 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. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The cancellation token. + /// + public static async Task BeginMoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginMoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } 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 0597d67340a7..278d53c6f78e 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 @@ -50,6 +50,46 @@ internal RestoresOperations(RecoveryServicesBackupClient client) /// public RecoveryServicesBackupClient Client { get; private set; } + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// 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 items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + { + // Send request + AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + /// /// Restores the specified backed up data. This is an asynchronous operation. /// To know the status of this API call, use @@ -83,7 +123,7 @@ internal RestoresOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -95,7 +135,7 @@ internal RestoresOperations(RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken)) + 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 (vaultName == null) { @@ -129,7 +169,7 @@ internal RestoresOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "parameters"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -146,11 +186,11 @@ internal RestoresOperations(RecoveryServicesBackupClient client) tracingParameters.Add("recoveryPointId", recoveryPointId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - ServiceClientTracing.Enter(_invocationId, this, "Trigger", tracingParameters); + 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}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/restore").ToString(); + 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}/restore").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)); @@ -229,14 +269,13 @@ internal RestoresOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 202) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -246,10 +285,6 @@ internal RestoresOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex); diff --git a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs index d3ba9b796a23..92aa7b04f5c6 100644 --- a/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs +++ b/sdk/recoveryservices-backup/Microsoft.Azure.Management.RecoveryServices.Backup/src/Generated/RestoresOperationsExtensions.cs @@ -94,5 +94,78 @@ public static void Trigger(this IRestoresOperations operations, string vaultName (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + public static void BeginTrigger(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters) + { + operations.BeginTriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + } + + /// + /// Restores the specified backed up data. This is an asynchronous operation. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the recovery services vault. + /// + /// + /// The name of the resource group where the recovery services vault is + /// present. + /// + /// + /// Fabric name associated with the backed up items. + /// + /// + /// Container name associated with the backed up items. + /// + /// + /// Backed up item to be restored. + /// + /// + /// Recovery point ID which represents the backed up data to be restored. + /// + /// + /// resource restore request + /// + /// + /// The cancellation token. + /// + public static async Task BeginTriggerAsync(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, CancellationToken cancellationToken = default(CancellationToken)) + { + (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + } } 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 5f8b9f8bf759..8a80ea1c2a8d 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 @@ -20,59 +20,61 @@ public static IEnumerable> ApiInfo_RecoveryService return new Tuple[] { new Tuple("RecoveryServices", "AadProperties", "2018-12-20"), - new Tuple("RecoveryServices", "BMSPrepareDataMove", "2020-12-01"), - new Tuple("RecoveryServices", "BMSPrepareDataMoveOperationResult", "2020-12-01"), - new Tuple("RecoveryServices", "BMSTriggerDataMove", "2020-12-01"), + new Tuple("RecoveryServices", "BMSPrepareDataMove", "2021-01-01"), + new Tuple("RecoveryServices", "BMSPrepareDataMoveOperationResult", "2021-01-01"), + new Tuple("RecoveryServices", "BMSTriggerDataMove", "2021-01-01"), new Tuple("RecoveryServices", "BackupCrrJobDetails", "2018-12-20"), new Tuple("RecoveryServices", "BackupCrrJobs", "2018-12-20"), - new Tuple("RecoveryServices", "BackupEngines", "2020-12-01"), - new Tuple("RecoveryServices", "BackupJobs", "2020-12-01"), - new Tuple("RecoveryServices", "BackupOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "BackupOperationStatuses", "2020-12-01"), - new Tuple("RecoveryServices", "BackupPolicies", "2020-12-01"), - new Tuple("RecoveryServices", "BackupProtectableItems", "2020-12-01"), - new Tuple("RecoveryServices", "BackupProtectedItems", "2020-12-01"), + new Tuple("RecoveryServices", "BackupEngines", "2021-01-01"), + new Tuple("RecoveryServices", "BackupJobs", "2021-01-01"), + new Tuple("RecoveryServices", "BackupOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "BackupOperationStatuses", "2021-01-01"), + new Tuple("RecoveryServices", "BackupPolicies", "2021-01-01"), + new Tuple("RecoveryServices", "BackupProtectableItems", "2021-01-01"), + new Tuple("RecoveryServices", "BackupProtectedItems", "2021-01-01"), new Tuple("RecoveryServices", "BackupProtectedItemsCrr", "2018-12-20"), - new Tuple("RecoveryServices", "BackupProtectionContainers", "2020-12-01"), + new Tuple("RecoveryServices", "BackupProtectionContainers", "2021-01-01"), new Tuple("RecoveryServices", "BackupProtectionIntent", "2017-07-01"), - new Tuple("RecoveryServices", "BackupResourceEncryptionConfigs", "2020-12-01"), + new Tuple("RecoveryServices", "BackupResourceEncryptionConfigs", "2021-01-01"), new Tuple("RecoveryServices", "BackupResourceStorageConfigs", "2018-12-20"), - new Tuple("RecoveryServices", "BackupResourceVaultConfigs", "2020-12-01"), + new Tuple("RecoveryServices", "BackupResourceVaultConfigs", "2021-01-01"), new Tuple("RecoveryServices", "BackupStatus", "2017-07-01"), new Tuple("RecoveryServices", "BackupUsageSummaries", "2017-07-01"), - new Tuple("RecoveryServices", "BackupWorkloadItems", "2020-12-01"), - new Tuple("RecoveryServices", "Backups", "2020-12-01"), + new Tuple("RecoveryServices", "BackupWorkloadItems", "2021-01-01"), + new Tuple("RecoveryServices", "Backups", "2021-01-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", "2020-12-01"), + new Tuple("RecoveryServices", "ExportJobsOperationResults", "2021-01-01"), new Tuple("RecoveryServices", "FeatureSupport", "2017-07-01"), - new Tuple("RecoveryServices", "GetOperationStatus", "2020-12-01"), - new Tuple("RecoveryServices", "ItemLevelRecoveryConnections", "2020-12-01"), - new Tuple("RecoveryServices", "JobCancellations", "2020-12-01"), - new Tuple("RecoveryServices", "JobDetails", "2020-12-01"), - new Tuple("RecoveryServices", "JobOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "Jobs", "2020-12-01"), - new Tuple("RecoveryServices", "Operation", "2020-12-01"), + new Tuple("RecoveryServices", "GetOperationStatus", "2021-01-01"), + new Tuple("RecoveryServices", "ItemLevelRecoveryConnections", "2021-01-01"), + new Tuple("RecoveryServices", "JobCancellations", "2021-01-01"), + new Tuple("RecoveryServices", "JobDetails", "2021-01-01"), + new Tuple("RecoveryServices", "JobOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "Jobs", "2021-01-01"), + new Tuple("RecoveryServices", "MoveRecoveryPoint", "2021-01-01"), + new Tuple("RecoveryServices", "Operation", "2021-01-01"), new Tuple("RecoveryServices", "Operations", "2016-08-10"), - new Tuple("RecoveryServices", "PrivateEndpoint", "2020-12-01"), - new Tuple("RecoveryServices", "PrivateEndpointConnection", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectableContainers", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectedItemOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectedItemOperationStatuses", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectedItems", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectionContainerOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectionContainerRefreshOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectionContainers", "2020-12-01"), + new Tuple("RecoveryServices", "PrivateEndpoint", "2021-01-01"), + new Tuple("RecoveryServices", "PrivateEndpointConnection", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectableContainers", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectedItemOperationStatuses", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectedItems", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectionContainerOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectionContainerRefreshOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectionContainers", "2021-01-01"), new Tuple("RecoveryServices", "ProtectionIntent", "2017-07-01"), - new Tuple("RecoveryServices", "ProtectionPolicies", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectionPolicyOperationResults", "2020-12-01"), - new Tuple("RecoveryServices", "ProtectionPolicyOperationStatuses", "2020-12-01"), + new Tuple("RecoveryServices", "ProtectionPolicies", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationResults", "2021-01-01"), + new Tuple("RecoveryServices", "ProtectionPolicyOperationStatuses", "2021-01-01"), new Tuple("RecoveryServices", "RecoveryPoints", "2018-12-20"), - new Tuple("RecoveryServices", "RecoveryPoints", "2020-12-01"), + new Tuple("RecoveryServices", "RecoveryPoints", "2021-01-01"), new Tuple("RecoveryServices", "RecoveryPointsCrr", "2018-12-20"), - new Tuple("RecoveryServices", "Restores", "2020-12-01"), - new Tuple("RecoveryServices", "SecurityPINs", "2020-12-01"), + new Tuple("RecoveryServices", "RecoveryPointsRecommendedForMove", "2021-01-01"), + new Tuple("RecoveryServices", "Restores", "2021-01-01"), + new Tuple("RecoveryServices", "SecurityPINs", "2021-01-01"), }.AsEnumerable(); } } 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 a340067cf406..3a5d3dd7a658 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 @@ -66,7 +66,7 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) /// /// The cancellation token. /// - /// + /// /// Thrown when the operation returned an invalid status code /// /// @@ -95,7 +95,7 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) { throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - string apiVersion = "2020-12-01"; + string apiVersion = "2021-01-01"; // Tracing bool _shouldTrace = ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +111,7 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) } // 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}/backupSecurityPIN").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupSecurityPIN").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)); @@ -180,14 +180,13 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) string _responseContent = null; if ((int)_statusCode != 200) { - var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); + NewErrorResponse _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings); if (_errorBody != null) { - ex = new CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -197,10 +196,6 @@ internal SecurityPINsOperations(RecoveryServicesBackupClient client) } ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { ServiceClientTracing.Error(_invocationId, ex);