diff --git a/src/RecoveryServices/RecoveryServices.Backup.Helpers/HelperUtils.cs b/src/RecoveryServices/RecoveryServices.Backup.Helpers/HelperUtils.cs index 9f4555d578ff..43c1b78d2ccb 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Helpers/HelperUtils.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Helpers/HelperUtils.cs @@ -356,7 +356,7 @@ public static List GetPagedListCrr( /// List of objects returned by the API public static List GetPagedList( Func> listResources, Func> listNext) - where T : ServiceClientModel.Resource + where T : class { var resources = new List(); string nextLink = null; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperations.cs index 1761b4cee741..8c8bccc79ad9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperations.cs @@ -39,17 +39,16 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie public RecoveryServicesBackupClient Client { get; private set; } /// - /// Fetches Operation Result for Prepare Data Move + /// Fetches operation status for data move operation on vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// Headers that will be added to request. @@ -72,7 +71,7 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -83,19 +82,35 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (operationId == null) @@ -110,8 +125,8 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("operationId", operationId); @@ -122,9 +137,9 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/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(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -192,11 +207,11 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs index 5201af8373f3..c674e692b615 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BMSPrepareDataMoveOperationResultOperationsExtensions.cs @@ -13,48 +13,46 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public static partial class BmsPrepareDataMoveOperationResultOperationsExtensions { /// - /// Fetches Operation Result for Prepare Data Move + /// Fetches operation status for data move operation on vault /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// - public static VaultStorageConfigOperationResultResponse Get(this IBmsPrepareDataMoveOperationResultOperations operations, string vaultName, string resourceGroupName, string operationId) + public static VaultStorageConfigOperationResultResponse Get(this IBmsPrepareDataMoveOperationResultOperations operations, string resourceGroupName, string vaultName, string operationId) { - return ((IBmsPrepareDataMoveOperationResultOperations)operations).GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + return ((IBmsPrepareDataMoveOperationResultOperations)operations).GetAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); } /// - /// Fetches Operation Result for Prepare Data Move + /// Fetches operation status for data move operation on vault /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBmsPrepareDataMoveOperationResultOperations operations, string vaultName, string resourceGroupName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IBmsPrepareDataMoveOperationResultOperations operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperations.cs index 17070a090c78..4927dac06454 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperations.cs @@ -42,15 +42,14 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) /// Backup management servers registered to Recovery Services Vault. Returns a /// pageable list of servers. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -76,34 +75,50 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,9 +126,9 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -124,23 +139,19 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsBackupEnginesQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsBackupEnginesQueryObject)) - { - _queryParameters.Add(_bmsBackupEnginesQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -205,14 +216,13 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -222,10 +232,6 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -278,19 +284,18 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) /// /// Returns backup management server registered to Recovery Services Vault. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// /// Name of the backup management server. /// + /// + /// OData filter options. + /// /// /// skipToken Filter. /// @@ -315,31 +320,46 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupEngineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string backupEngineName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (backupEngineName == null) @@ -348,6 +368,7 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -355,10 +376,10 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("backupEngineName", backupEngineName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -369,24 +390,20 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{backupEngineName}", System.Uri.EscapeDataString(backupEngineName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsBackupEngineQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsBackupEngineQueryObject)) - { - _queryParameters.Add(_bmsBackupEngineQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -451,14 +468,13 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -468,10 +484,6 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -634,14 +646,13 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -651,10 +662,6 @@ internal BackupEnginesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperationsExtensions.cs index 467cadcf7867..cebf78a27276 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupEnginesOperationsExtensions.cs @@ -19,22 +19,21 @@ public static partial class BackupEnginesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupEnginesOperations operations, string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupEnginesOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupEnginesOperations)operations).ListAsync(resourceGroupName, vaultName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -44,15 +43,14 @@ public static partial class BackupEnginesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -60,9 +58,9 @@ public static partial class BackupEnginesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupEnginesOperations operations, string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -73,25 +71,24 @@ public static partial class BackupEnginesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// /// Name of the backup management server. /// + /// + /// OData filter options. + /// /// /// skipToken Filter. /// - public static BackupEngineBaseResource Get(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, string backupEngineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static BackupEngineBaseResource Get(this IBackupEnginesOperations operations, string resourceGroupName, string vaultName, string backupEngineName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupEnginesOperations)operations).GetAsync(vaultName, resourceGroupName, backupEngineName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupEnginesOperations)operations).GetAsync(resourceGroupName, vaultName, backupEngineName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -100,28 +97,27 @@ public static partial class BackupEnginesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// /// Name of the backup management server. /// + /// + /// OData filter options. + /// /// /// skipToken Filter. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBackupEnginesOperations operations, string vaultName, string resourceGroupName, string backupEngineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IBackupEnginesOperations operations, string resourceGroupName, string vaultName, string backupEngineName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, backupEngineName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, backupEngineName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperations.cs index bb1e3e963dd5..04d861b98117 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperations.cs @@ -41,15 +41,14 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) /// /// Provides a pageable list of jobs. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -75,34 +74,50 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -110,9 +125,9 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -123,23 +138,19 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _jobQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_jobQueryObject)) - { - _queryParameters.Add(_jobQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -204,14 +215,13 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +231,6 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -386,14 +392,13 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +408,6 @@ internal BackupJobsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperationsExtensions.cs index a8bbae4511a3..62dcff855810 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupJobsOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class BackupJobsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupJobsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupJobsOperations operations, string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupJobsOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupJobsOperations)operations).ListAsync(resourceGroupName, vaultName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -42,15 +41,14 @@ public static partial class BackupJobsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -58,9 +56,9 @@ public static partial class BackupJobsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupJobsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupJobsOperations operations, string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperations.cs index 1758501bee76..66594c01b284 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperations.cs @@ -40,18 +40,18 @@ internal BackupOperationResultsOperations (RecoveryServicesBackupClient client) /// /// Provides the status of the delete operations such as deleting backed up - /// item. Once the operation has started, the status code in the response would - /// be Accepted. It will continue to be in this state till it reaches - /// completion. On successful completion, the status code will be OK. This - /// method expects OperationID as an argument. OperationID is part of the - /// Location header of the operation response. + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. @@ -94,12 +94,28 @@ internal BackupOperationResultsOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (operationId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); @@ -194,14 +210,13 @@ internal BackupOperationResultsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +226,6 @@ internal BackupOperationResultsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperationsExtensions.cs index 81a60e1394a1..6de4d7d8473c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationResultsOperationsExtensions.cs @@ -14,11 +14,12 @@ public static partial class BackupOperationResultsOperationsExtensions { /// /// Provides the status of the delete operations such as deleting backed up - /// item. Once the operation has started, the status code in the response would - /// be Accepted. It will continue to be in this state till it reaches - /// completion. On successful completion, the status code will be OK. This - /// method expects OperationID as an argument. OperationID is part of the - /// Location header of the operation response. + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. /// /// /// The operations group for this extension method. @@ -27,8 +28,7 @@ public static partial class BackupOperationResultsOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. @@ -40,11 +40,12 @@ public static void Get(this IBackupOperationResultsOperations operations, string /// /// Provides the status of the delete operations such as deleting backed up - /// item. Once the operation has started, the status code in the response would - /// be Accepted. It will continue to be in this state till it reaches - /// completion. On successful completion, the status code will be OK. This - /// method expects OperationID as an argument. OperationID is part of the - /// Location header of the operation response. + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. /// /// /// The operations group for this extension method. @@ -53,8 +54,7 @@ public static void Get(this IBackupOperationResultsOperations operations, string /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperations.cs index 2e4c93428662..e93fd25bef06 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperations.cs @@ -40,17 +40,17 @@ internal BackupOperationStatusesOperations (RecoveryServicesBackupClient client) /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs when the - /// operation is complete. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. @@ -96,12 +96,28 @@ internal BackupOperationStatusesOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (operationId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); @@ -196,14 +212,13 @@ internal BackupOperationStatusesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -213,10 +228,6 @@ internal BackupOperationStatusesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperationsExtensions.cs index 8f3c2eda3529..9aaa6933c7dc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupOperationStatusesOperationsExtensions.cs @@ -14,10 +14,11 @@ public static partial class BackupOperationStatusesOperationsExtensions { /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs when the - /// operation is complete. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. /// /// /// The operations group for this extension method. @@ -26,8 +27,7 @@ public static partial class BackupOperationStatusesOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. @@ -39,10 +39,11 @@ public static OperationStatus Get(this IBackupOperationStatusesOperations operat /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs when the - /// operation is complete. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. /// /// /// The operations group for this extension method. @@ -51,8 +52,7 @@ public static OperationStatus Get(this IBackupOperationStatusesOperations operat /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperations.cs index 7b430d825e3c..3008292472de 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperations.cs @@ -40,17 +40,17 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// Headers that will be added to request. @@ -73,33 +73,49 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -107,9 +123,9 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -119,23 +135,19 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _protectionPolicyQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_protectionPolicyQueryObject)) - { - _queryParameters.Add(_protectionPolicyQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -196,14 +208,13 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -213,10 +224,6 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -268,7 +275,8 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) } /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The NextLink from the previous successful call to List operation. @@ -379,14 +387,13 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -396,10 +403,6 @@ internal BackupPoliciesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs index 1489223e027c..b49352107fb7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupPoliciesOperationsExtensions.cs @@ -14,56 +14,57 @@ public static partial class BackupPoliciesOperationsExtensions { /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupPoliciesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static Microsoft.Rest.Azure.IPage List(this IBackupPoliciesOperations operations, string resourceGroupName, string vaultName, string filter = default(string)) { - return ((IBackupPoliciesOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + return ((IBackupPoliciesOperations)operations).ListAsync(resourceGroupName, vaultName, filter).GetAwaiter().GetResult(); } /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupPoliciesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupPoliciesOperations operations, string resourceGroupName, string vaultName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The operations group for this extension method. @@ -78,7 +79,8 @@ public static Microsoft.Rest.Azure.IPage ListNext(this /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The operations group for this extension method. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperations.cs index 2a8d0ff037c8..e7fc22e7e773 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperations.cs @@ -40,17 +40,17 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -76,13 +76,12 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -97,11 +96,28 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing @@ -111,9 +127,9 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -129,18 +145,14 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmspoQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmspoQueryObject)) - { - _queryParameters.Add(_bmspoQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -205,14 +217,13 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -222,10 +233,6 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -277,7 +284,8 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) } /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The NextLink from the previous successful call to List operation. @@ -388,14 +396,13 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -405,10 +412,6 @@ internal BackupProtectableItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperationsExtensions.cs index 6d90415dc7da..d56af107c3e9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectableItemsOperationsExtensions.cs @@ -14,45 +14,45 @@ public static partial class BackupProtectableItemsOperationsExtensions { /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupProtectableItemsOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupProtectableItemsOperations)operations).ListAsync(vaultName, resourceGroupName, filter, skipToken).GetAwaiter().GetResult(); } /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -60,16 +60,17 @@ public static partial class BackupProtectableItemsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectableItemsOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The operations group for this extension method. @@ -84,7 +85,8 @@ public static Microsoft.Rest.Azure.IPage ListNe /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The operations group for this extension method. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperations.cs index a78e7ab8e192..cbe7da61c78a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperations.cs @@ -41,15 +41,14 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// Provides a pageable list of all items that are backed up within a vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -75,13 +74,12 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,11 +94,28 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing @@ -110,9 +125,9 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -128,18 +143,14 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _protectedItemQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_protectedItemQueryObject)) - { - _queryParameters.Add(_protectedItemQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -204,14 +215,13 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +231,6 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -386,14 +392,13 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +408,6 @@ internal BackupProtectedItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperationsExtensions.cs index 1d83e44fb5ff..5a3d54fbb9a9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectedItemsOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class BackupProtectedItemsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupProtectedItemsOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupProtectedItemsOperations)operations).ListAsync(vaultName, resourceGroupName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -42,15 +41,14 @@ public static partial class BackupProtectedItemsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -58,9 +56,9 @@ public static partial class BackupProtectedItemsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectedItemsOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperations.cs index b41fc10266c3..4237b76142ab 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperations.cs @@ -41,15 +41,14 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie /// /// Lists the containers registered to Recovery Services Vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// Headers that will be added to request. @@ -72,13 +71,12 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -93,11 +91,28 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -106,9 +121,9 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -123,18 +138,14 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsContainerQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsContainerQueryObject)) - { - _queryParameters.Add(_bmsContainerQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -195,14 +206,13 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +222,6 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -377,14 +383,13 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -394,10 +399,6 @@ internal BackupProtectionContainersOperations (RecoveryServicesBackupClient clie } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperationsExtensions.cs index 3425975650e1..19ede5be910f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionContainersOperationsExtensions.cs @@ -18,19 +18,18 @@ public static partial class BackupProtectionContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static Microsoft.Rest.Azure.IPage List(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, string filter = default(string)) { - return ((IBackupProtectionContainersOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + return ((IBackupProtectionContainersOperations)operations).ListAsync(vaultName, resourceGroupName, filter).GetAwaiter().GetResult(); } /// @@ -39,22 +38,21 @@ public static partial class BackupProtectionContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectionContainersOperations operations, string vaultName, string resourceGroupName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperations.cs index 825db3cc8e48..445b4ee68bb9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperations.cs @@ -41,15 +41,14 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// Provides a pageable list of all intents that are present within a vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -75,13 +74,12 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,11 +94,28 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing @@ -110,9 +125,9 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -122,24 +137,20 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupProtectionIntents").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _protectionIntentQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_protectionIntentQueryObject)) - { - _queryParameters.Add(_protectionIntentQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -204,14 +215,13 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +231,6 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -386,14 +392,13 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -403,10 +408,6 @@ internal BackupProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperationsExtensions.cs index 2eb577868ebd..6f50d1f72c94 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupProtectionIntentOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class BackupProtectionIntentOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupProtectionIntentOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupProtectionIntentOperations)operations).ListAsync(vaultName, resourceGroupName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -42,15 +41,14 @@ public static partial class BackupProtectionIntentOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -58,9 +56,9 @@ public static partial class BackupProtectionIntentOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupProtectionIntentOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperations.cs index 087a8a5233b2..2a605fec0b3e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperations.cs @@ -41,12 +41,11 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient /// /// Fetches Vault Encryption config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Headers that will be added to request. @@ -69,7 +68,7 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -80,19 +79,35 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -102,8 +117,8 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -113,9 +128,9 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -182,11 +197,11 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -250,12 +265,11 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient /// /// Updates Vault encryption config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault encryption input config request @@ -278,7 +292,7 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceEncryptionConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -294,19 +308,35 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -316,8 +346,8 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("parameters", parameters); @@ -328,9 +358,9 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupEncryptionConfigs/backupResourceEncryptionConfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -403,11 +433,11 @@ internal BackupResourceEncryptionConfigsOperations (RecoveryServicesBackupClient if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs index d6fb20e0bf5b..1e1c4a76b57e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceEncryptionConfigsOperationsExtensions.cs @@ -18,16 +18,15 @@ public static partial class BackupResourceEncryptionConfigsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static BackupResourceEncryptionConfigExtendedResource Get(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName) + public static BackupResourceEncryptionConfigExtendedResource Get(this IBackupResourceEncryptionConfigsOperations operations, string resourceGroupName, string vaultName) { - return ((IBackupResourceEncryptionConfigsOperations)operations).GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + return ((IBackupResourceEncryptionConfigsOperations)operations).GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -36,19 +35,18 @@ public static BackupResourceEncryptionConfigExtendedResource Get(this IBackupRes /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceEncryptionConfigsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -59,16 +57,15 @@ public static BackupResourceEncryptionConfigExtendedResource Get(this IBackupRes /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static void Update(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters) + public static void Update(this IBackupResourceEncryptionConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceEncryptionConfigResource parameters) { - ((IBackupResourceEncryptionConfigsOperations)operations).UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + ((IBackupResourceEncryptionConfigsOperations)operations).UpdateAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// @@ -77,19 +74,18 @@ public static void Update(this IBackupResourceEncryptionConfigsOperations operat /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceEncryptionConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceEncryptionConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceEncryptionConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperations.cs index 9caefb91694e..5f831a27f980 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperations.cs @@ -41,12 +41,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// Fetches resource storage config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Headers that will be added to request. @@ -69,7 +68,7 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -80,19 +79,35 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -102,8 +117,8 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -112,10 +127,10 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -182,11 +197,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -250,12 +265,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// Updates vault storage model type. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault storage config request @@ -281,7 +295,7 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -297,19 +311,35 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -319,8 +349,8 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("parameters", parameters); @@ -330,10 +360,10 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -406,11 +436,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -474,12 +504,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// Updates vault storage model type. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault storage config request @@ -502,7 +531,7 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task PatchWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -517,19 +546,35 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -539,8 +584,8 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("parameters", parameters); @@ -550,10 +595,10 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -626,11 +671,11 @@ internal BackupResourceStorageConfigsNonCrrOperations (RecoveryServicesBackupCli if ((int)_statusCode != 204) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs index cd750ab2da78..0a7671489f4d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceStorageConfigsNonCRROperationsExtensions.cs @@ -18,16 +18,15 @@ public static partial class BackupResourceStorageConfigsNonCrrOperationsExtensio /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName) + public static BackupResourceConfigResource Get(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName) { - return ((IBackupResourceStorageConfigsNonCrrOperations)operations).GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + return ((IBackupResourceStorageConfigsNonCrrOperations)operations).GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -36,19 +35,18 @@ public static BackupResourceConfigResource Get(this IBackupResourceStorageConfig /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -59,16 +57,15 @@ public static BackupResourceConfigResource Get(this IBackupResourceStorageConfig /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) + public static BackupResourceConfigResource Update(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName, BackupResourceConfigResource parameters) { - return ((IBackupResourceStorageConfigsNonCrrOperations)operations).UpdateAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return ((IBackupResourceStorageConfigsNonCrrOperations)operations).UpdateAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// @@ -77,19 +74,18 @@ public static BackupResourceConfigResource Update(this IBackupResourceStorageCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -100,16 +96,15 @@ public static BackupResourceConfigResource Update(this IBackupResourceStorageCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - public static void Patch(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters) + /// + /// The name of the VaultResource + /// + public static void Patch(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName, BackupResourceConfigResource parameters) { - ((IBackupResourceStorageConfigsNonCrrOperations)operations).PatchAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + ((IBackupResourceStorageConfigsNonCrrOperations)operations).PatchAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// @@ -118,19 +113,18 @@ public static void Patch(this IBackupResourceStorageConfigsNonCrrOperations oper /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PatchAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task PatchAsync(this IBackupResourceStorageConfigsNonCrrOperations operations, string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.PatchWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.PatchWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperations.cs index 1df3f6f28ea8..6b9532670664 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperations.cs @@ -41,12 +41,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// Fetches resource vault config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Headers that will be added to request. @@ -69,7 +68,7 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -80,19 +79,35 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -102,8 +117,8 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -113,9 +128,9 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -182,11 +197,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -250,12 +265,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// Updates vault security config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -284,7 +298,7 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -294,24 +308,41 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } + if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } @@ -322,22 +353,22 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -351,7 +382,7 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -418,11 +449,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -486,12 +517,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// Updates vault security config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -520,7 +550,7 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -530,25 +560,40 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } @@ -559,22 +604,22 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Put", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Update", tracingParameters); } // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupconfig/vaultconfig").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -588,7 +633,7 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PATCH"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -655,11 +700,11 @@ internal BackupResourceVaultConfigsOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperationsExtensions.cs index 33d7de2d8b33..a85633a07bd3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupResourceVaultConfigsOperationsExtensions.cs @@ -18,16 +18,15 @@ public static partial class BackupResourceVaultConfigsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName) + public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName) { - return ((IBackupResourceVaultConfigsOperations)operations).GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + return ((IBackupResourceVaultConfigsOperations)operations).GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -36,19 +35,18 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -59,19 +57,18 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static BackupResourceVaultConfigResource Update(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static BackupResourceVaultConfigResource Put(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - return ((IBackupResourceVaultConfigsOperations)operations).UpdateAsync(vaultName, resourceGroupName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IBackupResourceVaultConfigsOperations)operations).PutAsync(resourceGroupName, vaultName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// @@ -80,12 +77,11 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -93,9 +89,9 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task PutAsync(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UpdateWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -106,19 +102,18 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static BackupResourceVaultConfigResource Put(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static BackupResourceVaultConfigResource Update(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - return ((IBackupResourceVaultConfigsOperations)operations).PutAsync(vaultName, resourceGroupName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IBackupResourceVaultConfigsOperations)operations).UpdateAsync(resourceGroupName, vaultName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// @@ -127,12 +122,11 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -140,9 +134,9 @@ public static BackupResourceVaultConfigResource Get(this IBackupResourceVaultCon /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PutAsync(this IBackupResourceVaultConfigsOperations operations, string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UpdateAsync(this IBackupResourceVaultConfigsOperations operations, string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UpdateWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupStatusOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupStatusOperations.cs index 8c40cbf10055..dbaad0b5f52f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupStatusOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupStatusOperations.cs @@ -93,7 +93,13 @@ internal BackupStatusOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -111,7 +117,7 @@ internal BackupStatusOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupStatus").ToString(); _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); @@ -186,14 +192,13 @@ internal BackupStatusOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -203,10 +208,6 @@ internal BackupStatusOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperations.cs index bbd9fda67763..75cb1a004f93 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperations.cs @@ -41,15 +41,14 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) /// /// Fetches the backup management usage summaries of the vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -75,13 +74,12 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,11 +94,28 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing @@ -110,9 +125,9 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -122,24 +137,20 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupUsageSummaries").ToString(); _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsBackupSummariesQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsBackupSummariesQueryObject)) - { - _queryParameters.Add(_bmsBackupSummariesQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -204,14 +215,13 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -221,10 +231,183 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); + _httpResponse.Dispose(); } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// Thrown when a required parameter is null + /// + /// + /// A response object containing the response body and response headers. + /// + public async System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + if (nextPageLink == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "nextPageLink"); + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("nextPageLink", nextPageLink); + + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "ListNext", tracingParameters); + } + // Construct URL + string _url = "{nextLink}"; + _url = _url.Replace("{nextLink}", nextPageLink); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("GET"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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 (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse); + } + + System.Net.HttpStatusCode _statusCode = _httpResponse.StatusCode; + cancellationToken.ThrowIfCancellationRequested(); + string _responseContent = null; + + if ((int)_statusCode != 200) + { + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -237,7 +420,7 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse>(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -251,7 +434,7 @@ internal BackupUsageSummariesOperations (RecoveryServicesBackupClient client) _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); try { - _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); + _result.Body = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, this.Client.DeserializationSettings); } catch (Newtonsoft.Json.JsonException ex) { diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperationsExtensions.cs index 3757316a96fe..9bd41c1a914d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupUsageSummariesOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class BackupUsageSummariesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static System.Collections.Generic.IEnumerable List(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupUsageSummariesOperations)operations).ListAsync(vaultName, resourceGroupName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupUsageSummariesOperations)operations).ListAsync(vaultName, resourceGroupName, filter, skipToken).GetAwaiter().GetResult(); } /// @@ -42,15 +41,14 @@ public static partial class BackupUsageSummariesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -58,9 +56,42 @@ public static partial class BackupUsageSummariesOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupUsageSummariesOperations operations, string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + public static Microsoft.Rest.Azure.IPage ListNext(this IBackupUsageSummariesOperations operations, string nextPageLink) + { + return ((IBackupUsageSummariesOperations)operations).ListNextAsync(nextPageLink).GetAwaiter().GetResult(); + } + + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task> ListNextAsync(this IBackupUsageSummariesOperations operations, string nextPageLink, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListNextWithHttpMessagesAsync(nextPageLink, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperations.cs index d27d9b5fc7e3..b20a69d3e023 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperations.cs @@ -40,23 +40,23 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -82,31 +82,46 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -120,6 +135,7 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -127,11 +143,11 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); + tracingParameters.Add("filter", filter); tracingParameters.Add("skipToken", skipToken); @@ -142,25 +158,21 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsWorkloadItemQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsWorkloadItemQueryObject)) - { - _queryParameters.Add(_bmsWorkloadItemQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (skipToken != null) { _queryParameters.Add(string.Format("$skipToken={0}", System.Uri.EscapeDataString(skipToken))); @@ -225,14 +237,13 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -242,10 +253,6 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -297,7 +304,8 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) } /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The NextLink from the previous successful call to List operation. @@ -408,14 +416,13 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -425,10 +432,6 @@ internal BackupWorkloadItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperationsExtensions.cs index 7677fb7d220e..d3a599cae66a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupWorkloadItemsOperationsExtensions.cs @@ -14,57 +14,57 @@ public static partial class BackupWorkloadItemsOperationsExtensions { /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. /// - public static Microsoft.Rest.Azure.IPage List(this IBackupWorkloadItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string)) + public static Microsoft.Rest.Azure.IPage List(this IBackupWorkloadItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), string skipToken = default(string)) { - return ((IBackupWorkloadItemsOperations)operations).ListAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, skipToken).GetAwaiter().GetResult(); + return ((IBackupWorkloadItemsOperations)operations).ListAsync(resourceGroupName, vaultName, fabricName, containerName, filter, skipToken).GetAwaiter().GetResult(); } /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -72,16 +72,17 @@ public static partial class BackupWorkloadItemsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IBackupWorkloadItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IBackupWorkloadItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), string skipToken = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, skipToken, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, filter, skipToken, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The operations group for this extension method. @@ -96,7 +97,8 @@ public static Microsoft.Rest.Azure.IPage ListNext(this IBa /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The operations group for this extension method. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperations.cs index e5a25b4f0ec3..3a2dab9af8e8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperations.cs @@ -40,24 +40,23 @@ internal BackupsOperations (RecoveryServicesBackupClient client) /// /// Triggers backup for specified backed up item. This is an asynchronous - /// operation. To know the status of the operation, call - /// GetProtectedItemOperationResult API. + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Backup item for which backup needs to be triggered. + /// Backed up item name whose details are to be fetched. /// /// /// resource backup request @@ -80,7 +79,7 @@ internal BackupsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -96,19 +95,35 @@ internal BackupsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -133,8 +148,8 @@ internal BackupsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -148,9 +163,9 @@ internal BackupsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -226,14 +241,13 @@ internal BackupsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -243,10 +257,6 @@ internal BackupsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperationsExtensions.cs index 8f3400adf200..888c34dffe7c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/BackupsOperationsExtensions.cs @@ -14,63 +14,61 @@ public static partial class BackupsOperationsExtensions { /// /// Triggers backup for specified backed up item. This is an asynchronous - /// operation. To know the status of the operation, call - /// GetProtectedItemOperationResult API. + /// operation. To know the status of the + /// operation, call 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Backup item for which backup needs to be triggered. + /// Backed up item name whose details are to be fetched. /// - public static void Trigger(this IBackupsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters) + public static void Trigger(this IBackupsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters) { - ((IBackupsOperations)operations).TriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); + ((IBackupsOperations)operations).TriggerAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters).GetAwaiter().GetResult(); } /// /// Triggers backup for specified backed up item. This is an asynchronous - /// operation. To know the status of the operation, call - /// GetProtectedItemOperationResult API. + /// operation. To know the status of the + /// operation, call 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Backup item for which backup needs to be triggered. + /// Backed up item name whose details are to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TriggerAsync(this IBackupsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task TriggerAsync(this IBackupsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.TriggerWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperations.cs new file mode 100644 index 000000000000..ff6381fde906 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperations.cs @@ -0,0 +1,362 @@ +// 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 System.Linq; + using Microsoft.Rest; + using Microsoft.Rest.Azure; + using Models; + + /// + /// ConfigureSourceScanOperations operations. + /// + internal partial class ConfigureSourceScanOperations : Microsoft.Rest.IServiceOperations, IConfigureSourceScanOperations + { + /// + /// Initializes a new instance of the ConfigureSourceScanOperations class. + /// + /// + /// Reference to the service client. + /// + /// + /// Thrown when a required parameter is null + /// + internal ConfigureSourceScanOperations (RecoveryServicesBackupClient client) + { + if (client == null) + { + throw new System.ArgumentNullException("client"); + } + this.Client = client; + } + + /// + /// Gets a reference to the RecoveryServicesBackupClient + /// + public RecoveryServicesBackupClient Client { get; private set; } + + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// Source scan action to perform + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> ExecuteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginExecuteWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, sourceScanAction, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// Source scan action to perform + /// + /// + /// 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 System.Threading.Tasks.Task> BeginExecuteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + + + + + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + + if (this.Client.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + } + + if (fabricName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); + } + + if (containerName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + + if (protectedItemName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); + } + + ProtectedItemConfigureSourceScanRequest body = new ProtectedItemConfigureSourceScanRequest(); + if(sourceScanAction != null) + { + body.SourceScanAction = sourceScanAction; + } + // Tracing + bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; + string _invocationId = null; + if (_shouldTrace) + { + _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); + System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); + tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + + tracingParameters.Add("body", body); + + tracingParameters.Add("cancellationToken", cancellationToken); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginExecute", tracingParameters); + } + // Construct URL + + var _baseUrl = this.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}/configureSourceScan").ToString(); + _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); + _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); + _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); + + System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); + if (this.Client.ApiVersion != null) + { + _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); + } + if (_queryParameters.Count > 0) + { + _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); + } + // Create HTTP transport objects + var _httpRequest = new System.Net.Http.HttpRequestMessage(); + System.Net.Http.HttpResponseMessage _httpResponse = null; + _httpRequest.Method = new System.Net.Http.HttpMethod("POST"); + _httpRequest.RequestUri = new System.Uri(_url); + // Set Headers + if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) + { + _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString()); + } + if (this.Client.AcceptLanguage != null) + { + if (_httpRequest.Headers.Contains("accept-language")) + { + _httpRequest.Headers.Remove("accept-language"); + } + _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.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(body != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(body, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } + // Set Credentials + if (this.Client.Credentials != null) + { + cancellationToken.ThrowIfCancellationRequested(); + await this.Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + } + // Send Request + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.SendRequest(_invocationId, _httpRequest); + } + cancellationToken.ThrowIfCancellationRequested(); + _httpResponse = await this.Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false); + if (_shouldTrace) + { + Microsoft.Rest.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 ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + try + { + _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + if (_errorBody != null) + { + ex.Body = _errorBody; + } + } + catch (Newtonsoft.Json.JsonException) + { + // Ignore the exception + } + ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); + ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); + } + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw ex; + } + // Create Result + var _result = new Microsoft.Rest.Azure.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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } + if (_shouldTrace) + { + Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); + } + return _result; + + + + + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperationsExtensions.cs new file mode 100644 index 000000000000..40c4fbb999e1 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ConfigureSourceScanOperationsExtensions.cs @@ -0,0 +1,138 @@ +// 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.Azure; + using Models; + + /// + /// Extension methods for ConfigureSourceScanOperations + /// + public static partial class ConfigureSourceScanOperationsExtensions + { + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + public static OperationStatus Execute(this IConfigureSourceScanOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string)) + { + return ((IConfigureSourceScanOperations)operations).ExecuteAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, sourceScanAction).GetAwaiter().GetResult(); + } + + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task ExecuteAsync(this IConfigureSourceScanOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.ExecuteWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, sourceScanAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + public static OperationStatus BeginExecute(this IConfigureSourceScanOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string)) + { + return ((IConfigureSourceScanOperations)operations).BeginExecuteAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, sourceScanAction).GetAwaiter().GetResult(); + } + + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task BeginExecuteAsync(this IConfigureSourceScanOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.BeginExecuteWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, sourceScanAction, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } + } + } +} diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperations.cs index d6ffcbd87b79..665d351b8fa3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperations.cs @@ -41,16 +41,15 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli /// /// Lists the soft deleted containers registered to Recovery Services Vault. /// - /// - /// - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. /// + /// + /// OData filter options. + /// /// /// Headers that will be added to request. /// @@ -72,32 +71,48 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (vaultName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -106,9 +121,9 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -123,18 +138,14 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsContainerQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsContainerQueryObject)) - { - _queryParameters.Add(_bmsContainerQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -195,14 +206,13 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +222,6 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -377,14 +383,13 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -394,10 +399,6 @@ internal DeletedProtectionContainersOperations (RecoveryServicesBackupClient cli } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperationsExtensions.cs index e9cfcc5dd0e6..4d513b9a3a6e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/DeletedProtectionContainersOperationsExtensions.cs @@ -18,19 +18,18 @@ public static partial class DeletedProtectionContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. /// - public static Microsoft.Rest.Azure.IPage List(this IDeletedProtectionContainersOperations operations, string resourceGroupName, string vaultName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// OData filter options. + /// + public static Microsoft.Rest.Azure.IPage List(this IDeletedProtectionContainersOperations operations, string resourceGroupName, string vaultName, string filter = default(string)) { - return ((IDeletedProtectionContainersOperations)operations).ListAsync(resourceGroupName, vaultName, odataQuery).GetAwaiter().GetResult(); + return ((IDeletedProtectionContainersOperations)operations).ListAsync(resourceGroupName, vaultName, filter).GetAwaiter().GetResult(); } /// @@ -39,22 +38,21 @@ public static partial class DeletedProtectionContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. /// + /// + /// OData filter options. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IDeletedProtectionContainersOperations operations, string resourceGroupName, string vaultName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IDeletedProtectionContainersOperations operations, string resourceGroupName, string vaultName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperations.cs index 5152ed09d1e9..0e75fa9b460c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperations.cs @@ -40,19 +40,18 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie /// /// Gets the operation result of operation triggered by Export Jobs API. If the - /// operation is successful, then it also contains URL of a Blob and a SAS key - /// to access the same. The blob contains exported jobs in JSON serialized - /// format. + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// OperationID which represents the export job. + /// The name of the JobResource /// /// /// Headers that will be added to request. @@ -75,7 +74,7 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -86,19 +85,35 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (operationId == null) @@ -113,8 +128,8 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("operationId", operationId); @@ -125,9 +140,9 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -195,14 +210,13 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -212,10 +226,6 @@ internal ExportJobsOperationResultsOperations (RecoveryServicesBackupClient clie } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperationsExtensions.cs index 2ebf9941cee8..ae700c40b6ad 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ExportJobsOperationResultsOperationsExtensions.cs @@ -14,53 +14,51 @@ public static partial class ExportJobsOperationResultsOperationsExtensions { /// /// Gets the operation result of operation triggered by Export Jobs API. If the - /// operation is successful, then it also contains URL of a Blob and a SAS key - /// to access the same. The blob contains exported jobs in JSON serialized - /// format. + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// OperationID which represents the export job. + /// The name of the JobResource /// - public static OperationResultInfoBaseResource Get(this IExportJobsOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId) + public static OperationResultInfoBaseResource Get(this IExportJobsOperationResultsOperations operations, string resourceGroupName, string vaultName, string operationId) { - return ((IExportJobsOperationResultsOperations)operations).GetAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + return ((IExportJobsOperationResultsOperations)operations).GetAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); } /// /// Gets the operation result of operation triggered by Export Jobs API. If the - /// operation is successful, then it also contains URL of a Blob and a SAS key - /// to access the same. The blob contains exported jobs in JSON serialized - /// format. + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// OperationID which represents the export job. + /// The name of the JobResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IExportJobsOperationResultsOperations operations, string vaultName, string resourceGroupName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IExportJobsOperationResultsOperations operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FeatureSupportOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FeatureSupportOperations.cs index f0d0c8b53994..4fbc6d2635dd 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FeatureSupportOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FeatureSupportOperations.cs @@ -94,7 +94,13 @@ internal FeatureSupportOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -112,7 +118,7 @@ internal FeatureSupportOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupValidateFeatures").ToString(); _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); @@ -187,14 +193,13 @@ internal FeatureSupportOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -204,10 +209,6 @@ internal FeatureSupportOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperations.cs index 9c8b8fedd1f4..2980cbf27c38 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperations.cs @@ -39,13 +39,12 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) public RecoveryServicesBackupClient Client { get; private set; } /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -67,13 +66,12 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) } /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -116,16 +114,37 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) { parameters.Validate(); } + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (vaultName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); @@ -145,11 +164,6 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.Pattern, "vaultName", "^[A-Za-z][-A-Za-z0-9]*[A-Za-z0-9]$"); } } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -244,14 +258,13 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -261,10 +274,6 @@ internal FetchTieringCostOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperationsExtensions.cs index e2ebc458ca3e..b609133768d6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/FetchTieringCostOperationsExtensions.cs @@ -13,16 +13,15 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public static partial class FetchTieringCostOperationsExtensions { /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -33,16 +32,15 @@ public static TieringCostInfo Post(this IFetchTieringCostOperations operations, } /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -58,16 +56,15 @@ public static TieringCostInfo Post(this IFetchTieringCostOperations operations, } } /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -78,16 +75,15 @@ public static TieringCostInfo BeginPost(this IFetchTieringCostOperations operati } /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperations.cs index 7edb3a85e9ce..213d804f2069 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperations.cs @@ -42,8 +42,7 @@ internal GetTieringCostOperationResultOperations (RecoveryServicesBackupClient c /// Gets the result of async operation for tiering cost /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -78,16 +77,37 @@ internal GetTieringCostOperationResultOperations (RecoveryServicesBackupClient c + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (vaultName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); @@ -112,11 +132,6 @@ internal GetTieringCostOperationResultOperations (RecoveryServicesBackupClient c throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -206,14 +221,13 @@ internal GetTieringCostOperationResultOperations (RecoveryServicesBackupClient c if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +237,6 @@ internal GetTieringCostOperationResultOperations (RecoveryServicesBackupClient c } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperationsExtensions.cs index b70cdac74d04..73d9eabd57e8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/GetTieringCostOperationResultOperationsExtensions.cs @@ -19,8 +19,7 @@ public static partial class GetTieringCostOperationResultOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -40,8 +39,7 @@ public static TieringCostInfo Get(this IGetTieringCostOperationResultOperations /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBMSPrepareDataMoveOperationResultOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBMSPrepareDataMoveOperationResultOperations.cs index fc616b1feb8f..a87fbb27158c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBMSPrepareDataMoveOperationResultOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBMSPrepareDataMoveOperationResultOperations.cs @@ -14,20 +14,19 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public partial interface IBmsPrepareDataMoveOperationResultOperations { /// - /// Fetches Operation Result for Prepare Data Move + /// Fetches operation status for data move operation on vault /// /// - /// Fetches Operation Result for Prepare Data Move + /// Fetches operation status for data move operation on vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// The headers that will be added to request. @@ -41,7 +40,7 @@ public partial interface IBmsPrepareDataMoveOperationResultOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupEnginesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupEnginesOperations.cs index 4201a49f8310..ae67a0fa38d4 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupEnginesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupEnginesOperations.cs @@ -21,15 +21,14 @@ public partial interface IBackupEnginesOperations /// Backup management servers registered to Recovery Services Vault. Returns a /// pageable list of servers. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -46,7 +45,7 @@ public partial interface IBackupEnginesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Returns backup management server registered to Recovery Services Vault. @@ -54,19 +53,18 @@ public partial interface IBackupEnginesOperations /// /// Returns backup management server registered to Recovery Services Vault. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// /// Name of the backup management server. /// + /// + /// OData filter options. + /// /// /// skipToken Filter. /// @@ -82,7 +80,7 @@ public partial interface IBackupEnginesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string backupEngineName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string backupEngineName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Backup management servers registered to Recovery Services Vault. Returns a diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupJobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupJobsOperations.cs index 63d67a1c6d01..63ca8eaf27d1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupJobsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupJobsOperations.cs @@ -19,15 +19,14 @@ public partial interface IBackupJobsOperations /// /// Provides a pageable list of jobs. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -44,7 +43,7 @@ public partial interface IBackupJobsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides a pageable list of jobs. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationResultsOperations.cs index de63c85ae4ee..0272a20f4cd5 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationResultsOperations.cs @@ -15,26 +15,27 @@ public partial interface IBackupOperationResultsOperations { /// /// Provides the status of the delete operations such as deleting backed up - /// item. Once the operation has started, the status code in the response would - /// be Accepted. It will continue to be in this state till it reaches - /// completion. On successful completion, the status code will be OK. This - /// method expects OperationID as an argument. OperationID is part of the - /// Location header of the operation response. + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. /// /// /// Provides the status of the delete operations such as deleting backed up - /// item. Once the operation has started, the status code in the response would - /// be Accepted. It will continue to be in this state till it reaches - /// completion. On successful completion, the status code will be OK. This - /// method expects OperationID as an argument. OperationID is part of the - /// Location header of the operation response. + /// item. Once the operation has started, the + /// status code in the response would be Accepted. It will continue to be in + /// this state till it reaches completion. On + /// successful completion, the status code will be OK. This method expects + /// OperationID as an argument. OperationID is + /// part of the Location header of the operation response. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationStatusesOperations.cs index 68322516889d..1eb4e3cddbc0 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupOperationStatusesOperations.cs @@ -15,24 +15,25 @@ public partial interface IBackupOperationStatusesOperations { /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs when the - /// operation is complete. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. /// /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs when the - /// operation is complete. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs when the operation is + /// complete. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupPoliciesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupPoliciesOperations.cs index 8871a0693d95..24828191a7cc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupPoliciesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupPoliciesOperations.cs @@ -15,21 +15,22 @@ public partial interface IBackupPoliciesOperations { /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// OData filter options. /// /// /// The headers that will be added to request. @@ -43,15 +44,17 @@ public partial interface IBackupPoliciesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// Lists of backup policies associated with Recovery Services Vault. API - /// provides pagination parameters to fetch scoped results. + /// provides pagination parameters to fetch + /// scoped results. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectableItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectableItemsOperations.cs index b30488b4ccaa..0e592e4f8079 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectableItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectableItemsOperations.cs @@ -15,21 +15,22 @@ public partial interface IBackupProtectableItemsOperations { /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -46,15 +47,17 @@ public partial interface IBackupProtectableItemsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// Provides a pageable list of protectable objects within your subscription - /// according to the query filter and the pagination parameters. + /// according to the query filter and the + /// pagination parameters. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectedItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectedItemsOperations.cs index 171143efa841..10d14fbe4f09 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectedItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectedItemsOperations.cs @@ -19,15 +19,14 @@ public partial interface IBackupProtectedItemsOperations /// /// Provides a pageable list of all items that are backed up within a vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -44,7 +43,7 @@ public partial interface IBackupProtectedItemsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides a pageable list of all items that are backed up within a vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionContainersOperations.cs index 3ccaca2d39d5..ce2bf5b0506a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionContainersOperations.cs @@ -19,15 +19,14 @@ public partial interface IBackupProtectionContainersOperations /// /// Lists the containers registered to Recovery Services Vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// The headers that will be added to request. @@ -41,7 +40,7 @@ public partial interface IBackupProtectionContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the containers registered to Recovery Services Vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionIntentOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionIntentOperations.cs index 7b7e47d40ee2..96400cc87fb2 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionIntentOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupProtectionIntentOperations.cs @@ -19,15 +19,14 @@ public partial interface IBackupProtectionIntentOperations /// /// Provides a pageable list of all intents that are present within a vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -44,7 +43,7 @@ public partial interface IBackupProtectionIntentOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides a pageable list of all intents that are present within a vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceEncryptionConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceEncryptionConfigsOperations.cs index 45074c68f5e5..ef011b2c03dc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceEncryptionConfigsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceEncryptionConfigsOperations.cs @@ -19,12 +19,11 @@ public partial interface IBackupResourceEncryptionConfigsOperations /// /// Fetches Vault Encryption config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The headers that will be added to request. @@ -38,7 +37,7 @@ public partial interface IBackupResourceEncryptionConfigsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates Vault encryption config. @@ -46,12 +45,11 @@ public partial interface IBackupResourceEncryptionConfigsOperations /// /// Updates Vault encryption config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault encryption input config request @@ -65,7 +63,7 @@ public partial interface IBackupResourceEncryptionConfigsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceEncryptionConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceEncryptionConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceStorageConfigsNonCRROperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceStorageConfigsNonCRROperations.cs index d72ae0b494ab..01fb6e2210e4 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceStorageConfigsNonCRROperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceStorageConfigsNonCRROperations.cs @@ -19,12 +19,11 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Fetches resource storage config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The headers that will be added to request. @@ -38,7 +37,7 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates vault storage model type. @@ -46,12 +45,11 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Updates vault storage model type. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault storage config request @@ -68,7 +66,7 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates vault storage model type. @@ -76,12 +74,11 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Updates vault storage model type. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Vault storage config request @@ -95,7 +92,7 @@ public partial interface IBackupResourceStorageConfigsNonCrrOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task PatchWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task PatchWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceConfigResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceVaultConfigsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceVaultConfigsOperations.cs index 6917d86a74dd..b23dae5046f3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceVaultConfigsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupResourceVaultConfigsOperations.cs @@ -19,12 +19,11 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Fetches resource vault config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The headers that will be added to request. @@ -38,7 +37,7 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates vault security config. @@ -46,12 +45,11 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Updates vault security config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -71,7 +69,7 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Updates vault security config. @@ -79,12 +77,11 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Updates vault security config. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -104,7 +101,7 @@ public partial interface IBackupResourceVaultConfigsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, BackupResourceVaultConfigResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupUsageSummariesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupUsageSummariesOperations.cs index 9900c9cd7703..defdb5ec3789 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupUsageSummariesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupUsageSummariesOperations.cs @@ -19,15 +19,14 @@ public partial interface IBackupUsageSummariesOperations /// /// Fetches the backup management usage summaries of the vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -44,7 +43,30 @@ public partial interface IBackupUsageSummariesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// Fetches the backup management usage summaries of the vault. + /// + /// + /// The NextLink from the previous successful call to List operation. + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task>> ListNextWithHttpMessagesAsync(string nextPageLink, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupWorkloadItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupWorkloadItemsOperations.cs index bc8b4a5f99a4..3b081f821214 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupWorkloadItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupWorkloadItemsOperations.cs @@ -15,27 +15,28 @@ public partial interface IBackupWorkloadItemsOperations { /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// skipToken Filter. @@ -52,15 +53,17 @@ public partial interface IBackupWorkloadItemsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), string skipToken = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// Provides a pageable list of workload item of a specific container according - /// to the query filter and the pagination parameters. + /// to the query filter and the pagination + /// parameters. /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupsOperations.cs index 932713cc8341..de59617d7f31 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IBackupsOperations.cs @@ -15,29 +15,28 @@ public partial interface IBackupsOperations { /// /// Triggers backup for specified backed up item. This is an asynchronous - /// operation. To know the status of the operation, call - /// GetProtectedItemOperationResult API. + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. /// /// /// Triggers backup for specified backed up item. This is an asynchronous - /// operation. To know the status of the operation, call - /// GetProtectedItemOperationResult API. + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Backup item for which backup needs to be triggered. + /// Backed up item name whose details are to be fetched. /// /// /// resource backup request @@ -51,7 +50,7 @@ public partial interface IBackupsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, BackupRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IConfigureSourceScanOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IConfigureSourceScanOperations.cs new file mode 100644 index 000000000000..2a64c21a6fd1 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IConfigureSourceScanOperations.cs @@ -0,0 +1,101 @@ +// 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.Azure; + using Models; + + /// + /// ConfigureSourceScanOperations operations. + /// + public partial interface IConfigureSourceScanOperations + { + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// Source scan action to perform + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> ExecuteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// Configures source scan for a protected item. This is an asynchronous + /// operation. To know the status of the + /// operation, call GetProtectedItemOperationResult API. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// Source scan action to perform + /// + /// + /// 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 + /// + System.Threading.Tasks.Task> BeginExecuteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string sourceScanAction = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IDeletedProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IDeletedProtectionContainersOperations.cs index 79c9c4b4b2d4..205857181e6d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IDeletedProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IDeletedProtectionContainersOperations.cs @@ -19,16 +19,15 @@ public partial interface IDeletedProtectionContainersOperations /// /// Lists the soft deleted containers registered to Recovery Services Vault. /// - /// - /// - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. /// + /// + /// OData filter options. + /// /// /// The headers that will be added to request. /// @@ -41,7 +40,7 @@ public partial interface IDeletedProtectionContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the soft deleted containers registered to Recovery Services Vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IExportJobsOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IExportJobsOperationResultsOperations.cs index 2ba838bbaeb3..2b2b5ed85564 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IExportJobsOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IExportJobsOperationResultsOperations.cs @@ -15,25 +15,24 @@ public partial interface IExportJobsOperationResultsOperations { /// /// Gets the operation result of operation triggered by Export Jobs API. If the - /// operation is successful, then it also contains URL of a Blob and a SAS key - /// to access the same. The blob contains exported jobs in JSON serialized - /// format. + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. /// /// /// Gets the operation result of operation triggered by Export Jobs API. If the - /// operation is successful, then it also contains URL of a Blob and a SAS key - /// to access the same. The blob contains exported jobs in JSON serialized - /// format. + /// operation is successful, then it also + /// contains URL of a Blob and a SAS key to access the same. The blob contains + /// exported jobs in JSON serialized format. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// OperationID which represents the export job. + /// The name of the JobResource /// /// /// The headers that will be added to request. @@ -47,7 +46,7 @@ public partial interface IExportJobsOperationResultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IFetchTieringCostOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IFetchTieringCostOperations.cs index 51ee84992d5a..fd439a614107 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IFetchTieringCostOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IFetchTieringCostOperations.cs @@ -14,18 +14,17 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public partial interface IFetchTieringCostOperations { /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -48,18 +47,17 @@ public partial interface IFetchTieringCostOperations System.Threading.Tasks.Task> PostWithHttpMessagesAsync(string resourceGroupName, string vaultName, FetchTieringCostInfoRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// Provides the details of the tiering related sizes and cost. Status of the - /// operation can be fetched using GetTieringCostOperationStatus API and result - /// using GetTieringCostOperationResult API. + /// Provides the details of the tiering related sizes and cost. + /// Status of the operation can be fetched using GetTieringCostOperationStatus + /// API and result using GetTieringCostOperationResult API. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IGetTieringCostOperationResultOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IGetTieringCostOperationResultOperations.cs index b8a86da879f2..c56d4b37b54e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IGetTieringCostOperationResultOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IGetTieringCostOperationResultOperations.cs @@ -20,8 +20,7 @@ public partial interface IGetTieringCostOperationResultOperations /// Gets the result of async operation for tiering cost /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IItemLevelRecoveryConnectionsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IItemLevelRecoveryConnectionsOperations.cs index 2bd823414aa7..8f84135ea889 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IItemLevelRecoveryConnectionsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IItemLevelRecoveryConnectionsOperations.cs @@ -15,35 +15,35 @@ public partial interface IItemLevelRecoveryConnectionsOperations { /// /// Provisions a script which invokes an iSCSI connection to the backup data. - /// Executing this script opens a file explorer displaying all the recoverable - /// files and folders. This is an asynchronous operation. To know the status of + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of /// provisioning, call GetProtectedItemOperationResult API. /// /// /// Provisions a script which invokes an iSCSI connection to the backup data. - /// Executing this script opens a file explorer displaying all the recoverable - /// files and folders. This is an asynchronous operation. To know the status of + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of /// provisioning, call GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// provisioned for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// resource ILR request @@ -57,37 +57,37 @@ public partial interface IItemLevelRecoveryConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task ProvisionWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ProvisionWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Revokes an iSCSI connection which can be used to download a script. - /// Executing this script opens a file explorer displaying all recoverable - /// files and folders. This is an asynchronous operation. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. /// /// /// Revokes an iSCSI connection which can be used to download a script. - /// Executing this script opens a file explorer displaying all recoverable - /// files and folders. This is an asynchronous operation. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// revoked for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// The headers that will be added to request. @@ -98,7 +98,7 @@ public partial interface IItemLevelRecoveryConnectionsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task RevokeWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task RevokeWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobCancellationsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobCancellationsOperations.cs index 2a9f91cf45b1..8ad2233858ca 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobCancellationsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobCancellationsOperations.cs @@ -15,21 +15,22 @@ public partial interface IJobCancellationsOperations { /// /// Cancels a job. This is an asynchronous operation. To know the status of the - /// cancellation, call GetCancelOperationResult API. + /// cancellation, call + /// GetCancelOperationResult API. /// /// /// Cancels a job. This is an asynchronous operation. To know the status of the - /// cancellation, call GetCancelOperationResult API. + /// cancellation, call + /// GetCancelOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the job to cancel. + /// Name of the job whose details are to be fetched. /// /// /// The headers that will be added to request. @@ -40,7 +41,7 @@ public partial interface IJobCancellationsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobDetailsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobDetailsOperations.cs index af7e7d3f603b..9abf792190a7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobDetailsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobDetailsOperations.cs @@ -19,12 +19,11 @@ public partial interface IJobDetailsOperations /// /// Gets extended information associated with the job. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Name of the job whose details are to be fetched. @@ -41,7 +40,7 @@ public partial interface IJobDetailsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobOperationResultsOperations.cs index 5f1fd8906547..6dd3c7826906 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobOperationResultsOperations.cs @@ -19,18 +19,17 @@ public partial interface IJobOperationResultsOperations /// /// Fetches the result of any operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Job name whose operation result has to be fetched. + /// The name of the JobResource /// /// - /// OperationID which represents the operation whose result has to be fetched. + /// The name of the JobResource /// /// /// The headers that will be added to request. @@ -41,7 +40,7 @@ public partial interface IJobOperationResultsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobsOperations.cs index 4e657ecbbcbe..e878d894609f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IJobsOperations.cs @@ -21,15 +21,14 @@ public partial interface IJobsOperations /// Triggers export of jobs specified by filters and returns an OperationID to /// track. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// The headers that will be added to request. @@ -40,7 +39,7 @@ public partial interface IJobsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperationOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperationOperations.cs index 51742078beac..ecd0d76031ed 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperationOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperationOperations.cs @@ -25,8 +25,7 @@ public partial interface IOperationOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperations.cs index e18607c91b4a..ecc818ccb073 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IOperations.cs @@ -14,10 +14,10 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public partial interface IOperations { /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The headers that will be added to request. @@ -34,10 +34,10 @@ public partial interface IOperations System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointConnectionOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointConnectionOperations.cs index 75c74ee9bdd5..a366b259d038 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointConnectionOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointConnectionOperations.cs @@ -19,12 +19,11 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Get Private Endpoint Connection. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -41,7 +40,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Approve or Reject Private Endpoint requests. This call is made by Backup @@ -51,12 +50,11 @@ public partial interface IPrivateEndpointConnectionOperations /// Approve or Reject Private Endpoint requests. This call is made by Backup /// Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -76,7 +74,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete Private Endpoint requests. This call is made by Backup Admin. @@ -84,12 +82,11 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Delete Private Endpoint requests. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -103,7 +100,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Approve or Reject Private Endpoint requests. This call is made by Backup @@ -113,12 +110,11 @@ public partial interface IPrivateEndpointConnectionOperations /// Approve or Reject Private Endpoint requests. This call is made by Backup /// Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -138,7 +134,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginPutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginPutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete Private Endpoint requests. This call is made by Backup Admin. @@ -146,12 +142,11 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Delete Private Endpoint requests. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -165,7 +160,7 @@ public partial interface IPrivateEndpointConnectionOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointOperations.cs index 432d198307c8..69488f9083d9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IPrivateEndpointOperations.cs @@ -19,18 +19,17 @@ public partial interface IPrivateEndpointOperations /// /// Gets the operation status for a private endpoint connection. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// The name of the private endpoint connection. + /// The name of the PrivateEndpointConnectionResource /// /// - /// Operation id + /// The name of the PrivateEndpointConnectionResource /// /// /// The headers that will be added to request. @@ -44,7 +43,7 @@ public partial interface IPrivateEndpointOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectableContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectableContainersOperations.cs index 115a4b0e5a8f..85e5ca5d161b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectableContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectableContainersOperations.cs @@ -19,19 +19,18 @@ public partial interface IProtectableContainersOperations /// /// Lists the containers that can be registered to Recovery Services Vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// /// + /// + /// OData filter options. + /// /// /// The headers that will be added to request. /// @@ -44,7 +43,7 @@ public partial interface IProtectableContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the containers that can be registered to Recovery Services Vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationResultsOperations.cs index 29db75912fd1..10c13f38f1b7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationResultsOperations.cs @@ -19,25 +19,23 @@ public partial interface IProtectedItemOperationResultsOperations /// /// Fetches the result of any operation on the backup item. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectedItemResource /// /// /// The headers that will be added to request. @@ -51,7 +49,7 @@ public partial interface IProtectedItemOperationResultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationStatusesOperations.cs index 50a4a115f0fc..7a38f706ad19 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemOperationStatusesOperations.cs @@ -15,36 +15,37 @@ public partial interface IProtectedItemOperationStatusesOperations { /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of the operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with the operation. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. /// /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of the operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with the operation. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID represents the operation whose status needs to be fetched. + /// The name of the ProtectedItemResource /// /// /// The headers that will be added to request. @@ -58,7 +59,7 @@ public partial interface IProtectedItemOperationStatusesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemsOperations.cs index 72775276e51a..61e2aa5e0980 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectedItemsOperations.cs @@ -15,33 +15,32 @@ public partial interface IProtectedItemsOperations { /// /// Provides the details of the backed up item. This is an asynchronous - /// operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// /// /// Provides the details of the backed up item. This is an asynchronous - /// operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// /// Backed up item name whose details are to be fetched. /// + /// + /// OData filter options. + /// /// /// The headers that will be added to request. /// @@ -54,33 +53,34 @@ public partial interface IProtectedItemsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Enables backup of an item or to modifies the backup policy information of - /// an already backed up item. This is an asynchronous operation. To know the - /// status of the operation, call the GetItemOperationResult API. + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. /// /// /// Enables backup of an item or to modifies the backup policy information of - /// an already backed up item. This is an asynchronous operation. To know the - /// status of the operation, call the GetItemOperationResult API. + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Item name to be backed up. + /// Backed up item name whose details are to be fetched. /// /// /// @@ -100,33 +100,76 @@ public partial interface IProtectedItemsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Used to disable backup of an item within a container. This is an - /// asynchronous operation. To know the status of the request, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. /// /// /// Used to disable backup of an item within a container. This is an - /// asynchronous operation. To know the status of the request, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The headers that will be added to request. /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be deleted. + /// Backed up item name whose details are to be fetched. + /// + /// + /// + /// + /// + /// resource backed up item /// /// /// The headers that will be added to request. @@ -137,7 +180,10 @@ public partial interface IProtectedItemsOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + /// + /// Thrown when unable to deserialize the response + /// + System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerOperationResultsOperations.cs index c5bad688c932..91240a632c86 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerOperationResultsOperations.cs @@ -19,22 +19,20 @@ public partial interface IProtectionContainerOperationResultsOperations /// /// Fetches the result of any operation on the container. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the container. + /// backupFabrics /// /// - /// Container name whose information should be fetched. + /// The name of the ProtectionContainerResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionContainerResource /// /// /// The headers that will be added to request. @@ -48,7 +46,7 @@ public partial interface IProtectionContainerOperationResultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerRefreshOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerRefreshOperationResultsOperations.cs index 3d138809962b..940cd2036c03 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerRefreshOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainerRefreshOperationResultsOperations.cs @@ -25,8 +25,7 @@ public partial interface IProtectionContainerRefreshOperationResultsOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated with the container. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainersOperations.cs index ed6d432beeee..626d93ba1b4d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionContainersOperations.cs @@ -21,15 +21,14 @@ public partial interface IProtectionContainersOperations /// Gets details of the specific container registered to your Recovery Services /// Vault. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// /// Name of the container whose details need to be fetched. @@ -46,30 +45,31 @@ public partial interface IProtectionContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// Request body for operation @@ -86,31 +86,31 @@ public partial interface IProtectionContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Unregisters the given container from your Recovery Services Vault. This is - /// an asynchronous operation. To determine whether the backend service has - /// finished processing the request, call Get Container Operation Result API. + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. /// /// /// Unregisters the given container from your Recovery Services Vault. This is - /// an asynchronous operation. To determine whether the backend service has - /// finished processing the request, call Get Container Operation Result API. + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// - /// Name of the container which needs to be unregistered from the Recovery - /// Services Vault. + /// Name of the container whose details need to be fetched. /// /// /// The headers that will be added to request. @@ -121,7 +121,7 @@ public partial interface IProtectionContainersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task UnregisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task UnregisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// This is an async operation and the results should be tracked using location @@ -131,21 +131,20 @@ public partial interface IProtectionContainersOperations /// This is an async operation and the results should be tracked using location /// header or Azure-async-url. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric Name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container in which inquiry needs to be triggered. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// The headers that will be added to request. @@ -156,31 +155,32 @@ public partial interface IProtectionContainersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task InquireWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task InquireWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Discovers all the containers in the subscription that can be backed up to - /// Recovery Services Vault. This is an asynchronous operation. To know the - /// status of the operation, call GetRefreshOperationResult API. + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. /// /// /// Discovers all the containers in the subscription that can be backed up to - /// Recovery Services Vault. This is an asynchronous operation. To know the - /// status of the operation, call GetRefreshOperationResult API. + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated the container. /// + /// + /// OData filter options. + /// /// /// The headers that will be added to request. /// @@ -190,30 +190,31 @@ public partial interface IProtectionContainersOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// Request body for operation @@ -230,7 +231,7 @@ public partial interface IProtectionContainersOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> BeginRegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginRegisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionIntentOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionIntentOperations.cs index 185004738ae2..545ee0566eea 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionIntentOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionIntentOperations.cs @@ -47,23 +47,22 @@ public partial interface IProtectionIntentOperations /// /// Provides the details of the protection intent up item. This is an - /// asynchronous operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// /// /// Provides the details of the protection intent up item. This is an - /// asynchronous operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// /// Backed up item name whose details are to be fetched. @@ -80,7 +79,7 @@ public partial interface IProtectionIntentOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Create Intent for Enabling backup of an item. This is a synchronous @@ -90,18 +89,17 @@ public partial interface IProtectionIntentOperations /// Create Intent for Enabling backup of an item. This is a synchronous /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Intent object name. + /// Backed up item name whose details are to be fetched. /// /// /// resource backed up item @@ -118,7 +116,7 @@ public partial interface IProtectionIntentOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Used to remove intent from an item @@ -126,18 +124,17 @@ public partial interface IProtectionIntentOperations /// /// Used to remove intent from an item /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the intent. + /// The name of the BackupFabricResource /// /// - /// Intent to be deleted. + /// Backed up item name whose details are to be fetched. /// /// /// The headers that will be added to request. @@ -148,7 +145,7 @@ public partial interface IProtectionIntentOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPoliciesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPoliciesOperations.cs index 345e96b46e9f..f7afc708359f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPoliciesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPoliciesOperations.cs @@ -15,20 +15,21 @@ public partial interface IProtectionPoliciesOperations { /// /// Provides the details of the backup policies associated to Recovery Services - /// Vault. This is an asynchronous operation. Status of the operation can be - /// fetched using GetPolicyOperationResult API. + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. /// /// /// Provides the details of the backup policies associated to Recovery Services - /// Vault. This is an asynchronous operation. Status of the operation can be - /// fetched using GetPolicyOperationResult API. + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Backup policy information to be fetched. @@ -45,25 +46,26 @@ public partial interface IProtectionPoliciesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Creates or modifies a backup policy. This is an asynchronous operation. - /// Status of the operation can be fetched using GetPolicyOperationResult API. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. /// /// /// Creates or modifies a backup policy. This is an asynchronous operation. - /// Status of the operation can be fetched using GetPolicyOperationResult API. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be created. + /// Backup policy information to be fetched. /// /// /// @@ -83,27 +85,26 @@ public partial interface IProtectionPoliciesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// The headers that will be added to request. @@ -114,27 +115,26 @@ public partial interface IProtectionPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// The headers that will be added to request. @@ -145,7 +145,7 @@ public partial interface IProtectionPoliciesOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationResultsOperations.cs index abcb807026ae..69160ebc06a6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationResultsOperations.cs @@ -19,19 +19,17 @@ public partial interface IProtectionPolicyOperationResultsOperations /// /// Provides the result of an operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's result needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// The headers that will be added to request. @@ -45,7 +43,7 @@ public partial interface IProtectionPolicyOperationResultsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationStatusesOperations.cs index 5dbec5470ac6..ed551e3c45be 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IProtectionPolicyOperationStatusesOperations.cs @@ -15,31 +15,31 @@ public partial interface IProtectionPolicyOperationStatusesOperations { /// /// Provides the status of the asynchronous operations like backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// Operation Status enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with operation. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. /// /// /// Provides the status of the asynchronous operations like backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// Operation Status enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with operation. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's status needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents an operation whose status needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// The headers that will be added to request. @@ -53,7 +53,7 @@ public partial interface IProtectionPolicyOperationStatusesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsOperations.cs index 7520cd442339..38c888186f9a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsOperations.cs @@ -19,24 +19,23 @@ public partial interface IRecoveryPointsOperations /// /// Lists the backup copies for the backed up item. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item whose backup copies are to be fetched. + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData filter options. /// /// /// The headers that will be added to request. @@ -50,33 +49,34 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Provides the information of the backed up data identified using - /// RecoveryPointID. This is an asynchronous operation. To know the status of - /// the operation, call the GetProtectedItemOperationResult API. + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. /// /// /// Provides the information of the backed up data identified using - /// RecoveryPointID. This is an asynchronous operation. To know the status of - /// the operation, call the GetProtectedItemOperationResult API. + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose backup data needs to be fetched. + /// Backed up item name whose details are to be fetched. /// /// /// RecoveryPointID represents the backed up data to be fetched. @@ -93,7 +93,7 @@ public partial interface IRecoveryPointsOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the backup copies for the backed up item. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsRecommendedForMoveOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsRecommendedForMoveOperations.cs index 0b521f941eb7..c02d16e2d416 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsRecommendedForMoveOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryPointsRecommendedForMoveOperations.cs @@ -19,21 +19,20 @@ 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// /// Gets the class type. @@ -53,7 +52,7 @@ public partial interface IRecoveryPointsRecommendedForMoveOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Lists the recovery points recommended for move to another tier diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryServicesBackupClient.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryServicesBackupClient.cs index c4ef3bd0b6d1..52aa38d75855 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryServicesBackupClient.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRecoveryServicesBackupClient.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using Models; /// - /// + /// Open API 2.0 Specs for Azure RecoveryServices Backup service /// public partial interface IRecoveryServicesBackupClient : System.IDisposable { @@ -42,7 +42,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// - /// The subscription Id. + /// The ID of the target subscription. /// string SubscriptionId { get; set;} @@ -69,9 +69,9 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// - /// Gets the IBackupResourceStorageConfigsNonCrrOperations + /// Gets the IOperations /// - IBackupResourceStorageConfigsNonCrrOperations BackupResourceStorageConfigsNonCrr { get; } + IOperations Operations { get; } /// /// Gets the IProtectionIntentOperations @@ -89,79 +89,89 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable IFeatureSupportOperations FeatureSupport { get; } /// - /// Gets the IBackupProtectionIntentOperations + /// Gets the IDeletedProtectionContainersOperations /// - IBackupProtectionIntentOperations BackupProtectionIntent { get; } + IDeletedProtectionContainersOperations DeletedProtectionContainers { get; } /// - /// Gets the IBackupUsageSummariesOperations + /// Gets the IBackupResourceEncryptionConfigsOperations /// - IBackupUsageSummariesOperations BackupUsageSummaries { get; } + IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; } /// - /// Gets the IOperations + /// Gets the IBackupEnginesOperations /// - IOperations Operations { get; } + IBackupEnginesOperations BackupEngines { get; } /// - /// Gets the IBackupResourceVaultConfigsOperations + /// Gets the IProtectionContainerRefreshOperationResultsOperations /// - IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; } + IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; } /// - /// Gets the IBackupResourceEncryptionConfigsOperations + /// Gets the IProtectableContainersOperations /// - IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; } + IProtectableContainersOperations ProtectableContainers { get; } /// - /// Gets the IPrivateEndpointConnectionOperations + /// Gets the IProtectionContainersOperations /// - IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; } + IProtectionContainersOperations ProtectionContainers { get; } /// - /// Gets the IPrivateEndpointOperations + /// Gets the IBackupWorkloadItemsOperations /// - IPrivateEndpointOperations PrivateEndpoint { get; } + IBackupWorkloadItemsOperations BackupWorkloadItems { get; } /// - /// Gets the IBmsPrepareDataMoveOperationResultOperations + /// Gets the IProtectionContainerOperationResultsOperations /// - IBmsPrepareDataMoveOperationResultOperations BmsPrepareDataMoveOperationResult { get; } + IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; } /// /// Gets the IProtectedItemsOperations /// IProtectedItemsOperations ProtectedItems { get; } + /// + /// Gets the IBackupsOperations + /// + IBackupsOperations Backups { get; } + + /// + /// Gets the IConfigureSourceScanOperations + /// + IConfigureSourceScanOperations ConfigureSourceScan { get; } + /// /// Gets the IProtectedItemOperationResultsOperations /// IProtectedItemOperationResultsOperations ProtectedItemOperationResults { get; } /// - /// Gets the IRecoveryPointsOperations + /// Gets the IProtectedItemOperationStatusesOperations /// - IRecoveryPointsOperations RecoveryPoints { get; } + IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; } /// - /// Gets the IRestoresOperations + /// Gets the IRecoveryPointsOperations /// - IRestoresOperations Restores { get; } + IRecoveryPointsOperations RecoveryPoints { get; } /// - /// Gets the IBackupPoliciesOperations + /// Gets the IItemLevelRecoveryConnectionsOperations /// - IBackupPoliciesOperations BackupPolicies { get; } + IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; } /// - /// Gets the IProtectionPoliciesOperations + /// Gets the IRestoresOperations /// - IProtectionPoliciesOperations ProtectionPolicies { get; } + IRestoresOperations Restores { get; } /// - /// Gets the IProtectionPolicyOperationResultsOperations + /// Gets the IRecoveryPointsRecommendedForMoveOperations /// - IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; } + IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; } /// /// Gets the IBackupJobsOperations @@ -194,155 +204,187 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable IJobsOperations Jobs { get; } /// - /// Gets the IBackupProtectedItemsOperations + /// Gets the IBackupOperationResultsOperations /// - IBackupProtectedItemsOperations BackupProtectedItems { get; } + IBackupOperationResultsOperations BackupOperationResults { get; } /// - /// Gets the IOperationOperations + /// Gets the IBackupOperationStatusesOperations /// - IOperationOperations Operation { get; } + IBackupOperationStatusesOperations BackupOperationStatuses { get; } /// - /// Gets the IValidateOperationOperations + /// Gets the IBackupPoliciesOperations /// - IValidateOperationOperations ValidateOperation { get; } + IBackupPoliciesOperations BackupPolicies { get; } /// - /// Gets the IValidateOperationResultsOperations + /// Gets the IProtectionPoliciesOperations /// - IValidateOperationResultsOperations ValidateOperationResults { get; } + IProtectionPoliciesOperations ProtectionPolicies { get; } /// - /// Gets the IValidateOperationStatusesOperations + /// Gets the IProtectionPolicyOperationResultsOperations /// - IValidateOperationStatusesOperations ValidateOperationStatuses { get; } + IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; } /// - /// Gets the IBackupEnginesOperations + /// Gets the IProtectionPolicyOperationStatusesOperations /// - IBackupEnginesOperations BackupEngines { get; } + IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; } /// - /// Gets the IProtectionContainerRefreshOperationResultsOperations + /// Gets the IBackupProtectableItemsOperations /// - IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; } + IBackupProtectableItemsOperations BackupProtectableItems { get; } /// - /// Gets the IProtectableContainersOperations + /// Gets the IBackupProtectedItemsOperations /// - IProtectableContainersOperations ProtectableContainers { get; } + IBackupProtectedItemsOperations BackupProtectedItems { get; } /// - /// Gets the IProtectionContainersOperations + /// Gets the IBackupProtectionContainersOperations /// - IProtectionContainersOperations ProtectionContainers { get; } + IBackupProtectionContainersOperations BackupProtectionContainers { get; } /// - /// Gets the IBackupWorkloadItemsOperations + /// Gets the IBackupProtectionIntentOperations /// - IBackupWorkloadItemsOperations BackupWorkloadItems { get; } + IBackupProtectionIntentOperations BackupProtectionIntent { get; } /// - /// Gets the IProtectionContainerOperationResultsOperations + /// Gets the IResourceGuardProxiesOperations /// - IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; } + IResourceGuardProxiesOperations ResourceGuardProxies { get; } /// - /// Gets the IBackupsOperations + /// Gets the IResourceGuardProxyOperations /// - IBackupsOperations Backups { get; } + IResourceGuardProxyOperations ResourceGuardProxy { get; } /// - /// Gets the IProtectedItemOperationStatusesOperations + /// Gets the ISecurityPiNsOperations /// - IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; } + ISecurityPiNsOperations SecurityPiNs { get; } /// - /// Gets the IItemLevelRecoveryConnectionsOperations + /// Gets the IFetchTieringCostOperations /// - IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; } + IFetchTieringCostOperations FetchTieringCost { get; } /// - /// Gets the IBackupOperationResultsOperations + /// Gets the IGetTieringCostOperationResultOperations /// - IBackupOperationResultsOperations BackupOperationResults { get; } + IGetTieringCostOperationResultOperations GetTieringCostOperationResult { get; } /// - /// Gets the IBackupOperationStatusesOperations + /// Gets the ITieringCostOperationStatusOperations /// - IBackupOperationStatusesOperations BackupOperationStatuses { get; } + ITieringCostOperationStatusOperations TieringCostOperationStatus { get; } /// - /// Gets the IProtectionPolicyOperationStatusesOperations + /// Gets the IValidateOperationOperations /// - IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; } + IValidateOperationOperations ValidateOperation { get; } /// - /// Gets the IBackupProtectableItemsOperations + /// Gets the IBackupUsageSummariesOperations /// - IBackupProtectableItemsOperations BackupProtectableItems { get; } + IBackupUsageSummariesOperations BackupUsageSummaries { get; } /// - /// Gets the IBackupProtectionContainersOperations + /// Gets the IOperationOperations /// - IBackupProtectionContainersOperations BackupProtectionContainers { get; } + IOperationOperations Operation { get; } /// - /// Gets the IDeletedProtectionContainersOperations + /// Gets the IValidateOperationResultsOperations /// - IDeletedProtectionContainersOperations DeletedProtectionContainers { get; } + IValidateOperationResultsOperations ValidateOperationResults { get; } /// - /// Gets the ISecurityPiNsOperations + /// Gets the IValidateOperationStatusesOperations /// - ISecurityPiNsOperations SecurityPiNs { get; } + IValidateOperationStatusesOperations ValidateOperationStatuses { get; } /// - /// Gets the IRecoveryPointsRecommendedForMoveOperations + /// Gets the IBackupResourceVaultConfigsOperations /// - IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; } + IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; } /// - /// Gets the IResourceGuardProxiesOperations + /// Gets the IBackupResourceStorageConfigsNonCrrOperations /// - IResourceGuardProxiesOperations ResourceGuardProxies { get; } + IBackupResourceStorageConfigsNonCrrOperations BackupResourceStorageConfigsNonCrr { get; } /// - /// Gets the IResourceGuardProxyOperations + /// Gets the IBmsPrepareDataMoveOperationResultOperations /// - IResourceGuardProxyOperations ResourceGuardProxy { get; } + IBmsPrepareDataMoveOperationResultOperations BmsPrepareDataMoveOperationResult { get; } /// - /// Gets the IFetchTieringCostOperations + /// Gets the IPrivateEndpointConnectionOperations /// - IFetchTieringCostOperations FetchTieringCost { get; } + IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; } /// - /// Gets the IGetTieringCostOperationResultOperations + /// Gets the IPrivateEndpointOperations /// - IGetTieringCostOperationResultOperations GetTieringCostOperationResult { get; } + IPrivateEndpointOperations PrivateEndpoint { get; } /// - /// Gets the ITieringCostOperationStatusOperations + /// Move recovery point from one datastore to another store. /// - ITieringCostOperationStatusOperations TieringCostOperationStatus { get; } + /// + /// Move recovery point from one datastore to another store. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// The headers that will be added to request. + /// + /// + /// The cancellation token. + /// + /// + /// Thrown when the operation returned an invalid status code + /// + System.Threading.Tasks.Task> MoveRecoveryPointWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Fetches operation status for data move operation on vault + /// Fetches Operation Result for Prepare Data Move /// /// - /// Fetches operation status for data move operation on vault + /// Fetches Operation Result for Prepare Data Move /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// The headers that will be added to request. @@ -356,7 +398,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Prepares source vault for Data Move operation @@ -364,12 +406,11 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Prepare data move request @@ -383,7 +424,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BMSPrepareDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Triggers Data Move Operation on target vault @@ -391,12 +432,11 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Trigger data move request @@ -410,7 +450,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BMSTriggerDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Move recovery point from one datastore to another store. @@ -418,24 +458,23 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// - /// + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// Move Resource Across Tiers Request @@ -449,7 +488,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginMoveRecoveryPointWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Prepares source vault for Data Move operation @@ -457,12 +496,11 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Prepare data move request @@ -476,7 +514,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginBMSPrepareDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Triggers Data Move Operation on target vault @@ -484,54 +522,14 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// 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. + /// The name of the resource group. The name is case insensitive. /// - /// - /// Trigger data move request - /// - /// - /// The headers that will be added to request. - /// - /// - /// The cancellation token. - /// - /// - /// Thrown when the operation returned an invalid status code - /// - System.Threading.Tasks.Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); - - /// - /// Move recovery point from one datastore to another store. - /// - /// - /// 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. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// The name of the VaultResource /// /// - /// Move Resource Across Tiers Request + /// Trigger data move request /// /// /// The headers that will be added to request. @@ -542,7 +540,7 @@ public partial interface IRecoveryServicesBackupClient : System.IDisposable /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginBMSTriggerDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxiesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxiesOperations.cs index 47c0ca1333a3..a2014dc07bc7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxiesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxiesOperations.cs @@ -19,12 +19,11 @@ public partial interface IResourceGuardProxiesOperations /// /// List the ResourceGuardProxies under vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The headers that will be added to request. @@ -38,7 +37,7 @@ public partial interface IResourceGuardProxiesOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// List the ResourceGuardProxies under vault diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxyOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxyOperations.cs index 934932dcc54b..f137490ebe10 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxyOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IResourceGuardProxyOperations.cs @@ -21,12 +21,11 @@ public partial interface IResourceGuardProxyOperations /// Returns ResourceGuardProxy under vault and with the name referenced in /// request /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -43,22 +42,21 @@ public partial interface IResourceGuardProxyOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// - /// Add or Update ResourceGuardProxy under vault Secures vault critical - /// operations + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations /// /// - /// Add or Update ResourceGuardProxy under vault Secures vault critical - /// operations + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -78,7 +76,7 @@ public partial interface IResourceGuardProxyOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Delete ResourceGuardProxy under vault @@ -86,12 +84,11 @@ public partial interface IResourceGuardProxyOperations /// /// Delete ResourceGuardProxy under vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -105,7 +102,7 @@ public partial interface IResourceGuardProxyOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Secures delete ResourceGuardProxy operations. @@ -113,12 +110,11 @@ public partial interface IResourceGuardProxyOperations /// /// Secures delete ResourceGuardProxy operations. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -141,7 +137,7 @@ public partial interface IResourceGuardProxyOperations /// /// Thrown when unable to deserialize the response /// - System.Threading.Tasks.Task> UnlockDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> UnlockDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRestoresOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRestoresOperations.cs index b39194a5f55b..975158d6cf3f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRestoresOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IRestoresOperations.cs @@ -15,32 +15,31 @@ public partial interface IRestoresOperations { /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. /// /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -57,36 +56,35 @@ public partial interface IRestoresOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// To know the status of this API call, use + /// GetProtectedItemOperationResult API. /// /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -103,7 +101,7 @@ public partial interface IRestoresOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginTriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ISecurityPINsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ISecurityPINsOperations.cs index 0517f0d86da0..b3b50d2b5bc7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ISecurityPINsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ISecurityPINsOperations.cs @@ -23,8 +23,7 @@ public partial interface ISecurityPiNsOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ITieringCostOperationStatusOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ITieringCostOperationStatusOperations.cs index eb174dc6b412..ee0cdca16510 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ITieringCostOperationStatusOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ITieringCostOperationStatusOperations.cs @@ -20,8 +20,7 @@ public partial interface ITieringCostOperationStatusOperations /// Gets the status of async operations of tiering cost /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationOperations.cs index 43733b629426..943e53f9938f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationOperations.cs @@ -27,8 +27,7 @@ public partial interface IValidateOperationOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. @@ -45,7 +44,7 @@ public partial interface IValidateOperationOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); /// /// Validate operation for specified backed up item in the form of an @@ -61,8 +60,7 @@ public partial interface IValidateOperationOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. @@ -79,7 +77,7 @@ public partial interface IValidateOperationOperations /// /// Thrown when the operation returned an invalid status code /// - System.Threading.Tasks.Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); + System.Threading.Tasks.Task> BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)); } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationResultsOperations.cs index 5de6dc16e09c..969d5001102c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationResultsOperations.cs @@ -23,8 +23,7 @@ public partial interface IValidateOperationResultsOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation whose result needs to be diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationStatusesOperations.cs index b73826906b15..f728b7a863ae 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/IValidateOperationStatusesOperations.cs @@ -15,24 +15,25 @@ public partial interface IValidateOperationStatusesOperations { /// /// Fetches the status of a triggered validate operation. The status can be in - /// progress, completed or failed. You can refer to the OperationStatus enum - /// for all the possible states of the operation. If operation has completed, - /// this method returns the list of errors obtained while validating the - /// operation. + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. /// /// /// Fetches the status of a triggered validate operation. The status can be in - /// progress, completed or failed. You can refer to the OperationStatus enum - /// for all the possible states of the operation. If operation has completed, - /// this method returns the list of errors obtained while validating the - /// operation. + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID represents the operation whose status needs to be fetched. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperations.cs index ac5c29cc0b18..48154bef0dee 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperations.cs @@ -40,29 +40,28 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl /// /// Provisions a script which invokes an iSCSI connection to the backup data. - /// Executing this script opens a file explorer displaying all the recoverable - /// files and folders. This is an asynchronous operation. To know the status of + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of /// provisioning, call GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// provisioned for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// resource ILR request @@ -85,7 +84,7 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task ProvisionWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ProvisionWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -101,19 +100,35 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -143,8 +158,8 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -159,9 +174,9 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -238,14 +253,13 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -255,10 +269,6 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -292,28 +302,27 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl } /// /// Revokes an iSCSI connection which can be used to download a script. - /// Executing this script opens a file explorer displaying all recoverable - /// files and folders. This is an asynchronous operation. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// revoked for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// Headers that will be added to request. @@ -333,7 +342,7 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task RevokeWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task RevokeWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -344,19 +353,35 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -386,8 +411,8 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -401,9 +426,9 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -474,14 +499,13 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -491,10 +515,6 @@ internal ItemLevelRecoveryConnectionsOperations (RecoveryServicesBackupClient cl } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs index c86dadf497f1..bf98eb76ef7a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ItemLevelRecoveryConnectionsOperationsExtensions.cs @@ -14,141 +14,137 @@ public static partial class ItemLevelRecoveryConnectionsOperationsExtensions { /// /// Provisions a script which invokes an iSCSI connection to the backup data. - /// Executing this script opens a file explorer displaying all the recoverable - /// files and folders. This is an asynchronous operation. To know the status of + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of /// provisioning, call 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// provisioned for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// - public static void Provision(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters) + public static void Provision(this IItemLevelRecoveryConnectionsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters) { - ((IItemLevelRecoveryConnectionsOperations)operations).ProvisionAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + ((IItemLevelRecoveryConnectionsOperations)operations).ProvisionAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); } /// /// Provisions a script which invokes an iSCSI connection to the backup data. - /// Executing this script opens a file explorer displaying all the recoverable - /// files and folders. This is an asynchronous operation. To know the status of + /// Executing this script opens a file + /// explorer displaying all the recoverable files and folders. This is an + /// asynchronous operation. To know the status of /// provisioning, call 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// provisioned for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ProvisionAsync(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task ProvisionAsync(this IItemLevelRecoveryConnectionsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, ILRRequestResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.ProvisionWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ProvisionWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// /// Revokes an iSCSI connection which can be used to download a script. - /// Executing this script opens a file explorer displaying all recoverable - /// files and folders. This is an asynchronous operation. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// revoked for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// - public static void Revoke(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) + public static void Revoke(this IItemLevelRecoveryConnectionsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) { - ((IItemLevelRecoveryConnectionsOperations)operations).RevokeAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); + ((IItemLevelRecoveryConnectionsOperations)operations).RevokeAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); } /// /// Revokes an iSCSI connection which can be used to download a script. - /// Executing this script opens a file explorer displaying all recoverable - /// files and folders. This is an asynchronous operation. + /// Executing this script opens a file explorer + /// displaying all recoverable files and folders. This is an asynchronous + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose files/folders are to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents backed up data. iSCSI connection will be - /// revoked for this backed up data. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RevokeAsync(this IItemLevelRecoveryConnectionsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RevokeAsync(this IItemLevelRecoveryConnectionsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.RevokeWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.RevokeWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperations.cs index 062742bc7fb5..e08781ccecb8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperations.cs @@ -40,17 +40,17 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) /// /// Cancels a job. This is an asynchronous operation. To know the status of the - /// cancellation, call GetCancelOperationResult API. + /// cancellation, call + /// GetCancelOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the job to cancel. + /// Name of the job whose details are to be fetched. /// /// /// Headers that will be added to request. @@ -70,7 +70,7 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -81,19 +81,35 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (jobName == null) @@ -108,8 +124,8 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("jobName", jobName); @@ -120,9 +136,9 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -190,14 +206,13 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -207,10 +222,6 @@ internal JobCancellationsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperationsExtensions.cs index 182803f4ac73..7d1cb987cc19 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobCancellationsOperationsExtensions.cs @@ -14,49 +14,49 @@ public static partial class JobCancellationsOperationsExtensions { /// /// Cancels a job. This is an asynchronous operation. To know the status of the - /// cancellation, call GetCancelOperationResult API. + /// cancellation, call + /// GetCancelOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the job to cancel. + /// Name of the job whose details are to be fetched. /// - public static void Trigger(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName) + public static void Trigger(this IJobCancellationsOperations operations, string resourceGroupName, string vaultName, string jobName) { - ((IJobCancellationsOperations)operations).TriggerAsync(vaultName, resourceGroupName, jobName).GetAwaiter().GetResult(); + ((IJobCancellationsOperations)operations).TriggerAsync(resourceGroupName, vaultName, jobName).GetAwaiter().GetResult(); } /// /// Cancels a job. This is an asynchronous operation. To know the status of the - /// cancellation, call GetCancelOperationResult API. + /// cancellation, call + /// GetCancelOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the job to cancel. + /// Name of the job whose details are to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TriggerAsync(this IJobCancellationsOperations operations, string vaultName, string resourceGroupName, string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task TriggerAsync(this IJobCancellationsOperations operations, string resourceGroupName, string vaultName, string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.TriggerWithHttpMessagesAsync(resourceGroupName, vaultName, jobName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperations.cs index 4150fe177771..1ea9b2fa8aad 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperations.cs @@ -41,12 +41,11 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) /// /// Gets extended information associated with the job. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Name of the job whose details are to be fetched. @@ -72,7 +71,7 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -83,19 +82,35 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (jobName == null) @@ -110,8 +125,8 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("jobName", jobName); @@ -122,9 +137,9 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -192,14 +207,13 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -209,10 +223,6 @@ internal JobDetailsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperationsExtensions.cs index 3a9b57e3db52..d523f26cd16a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobDetailsOperationsExtensions.cs @@ -18,19 +18,18 @@ public static partial class JobDetailsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Name of the job whose details are to be fetched. /// - public static JobResource Get(this IJobDetailsOperations operations, string vaultName, string resourceGroupName, string jobName) + public static JobResource Get(this IJobDetailsOperations operations, string resourceGroupName, string vaultName, string jobName) { - return ((IJobDetailsOperations)operations).GetAsync(vaultName, resourceGroupName, jobName).GetAwaiter().GetResult(); + return ((IJobDetailsOperations)operations).GetAsync(resourceGroupName, vaultName, jobName).GetAwaiter().GetResult(); } /// @@ -39,12 +38,11 @@ public static JobResource Get(this IJobDetailsOperations operations, string vaul /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Name of the job whose details are to be fetched. @@ -52,9 +50,9 @@ public static JobResource Get(this IJobDetailsOperations operations, string vaul /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IJobDetailsOperations operations, string vaultName, string resourceGroupName, string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IJobDetailsOperations operations, string resourceGroupName, string vaultName, string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperations.cs index 7560a1a0b10b..3b1c8a2f8368 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperations.cs @@ -41,18 +41,17 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) /// /// Fetches the result of any operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Job name whose operation result has to be fetched. + /// The name of the JobResource /// /// - /// OperationID which represents the operation whose result has to be fetched. + /// The name of the JobResource /// /// /// Headers that will be added to request. @@ -72,7 +71,7 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string jobName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string jobName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -83,19 +82,35 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (jobName == null) @@ -115,8 +130,8 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("jobName", jobName); tracingParameters.Add("operationId", operationId); @@ -128,9 +143,9 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{jobName}", System.Uri.EscapeDataString(jobName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -199,14 +214,13 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -216,10 +230,6 @@ internal JobOperationResultsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperationsExtensions.cs index 60a2f2a8a141..0a31083653a3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobOperationResultsOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class JobOperationResultsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Job name whose operation result has to be fetched. + /// The name of the JobResource /// /// - /// OperationID which represents the operation whose result has to be fetched. + /// The name of the JobResource /// - public static void Get(this IJobOperationResultsOperations operations, string vaultName, string resourceGroupName, string jobName, string operationId) + public static void Get(this IJobOperationResultsOperations operations, string resourceGroupName, string vaultName, string jobName, string operationId) { - ((IJobOperationResultsOperations)operations).GetAsync(vaultName, resourceGroupName, jobName, operationId).GetAwaiter().GetResult(); + ((IJobOperationResultsOperations)operations).GetAsync(resourceGroupName, vaultName, jobName, operationId).GetAwaiter().GetResult(); } /// @@ -42,25 +41,24 @@ public static void Get(this IJobOperationResultsOperations operations, string va /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Job name whose operation result has to be fetched. + /// The name of the JobResource /// /// - /// OperationID which represents the operation whose result has to be fetched. + /// The name of the JobResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IJobOperationResultsOperations operations, string vaultName, string resourceGroupName, string jobName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IJobOperationResultsOperations operations, string resourceGroupName, string vaultName, string jobName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, jobName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, jobName, operationId, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperations.cs index c19aa51b5eca..cc701b88e72b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperations.cs @@ -42,15 +42,14 @@ internal JobsOperations (RecoveryServicesBackupClient client) /// Triggers export of jobs specified by filters and returns an OperationID to /// track. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// Headers that will be added to request. @@ -70,13 +69,12 @@ internal JobsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task ExportWithHttpMessagesAsync(string vaultName, string resourceGroupName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -91,11 +89,28 @@ internal JobsOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; @@ -104,9 +119,9 @@ internal JobsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -121,18 +136,14 @@ internal JobsOperations (RecoveryServicesBackupClient client) _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _jobQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_jobQueryObject)) - { - _queryParameters.Add(_jobQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -193,14 +204,13 @@ internal JobsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -210,10 +220,6 @@ internal JobsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperationsExtensions.cs index b00e419e4d96..58372b812786 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/JobsOperationsExtensions.cs @@ -19,19 +19,18 @@ public static partial class JobsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// - public static void Export(this IJobsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static void Export(this IJobsOperations operations, string vaultName, string resourceGroupName, string filter = default(string)) { - ((IJobsOperations)operations).ExportAsync(vaultName, resourceGroupName, odataQuery).GetAwaiter().GetResult(); + ((IJobsOperations)operations).ExportAsync(vaultName, resourceGroupName, filter).GetAwaiter().GetResult(); } /// @@ -41,22 +40,21 @@ public static partial class JobsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// OData filter options. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task ExportAsync(this IJobsOperations operations, string vaultName, string resourceGroupName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task ExportAsync(this IJobsOperations operations, string vaultName, string resourceGroupName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.ExportWithHttpMessagesAsync(vaultName, resourceGroupName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.ExportWithHttpMessagesAsync(vaultName, resourceGroupName, filter, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AccessType.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AccessType.cs new file mode 100644 index 000000000000..47a9ce5473cc --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AccessType.cs @@ -0,0 +1,25 @@ +// 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 AccessType. + /// + + + public static class AccessType + { + /// + /// Access using storage account keys. + /// + public const string KeyBased = "KeyBased"; + /// + /// Access using managed identity. + /// + public const string IdentityBased = "IdentityBased"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureBackupServerContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureBackupServerContainer.cs index 6f9bd03ccd99..ff49e168bef8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureBackupServerContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureBackupServerContainer.cs @@ -42,6 +42,9 @@ public AzureBackupServerContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Specifies whether the container is re-registrable. /// @@ -65,9 +68,9 @@ public AzureBackupServerContainer() /// Extended Info of the container. /// - public AzureBackupServerContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), System.Collections.Generic.IList dpmServers = default(System.Collections.Generic.IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + public AzureBackupServerContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), System.Collections.Generic.IList dpmServers = default(System.Collections.Generic.IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, canReRegister, containerId, protectedItemCount, dpmAgentVersion, dpmServers, upgradeAvailable, protectionStatus, extendedInfo) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation, canReRegister, containerId, protectedItemCount, dpmAgentVersion, dpmServers, upgradeAvailable, protectionStatus, extendedInfo) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRecoveryPoint.cs index 0ba7185d06ee..701319ee5c38 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRecoveryPoint.cs @@ -25,6 +25,13 @@ public AzureFileShareRecoveryPoint() /// Initializes a new instance of the AzureFileShareRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// Type of the backup copy. Specifies whether it is a crash consistent backup /// or app consistent. /// @@ -43,8 +50,9 @@ public AzureFileShareRecoveryPoint() /// Recovery point tier information. /// - public AzureFileShareRecoveryPoint(string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string fileShareSnapshotUri = default(string), int? recoveryPointSizeInGb = default(int?), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList)) + public AzureFileShareRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string fileShareSnapshotUri = default(string), int? recoveryPointSizeInGb = default(int?), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList)) + : base(threatStatus, threatInfo) { this.RecoveryPointType = recoveryPointType; this.RecoveryPointTime = recoveryPointTime; @@ -97,5 +105,21 @@ public AzureFileShareRecoveryPoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "recoveryPointTierDetails")] public System.Collections.Generic.IList RecoveryPointTierDetails {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.RecoveryPointProperties != null) + { + this.RecoveryPointProperties.Validate(); + } + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRestoreRequest.cs index 0333c1d02042..815c4d668035 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileShareRestoreRequest.cs @@ -48,7 +48,10 @@ public AzureFileShareRestoreRequest() /// Target File Share Details /// - public AzureFileShareRestoreRequest(System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string recoveryType = default(string), string sourceResourceId = default(string), string copyOptions = default(string), string restoreRequestType = default(string), System.Collections.Generic.IList restoreFileSpecs = default(System.Collections.Generic.IList), TargetAFSRestoreInfo targetDetails = default(TargetAFSRestoreInfo)) + + /// Managed identity information required to access the storage account. + /// + public AzureFileShareRestoreRequest(System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string recoveryType = default(string), string sourceResourceId = default(string), string copyOptions = default(string), string restoreRequestType = default(string), System.Collections.Generic.IList restoreFileSpecs = default(System.Collections.Generic.IList), TargetAFSRestoreInfo targetDetails = default(TargetAFSRestoreInfo), IdentityInfo identityInfo = default(IdentityInfo)) : base(resourceGuardOperationRequests) { @@ -58,6 +61,7 @@ public AzureFileShareRestoreRequest() this.RestoreRequestType = restoreRequestType; this.RestoreFileSpecs = restoreFileSpecs; this.TargetDetails = targetDetails; + this.IdentityInfo = identityInfo; CustomInit(); } @@ -103,5 +107,12 @@ public AzureFileShareRestoreRequest() /// [Newtonsoft.Json.JsonProperty(PropertyName = "targetDetails")] public TargetAFSRestoreInfo TargetDetails {get; set; } + + /// + /// Gets or sets managed identity information required to access the storage + /// account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identityInfo")] + public IdentityInfo IdentityInfo {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileshareProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileshareProtectedItem.cs index 583c6c6f0d4d..78aa000d7c8c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileshareProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureFileshareProtectedItem.cs @@ -84,9 +84,15 @@ public AzureFileshareProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the fileshare represented by this backup item. /// @@ -109,9 +115,9 @@ public AzureFileshareProtectedItem() /// Additional information with this backup item. /// - public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) + public AzureFileshareProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), AzureFileshareProtectedItemExtendedInfo extendedInfo = default(AzureFileshareProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.ProtectionStatus = protectionStatus; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMContainer.cs index f5bdebada944..40a841c0921b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMContainer.cs @@ -43,6 +43,9 @@ public AzureIaaSClassicComputeVMContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure /// IaaS VM container. /// @@ -53,9 +56,9 @@ public AzureIaaSClassicComputeVMContainer() /// Resource group name of Recovery Services Vault. /// - public AzureIaaSClassicComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + public AzureIaaSClassicComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs index 24b85ac54314..d3ce24bc2f3e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSClassicComputeVMProtectedItem.cs @@ -84,9 +84,15 @@ public AzureIaaSClassicComputeVMProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the VM represented by this backup item. /// @@ -128,9 +134,9 @@ public AzureIaaSClassicComputeVMProtectedItem() /// Type of the policy used for protection /// - public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) + public AzureIaaSClassicComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties, policyType) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties, policyType) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMContainer.cs index 88fd3edf4842..c6aed5d47b25 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMContainer.cs @@ -43,6 +43,9 @@ public AzureIaaSComputeVMContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure /// IaaS VM container. /// @@ -53,9 +56,9 @@ public AzureIaaSComputeVMContainer() /// Resource group name of Recovery Services Vault. /// - public AzureIaaSComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + public AzureIaaSComputeVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, virtualMachineId, virtualMachineVersion, resourceGroup) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation, virtualMachineId, virtualMachineVersion, resourceGroup) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMProtectedItem.cs index f95a6e77856f..a4a00b80b950 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSComputeVMProtectedItem.cs @@ -85,9 +85,15 @@ public AzureIaaSComputeVMProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the VM represented by this backup item. /// @@ -129,9 +135,9 @@ public AzureIaaSComputeVMProtectedItem() /// Type of the policy used for protection /// - public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) + public AzureIaaSComputeVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties, policyType) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, virtualMachineId, protectionStatus, protectionState, healthStatus, healthDetails, kpisHealths, lastBackupStatus, lastBackupTime, protectedItemDataId, extendedInfo, extendedProperties, policyType) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMJobTaskDetails.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMJobTaskDetails.cs index 8c932871a294..e0f0da1a8185 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMJobTaskDetails.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMJobTaskDetails.cs @@ -45,7 +45,8 @@ public AzureIaaSVMJobTaskDetails() /// Progress of the task. /// - /// Details about execution of the task. eg: number of bytes transferred etc + /// Details about execution of the task. + /// eg: number of bytes transferred etc /// public AzureIaaSVMJobTaskDetails(string taskId = default(string), System.DateTime? startTime = default(System.DateTime?), System.DateTime? endTime = default(System.DateTime?), string instanceId = default(string), System.TimeSpan? duration = default(System.TimeSpan?), string status = default(string), double? progressPercentage = default(double?), string taskExecutionDetails = default(string)) @@ -110,8 +111,8 @@ public AzureIaaSVMJobTaskDetails() public double? ProgressPercentage {get; set; } /// - /// Gets or sets details about execution of the task. eg: number of bytes - /// transferred etc + /// Gets or sets details about execution of the task. + /// eg: number of bytes transferred etc /// [Newtonsoft.Json.JsonProperty(PropertyName = "taskExecutionDetails")] public string TaskExecutionDetails {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectedItem.cs index 87e50a6123f8..a8b188e7f9e6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectedItem.cs @@ -84,9 +84,15 @@ public AzureIaaSVMProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the VM represented by this backup item. /// @@ -128,9 +134,9 @@ public AzureIaaSVMProtectedItem() /// Type of the policy used for protection /// - public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) + public AzureIaaSVMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string virtualMachineId = default(string), string protectionStatus = default(string), string protectionState = default(string), string healthStatus = default(string), System.Collections.Generic.IList healthDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectedItemDataId = default(string), AzureIaaSVMProtectedItemExtendedInfo extendedInfo = default(AzureIaaSVMProtectedItemExtendedInfo), ExtendedProperties extendedProperties = default(ExtendedProperties), string policyType = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.VirtualMachineId = virtualMachineId; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectionPolicy.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectionPolicy.cs index 76954207027b..1ab9d46d8790 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectionPolicy.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureIaaSVMProtectionPolicy.cs @@ -40,9 +40,9 @@ public AzureIaaSVMProtectionPolicy() /// Retention policy with the details on backup copy retention ranges. /// - /// Tiering policy to automatically move RPs to another tier Key is Target - /// Tier, defined in RecoveryPointTierType enum. Tiering policy specifies the - /// criteria to move RP to the target tier. + /// Tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. /// /// Instant RP retention policy range in days @@ -98,9 +98,9 @@ public AzureIaaSVMProtectionPolicy() public RetentionPolicy RetentionPolicy {get; set; } /// - /// Gets or sets tiering policy to automatically move RPs to another tier Key - /// is Target Tier, defined in RecoveryPointTierType enum. Tiering policy - /// specifies the criteria to move RP to the target tier. + /// Gets or sets tiering policy to automatically move RPs to another tier + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. /// [Newtonsoft.Json.JsonProperty(PropertyName = "tieringPolicy")] public System.Collections.Generic.IDictionary TieringPolicy {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs index 025ec466c063..ccbd08a410cf 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSQLAGWorkloadContainerProtectionContainer.cs @@ -42,6 +42,9 @@ public AzureSqlagWorkloadContainerProtectionContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// ARM ID of the virtual machine represented by this Azure Workload Container /// @@ -59,9 +62,9 @@ public AzureSqlagWorkloadContainerProtectionContainer() /// Re-Do Operation /// Possible values include: 'Invalid', 'Register', 'Reregister', 'Rehydrate' - public AzureSqlagWorkloadContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + public AzureSqlagWorkloadContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlContainer.cs index 5c8b5644282d..1b0566f69de4 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlContainer.cs @@ -41,9 +41,12 @@ public AzureSqlContainer() /// Type of the protectable object associated with this container /// - public AzureSqlContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + /// Source location of the container + /// + public AzureSqlContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string)) + + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlProtectedItem.cs index 46ae4173f019..3a8e9d2a1b0e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureSqlProtectedItem.cs @@ -84,9 +84,15 @@ public AzureSqlProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Internal ID of a backup item. Used by Azure SQL Backup engine to contact /// Recovery Services. /// @@ -98,9 +104,9 @@ public AzureSqlProtectedItem() /// Additional information for this backup item. /// - public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) + public AzureSqlProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string protectedItemDataId = default(string), string protectionState = default(string), AzureSqlProtectedItemExtendedInfo extendedInfo = default(AzureSqlProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.ProtectedItemDataId = protectedItemDataId; this.ProtectionState = protectionState; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureStorageContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureStorageContainer.cs index dc3ec91bb801..8fb296ea8fe0 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureStorageContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureStorageContainer.cs @@ -42,6 +42,9 @@ public AzureStorageContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Fully qualified ARM url. /// @@ -59,9 +62,17 @@ public AzureStorageContainer() /// Re-Do Operation /// Possible values include: 'Invalid', 'Register', 'Reregister', 'Rehydrate' - public AzureStorageContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), string storageAccountVersion = default(string), string resourceGroup = default(string), long? protectedItemCount = default(long?), string acquireStorageAccountLock = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + /// Whether access to the storage account is key-based or identity-based. + /// When `IdentityBased`, `identityInfo` must be provided to identify the + /// managed identity used to access the storage account. + /// Possible values include: 'KeyBased', 'IdentityBased' + + /// Managed identity information required to access the storage account. + /// + public AzureStorageContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string sourceResourceId = default(string), string storageAccountVersion = default(string), string resourceGroup = default(string), long? protectedItemCount = default(long?), string acquireStorageAccountLock = default(string), string operationType = default(string), string accessType = default(string), IdentityInfo identityInfo = default(IdentityInfo)) + + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.SourceResourceId = sourceResourceId; this.StorageAccountVersion = storageAccountVersion; @@ -69,6 +80,8 @@ public AzureStorageContainer() this.ProtectedItemCount = protectedItemCount; this.AcquireStorageAccountLock = acquireStorageAccountLock; this.OperationType = operationType; + this.AccessType = accessType; + this.IdentityInfo = identityInfo; CustomInit(); } @@ -114,5 +127,21 @@ public AzureStorageContainer() /// [Newtonsoft.Json.JsonProperty(PropertyName = "operationType")] public string OperationType {get; set; } + + /// + /// Gets or sets whether access to the storage account is key-based or + /// identity-based. + /// When `IdentityBased`, `identityInfo` must be provided to identify the + /// managed identity used to access the storage account. Possible values include: 'KeyBased', 'IdentityBased' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "accessType")] + public string AccessType {get; set; } + + /// + /// Gets or sets managed identity information required to access the storage + /// account. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "identityInfo")] + public IdentityInfo IdentityInfo {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVMAppContainerProtectionContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVMAppContainerProtectionContainer.cs index 4db836c7fc79..fb5638a32b93 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVMAppContainerProtectionContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVMAppContainerProtectionContainer.cs @@ -42,6 +42,9 @@ public AzureVMAppContainerProtectionContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// ARM ID of the virtual machine represented by this Azure Workload Container /// @@ -59,9 +62,9 @@ public AzureVMAppContainerProtectionContainer() /// Re-Do Operation /// Possible values include: 'Invalid', 'Register', 'Reregister', 'Rehydrate' - public AzureVMAppContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + public AzureVMAppContainerProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation, sourceResourceId, lastUpdatedTime, extendedInfo, workloadType, operationType) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectableItem.cs index 8560b7917651..880b2c76ddb7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG @@ -96,8 +97,9 @@ public AzureVmWorkloadProtectableItem() /// /// Gets or sets parent Unique Name is added to provide the service formatted - /// URI Name of the Parent Only Applicable for data bases where the parent - /// would be either Instance or a SQL AG. + /// URI Name of the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// [Newtonsoft.Json.JsonProperty(PropertyName = "parentUniqueName")] public string ParentUniqueName {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectedItem.cs index de4a5e4a6471..5a6dd20cd721 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadProtectedItem.cs @@ -84,9 +84,15 @@ public AzureVmWorkloadProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the DB represented by this backup item. /// @@ -133,9 +139,9 @@ public AzureVmWorkloadProtectedItem() /// List of the nodes in case of distributed container. /// - public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) + public AzureVmWorkloadProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetailAutoGenerated lastBackupErrorDetail = default(ErrorDetailAutoGenerated), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.ServerName = serverName; @@ -214,7 +220,7 @@ public AzureVmWorkloadProtectedItem() /// Gets or sets error details in last backup /// [Newtonsoft.Json.JsonProperty(PropertyName = "lastBackupErrorDetail")] - public ErrorDetail LastBackupErrorDetail {get; set; } + public ErrorDetailAutoGenerated LastBackupErrorDetail {get; set; } /// /// Gets or sets data ID of the protected item. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectableItem.cs index 993beacc65d9..f05cbaf53ece 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSAPAseDatabaseProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs index a78c453762be..89cb6728bf95 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseDatabaseProtectedItem.cs @@ -84,9 +84,15 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the DB represented by this backup item. /// @@ -133,9 +139,9 @@ public AzureVmWorkloadSAPAseDatabaseProtectedItem() /// List of the nodes in case of distributed container. /// - public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) + public AzureVmWorkloadSAPAseDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetailAutoGenerated lastBackupErrorDetail = default(ErrorDetailAutoGenerated), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs index 4c5e9d5c53e9..0e9ff9bcdbac 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPAseSystemProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSAPAseSystemProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstance.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstance.cs index f61d8bee0f4d..e07e7baf60d7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstance.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstance.cs @@ -43,8 +43,9 @@ public AzureVmWorkloadSAPHanaDBInstance() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstanceProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstanceProtectedItem.cs index c21c3afb1428..8be8c20a587a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstanceProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDBInstanceProtectedItem.cs @@ -84,9 +84,15 @@ public AzureVmWorkloadSAPHanaDBInstanceProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the DB represented by this backup item. /// @@ -133,9 +139,9 @@ public AzureVmWorkloadSAPHanaDBInstanceProtectedItem() /// List of the nodes in case of distributed container. /// - public AzureVmWorkloadSAPHanaDBInstanceProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) + public AzureVmWorkloadSAPHanaDBInstanceProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetailAutoGenerated lastBackupErrorDetail = default(ErrorDetailAutoGenerated), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs index 440ff7b6311d..0504a8cf9377 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSAPHanaDatabaseProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs index 1b8a576e263f..9281d5824c04 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaDatabaseProtectedItem.cs @@ -84,9 +84,15 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the DB represented by this backup item. /// @@ -133,9 +139,9 @@ public AzureVmWorkloadSAPHanaDatabaseProtectedItem() /// List of the nodes in case of distributed container. /// - public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) + public AzureVmWorkloadSAPHanaDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetailAutoGenerated lastBackupErrorDetail = default(ErrorDetailAutoGenerated), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaHSRProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaHSRProtectableItem.cs index 00bfc7876e0c..a1eeba38d794 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaHSRProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaHSRProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSAPHanaHSRProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs index 338f0dc4194b..3c78a69e0fc1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSAPHanaSystemProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSAPHanaSystemProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs index c46060542af8..19e9e46a404c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLAvailabilityGroupProtectableItem.cs @@ -43,8 +43,9 @@ public AzureVmWorkloadSQLAvailabilityGroupProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs index becfb4050fae..4fcc24b0a7d6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSQLDatabaseProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs index dcb043a6a2ce..e3fe357c6887 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLDatabaseProtectedItem.cs @@ -84,9 +84,15 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the DB represented by this backup item. /// @@ -133,9 +139,9 @@ public AzureVmWorkloadSQLDatabaseProtectedItem() /// List of the nodes in case of distributed container. /// - public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetail lastBackupErrorDetail = default(ErrorDetail), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) + public AzureVmWorkloadSQLDatabaseProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string serverName = default(string), string parentName = default(string), string parentType = default(string), string protectionStatus = default(string), string protectionState = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), ErrorDetailAutoGenerated lastBackupErrorDetail = default(ErrorDetailAutoGenerated), string protectedItemDataSourceId = default(string), string protectedItemHealthStatus = default(string), AzureVmWorkloadProtectedItemExtendedInfo extendedInfo = default(AzureVmWorkloadProtectedItemExtendedInfo), System.Collections.Generic.IDictionary kpisHealths = default(System.Collections.Generic.IDictionary), System.Collections.Generic.IList nodesList = default(System.Collections.Generic.IList)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo, friendlyName, serverName, parentName, parentType, protectionStatus, protectionState, lastBackupStatus, lastBackupTime, lastBackupErrorDetail, protectedItemDataSourceId, protectedItemHealthStatus, extendedInfo, kpisHealths, nodesList) { CustomInit(); } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs index 50e037cfd4eb..fdf7a3a0a8fe 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureVmWorkloadSQLInstanceProtectableItem.cs @@ -42,8 +42,9 @@ public AzureVmWorkloadSQLInstanceProtectableItem() /// /// Parent Unique Name is added to provide the service formatted URI Name of - /// the Parent Only Applicable for data bases where the parent would be either - /// Instance or a SQL AG. + /// the Parent + /// Only Applicable for data bases where the parent would be either Instance or + /// a SQL AG. /// /// Host/Cluster Name for instance or AG diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadContainer.cs index d7f4aaa4ed64..d028cd6cffce 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadContainer.cs @@ -43,6 +43,9 @@ public AzureWorkloadContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// ARM ID of the virtual machine represented by this Azure Workload Container /// @@ -60,9 +63,9 @@ public AzureWorkloadContainer() /// Re-Do Operation /// Possible values include: 'Invalid', 'Register', 'Reregister', 'Rehydrate' - public AzureWorkloadContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) + public AzureWorkloadContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string sourceResourceId = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), AzureWorkloadContainerExtendedInfo extendedInfo = default(AzureWorkloadContainerExtendedInfo), string workloadType = default(string), string operationType = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.SourceResourceId = sourceResourceId; this.LastUpdatedTime = lastUpdatedTime; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs index 6e5d0b19c35b..d8916203df1e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRecoveryPoint.cs @@ -25,6 +25,13 @@ public AzureWorkloadPointInTimeRecoveryPoint() /// Initializes a new instance of the AzureWorkloadPointInTimeRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -43,9 +50,9 @@ public AzureWorkloadPointInTimeRecoveryPoint() /// List of log ranges /// - public AzureWorkloadPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) + public AzureWorkloadPointInTimeRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) { this.TimeRanges = timeRanges; CustomInit(); @@ -62,5 +69,16 @@ public AzureWorkloadPointInTimeRecoveryPoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeRanges")] public System.Collections.Generic.IList TimeRanges {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs index 2c3d62a574c9..eedb9f30ed42 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadPointInTimeRestoreRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadPointInTimeRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRecoveryPoint.cs index 370051903293..84ebfc05594e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRecoveryPoint.cs @@ -26,6 +26,13 @@ public AzureWorkloadRecoveryPoint() /// Initializes a new instance of the AzureWorkloadRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -41,8 +48,9 @@ public AzureWorkloadRecoveryPoint() /// Properties of Recovery Point /// - public AzureWorkloadRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + public AzureWorkloadRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + : base(threatStatus, threatInfo) { this.RecoveryPointTimeInUtc = recoveryPointTimeInUtc; this.Type = type; @@ -87,5 +95,21 @@ public AzureWorkloadRecoveryPoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "recoveryPointProperties")] public RecoveryPointProperties RecoveryPointProperties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.RecoveryPointProperties != null) + { + this.RecoveryPointProperties.Validate(); + } + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRestoreRequest.cs index 53ed0351184c..12818bf7909b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadRestoreRequest.cs @@ -50,14 +50,16 @@ public AzureWorkloadRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// public AzureWorkloadRestoreRequest(System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string recoveryType = default(string), string sourceResourceId = default(string), System.Collections.Generic.IDictionary propertyBag = default(System.Collections.Generic.IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetResourceGroupName = default(string), UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails = default(UserAssignedManagedIdentityDetails), SnapshotRestoreParameters snapshotRestoreParameters = default(SnapshotRestoreParameters), string targetVirtualMachineId = default(string)) @@ -121,21 +123,22 @@ public AzureWorkloadRestoreRequest() public string TargetResourceGroupName {get; set; } /// - /// Gets or sets user Assigned managed identity details Currently used for - /// snapshot. + /// Gets or sets user Assigned managed identity details + /// Currently used for snapshot. /// [Newtonsoft.Json.JsonProperty(PropertyName = "userAssignedManagedIdentityDetails")] public UserAssignedManagedIdentityDetails UserAssignedManagedIdentityDetails {get; set; } /// - /// Gets or sets additional details for snapshot recovery Currently used for - /// snapshot for SAP Hana. + /// Gets or sets additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// [Newtonsoft.Json.JsonProperty(PropertyName = "snapshotRestoreParameters")] public SnapshotRestoreParameters SnapshotRestoreParameters {get; set; } /// - /// Gets or sets this is the complete ARM Id of the target VM For e.g. + /// Gets or sets this is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// [Newtonsoft.Json.JsonProperty(PropertyName = "targetVirtualMachineId")] diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRecoveryPoint.cs index 268367d3f193..7f82fd28823b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRecoveryPoint.cs @@ -25,6 +25,13 @@ public AzureWorkloadSAPAsePointInTimeRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSAPAsePointInTimeRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -43,9 +50,9 @@ public AzureWorkloadSAPAsePointInTimeRecoveryPoint() /// List of log ranges /// - public AzureWorkloadSAPAsePointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) + public AzureWorkloadSAPAsePointInTimeRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, timeRanges) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, timeRanges) { CustomInit(); } @@ -55,5 +62,15 @@ public AzureWorkloadSAPAsePointInTimeRecoveryPoint() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRestoreRequest.cs index dc555ee89c6d..931960b36f5f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAsePointInTimeRestoreRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSAPAsePointInTimeRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRecoveryPoint.cs index 1bc31c94bbc2..72a6937ad88e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRecoveryPoint.cs @@ -26,6 +26,13 @@ public AzureWorkloadSAPAseRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSAPAseRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -41,9 +48,9 @@ public AzureWorkloadSAPAseRecoveryPoint() /// Properties of Recovery Point /// - public AzureWorkloadSAPAseRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + public AzureWorkloadSAPAseRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) { CustomInit(); } @@ -53,5 +60,15 @@ public AzureWorkloadSAPAseRecoveryPoint() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRestoreRequest.cs index 9e8eea75f9e9..8ebe11ce8b27 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPAseRestoreRequest.cs @@ -50,14 +50,16 @@ public AzureWorkloadSAPAseRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// public AzureWorkloadSAPAseRestoreRequest(System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string recoveryType = default(string), string sourceResourceId = default(string), System.Collections.Generic.IDictionary propertyBag = default(System.Collections.Generic.IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetResourceGroupName = default(string), UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails = default(UserAssignedManagedIdentityDetails), SnapshotRestoreParameters snapshotRestoreParameters = default(SnapshotRestoreParameters), string targetVirtualMachineId = default(string)) diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs index ecf4c4f544c0..dfc228817385 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRecoveryPoint.cs @@ -25,6 +25,13 @@ public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSAPHanaPointInTimeRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -43,9 +50,9 @@ public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() /// List of log ranges /// - public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) + public AzureWorkloadSAPHanaPointInTimeRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, timeRanges) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, timeRanges) { CustomInit(); } @@ -55,5 +62,15 @@ public AzureWorkloadSAPHanaPointInTimeRecoveryPoint() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs index 185458ecffa4..f1a2a2418fc3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSAPHanaPointInTimeRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs index 9b42532c8bee..1750686f2bf3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSAPHanaPointInTimeRestoreWithRehydrateRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs index 0f672cf7c819..a17d2705df9a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRecoveryPoint.cs @@ -26,6 +26,13 @@ public AzureWorkloadSAPHanaRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSAPHanaRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -41,9 +48,9 @@ public AzureWorkloadSAPHanaRecoveryPoint() /// Properties of Recovery Point /// - public AzureWorkloadSAPHanaRecoveryPoint(System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + public AzureWorkloadSAPHanaRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) { CustomInit(); } @@ -53,5 +60,15 @@ public AzureWorkloadSAPHanaRecoveryPoint() /// partial void CustomInit(); + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs index ee86f2f108f6..48ae2d644ad3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreRequest.cs @@ -50,14 +50,16 @@ public AzureWorkloadSAPHanaRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// public AzureWorkloadSAPHanaRestoreRequest(System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string recoveryType = default(string), string sourceResourceId = default(string), System.Collections.Generic.IDictionary propertyBag = default(System.Collections.Generic.IDictionary), TargetRestoreInfo targetInfo = default(TargetRestoreInfo), string recoveryMode = default(string), string targetResourceGroupName = default(string), UserAssignedManagedIdentityDetails userAssignedManagedIdentityDetails = default(UserAssignedManagedIdentityDetails), SnapshotRestoreParameters snapshotRestoreParameters = default(SnapshotRestoreParameters), string targetVirtualMachineId = default(string)) diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs index 7b83b02a9f75..52951e4346fa 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSAPHanaRestoreWithRehydrateRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSAPHanaRestoreWithRehydrateRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs index 69c3ab230227..b679791c76c2 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRecoveryPoint.cs @@ -25,6 +25,13 @@ public AzureWorkloadSQLPointInTimeRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSQLPointInTimeRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -42,16 +49,17 @@ public AzureWorkloadSQLPointInTimeRecoveryPoint() /// /// 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 + /// 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), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) + public AzureWorkloadSQLPointInTimeRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo), System.Collections.Generic.IList timeRanges = default(System.Collections.Generic.IList)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, extendedInfo) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties, extendedInfo) { this.TimeRanges = timeRanges; CustomInit(); @@ -68,5 +76,16 @@ public AzureWorkloadSQLPointInTimeRecoveryPoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "timeRanges")] public System.Collections.Generic.IList TimeRanges {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs index ee8edbcd1e80..d29208c4bb05 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSQLPointInTimeRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs index af52781072d6..44fb32a8d9ef 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSQLPointInTimeRestoreWithRehydrateRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs index 21a822f671f4..5ef74c49c033 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRecoveryPoint.cs @@ -26,6 +26,13 @@ public AzureWorkloadSQLRecoveryPoint() /// Initializes a new instance of the AzureWorkloadSQLRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// UTC time at which recovery point was created /// @@ -43,13 +50,14 @@ public AzureWorkloadSQLRecoveryPoint() /// /// 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 + /// 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), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) + public AzureWorkloadSQLRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), System.DateTime? recoveryPointTimeInUtc = default(System.DateTime?), string type = default(string), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), AzureWorkloadSQLRecoveryPointExtendedInfo extendedInfo = default(AzureWorkloadSQLRecoveryPointExtendedInfo)) - : base(recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) + : base(threatStatus, threatInfo, recoveryPointTimeInUtc, type, recoveryPointTierDetails, recoveryPointMoveReadinessInfo, recoveryPointProperties) { this.ExtendedInfo = extendedInfo; CustomInit(); @@ -63,11 +71,23 @@ public AzureWorkloadSQLRecoveryPoint() /// /// Gets or sets 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 + /// 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 /// [Newtonsoft.Json.JsonProperty(PropertyName = "extendedInfo")] public AzureWorkloadSQLRecoveryPointExtendedInfo ExtendedInfo {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public override void Validate() + { + base.Validate(); + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreRequest.cs index 825df8bdaaf5..460ff1357f93 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreRequest.cs @@ -50,14 +50,16 @@ public AzureWorkloadSQLRestoreRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs index d6d90173b5c4..9f359ee47cf1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/AzureWorkloadSQLRestoreWithRehydrateRequest.cs @@ -51,14 +51,16 @@ public AzureWorkloadSQLRestoreWithRehydrateRequest() /// Defines the Resource group of the Target VM /// - /// User Assigned managed identity details Currently used for snapshot. + /// User Assigned managed identity details + /// Currently used for snapshot. /// - /// Additional details for snapshot recovery Currently used for snapshot for - /// SAP Hana. + /// Additional details for snapshot recovery + /// Currently used for snapshot for SAP Hana. /// - /// This is the complete ARM Id of the target VM For e.g. + /// This is the complete ARM Id of the target VM + /// For e.g. /// /subscriptions/{subId}/resourcegroups/{rg}/provider/Microsoft.Compute/virtualmachines/{vm} /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupEngineBaseResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupEngineBaseResource.cs index 779994e335a8..a2e0498462a8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupEngineBaseResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupEngineBaseResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// The base backup engine class. All workload specific backup engines derive /// from this class. /// - public partial class BackupEngineBaseResource : Resource + public partial class BackupEngineBaseResource : ProxyResource { /// /// Initializes a new instance of the BackupEngineBaseResource class. @@ -25,32 +25,40 @@ public BackupEngineBaseResource() /// Initializes a new instance of the BackupEngineBaseResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// BackupEngineBaseResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// BackupEngineBaseResource properties + /// Optional ETag. /// - public BackupEngineBaseResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupEngineBase properties = default(BackupEngineBase)) + public BackupEngineBaseResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), BackupEngineBase properties = default(BackupEngineBase), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -65,5 +73,23 @@ public BackupEngineBaseResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public BackupEngineBase Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupFabricResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupFabricResource.cs new file mode 100644 index 000000000000..a45bdd8896bc --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupFabricResource.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Backup Fabric virtual resource. + /// + public partial class BackupFabricResource + { + /// + /// Initializes a new instance of the BackupFabricResource class. + /// + public BackupFabricResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BackupFabricResource class. + /// + + /// The name of the BackupFabricResource + /// + public BackupFabricResource(string name) + + { + this.Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the BackupFabricResource + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupRequestResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupRequestResource.cs index 8574acd449e7..62a0755340f3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupRequestResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupRequestResource.cs @@ -25,14 +25,19 @@ public BackupRequestResource() /// Initializes a new instance of the BackupRequestResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -46,10 +51,13 @@ public BackupRequestResource() /// BackupRequestResource properties /// - public BackupRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupRequest properties = default(BackupRequest)) + public BackupRequestResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupRequest properties = default(BackupRequest)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -60,6 +68,24 @@ public BackupRequestResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets backupRequestResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceConfigResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceConfigResource.cs index af93875a892b..0b69864a76b7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceConfigResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceConfigResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// The resource storage details. /// - public partial class BackupResourceConfigResource : Resource + public partial class BackupResourceConfigResource : ProxyResource { /// /// Initializes a new instance of the BackupResourceConfigResource class. @@ -24,32 +24,40 @@ public BackupResourceConfigResource() /// Initializes a new instance of the BackupResourceConfigResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// BackupResourceConfigResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// BackupResourceConfigResource properties + /// Optional ETag. /// - public BackupResourceConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupResourceConfig properties = default(BackupResourceConfig)) + public BackupResourceConfigResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), BackupResourceConfig properties = default(BackupResourceConfig), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public BackupResourceConfigResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public BackupResourceConfig Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs index af3d9a191013..677d36d4cbd7 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigExtendedResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { using System.Linq; - public partial class BackupResourceEncryptionConfigExtendedResource : Resource + public partial class BackupResourceEncryptionConfigExtendedResource : ProxyResource { /// /// Initializes a new instance of the BackupResourceEncryptionConfigExtendedResource class. @@ -21,32 +21,40 @@ public BackupResourceEncryptionConfigExtendedResource() /// Initializes a new instance of the BackupResourceEncryptionConfigExtendedResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The properties of the backup resource encryption config extended resource /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// BackupResourceEncryptionConfigExtendedResource properties + /// Optional ETag. /// - public BackupResourceEncryptionConfigExtendedResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupResourceEncryptionConfigExtended properties = default(BackupResourceEncryptionConfigExtended)) + public BackupResourceEncryptionConfigExtendedResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), BackupResourceEncryptionConfigExtended properties = default(BackupResourceEncryptionConfigExtended), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -57,9 +65,28 @@ public BackupResourceEncryptionConfigExtendedResource() /// - /// Gets or sets backupResourceEncryptionConfigExtendedResource properties + /// Gets or sets the properties of the backup resource encryption config + /// extended resource /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public BackupResourceEncryptionConfigExtended Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigResource.cs index a18616a1d3cc..faa4bddfd8d8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceEncryptionConfigResource.cs @@ -21,32 +21,40 @@ public BackupResourceEncryptionConfigResource() /// Initializes a new instance of the BackupResourceEncryptionConfigResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// The properties of the backup resource encryption config /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// BackupResourceEncryptionConfigResource properties + /// Optional ETag. /// - public BackupResourceEncryptionConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupResourceEncryptionConfig properties = default(BackupResourceEncryptionConfig)) + public BackupResourceEncryptionConfigResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), BackupResourceEncryptionConfig properties = default(BackupResourceEncryptionConfig), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -57,9 +65,27 @@ public BackupResourceEncryptionConfigResource() /// - /// Gets or sets backupResourceEncryptionConfigResource properties + /// Gets or sets the properties of the backup resource encryption config /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public BackupResourceEncryptionConfig Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceVaultConfigResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceVaultConfigResource.cs index 49fefb48adc2..c1a52aead855 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceVaultConfigResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BackupResourceVaultConfigResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Backup resource vault config details. /// - public partial class BackupResourceVaultConfigResource : Resource + public partial class BackupResourceVaultConfigResource : ProxyResource { /// /// Initializes a new instance of the BackupResourceVaultConfigResource class. @@ -24,32 +24,40 @@ public BackupResourceVaultConfigResource() /// Initializes a new instance of the BackupResourceVaultConfigResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// BackupResourceVaultConfigResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// BackupResourceVaultConfigResource properties + /// Optional ETag. /// - public BackupResourceVaultConfigResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), BackupResourceVaultConfig properties = default(BackupResourceVaultConfig)) + public BackupResourceVaultConfigResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), BackupResourceVaultConfig properties = default(BackupResourceVaultConfig), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public BackupResourceVaultConfigResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public BackupResourceVaultConfig Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsPrepareDataMoveHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsPrepareDataMoveHeaders.cs new file mode 100644 index 000000000000..993af124b417 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsPrepareDataMoveHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class BmsPrepareDataMoveHeaders + { + /// + /// Initializes a new instance of the BmsPrepareDataMoveHeaders class. + /// + public BmsPrepareDataMoveHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BmsPrepareDataMoveHeaders class. + /// + + /// + /// + + /// + /// + public BmsPrepareDataMoveHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsTriggerDataMoveHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsTriggerDataMoveHeaders.cs new file mode 100644 index 000000000000..4ee24b322893 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/BmsTriggerDataMoveHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class BmsTriggerDataMoveHeaders + { + /// + /// Initializes a new instance of the BmsTriggerDataMoveHeaders class. + /// + public BmsTriggerDataMoveHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the BmsTriggerDataMoveHeaders class. + /// + + /// + /// + + /// + /// + public BmsTriggerDataMoveHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ClientScriptForConnect.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ClientScriptForConnect.cs index 7d2d2f4f87ea..c6c246ca1e64 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ClientScriptForConnect.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ClientScriptForConnect.cs @@ -40,7 +40,8 @@ public ClientScriptForConnect() /// /// Mandatory suffix that should be added to the name of script that is given - /// for download to user. If its null or empty then , ignore it. + /// for download to user. + /// If its null or empty then , ignore it. /// public ClientScriptForConnect(string scriptContent = default(string), string scriptExtension = default(string), string osType = default(string), string url = default(string), string scriptNameSuffix = default(string)) @@ -88,7 +89,8 @@ public ClientScriptForConnect() /// /// Gets or sets mandatory suffix that should be added to the name of script - /// that is given for download to user. If its null or empty then , ignore it. + /// that is given for download to user. + /// If its null or empty then , ignore it. /// [Newtonsoft.Json.JsonProperty(PropertyName = "scriptNameSuffix")] public string ScriptNameSuffix {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponse.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudError.cs similarity index 71% rename from src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponse.cs rename to src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudError.cs index 639ea268d21e..686e65f76677 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponse.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudError.cs @@ -8,25 +8,25 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// The resource management error response. + /// An error response from the Container Instance service. /// - public partial class NewErrorResponse + public partial class CloudError { /// - /// Initializes a new instance of the NewErrorResponse class. + /// Initializes a new instance of the CloudError class. /// - public NewErrorResponse() + public CloudError() { CustomInit(); } /// - /// Initializes a new instance of the NewErrorResponse class. + /// Initializes a new instance of the CloudError class. /// /// The error object. /// - public NewErrorResponse(NewErrorResponseError error = default(NewErrorResponseError)) + public CloudError(CloudErrorBody error = default(CloudErrorBody)) { this.Error = error; @@ -43,6 +43,6 @@ public NewErrorResponse() /// Gets or sets the error object. /// [Newtonsoft.Json.JsonProperty(PropertyName = "error")] - public NewErrorResponseError Error {get; set; } + public CloudErrorBody Error {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseError.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudErrorBody.cs similarity index 55% rename from src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseError.cs rename to src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudErrorBody.cs index 54c22ac8b5f7..9c91b8e5e09b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseError.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CloudErrorBody.cs @@ -8,37 +8,40 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// The error object. + /// An error response from the Container Instance service. /// - public partial class NewErrorResponseError + public partial class CloudErrorBody { /// - /// Initializes a new instance of the NewErrorResponseError class. + /// Initializes a new instance of the CloudErrorBody class. /// - public NewErrorResponseError() + public CloudErrorBody() { CustomInit(); } /// - /// Initializes a new instance of the NewErrorResponseError class. + /// Initializes a new instance of the CloudErrorBody class. /// - /// The error code. + /// An identifier for the error. Codes are invariant and are intended to be + /// consumed programmatically. /// - /// The error message. + /// A message describing the error, intended to be suitable for display in a + /// user interface. /// - /// The error target. + /// The target of the particular error. For example, the name of the property + /// in error. /// - /// The error details. + /// A list of additional details about the error. /// /// The error additional info. /// - public NewErrorResponseError(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) + public CloudErrorBody(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) { this.Code = code; @@ -56,28 +59,31 @@ public NewErrorResponseError() /// - /// Gets the error code. + /// Gets an identifier for the error. Codes are invariant and are intended to + /// be consumed programmatically. /// [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public string Code {get; private set; } /// - /// Gets the error message. + /// Gets a message describing the error, intended to be suitable for display in + /// a user interface. /// [Newtonsoft.Json.JsonProperty(PropertyName = "message")] public string Message {get; private set; } /// - /// Gets the error target. + /// Gets the target of the particular error. For example, the name of the + /// property in error. /// [Newtonsoft.Json.JsonProperty(PropertyName = "target")] public string Target {get; private set; } /// - /// Gets the error details. + /// Gets a list of additional details about the error. /// [Newtonsoft.Json.JsonProperty(PropertyName = "details")] - public System.Collections.Generic.IList Details {get; private set; } + public System.Collections.Generic.IList Details {get; private set; } /// /// Gets the error additional info. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ConfigureSourceScanExecuteHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ConfigureSourceScanExecuteHeaders.cs new file mode 100644 index 000000000000..9255c26474db --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ConfigureSourceScanExecuteHeaders.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class ConfigureSourceScanExecuteHeaders + { + /// + /// Initializes a new instance of the ConfigureSourceScanExecuteHeaders class. + /// + public ConfigureSourceScanExecuteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ConfigureSourceScanExecuteHeaders class. + /// + + /// + /// + + /// + /// + + /// + /// + public ConfigureSourceScanExecuteHeaders(string azureAsyncOperation = default(string), string location = default(string), int? retryAfter = default(int?)) + + { + this.AzureAsyncOperation = azureAsyncOperation; + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Azure-AsyncOperation")] + public string AzureAsyncOperation {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CreatedByType.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CreatedByType.cs new file mode 100644 index 000000000000..54f60587c2f1 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/CreatedByType.cs @@ -0,0 +1,21 @@ +// 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 CreatedByType. + /// + + + public static class CreatedByType + { + public const string User = "User"; + public const string Application = "Application"; + public const string ManagedIdentity = "ManagedIdentity"; + public const string Key = "Key"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DPMProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DPMProtectedItem.cs index 2aaf6bf040c5..58a8abf22efc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DPMProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DPMProtectedItem.cs @@ -84,9 +84,15 @@ public DPMProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the managed item /// @@ -100,9 +106,9 @@ public DPMProtectedItem() /// Extended info of the backup item. /// - public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) + public DPMProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string backupEngineName = default(string), string protectionState = default(string), DPMProtectedItemExtendedInfo extendedInfo = default(DPMProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.BackupEngineName = backupEngineName; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskDetails.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskDetails.cs new file mode 100644 index 000000000000..b02432cab7cd --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskDetails.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Data disk details + /// + public partial class DataDiskDetails + { + /// + /// Initializes a new instance of the DataDiskDetails class. + /// + public DataDiskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataDiskDetails class. + /// + + /// List of data disks in the VM which are encrypted at the time of backup. + /// This will be used to provide Disk Encryption Set Id for each data disk. + /// + public DataDiskDetails(System.Collections.Generic.IList encryptedDataDisks = default(System.Collections.Generic.IList)) + + { + this.EncryptedDataDisks = encryptedDataDisks; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets list of data disks in the VM which are encrypted at the time + /// of backup. This will be used to provide Disk Encryption Set Id for each + /// data disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "encryptedDataDisks")] + public System.Collections.Generic.IList EncryptedDataDisks {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskEncryptionSettings.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskEncryptionSettings.cs new file mode 100644 index 000000000000..43a56c4aeabf --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DataDiskEncryptionSettings.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 System.Linq; + + /// + /// Data disk encryption settings for Secured VM. This will be used to provide + /// Disk Encryption Set Id for each data disk. + /// + public partial class DataDiskEncryptionSettings + { + /// + /// Initializes a new instance of the DataDiskEncryptionSettings class. + /// + public DataDiskEncryptionSettings() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DataDiskEncryptionSettings class. + /// + + /// Per Disk Encryption Set Ids for Secured VM Data Disks. This will be used to + /// provide Disk Encryption Set Id for each data disk. + /// + + /// Disk Encryption Set Id for Secured VM Data Disk. This will be used for all + /// data disks if perDiskEncryptionSetIds is not provided. If + /// perDiskEncryptionSetIds is provided, this will be ignored. + /// + + /// Managed Identity resource Id used to encrypt the data disk during restore. + /// + public DataDiskEncryptionSettings(System.Collections.Generic.IList perDiskEncryptionSetIds = default(System.Collections.Generic.IList), string dataDiskEncryptionSetId = default(string), string dataDiskEncryptionIdentity = default(string)) + + { + this.PerDiskEncryptionSetIds = perDiskEncryptionSetIds; + this.DataDiskEncryptionSetId = dataDiskEncryptionSetId; + this.DataDiskEncryptionIdentity = dataDiskEncryptionIdentity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets per Disk Encryption Set Ids for Secured VM Data Disks. This + /// will be used to provide Disk Encryption Set Id for each data disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "perDiskEncryptionSetIds")] + public System.Collections.Generic.IList PerDiskEncryptionSetIds {get; set; } + + /// + /// Gets or sets disk Encryption Set Id for Secured VM Data Disk. This will be + /// used for all data disks if perDiskEncryptionSetIds is not provided. If + /// perDiskEncryptionSetIds is provided, this will be ignored. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskEncryptionSetId")] + public string DataDiskEncryptionSetId {get; set; } + + /// + /// Gets or sets managed Identity resource Id used to encrypt the data disk + /// during restore. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskEncryptionIdentity")] + public string DataDiskEncryptionIdentity {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DiskDetails.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DiskDetails.cs new file mode 100644 index 000000000000..a8867fa65f76 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DiskDetails.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Disk details + /// + public partial class DiskDetails + { + /// + /// Initializes a new instance of the DiskDetails class. + /// + public DiskDetails() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the DiskDetails class. + /// + + /// LUN of the disk + /// + + /// Disk name of the disk + /// + public DiskDetails(int? lun = default(int?), string diskName = default(string)) + + { + this.Lun = lun; + this.DiskName = diskName; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets lUN of the disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; set; } + + /// + /// Gets or sets disk name of the disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskName")] + public string DiskName {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DistributedNodesInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DistributedNodesInfo.cs index cd8abfddb88d..d5c5cc2244fa 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DistributedNodesInfo.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DistributedNodesInfo.cs @@ -27,7 +27,8 @@ public DistributedNodesInfo() /// Name of the node under a distributed container. /// - /// Status of this Node. Failed | Succeeded + /// Status of this Node. + /// Failed | Succeeded /// /// Error Details if the Status is non-success. @@ -35,7 +36,7 @@ public DistributedNodesInfo() /// ARM resource id of the node /// - public DistributedNodesInfo(string nodeName = default(string), string status = default(string), ErrorDetail errorDetail = default(ErrorDetail), string sourceResourceId = default(string)) + public DistributedNodesInfo(string nodeName = default(string), string status = default(string), ErrorDetailAutoGenerated errorDetail = default(ErrorDetailAutoGenerated), string sourceResourceId = default(string)) { this.NodeName = nodeName; @@ -58,7 +59,8 @@ public DistributedNodesInfo() public string NodeName {get; set; } /// - /// Gets or sets status of this Node. Failed | Succeeded + /// Gets or sets status of this Node. + /// Failed | Succeeded /// [Newtonsoft.Json.JsonProperty(PropertyName = "status")] public string Status {get; set; } @@ -67,7 +69,7 @@ public DistributedNodesInfo() /// Gets or sets error Details if the Status is non-success. /// [Newtonsoft.Json.JsonProperty(PropertyName = "errorDetail")] - public ErrorDetail ErrorDetail {get; set; } + public ErrorDetailAutoGenerated ErrorDetail {get; set; } /// /// Gets or sets aRM resource id of the node diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DpmContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DpmContainer.cs index 7a56841f670d..ab6fed92082b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DpmContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/DpmContainer.cs @@ -42,6 +42,9 @@ public DpmContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Specifies whether the container is re-registrable. /// @@ -65,9 +68,9 @@ public DpmContainer() /// Extended Info of the container. /// - public DpmContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), System.Collections.Generic.IList dpmServers = default(System.Collections.Generic.IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) + public DpmContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), bool? canReRegister = default(bool?), string containerId = default(string), long? protectedItemCount = default(long?), string dpmAgentVersion = default(string), System.Collections.Generic.IList dpmServers = default(System.Collections.Generic.IList), bool? upgradeAvailable = default(bool?), string protectionStatus = default(string), DPMContainerExtendedInfo extendedInfo = default(DPMContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.CanReRegister = canReRegister; this.ContainerId = containerId; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetail.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetail.cs index ca73ade885f4..b1053139dc55 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetail.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetail.cs @@ -8,7 +8,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// Error Detail class which encapsulates Code, Message and Recommendations. + /// The error detail. /// public partial class ErrorDetail { @@ -24,20 +24,28 @@ public ErrorDetail() /// Initializes a new instance of the ErrorDetail class. /// - /// Error code. + /// The error code. /// - /// Error Message related to the Code. + /// The error message. /// - /// List of recommendation strings. + /// The error target. /// - public ErrorDetail(string code = default(string), string message = default(string), System.Collections.Generic.IList recommendations = default(System.Collections.Generic.IList)) + + /// The error details. + /// + + /// The error additional info. + /// + public ErrorDetail(string code = default(string), string message = default(string), string target = default(string), System.Collections.Generic.IList details = default(System.Collections.Generic.IList), System.Collections.Generic.IList additionalInfo = default(System.Collections.Generic.IList)) { this.Code = code; this.Message = message; - this.Recommendations = recommendations; + this.Target = target; + this.Details = details; + this.AdditionalInfo = additionalInfo; CustomInit(); } @@ -48,21 +56,33 @@ public ErrorDetail() /// - /// Gets error code. + /// Gets the error code. /// [Newtonsoft.Json.JsonProperty(PropertyName = "code")] public string Code {get; private set; } /// - /// Gets error Message related to the Code. + /// Gets the error message. /// [Newtonsoft.Json.JsonProperty(PropertyName = "message")] public string Message {get; private set; } /// - /// Gets list of recommendation strings. + /// Gets the error target. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "target")] + public string Target {get; private set; } + + /// + /// Gets the error details. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "details")] + public System.Collections.Generic.IList Details {get; private set; } + + /// + /// Gets the error additional info. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "recommendations")] - public System.Collections.Generic.IList Recommendations {get; private set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "additionalInfo")] + public System.Collections.Generic.IList AdditionalInfo {get; private set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.cs new file mode 100644 index 000000000000..8982ed423e36 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorDetailAutoGenerated.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 System.Linq; + + /// + /// Error Detail class which encapsulates Code, Message and Recommendations. + /// + public partial class ErrorDetailAutoGenerated + { + /// + /// Initializes a new instance of the ErrorDetailAutoGenerated class. + /// + public ErrorDetailAutoGenerated() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ErrorDetailAutoGenerated class. + /// + + /// Error code. + /// + + /// Error Message related to the Code. + /// + + /// List of recommendation strings. + /// + public ErrorDetailAutoGenerated(string code = default(string), string message = default(string), System.Collections.Generic.IList recommendations = default(System.Collections.Generic.IList)) + + { + this.Code = code; + this.Message = message; + this.Recommendations = recommendations; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets error code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "code")] + public string Code {get; private set; } + + /// + /// Gets error Message related to the Code. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "message")] + public string Message {get; private set; } + + /// + /// Gets list of recommendation strings. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "recommendations")] + public System.Collections.Generic.IList Recommendations {get; private set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponse.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponse.cs new file mode 100644 index 000000000000..5fbde956b68d --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponse.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Common error response for all Azure Resource Manager APIs to return error + /// details for failed operations. (This also follows the OData error response + /// format.). + /// + /// + /// 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 object. + /// + public ErrorResponse(ErrorDetail error = default(ErrorDetail)) + + { + this.Error = error; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the error object. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "error")] + public ErrorDetail Error {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseException.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponseException.cs similarity index 68% rename from src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseException.cs rename to src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponseException.cs index 132f3dc6c70c..2f42a97f08bf 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/NewErrorResponseException.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ErrorResponseException.cs @@ -7,9 +7,9 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { /// - /// Exception thrown for an invalid response with NewErrorResponse information. + /// Exception thrown for an invalid response with ErrorResponse information. /// - public partial class NewErrorResponseException : Microsoft.Rest.RestException + public partial class ErrorResponseException : Microsoft.Rest.RestException { /// /// Gets information about the associated HTTP request. @@ -24,30 +24,30 @@ public partial class NewErrorResponseException : Microsoft.Rest.RestException /// /// Gets or sets the body object. /// - public NewErrorResponse Body { get; set; } + public ErrorResponse Body { get; set; } /// - /// Initializes a new instance of the NewErrorResponseException class. + /// Initializes a new instance of the ErrorResponseException class. /// - public NewErrorResponseException() + public ErrorResponseException() { } /// - /// Initializes a new instance of the NewErrorResponse class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. - public NewErrorResponseException(string message) + public ErrorResponseException(string message) : this(message, null) { } /// - /// Initializes a new instance of the NewErrorResponse class. + /// Initializes a new instance of the ErrorResponse class. /// /// The exception message. /// Inner exception. - public NewErrorResponseException(string message, System.Exception innerException) + public ErrorResponseException(string message, System.Exception innerException) : base(message, innerException) { } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostInfoRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostInfoRequest.cs index 4e1a70dd7585..a36c9e4c75f8 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostInfoRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostInfoRequest.cs @@ -8,8 +8,8 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// Base class for tiering cost request. Specific cost request types are - /// derived from this class. + /// Base class for tiering cost request. + /// Specific cost request types are derived from this class. /// [Newtonsoft.Json.JsonObject("FetchTieringCostInfoRequest")] public partial class FetchTieringCostInfoRequest diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostPostHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostPostHeaders.cs index f815522a29f0..9cc3b291e71d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostPostHeaders.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/FetchTieringCostPostHeaders.cs @@ -23,10 +23,14 @@ public FetchTieringCostPostHeaders() /// /// - public FetchTieringCostPostHeaders(string location = default(string)) + + /// + /// + public FetchTieringCostPostHeaders(string location = default(string), int? retryAfter = default(int?)) { this.Location = location; + this.RetryAfter = retryAfter; CustomInit(); } @@ -41,5 +45,11 @@ public FetchTieringCostPostHeaders() /// [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericContainer.cs index 5b519b89f799..cc11afdc1d98 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericContainer.cs @@ -42,14 +42,17 @@ public GenericContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Name of the container's fabric /// /// Extended information (not returned in List container API calls) /// - public GenericContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string fabricName = default(string), GenericContainerExtendedInfo extendedInformation = default(GenericContainerExtendedInfo)) + public GenericContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string fabricName = default(string), GenericContainerExtendedInfo extendedInformation = default(GenericContainerExtendedInfo)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.FabricName = fabricName; this.ExtendedInformation = extendedInformation; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericProtectedItem.cs index 62804a15107e..649623562f4f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericProtectedItem.cs @@ -84,9 +84,15 @@ public GenericProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of the container. /// @@ -108,9 +114,9 @@ public GenericProtectedItem() /// Name of this backup item's fabric. /// - public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), System.Collections.Generic.IDictionary sourceAssociations = default(System.Collections.Generic.IDictionary), string fabricName = default(string)) + public GenericProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string policyState = default(string), string protectionState = default(string), long? protectedItemId = default(long?), System.Collections.Generic.IDictionary sourceAssociations = default(System.Collections.Generic.IDictionary), string fabricName = default(string)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.PolicyState = policyState; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericRecoveryPoint.cs index 85591cfa43c5..3738c6baac6f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/GenericRecoveryPoint.cs @@ -25,6 +25,13 @@ public GenericRecoveryPoint() /// Initializes a new instance of the GenericRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// Friendly name of the backup copy. /// @@ -39,8 +46,9 @@ public GenericRecoveryPoint() /// Properties of Recovery Point /// - public GenericRecoveryPoint(string friendlyName = default(string), string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + public GenericRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), string friendlyName = default(string), string recoveryPointType = default(string), System.DateTime? recoveryPointTime = default(System.DateTime?), string recoveryPointAdditionalInfo = default(string), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties)) + : base(threatStatus, threatInfo) { this.FriendlyName = friendlyName; this.RecoveryPointType = recoveryPointType; @@ -85,5 +93,21 @@ public GenericRecoveryPoint() /// [Newtonsoft.Json.JsonProperty(PropertyName = "recoveryPointProperties")] public RecoveryPointProperties RecoveryPointProperties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + if (this.RecoveryPointProperties != null) + { + this.RecoveryPointProperties.Validate(); + } + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/HourlySchedule.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/HourlySchedule.cs index 01236ff3458d..bfbf9d4d80bf 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/HourlySchedule.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/HourlySchedule.cs @@ -21,8 +21,8 @@ public HourlySchedule() /// Initializes a new instance of the HourlySchedule class. /// - /// Interval at which backup needs to be triggered. For hourly the value can - /// be 4/6/8/12 + /// Interval at which backup needs to be triggered. For hourly the value + /// can be 4/6/8/12 /// /// To specify start time of the backup window @@ -47,7 +47,8 @@ public HourlySchedule() /// /// Gets or sets interval at which backup needs to be triggered. For hourly the - /// value can be 4/6/8/12 + /// value + /// can be 4/6/8/12 /// [Newtonsoft.Json.JsonProperty(PropertyName = "interval")] public int? Interval {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ILRRequestResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ILRRequestResource.cs index b955cb3ec831..6a385e3e89a6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ILRRequestResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ILRRequestResource.cs @@ -24,14 +24,19 @@ public ILRRequestResource() /// Initializes a new instance of the ILRRequestResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -45,10 +50,13 @@ public ILRRequestResource() /// ILRRequestResource properties /// - public ILRRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ILRRequest properties = default(ILRRequest)) + public ILRRequestResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ILRRequest properties = default(ILRRequest)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -59,6 +67,24 @@ public ILRRequestResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets iLRRequestResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaaSVMContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaaSVMContainer.cs index 82a2cf42e921..88402118bcfd 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaaSVMContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaaSVMContainer.cs @@ -42,6 +42,9 @@ public IaaSVMContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Fully qualified ARM url of the virtual machine represented by this Azure /// IaaS VM container. /// @@ -52,9 +55,9 @@ public IaaSVMContainer() /// Resource group name of Recovery Services Vault. /// - public IaaSVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) + public IaaSVMContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), string virtualMachineId = default(string), string virtualMachineVersion = default(string), string resourceGroup = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.VirtualMachineId = virtualMachineId; this.VirtualMachineVersion = virtualMachineVersion; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRecoveryPoint.cs index 6451b191122b..863e1516794e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRecoveryPoint.cs @@ -25,6 +25,13 @@ public IaasVMRecoveryPoint() /// Initializes a new instance of the IaasVMRecoveryPoint class. /// + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + /// Type of the backup copy. /// @@ -82,11 +89,15 @@ public IaasVMRecoveryPoint() /// network setting /// - /// Extended location of the VM recovery point, should be null if VM is in - /// public cloud + /// Extended location of the VM recovery point, + /// should be null if VM is in public cloud /// - 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?), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), string securityType = default(string), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), bool? isPrivateAccessEnabledOnAnyDisk = default(bool?), ExtendedLocation extendedLocation = default(ExtendedLocation)) + /// Data disk metadata for the VM recovery point + /// + public IaasVMRecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList), 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?), System.Collections.Generic.IList recoveryPointTierDetails = default(System.Collections.Generic.IList), bool? isManagedVirtualMachine = default(bool?), string virtualMachineSize = default(string), bool? originalStorageAccountOption = default(bool?), string osType = default(string), RecoveryPointDiskConfiguration recoveryPointDiskConfiguration = default(RecoveryPointDiskConfiguration), System.Collections.Generic.IList zones = default(System.Collections.Generic.IList), System.Collections.Generic.IDictionary recoveryPointMoveReadinessInfo = default(System.Collections.Generic.IDictionary), string securityType = default(string), RecoveryPointProperties recoveryPointProperties = default(RecoveryPointProperties), bool? isPrivateAccessEnabledOnAnyDisk = default(bool?), ExtendedLocation extendedLocation = default(ExtendedLocation), DataDiskDetails dataDiskMetadata = default(DataDiskDetails)) + + : base(threatStatus, threatInfo) { this.RecoveryPointType = recoveryPointType; this.RecoveryPointTime = recoveryPointTime; @@ -107,6 +118,7 @@ public IaasVMRecoveryPoint() this.RecoveryPointProperties = recoveryPointProperties; this.IsPrivateAccessEnabledOnAnyDisk = isPrivateAccessEnabledOnAnyDisk; this.ExtendedLocation = extendedLocation; + this.DataDiskMetadata = dataDiskMetadata; CustomInit(); } @@ -230,10 +242,42 @@ public IaasVMRecoveryPoint() public bool? IsPrivateAccessEnabledOnAnyDisk {get; set; } /// - /// Gets or sets extended location of the VM recovery point, should be null if - /// VM is in public cloud + /// Gets or sets extended location of the VM recovery point, + /// should be null if VM is in public cloud /// [Newtonsoft.Json.JsonProperty(PropertyName = "extendedLocation")] public ExtendedLocation ExtendedLocation {get; set; } + + /// + /// Gets or sets data disk metadata for the VM recovery point + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskMetadata")] + public DataDiskDetails DataDiskMetadata {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + + + + + + + + + + if (this.RecoveryPointProperties != null) + { + this.RecoveryPointProperties.Validate(); + } + + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreRequest.cs index a0bb2a52e7e7..eb5fac95c6ff 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreRequest.cs @@ -38,13 +38,14 @@ public IaasVMRestoreRequest() /// 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. + /// 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} + /// 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 @@ -52,18 +53,20 @@ public IaasVMRestoreRequest() /// /// 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. + /// 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. + /// 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. + /// restored. This applies only to Classic + /// Virtual Machines. /// /// Region in which the virtual machine is restored. @@ -74,8 +77,8 @@ public IaasVMRestoreRequest() /// /// 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. + /// false, VM will be restored to the same + /// cloud service as it was at the time of backup. /// /// Original Storage Account Option @@ -105,8 +108,8 @@ public IaasVMRestoreRequest() /// identity. /// - /// Target extended location where the VM should be restored, should be null if - /// restore is to be done in public cloud + /// Target extended location where the VM should be restored, + /// should be null if restore is to be done in public cloud /// /// Stores Secured VM Details @@ -178,8 +181,8 @@ public IaasVMRestoreRequest() /// /// Gets or sets 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} + /// create for this Virtual machine and other artifacts. + /// For e.g. /subscriptions/{subId}/resourcegroups/{rg} /// [Newtonsoft.Json.JsonProperty(PropertyName = "targetResourceGroupId")] public string TargetResourceGroupId {get; set; } @@ -193,16 +196,17 @@ public IaasVMRestoreRequest() /// /// Gets or sets 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. + /// attached to the virtual machine. + /// User will be validated for join action permissions in the linked access. /// [Newtonsoft.Json.JsonProperty(PropertyName = "virtualNetworkId")] public string VirtualNetworkId {get; set; } /// /// Gets or sets 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 + /// 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. /// [Newtonsoft.Json.JsonProperty(PropertyName = "subnetId")] @@ -210,7 +214,8 @@ public IaasVMRestoreRequest() /// /// Gets or sets fully qualified ARM ID of the domain name to be associated to - /// the VM being restored. This applies only to Classic Virtual Machines. + /// the VM being restored. This applies only to Classic + /// Virtual Machines. /// [Newtonsoft.Json.JsonProperty(PropertyName = "targetDomainNameId")] public string TargetDomainNameId {get; set; } @@ -230,8 +235,8 @@ public IaasVMRestoreRequest() /// /// Gets or sets 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. + /// If this is false, VM will be restored to the same + /// cloud service as it was at the time of backup. /// [Newtonsoft.Json.JsonProperty(PropertyName = "createNewCloudService")] public bool? CreateNewCloudService {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs index 23bb4dbfd41f..c1dc6e51b3fe 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IaasVMRestoreWithRehydrationRequest.cs @@ -39,13 +39,14 @@ public IaasVMRestoreWithRehydrationRequest() /// 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. + /// 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} + /// 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 @@ -53,18 +54,20 @@ public IaasVMRestoreWithRehydrationRequest() /// /// 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. + /// 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. + /// 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. + /// restored. This applies only to Classic + /// Virtual Machines. /// /// Region in which the virtual machine is restored. @@ -75,8 +78,8 @@ public IaasVMRestoreWithRehydrationRequest() /// /// 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. + /// false, VM will be restored to the same + /// cloud service as it was at the time of backup. /// /// Original Storage Account Option @@ -106,8 +109,8 @@ public IaasVMRestoreWithRehydrationRequest() /// identity. /// - /// Target extended location where the VM should be restored, should be null if - /// restore is to be done in public cloud + /// Target extended location where the VM should be restored, + /// should be null if restore is to be done in public cloud /// /// Stores Secured VM Details diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IdentityInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IdentityInfo.cs index 1542e63e1683..ed01e9772696 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IdentityInfo.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/IdentityInfo.cs @@ -28,8 +28,9 @@ public IdentityInfo() /// assigned /// - /// Managed Identity Resource Id Optional: Might not be required in the case of - /// system assigned managed identity + /// Managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed + /// identity /// public IdentityInfo(bool? isSystemAssignedIdentity = default(bool?), string managedIdentityResourceId = default(string)) @@ -53,8 +54,9 @@ public IdentityInfo() public bool? IsSystemAssignedIdentity {get; set; } /// - /// Gets or sets managed Identity Resource Id Optional: Might not be required - /// in the case of system assigned managed identity + /// Gets or sets managed Identity Resource Id + /// Optional: Might not be required in the case of system assigned managed + /// identity /// [Newtonsoft.Json.JsonProperty(PropertyName = "managedIdentityResourceId")] public string ManagedIdentityResourceId {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryInfo.cs index 07aa2839339e..80733ce651b9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryInfo.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryInfo.cs @@ -24,16 +24,17 @@ public InquiryInfo() /// Initializes a new instance of the InquiryInfo class. /// - /// Inquiry Status for this container such as InProgress | Failed | Succeeded + /// Inquiry Status for this container such as + /// InProgress | Failed | Succeeded /// /// Error Details if the Status is non-success. /// - /// Inquiry Details which will have workload specific details. For e.g. - For - /// SQL and oracle this will contain different details. + /// Inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. /// - public InquiryInfo(string status = default(string), ErrorDetail errorDetail = default(ErrorDetail), System.Collections.Generic.IList inquiryDetails = default(System.Collections.Generic.IList)) + public InquiryInfo(string status = default(string), ErrorDetailAutoGenerated errorDetail = default(ErrorDetailAutoGenerated), System.Collections.Generic.IList inquiryDetails = default(System.Collections.Generic.IList)) { this.Status = status; @@ -49,8 +50,8 @@ public InquiryInfo() /// - /// Gets or sets inquiry Status for this container such as InProgress | Failed - /// | Succeeded + /// Gets or sets inquiry Status for this container such as + /// InProgress | Failed | Succeeded /// [Newtonsoft.Json.JsonProperty(PropertyName = "status")] public string Status {get; set; } @@ -59,11 +60,11 @@ public InquiryInfo() /// Gets or sets error Details if the Status is non-success. /// [Newtonsoft.Json.JsonProperty(PropertyName = "errorDetail")] - public ErrorDetail ErrorDetail {get; set; } + public ErrorDetailAutoGenerated ErrorDetail {get; set; } /// - /// Gets or sets inquiry Details which will have workload specific details. For - /// e.g. - For SQL and oracle this will contain different details. + /// Gets or sets inquiry Details which will have workload specific details. + /// For e.g. - For SQL and oracle this will contain different details. /// [Newtonsoft.Json.JsonProperty(PropertyName = "inquiryDetails")] public System.Collections.Generic.IList InquiryDetails {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryValidation.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryValidation.cs index c61407630cc1..eb6bfe85e232 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryValidation.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/InquiryValidation.cs @@ -35,7 +35,7 @@ public InquiryValidation() /// Dictionary to store the count of ProtectableItems with key POType. /// - public InquiryValidation(string status = default(string), ErrorDetail errorDetail = default(ErrorDetail), string additionalDetail = default(string), object protectableItemCount = default(object)) + public InquiryValidation(string status = default(string), ErrorDetailAutoGenerated errorDetail = default(ErrorDetailAutoGenerated), string additionalDetail = default(string), object protectableItemCount = default(object)) { this.Status = status; @@ -61,7 +61,7 @@ public InquiryValidation() /// Gets or sets error Detail in case the status is non-success. /// [Newtonsoft.Json.JsonProperty(PropertyName = "errorDetail")] - public ErrorDetail ErrorDetail {get; set; } + public ErrorDetailAutoGenerated ErrorDetail {get; set; } /// /// Gets error Additional Detail in case the status is non-success. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/JobResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/JobResource.cs index 8f69bb6b1c32..548b7e781954 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/JobResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/JobResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Defines workload agnostic properties for a job. /// - public partial class JobResource : Resource + public partial class JobResource : ProxyResource { /// /// Initializes a new instance of the JobResource class. @@ -24,32 +24,40 @@ public JobResource() /// Initializes a new instance of the JobResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// JobResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// JobResource properties + /// Optional ETag. /// - public JobResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), Job properties = default(Job)) + public JobResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), Job properties = default(Job), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public JobResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public Job Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/KeyAndSecretDetails.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/KeyAndSecretDetails.cs index 0f6fe82df2fa..e3f992c9a365 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/KeyAndSecretDetails.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/KeyAndSecretDetails.cs @@ -8,9 +8,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// BEK is bitlocker key. KEK is encryption key for BEK If the VM was encrypted - /// then we will store following details : 1. Secret(BEK) - Url + Backup Data + - /// vaultId. 2. Key(KEK) - Url + Backup Data + vaultId. 3. EncryptionMechanism + /// BEK is bitlocker key. + /// KEK is encryption key for BEK + /// If the VM was encrypted then we will store following details : + /// 1. Secret(BEK) - Url + Backup Data + vaultId. + /// 2. Key(KEK) - Url + Backup Data + vaultId. + /// 3. EncryptionMechanism /// BEK and KEK can potentially have different vault ids. /// public partial class KeyAndSecretDetails diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabContainer.cs index 2bf12d2f70de..60e9ab0f8251 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabContainer.cs @@ -42,6 +42,9 @@ public MabContainer() /// Type of the protectable object associated with this container /// + /// Source location of the container + /// + /// Can the container be registered one more time. /// @@ -62,9 +65,9 @@ public MabContainer() /// Health state of mab container. /// - public MabContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), bool? canReRegister = default(bool?), long? containerId = default(long?), long? protectedItemCount = default(long?), string agentVersion = default(string), MabContainerExtendedInfo extendedInfo = default(MabContainerExtendedInfo), System.Collections.Generic.IList mabContainerHealthDetails = default(System.Collections.Generic.IList), string containerHealthState = default(string)) + public MabContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string), bool? canReRegister = default(bool?), long? containerId = default(long?), long? protectedItemCount = default(long?), string agentVersion = default(string), MabContainerExtendedInfo extendedInfo = default(MabContainerExtendedInfo), System.Collections.Generic.IList mabContainerHealthDetails = default(System.Collections.Generic.IList), string containerHealthState = default(string)) - : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType) + : base(friendlyName, backupManagementType, registrationStatus, healthStatus, protectableObjectType, sourceLocation) { this.CanReRegister = canReRegister; this.ContainerId = containerId; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabFileFolderProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabFileFolderProtectedItem.cs index 574cff935f62..dfdaabd3ec24 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabFileFolderProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MabFileFolderProtectedItem.cs @@ -84,9 +84,15 @@ public MabFileFolderProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// + /// Source side threat information + /// + /// Friendly name of this backup item. /// @@ -107,9 +113,9 @@ public MabFileFolderProtectedItem() /// Additional information with this backup item. /// - public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectionState = default(string), long? deferredDeleteSyncTimeInUtc = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) + public MabFileFolderProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo), string friendlyName = default(string), string computerName = default(string), string lastBackupStatus = default(string), System.DateTime? lastBackupTime = default(System.DateTime?), string protectionState = default(string), long? deferredDeleteSyncTimeInUtc = default(long?), MabFileFolderProtectedItemExtendedInfo extendedInfo = default(MabFileFolderProtectedItemExtendedInfo)) - : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, vaultId) + : base(backupManagementType, workloadType, containerName, sourceResourceId, policyId, lastRecoveryPoint, backupSetName, createMode, deferredDeleteTimeInUtc, isScheduledForDeferredDelete, deferredDeleteTimeRemaining, isDeferredDeleteScheduleUpcoming, isRehydrate, resourceGuardOperationRequests, isArchiveEnabled, policyName, softDeleteRetentionPeriodInDays, sourceLocation, vaultId, sourceSideScanInfo) { this.FriendlyName = friendlyName; this.ComputerName = computerName; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MoveRecoveryPointHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MoveRecoveryPointHeaders.cs new file mode 100644 index 000000000000..51cbfddada09 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/MoveRecoveryPointHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class MoveRecoveryPointHeaders + { + /// + /// Initializes a new instance of the MoveRecoveryPointHeaders class. + /// + public MoveRecoveryPointHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the MoveRecoveryPointHeaders class. + /// + + /// + /// + + /// + /// + public MoveRecoveryPointHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Page1.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Page1.cs deleted file mode 100644 index cd2eedfc063f..000000000000 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Page1.cs +++ /dev/null @@ -1,43 +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 -{ - - /// - /// Defines a page in Azure responses. - /// - /// Type of the page content items - [Newtonsoft.Json.JsonObject] - public class Page1 : Microsoft.Rest.Azure.IPage - { - /// - /// Gets the link to the next page. - /// - [Newtonsoft.Json.JsonProperty("")] - public System.String NextPageLink { get; private set; } - - [Newtonsoft.Json.JsonProperty("value")] - private System.Collections.Generic.IList Items{ get; set; } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - public System.Collections.Generic.IEnumerator GetEnumerator() - { - return (Items == null) ? System.Linq.Enumerable.Empty().GetEnumerator() : Items.GetEnumerator(); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// A an enumerator that can be used to iterate through the collection. - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - } -} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PerDiskEncryptionSetId.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PerDiskEncryptionSetId.cs new file mode 100644 index 000000000000..5be5fd8d93d9 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PerDiskEncryptionSetId.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Per Disk Encryption Set Ids for Secured VM Data Disks. This will be used to + /// provide Disk Encryption Set Id for each data disk. + /// + public partial class PerDiskEncryptionSetId + { + /// + /// Initializes a new instance of the PerDiskEncryptionSetId class. + /// + public PerDiskEncryptionSetId() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PerDiskEncryptionSetId class. + /// + + /// LUN for Secured VM Data Disk + /// + + /// Disk Encryption Set Id for Secured VM Data Disk + /// + public PerDiskEncryptionSetId(int? lun = default(int?), string diskEncryptionSetId = default(string)) + + { + this.Lun = lun; + this.DiskEncryptionSetId = diskEncryptionSetId; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets lUN for Secured VM Data Disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lun")] + public int? Lun {get; set; } + + /// + /// Gets or sets disk Encryption Set Id for Secured VM Data Disk + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "diskEncryptionSetId")] + public string DiskEncryptionSetId {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupRequest.cs index 7d815bb29c0c..e3b2778981ea 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupRequest.cs @@ -9,9 +9,11 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Contract to validate if backup can be enabled on the given resource in a - /// given vault and given configuration. It will validate followings 1. Vault - /// capacity 2. VM is already protected 3. Any VM related configuration passed - /// in properties. + /// given vault and given configuration. + /// It will validate followings + /// 1. Vault capacity + /// 2. VM is already protected + /// 3. Any VM related configuration passed in properties. /// public partial class PreValidateEnableBackupRequest { diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupResponse.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupResponse.cs index f184e18b6cf5..6a70b09bf87a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupResponse.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PreValidateEnableBackupResponse.cs @@ -37,7 +37,8 @@ public PreValidateEnableBackupResponse() /// /// Specifies the product specific container name. E.g. - /// iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required for portal + /// iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal /// /// Specifies the product specific ds name. E.g. @@ -87,7 +88,8 @@ public PreValidateEnableBackupResponse() /// /// Gets or sets specifies the product specific container name. E.g. - /// iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required for portal + /// iaasvmcontainer;iaasvmcontainer;rgname;vmname. This is required + /// for portal /// [Newtonsoft.Json.JsonProperty(PropertyName = "containerName")] public string ContainerName {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrepareDataMoveRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrepareDataMoveRequest.cs index cc181e91e574..8cb9875099cc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrepareDataMoveRequest.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrepareDataMoveRequest.cs @@ -33,8 +33,8 @@ public PrepareDataMoveRequest() /// DataMove Level /// Possible values include: 'Invalid', 'Vault', 'Container' - /// Source Container ArmIds This needs to be populated only if DataMoveLevel is - /// set to container + /// Source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to container /// /// Ignore the artifacts which are already moved. @@ -75,8 +75,8 @@ public PrepareDataMoveRequest() public string DataMoveLevel {get; set; } /// - /// Gets or sets source Container ArmIds This needs to be populated only if - /// DataMoveLevel is set to container + /// Gets or sets source Container ArmIds + /// This needs to be populated only if DataMoveLevel is set to container /// [Newtonsoft.Json.JsonProperty(PropertyName = "sourceContainerArmIds")] public System.Collections.Generic.IList SourceContainerArmIds {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionDeleteHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionDeleteHeaders.cs new file mode 100644 index 000000000000..3745f748bfec --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class PrivateEndpointConnectionDeleteHeaders + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionDeleteHeaders class. + /// + public PrivateEndpointConnectionDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionDeleteHeaders class. + /// + + /// + /// + + /// + /// + public PrivateEndpointConnectionDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionPutHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionPutHeaders.cs new file mode 100644 index 000000000000..0bc6c2007d67 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionPutHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class PrivateEndpointConnectionPutHeaders + { + /// + /// Initializes a new instance of the PrivateEndpointConnectionPutHeaders class. + /// + public PrivateEndpointConnectionPutHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the PrivateEndpointConnectionPutHeaders class. + /// + + /// + /// + + /// + /// + public PrivateEndpointConnectionPutHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionResource.cs index 6dd39a362497..428c7dec4637 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/PrivateEndpointConnectionResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Private Endpoint Connection Response Properties /// - public partial class PrivateEndpointConnectionResource : Resource + public partial class PrivateEndpointConnectionResource : ProxyResource { /// /// Initializes a new instance of the PrivateEndpointConnectionResource class. @@ -24,32 +24,40 @@ public PrivateEndpointConnectionResource() /// Initializes a new instance of the PrivateEndpointConnectionResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// PrivateEndpointConnectionResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// PrivateEndpointConnectionResource properties + /// Optional ETag. /// - public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), PrivateEndpointConnection properties = default(PrivateEndpointConnection)) + public PrivateEndpointConnectionResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), PrivateEndpointConnection properties = default(PrivateEndpointConnection), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public PrivateEndpointConnectionResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public PrivateEndpointConnection Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectableContainerResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectableContainerResource.cs index 665a02c215c1..306c27a34bc2 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectableContainerResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectableContainerResource.cs @@ -24,14 +24,19 @@ public ProtectableContainerResource() /// Initializes a new instance of the ProtectableContainerResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -45,10 +50,13 @@ public ProtectableContainerResource() /// ProtectableContainerResource properties /// - public ProtectableContainerResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectableContainer properties = default(ProtectableContainer)) + public ProtectableContainerResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectableContainer properties = default(ProtectableContainer)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -59,6 +67,24 @@ public ProtectableContainerResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets protectableContainerResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItem.cs index a3095fab67f1..d1608e19c9c1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItem.cs @@ -84,9 +84,15 @@ public ProtectedItem() /// Soft delete retention period in days /// + /// Source location of the protected item datasource. + /// + /// ID of the vault which protects this item /// - public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string vaultId = default(string)) + + /// Source side threat information + /// + public ProtectedItem(string backupManagementType = default(string), string workloadType = default(string), string containerName = default(string), string sourceResourceId = default(string), string policyId = default(string), System.DateTime? lastRecoveryPoint = default(System.DateTime?), string backupSetName = default(string), string createMode = default(string), System.DateTime? deferredDeleteTimeInUtc = default(System.DateTime?), bool? isScheduledForDeferredDelete = default(bool?), string deferredDeleteTimeRemaining = default(string), bool? isDeferredDeleteScheduleUpcoming = default(bool?), bool? isRehydrate = default(bool?), System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), bool? isArchiveEnabled = default(bool?), string policyName = default(string), int? softDeleteRetentionPeriodInDays = default(int?), string sourceLocation = default(string), string vaultId = default(string), SourceSideScanInfo sourceSideScanInfo = default(SourceSideScanInfo)) { this.BackupManagementType = backupManagementType; @@ -106,7 +112,9 @@ public ProtectedItem() this.IsArchiveEnabled = isArchiveEnabled; this.PolicyName = policyName; this.SoftDeleteRetentionPeriodInDays = softDeleteRetentionPeriodInDays; + this.SourceLocation = sourceLocation; this.VaultId = vaultId; + this.SourceSideScanInfo = sourceSideScanInfo; CustomInit(); } @@ -225,10 +233,22 @@ public ProtectedItem() [Newtonsoft.Json.JsonProperty(PropertyName = "softDeleteRetentionPeriodInDays")] public int? SoftDeleteRetentionPeriodInDays {get; set; } + /// + /// Gets source location of the protected item datasource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceLocation")] + public string SourceLocation {get; private set; } + /// /// Gets iD of the vault which protects this item /// [Newtonsoft.Json.JsonProperty(PropertyName = "vaultId")] public string VaultId {get; private set; } + + /// + /// Gets or sets source side threat information + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceSideScanInfo")] + public SourceSideScanInfo SourceSideScanInfo {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemConfigureSourceScanRequest.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemConfigureSourceScanRequest.cs new file mode 100644 index 000000000000..8966a8e56607 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemConfigureSourceScanRequest.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Request to configure source scan for a protected item + /// + public partial class ProtectedItemConfigureSourceScanRequest + { + /// + /// Initializes a new instance of the ProtectedItemConfigureSourceScanRequest class. + /// + public ProtectedItemConfigureSourceScanRequest() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectedItemConfigureSourceScanRequest class. + /// + + /// Source scan action to perform + /// Possible values include: 'Enable', 'Disable' + public ProtectedItemConfigureSourceScanRequest(string sourceScanAction = default(string)) + + { + this.SourceScanAction = sourceScanAction; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets source scan action to perform Possible values include: 'Enable', 'Disable' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceScanAction")] + public string SourceScanAction {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemResource.cs index 929d2e44c429..27ef2978e054 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Base class for backup items. /// - public partial class ProtectedItemResource : Resource + public partial class ProtectedItemResource : ProxyResource { /// /// Initializes a new instance of the ProtectedItemResource class. @@ -24,32 +24,40 @@ public ProtectedItemResource() /// Initializes a new instance of the ProtectedItemResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// ProtectedItemResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// ProtectedItemResource properties + /// Optional ETag. /// - public ProtectedItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectedItem properties = default(ProtectedItem)) + public ProtectedItemResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ProtectedItem properties = default(ProtectedItem), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public ProtectedItemResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ProtectedItem Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemsCreateOrUpdateHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemsCreateOrUpdateHeaders.cs new file mode 100644 index 000000000000..1b0a62705a33 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectedItemsCreateOrUpdateHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class ProtectedItemsCreateOrUpdateHeaders + { + /// + /// Initializes a new instance of the ProtectedItemsCreateOrUpdateHeaders class. + /// + public ProtectedItemsCreateOrUpdateHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectedItemsCreateOrUpdateHeaders class. + /// + + /// + /// + + /// + /// + public ProtectedItemsCreateOrUpdateHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainer.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainer.cs index b29a9ec72665..c05172256618 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainer.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainer.cs @@ -42,7 +42,10 @@ public ProtectionContainer() /// Type of the protectable object associated with this container /// - public ProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string)) + + /// Source location of the container + /// + public ProtectionContainer(string friendlyName = default(string), string backupManagementType = default(string), string registrationStatus = default(string), string healthStatus = default(string), string protectableObjectType = default(string), string sourceLocation = default(string)) { this.FriendlyName = friendlyName; @@ -50,6 +53,7 @@ public ProtectionContainer() this.RegistrationStatus = registrationStatus; this.HealthStatus = healthStatus; this.ProtectableObjectType = protectableObjectType; + this.SourceLocation = sourceLocation; CustomInit(); } @@ -89,5 +93,11 @@ public ProtectionContainer() /// [Newtonsoft.Json.JsonProperty(PropertyName = "protectableObjectType")] public string ProtectableObjectType {get; set; } + + /// + /// Gets source location of the container + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceLocation")] + public string SourceLocation {get; private set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainerResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainerResource.cs index 2e1800c984e8..bae01fd3d034 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainerResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainerResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// Base class for container with backup items. Containers with specific /// workloads are derived from this class. /// - public partial class ProtectionContainerResource : Resource + public partial class ProtectionContainerResource : ProxyResource { /// /// Initializes a new instance of the ProtectionContainerResource class. @@ -25,32 +25,40 @@ public ProtectionContainerResource() /// Initializes a new instance of the ProtectionContainerResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// ProtectionContainerResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// ProtectionContainerResource properties + /// Optional ETag. /// - public ProtectionContainerResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectionContainer properties = default(ProtectionContainer)) + public ProtectionContainerResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ProtectionContainer properties = default(ProtectionContainer), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -65,5 +73,23 @@ public ProtectionContainerResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ProtectionContainer Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainersRegisterHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainersRegisterHeaders.cs new file mode 100644 index 000000000000..0cc5eb6b3d04 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionContainersRegisterHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class ProtectionContainersRegisterHeaders + { + /// + /// Initializes a new instance of the ProtectionContainersRegisterHeaders class. + /// + public ProtectionContainersRegisterHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionContainersRegisterHeaders class. + /// + + /// + /// + + /// + /// + public ProtectionContainersRegisterHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionIntentResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionIntentResource.cs index fc3df1a3c1b8..be8734fdeaec 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionIntentResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionIntentResource.cs @@ -10,7 +10,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// /// Base class for backup ProtectionIntent. /// - public partial class ProtectionIntentResource : Resource + public partial class ProtectionIntentResource : ProxyResource { /// /// Initializes a new instance of the ProtectionIntentResource class. @@ -24,32 +24,40 @@ public ProtectionIntentResource() /// Initializes a new instance of the ProtectionIntentResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// ProtectionIntentResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// ProtectionIntentResource properties + /// Optional ETag. /// - public ProtectionIntentResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectionIntent properties = default(ProtectionIntent)) + public ProtectionIntentResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ProtectionIntent properties = default(ProtectionIntent), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -64,5 +72,23 @@ public ProtectionIntentResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ProtectionIntent Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPoliciesDeleteHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPoliciesDeleteHeaders.cs new file mode 100644 index 000000000000..a9395f2bfc5f --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPoliciesDeleteHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class ProtectionPoliciesDeleteHeaders + { + /// + /// Initializes a new instance of the ProtectionPoliciesDeleteHeaders class. + /// + public ProtectionPoliciesDeleteHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProtectionPoliciesDeleteHeaders class. + /// + + /// + /// + + /// + /// + public ProtectionPoliciesDeleteHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPolicyResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPolicyResource.cs index b8f6b9894655..9504ee1cd80e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPolicyResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProtectionPolicyResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// Base class for backup policy. Workload-specific backup policies are derived /// from this class. /// - public partial class ProtectionPolicyResource : Resource + public partial class ProtectionPolicyResource : ProxyResource { /// /// Initializes a new instance of the ProtectionPolicyResource class. @@ -25,32 +25,40 @@ public ProtectionPolicyResource() /// Initializes a new instance of the ProtectionPolicyResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// ProtectionPolicyResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// ProtectionPolicyResource properties + /// Optional ETag. /// - public ProtectionPolicyResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ProtectionPolicy properties = default(ProtectionPolicy)) + public ProtectionPolicyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ProtectionPolicy properties = default(ProtectionPolicy), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -65,5 +73,23 @@ public ProtectionPolicyResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ProtectionPolicy Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProxyResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProxyResource.cs new file mode 100644 index 000000000000..92e2a08b5d82 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ProxyResource.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + /// + /// The resource model definition for a Azure Resource Manager proxy resource. + /// It will not have tags and a location + /// + public partial class ProxyResource : Resource + { + /// + /// Initializes a new instance of the ProxyResource class. + /// + public ProxyResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ProxyResource class. + /// + + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + + /// The name of the resource + /// + + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + public ProxyResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) + + : base(id, name, type, systemData) + { + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPoint.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPoint.cs index a53149e0c4c5..90f6bfbb5462 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPoint.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPoint.cs @@ -22,11 +22,40 @@ public RecoveryPoint() CustomInit(); } + /// + /// Initializes a new instance of the RecoveryPoint class. + /// + + /// Threat status of the recovery point + /// Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', + /// 'NotAvailable' + + /// Recovery point threat information. + /// + public RecoveryPoint(string threatStatus = default(string), System.Collections.Generic.IList threatInfo = default(System.Collections.Generic.IList)) + + { + this.ThreatStatus = threatStatus; + this.ThreatInfo = threatInfo; + CustomInit(); + } /// /// An initialization method that performs custom operations like setting defaults /// partial void CustomInit(); + + /// + /// Gets or sets threat status of the recovery point Possible values include: 'Unknown', 'Healthy', 'UnHealthy', 'Warning', 'NotAvailable' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatStatus")] + public string ThreatStatus {get; set; } + + /// + /// Gets or sets recovery point threat information. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatInfo")] + public System.Collections.Generic.IList ThreatInfo {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointImmutabilityProperties.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointImmutabilityProperties.cs new file mode 100644 index 000000000000..2848d27d2b76 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointImmutabilityProperties.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 System.Linq; + + /// + /// Immutability properties of a recovery point. + /// + public partial class RecoveryPointImmutabilityProperties + { + /// + /// Initializes a new instance of the RecoveryPointImmutabilityProperties class. + /// + public RecoveryPointImmutabilityProperties() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RecoveryPointImmutabilityProperties class. + /// + + /// Whether the recovery point is immutable. + /// + + /// Expiry time of immutability in UTC. Omitted when immutability is as per + /// policy. + /// + public RecoveryPointImmutabilityProperties(bool isImmutable, System.DateTime? expiryTime = default(System.DateTime?)) + + { + this.IsImmutable = isImmutable; + this.ExpiryTime = expiryTime; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets whether the recovery point is immutable. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "isImmutable")] + public bool IsImmutable {get; set; } + + /// + /// Gets or sets expiry time of immutability in UTC. Omitted when immutability + /// is as per policy. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "expiryTime")] + public System.DateTime? ExpiryTime {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + //Nothing to validate + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointProperties.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointProperties.cs index 3baad10620b6..f3e581f60af1 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointProperties.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointProperties.cs @@ -32,12 +32,16 @@ public RecoveryPointProperties() /// Bool to indicate whether RP is in soft delete state or not /// - public RecoveryPointProperties(string expiryTime = default(string), string ruleName = default(string), bool? isSoftDeleted = default(bool?)) + + /// Immutability properties of the recovery point. + /// + public RecoveryPointProperties(string expiryTime = default(string), string ruleName = default(string), bool? isSoftDeleted = default(bool?), RecoveryPointImmutabilityProperties immutabilityProperties = default(RecoveryPointImmutabilityProperties)) { this.ExpiryTime = expiryTime; this.RuleName = ruleName; this.IsSoftDeleted = isSoftDeleted; + this.ImmutabilityProperties = immutabilityProperties; CustomInit(); } @@ -64,5 +68,26 @@ public RecoveryPointProperties() /// [Newtonsoft.Json.JsonProperty(PropertyName = "isSoftDeleted")] public bool? IsSoftDeleted {get; set; } + + /// + /// Gets or sets immutability properties of the recovery point. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "immutabilityProperties")] + public RecoveryPointImmutabilityProperties ImmutabilityProperties {get; set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + + if (this.ImmutabilityProperties != null) + { + this.ImmutabilityProperties.Validate(); + } + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointRehydrationInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointRehydrationInfo.cs index 3d8f1faa523c..28731b642888 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointRehydrationInfo.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointRehydrationInfo.cs @@ -24,8 +24,8 @@ public RecoveryPointRehydrationInfo() /// Initializes a new instance of the RecoveryPointRehydrationInfo class. /// - /// How long the rehydrated RP should be kept Should be ISO8601 Duration format - /// e.g. "P7D" + /// How long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" /// /// Rehydration Priority @@ -45,8 +45,8 @@ public RecoveryPointRehydrationInfo() /// - /// Gets or sets how long the rehydrated RP should be kept Should be ISO8601 - /// Duration format e.g. "P7D" + /// Gets or sets how long the rehydrated RP should be kept + /// Should be ISO8601 Duration format e.g. "P7D" /// [Newtonsoft.Json.JsonProperty(PropertyName = "rehydrationRetentionDuration")] public string RehydrationRetentionDuration {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointResource.cs index 42e6287584fd..08dbfdd8be4a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointResource.cs @@ -11,7 +11,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// Base class for backup copies. Workload-specific backup copies are derived /// from this class. /// - public partial class RecoveryPointResource : Resource + public partial class RecoveryPointResource : ProxyResource { /// /// Initializes a new instance of the RecoveryPointResource class. @@ -25,32 +25,40 @@ public RecoveryPointResource() /// Initializes a new instance of the RecoveryPointResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// RecoveryPointResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// RecoveryPointResource properties + /// Optional ETag. /// - public RecoveryPointResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), RecoveryPoint properties = default(RecoveryPoint)) + public RecoveryPointResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), RecoveryPoint properties = default(RecoveryPoint), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -65,5 +73,23 @@ public RecoveryPointResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public RecoveryPoint Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformation.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformation.cs index 7e48eac90578..9519654d0c2c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformation.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformation.cs @@ -33,7 +33,7 @@ public RecoveryPointTierInformation() /// Recovery point tier status. /// - public RecoveryPointTierInformation(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), System.Collections.Generic.IDictionary extendedInfo = default(System.Collections.Generic.IDictionary)) + public RecoveryPointTierInformation(RecoveryPointTierType? type = default(RecoveryPointTierType?), string status = default(string), System.Collections.Generic.IDictionary extendedInfo = default(System.Collections.Generic.IDictionary)) { this.Type = type; @@ -58,7 +58,7 @@ public RecoveryPointTierInformation() /// Gets or sets recovery point tier status. Possible values include: 'Invalid', 'Valid', 'Disabled', 'Deleted', 'Rehydrated' /// [Newtonsoft.Json.JsonProperty(PropertyName = "status")] - public RecoveryPointTierStatus? Status {get; set; } + public string Status {get; set; } /// /// Gets or sets recovery point tier status. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformationV2.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformationV2.cs index ff6596b48f05..c198716cfcd5 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformationV2.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierInformationV2.cs @@ -33,7 +33,7 @@ public RecoveryPointTierInformationV2() /// Recovery point tier status. /// - public RecoveryPointTierInformationV2(RecoveryPointTierType? type = default(RecoveryPointTierType?), RecoveryPointTierStatus? status = default(RecoveryPointTierStatus?), System.Collections.Generic.IDictionary extendedInfo = default(System.Collections.Generic.IDictionary)) + public RecoveryPointTierInformationV2(RecoveryPointTierType? type = default(RecoveryPointTierType?), string status = default(string), System.Collections.Generic.IDictionary extendedInfo = default(System.Collections.Generic.IDictionary)) : base(type, status, extendedInfo) { diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierStatus.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierStatus.cs index 647d27ae528f..629a7153ac03 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierStatus.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RecoveryPointTierStatus.cs @@ -11,59 +11,12 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models /// - [Newtonsoft.Json.JsonConverter(typeof(Newtonsoft.Json.Converters.StringEnumConverter))] - public enum RecoveryPointTierStatus + public static class RecoveryPointTierStatus { - [System.Runtime.Serialization.EnumMember(Value = "Invalid")] - Invalid, - [System.Runtime.Serialization.EnumMember(Value = "Valid")] - Valid, - [System.Runtime.Serialization.EnumMember(Value = "Disabled")] - Disabled, - [System.Runtime.Serialization.EnumMember(Value = "Deleted")] - Deleted, - [System.Runtime.Serialization.EnumMember(Value = "Rehydrated")] - Rehydrated - } - internal static class RecoveryPointTierStatusEnumExtension - { - internal static string ToSerializedValue(this RecoveryPointTierStatus? value) - { - return value == null ? null : ((RecoveryPointTierStatus)value).ToSerializedValue(); - } - internal static string ToSerializedValue(this RecoveryPointTierStatus value) - { - switch( value ) - { - case RecoveryPointTierStatus.Invalid: - return "Invalid"; - case RecoveryPointTierStatus.Valid: - return "Valid"; - case RecoveryPointTierStatus.Disabled: - return "Disabled"; - case RecoveryPointTierStatus.Deleted: - return "Deleted"; - case RecoveryPointTierStatus.Rehydrated: - return "Rehydrated"; - } - return null; - } - internal static RecoveryPointTierStatus? ParseRecoveryPointTierStatus(this string value) - { - switch( value ) - { - case "Invalid": - return RecoveryPointTierStatus.Invalid; - case "Valid": - return RecoveryPointTierStatus.Valid; - case "Disabled": - return RecoveryPointTierStatus.Disabled; - case "Deleted": - return RecoveryPointTierStatus.Deleted; - case "Rehydrated": - return RecoveryPointTierStatus.Rehydrated; - } - return null; - } + public const string Invalid = "Invalid"; + public const string Valid = "Valid"; + public const string Disabled = "Disabled"; + public const string Deleted = "Deleted"; + public const string Rehydrated = "Rehydrated"; } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Resource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Resource.cs index cfc6ab4c1c7f..0dbc6ab5a279 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Resource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Resource.cs @@ -8,8 +8,13 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// ARM Resource. + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources /// + /// + /// Common fields that are returned in the response for all Azure Resource + /// Manager resources + /// public partial class Resource : Microsoft.Rest.Azure.IResource { /// @@ -24,33 +29,27 @@ public Resource() /// Initializes a new instance of the Resource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - - /// Resource tags. - /// - - /// Optional ETag. - /// - public Resource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string)) + public Resource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData)) { this.Id = id; this.Name = name; this.Type = type; - this.Location = location; - this.Tags = tags; - this.ETag = eTag; + this.SystemData = systemData; CustomInit(); } @@ -61,40 +60,30 @@ public Resource() /// - /// Gets resource Id represents the complete path to the resource. + /// Gets fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// [Newtonsoft.Json.JsonProperty(PropertyName = "id")] public string Id {get; private set; } /// - /// Gets resource name associated with the resource. + /// Gets the name of the resource /// [Newtonsoft.Json.JsonProperty(PropertyName = "name")] public string Name {get; private set; } /// - /// Gets resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// Gets the type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// [Newtonsoft.Json.JsonProperty(PropertyName = "type")] public string Type {get; private set; } /// - /// Gets or sets resource location. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "location")] - public string Location {get; set; } - - /// - /// Gets or sets resource tags. - /// - [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] - public System.Collections.Generic.IDictionary Tags {get; set; } - - /// - /// Gets or sets optional ETag. + /// Gets azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// - [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] - public string ETag {get; set; } + [Newtonsoft.Json.JsonProperty(PropertyName = "systemData")] + public SystemData SystemData {get; private set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ResourceGuardProxyBaseResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ResourceGuardProxyBaseResource.cs index 4f608a6b07a0..25247c5fee6e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ResourceGuardProxyBaseResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ResourceGuardProxyBaseResource.cs @@ -7,7 +7,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models { using System.Linq; - public partial class ResourceGuardProxyBaseResource : Resource + public partial class ResourceGuardProxyBaseResource : ProxyResource { /// /// Initializes a new instance of the ResourceGuardProxyBaseResource class. @@ -21,32 +21,40 @@ public ResourceGuardProxyBaseResource() /// Initializes a new instance of the ResourceGuardProxyBaseResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" /// - /// Resource location. + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. + /// + + /// ResourceGuardProxyBaseResource properties /// /// Resource tags. /// - /// Optional ETag. + /// The geo-location where the resource lives /// - /// ResourceGuardProxyBaseResource properties + /// Optional ETag. /// - public ResourceGuardProxyBaseResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), ResourceGuardProxyBase properties = default(ResourceGuardProxyBase)) + public ResourceGuardProxyBaseResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), ResourceGuardProxyBase properties = default(ResourceGuardProxyBase), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string location = default(string), string eTag = default(string)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { this.Properties = properties; + this.Tags = tags; + this.Location = location; + this.ETag = eTag; CustomInit(); } @@ -61,6 +69,24 @@ public ResourceGuardProxyBaseResource() /// [Newtonsoft.Json.JsonProperty(PropertyName = "properties")] public ResourceGuardProxyBase Properties {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets the geo-location where the resource lives + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } /// /// Validate the object. /// @@ -73,6 +99,9 @@ public virtual void Validate() { this.Properties.Validate(); } + + + } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoreRequestResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoreRequestResource.cs index 0f9c4c6b5c96..4a59b93c80cc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoreRequestResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoreRequestResource.cs @@ -25,14 +25,19 @@ public RestoreRequestResource() /// Initializes a new instance of the RestoreRequestResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -46,10 +51,13 @@ public RestoreRequestResource() /// RestoreRequestResource properties /// - public RestoreRequestResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), RestoreRequest properties = default(RestoreRequest)) + public RestoreRequestResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), RestoreRequest properties = default(RestoreRequest)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -60,6 +68,24 @@ public RestoreRequestResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets restoreRequestResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoresTriggerHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoresTriggerHeaders.cs new file mode 100644 index 000000000000..1703a06d0480 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RestoresTriggerHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class RestoresTriggerHeaders + { + /// + /// Initializes a new instance of the RestoresTriggerHeaders class. + /// + public RestoresTriggerHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the RestoresTriggerHeaders class. + /// + + /// + /// + + /// + /// + public RestoresTriggerHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RetentionDuration.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RetentionDuration.cs index 3ab2343ad68a..f44c55dc42ab 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RetentionDuration.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/RetentionDuration.cs @@ -25,8 +25,9 @@ public RetentionDuration() /// /// Count of duration types. Retention duration is obtained by the counting the - /// duration type Count times. For example, when Count = 3 and DurationType = - /// Weeks, retention duration will be three weeks. + /// duration type Count times. + /// For example, when Count = 3 and DurationType = Weeks, retention duration + /// will be three weeks. /// /// Retention duration type of retention policy. @@ -47,8 +48,9 @@ public RetentionDuration() /// /// Gets or sets count of duration types. Retention duration is obtained by the - /// counting the duration type Count times. For example, when Count = 3 and - /// DurationType = Weeks, retention duration will be three weeks. + /// counting the duration type Count times. + /// For example, when Count = 3 and DurationType = Weeks, retention duration + /// will be three weeks. /// [Newtonsoft.Json.JsonProperty(PropertyName = "count")] public int? Count {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SecuredVMDetails.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SecuredVMDetails.cs index ab222a92c0a0..f27d9d066153 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SecuredVMDetails.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SecuredVMDetails.cs @@ -26,10 +26,15 @@ public SecuredVMDetails() /// Gets or Sets Disk Encryption Set Id for Secured VM OS Disk /// - public SecuredVMDetails(string securedVmosDiskEncryptionSetId = default(string)) + + /// Data disk encryption settings for Secured VM. This will be used to provide + /// Disk Encryption Set Id for each data disk. + /// + public SecuredVMDetails(string securedVmosDiskEncryptionSetId = default(string), DataDiskEncryptionSettings dataDiskEncryptionSettings = default(DataDiskEncryptionSettings)) { this.SecuredVMOSDiskEncryptionSetId = securedVmosDiskEncryptionSetId; + this.DataDiskEncryptionSettings = dataDiskEncryptionSettings; CustomInit(); } @@ -44,5 +49,12 @@ public SecuredVMDetails() /// [Newtonsoft.Json.JsonProperty(PropertyName = "securedVMOsDiskEncryptionSetId")] public string SecuredVMOSDiskEncryptionSetId {get; set; } + + /// + /// Gets or sets data disk encryption settings for Secured VM. This will be + /// used to provide Disk Encryption Set Id for each data disk. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "dataDiskEncryptionSettings")] + public DataDiskEncryptionSettings DataDiskEncryptionSettings {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Settings.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Settings.cs index 287d6a4e81eb..5bbf78abd092 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Settings.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/Settings.cs @@ -64,8 +64,8 @@ public Settings() /// /// Gets or sets workload compression flag. This has been added so that - /// 'isSqlCompression' will be deprecated once clients upgrade to consider this - /// flag. + /// 'isSqlCompression' + /// will be deprecated once clients upgrade to consider this flag. /// [Newtonsoft.Json.JsonProperty(PropertyName = "isCompression")] public bool? IsCompression {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceScanAction.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceScanAction.cs new file mode 100644 index 000000000000..219b70a0f455 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceScanAction.cs @@ -0,0 +1,25 @@ +// 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 SourceScanAction. + /// + + + public static class SourceScanAction + { + /// + /// Enable source scan + /// + public const string Enable = "Enable"; + /// + /// Disable source scan + /// + public const string Disable = "Disable"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanInfo.cs new file mode 100644 index 000000000000..90384ba1c9bc --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanInfo.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Source side threat information + /// + public partial class SourceSideScanInfo + { + /// + /// Initializes a new instance of the SourceSideScanInfo class. + /// + public SourceSideScanInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SourceSideScanInfo class. + /// + + /// Threat status of the container + /// Possible values include: 'Configured', 'NotConfigured', 'NotApplicable', + /// 'ConfigurationFailed' + + /// Threat summary for the container + /// Possible values include: 'Unknown', 'NotApplicable', 'Suspicious', + /// 'Healthy', 'NoThreatsReported' + public SourceSideScanInfo(string sourceSideScanStatus = default(string), string sourceSideScanSummary = default(string)) + + { + this.SourceSideScanStatus = sourceSideScanStatus; + this.SourceSideScanSummary = sourceSideScanSummary; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets threat status of the container Possible values include: 'Configured', 'NotConfigured', 'NotApplicable', 'ConfigurationFailed' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceSideScanStatus")] + public string SourceSideScanStatus {get; set; } + + /// + /// Gets or sets threat summary for the container Possible values include: 'Unknown', 'NotApplicable', 'Suspicious', 'Healthy', 'NoThreatsReported' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "sourceSideScanSummary")] + public string SourceSideScanSummary {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanStatus.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanStatus.cs new file mode 100644 index 000000000000..e0d797171742 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanStatus.cs @@ -0,0 +1,33 @@ +// 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 SourceSideScanStatus. + /// + + + public static class SourceSideScanStatus + { + /// + /// Source side scan is configured + /// + public const string Configured = "Configured"; + /// + /// Source side scan is not configured + /// + public const string NotConfigured = "NotConfigured"; + /// + /// Source side scan is not applicable + /// + public const string NotApplicable = "NotApplicable"; + /// + /// Source side scan configuration failed + /// + public const string ConfigurationFailed = "ConfigurationFailed"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanSummary.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanSummary.cs new file mode 100644 index 000000000000..2e5c4932cf02 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SourceSideScanSummary.cs @@ -0,0 +1,37 @@ +// 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 SourceSideScanSummary. + /// + + + public static class SourceSideScanSummary + { + /// + /// Scan summary is unknown + /// + public const string Unknown = "Unknown"; + /// + /// Scan summary is not applicable + /// + public const string NotApplicable = "NotApplicable"; + /// + /// Scan summary is suspicious + /// + public const string Suspicious = "Suspicious"; + /// + /// Scan summary indicates healthy state + /// + public const string Healthy = "Healthy"; + /// + /// No threats reported + /// + public const string NoThreatsReported = "NoThreatsReported"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SubProtectionPolicy.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SubProtectionPolicy.cs index 0e887a2d2c9f..6983b83bbcce 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SubProtectionPolicy.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SubProtectionPolicy.cs @@ -34,9 +34,9 @@ public SubProtectionPolicy() /// Retention policy with the details on backup copy retention ranges. /// - /// Tiering policy to automatically move RPs to another tier. Key is Target - /// Tier, defined in RecoveryPointTierType enum. Tiering policy specifies the - /// criteria to move RP to the target tier. + /// Tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. /// /// Snapshot Backup related fields for WorkloadType SaPHanaSystem @@ -78,9 +78,9 @@ public SubProtectionPolicy() public RetentionPolicy RetentionPolicy {get; set; } /// - /// Gets or sets tiering policy to automatically move RPs to another tier. Key - /// is Target Tier, defined in RecoveryPointTierType enum. Tiering policy - /// specifies the criteria to move RP to the target tier. + /// Gets or sets tiering policy to automatically move RPs to another tier. + /// Key is Target Tier, defined in RecoveryPointTierType enum. + /// Tiering policy specifies the criteria to move RP to the target tier. /// [Newtonsoft.Json.JsonProperty(PropertyName = "tieringPolicy")] public System.Collections.Generic.IDictionary TieringPolicy {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SystemData.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SystemData.cs new file mode 100644 index 000000000000..907b9b66dcce --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/SystemData.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Metadata pertaining to creation and last modification of the resource. + /// + public partial class SystemData + { + /// + /// Initializes a new instance of the SystemData class. + /// + public SystemData() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the SystemData class. + /// + + /// The identity that created the resource. + /// + + /// The type of identity that created the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource creation (UTC). + /// + + /// The identity that last modified the resource. + /// + + /// The type of identity that last modified the resource. + /// Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + + /// The timestamp of resource last modification (UTC) + /// + public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?)) + + { + this.CreatedBy = createdBy; + this.CreatedByType = createdByType; + this.CreatedAt = createdAt; + this.LastModifiedBy = lastModifiedBy; + this.LastModifiedByType = lastModifiedByType; + this.LastModifiedAt = lastModifiedAt; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets the identity that created the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdBy")] + public string CreatedBy {get; set; } + + /// + /// Gets or sets the type of identity that created the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdByType")] + public string CreatedByType {get; set; } + + /// + /// Gets or sets the timestamp of resource creation (UTC). + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "createdAt")] + public System.DateTime? CreatedAt {get; set; } + + /// + /// Gets or sets the identity that last modified the resource. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedBy")] + public string LastModifiedBy {get; set; } + + /// + /// Gets or sets the type of identity that last modified the resource. Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedByType")] + public string LastModifiedByType {get; set; } + + /// + /// Gets or sets the timestamp of resource last modification (UTC) + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastModifiedAt")] + public System.DateTime? LastModifiedAt {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatInfo.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatInfo.cs new file mode 100644 index 000000000000..0a75b6daf594 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatInfo.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Recovery Point Threat information + /// + public partial class ThreatInfo + { + /// + /// Initializes a new instance of the ThreatInfo class. + /// + public ThreatInfo() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ThreatInfo class. + /// + + /// Threat Subject + /// + + /// Threat Description + /// + + /// Timestamp when the last (latest)threat information was sent + /// + + /// Threat Status Types + /// Possible values include: 'Active', 'InProgress', 'Ignored', 'Resolved' + + /// Start timestamp of the threat + /// + + /// End timestamp of the threat + /// + + /// threat details link + /// + + /// Threat Severity Types + /// Possible values include: 'Critical', 'High', 'Warning', 'Informational' + public ThreatInfo(string threatTitle = default(string), string threatDescription = default(string), System.DateTime? lastUpdatedTime = default(System.DateTime?), string threatState = default(string), System.DateTime? threatStartTime = default(System.DateTime?), System.DateTime? threatEndTime = default(System.DateTime?), string threatUri = default(string), string threatSeverity = default(string)) + + { + this.ThreatTitle = threatTitle; + this.ThreatDescription = threatDescription; + this.LastUpdatedTime = lastUpdatedTime; + this.ThreatState = threatState; + this.ThreatStartTime = threatStartTime; + this.ThreatEndTime = threatEndTime; + this.ThreatUri = threatUri; + this.ThreatSeverity = threatSeverity; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets threat Subject + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatTitle")] + public string ThreatTitle {get; private set; } + + /// + /// Gets threat Description + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatDescription")] + public string ThreatDescription {get; private set; } + + /// + /// Gets timestamp when the last (latest)threat information was sent + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "lastUpdatedTime")] + public System.DateTime? LastUpdatedTime {get; private set; } + + /// + /// Gets or sets threat Status Types Possible values include: 'Active', 'InProgress', 'Ignored', 'Resolved' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatState")] + public string ThreatState {get; set; } + + /// + /// Gets start timestamp of the threat + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatStartTime")] + public System.DateTime? ThreatStartTime {get; private set; } + + /// + /// Gets end timestamp of the threat + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatEndTime")] + public System.DateTime? ThreatEndTime {get; private set; } + + /// + /// Gets threat details link + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatURI")] + public string ThreatUri {get; private set; } + + /// + /// Gets or sets threat Severity Types Possible values include: 'Critical', 'High', 'Warning', 'Informational' + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "threatSeverity")] + public string ThreatSeverity {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatSeverity.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatSeverity.cs new file mode 100644 index 000000000000..8b40129e010b --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatSeverity.cs @@ -0,0 +1,33 @@ +// 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 ThreatSeverity. + /// + + + public static class ThreatSeverity + { + /// + /// Critical severity level + /// + public const string Critical = "Critical"; + /// + /// High severity level + /// + public const string High = "High"; + /// + /// Warning severity level + /// + public const string Warning = "Warning"; + /// + /// Informational severity level + /// + public const string Informational = "Informational"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatState.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatState.cs new file mode 100644 index 000000000000..23bc3ae285bc --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatState.cs @@ -0,0 +1,33 @@ +// 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 ThreatState. + /// + + + public static class ThreatState + { + /// + /// Threat is active + /// + public const string Active = "Active"; + /// + /// Threat remediation is in progress + /// + public const string InProgress = "InProgress"; + /// + /// Threat has been ignored + /// + public const string Ignored = "Ignored"; + /// + /// Threat has been resolved + /// + public const string Resolved = "Resolved"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatStatus.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatStatus.cs new file mode 100644 index 000000000000..de73c8b28b15 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ThreatStatus.cs @@ -0,0 +1,37 @@ +// 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 ThreatStatus. + /// + + + public static class ThreatStatus + { + /// + /// Threat status is unknown + /// + public const string Unknown = "Unknown"; + /// + /// Recovery point is healthy + /// + public const string Healthy = "Healthy"; + /// + /// Recovery point is unhealthy + /// + public const string UnHealthy = "UnHealthy"; + /// + /// Recovery point has warning-level threats + /// + public const string Warning = "Warning"; + /// + /// Threat status is not available + /// + public const string NotAvailable = "NotAvailable"; + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/TieringPolicy.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/TieringPolicy.cs index e752e0ed14af..37fd7dfc827c 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/TieringPolicy.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/TieringPolicy.cs @@ -8,9 +8,9 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models using System.Linq; /// - /// Tiering Policy for a target tier. If the policy is not specified for a - /// given target tier, service retains the existing configured tiering policy - /// for that tier + /// Tiering Policy for a target tier. + /// If the policy is not specified for a given target tier, service retains the + /// existing configured tiering policy for that tier /// public partial class TieringPolicy { @@ -27,19 +27,21 @@ public TieringPolicy() /// /// Tiering Mode to control automatic tiering of recovery points. Supported - /// values are: 1. TierRecommended: Tier all recovery points recommended to be - /// tiered 2. TierAfter: Tier all recovery points after a fixed period, as - /// specified in duration + durationType below. 3. DoNotTier: Do not tier any - /// recovery points + /// values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified + /// in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points /// Possible values include: 'Invalid', 'TierRecommended', 'TierAfter', /// 'DoNotTier' /// Number of days/weeks/months/years to retain backups in current tier before - /// tiering. Used only if TieringMode is set to TierAfter + /// tiering. + /// Used only if TieringMode is set to TierAfter /// - /// Retention duration type: days/weeks/months/years Used only if TieringMode - /// is set to TierAfter + /// Retention duration type: days/weeks/months/years + /// Used only if TieringMode is set to TierAfter /// Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years' public TieringPolicy(string tieringMode = default(string), int? duration = default(int?), string durationType = default(string)) @@ -58,24 +60,26 @@ public TieringPolicy() /// /// Gets or sets tiering Mode to control automatic tiering of recovery points. - /// Supported values are: 1. TierRecommended: Tier all recovery points - /// recommended to be tiered 2. TierAfter: Tier all recovery points after a - /// fixed period, as specified in duration + durationType below. 3. DoNotTier: - /// Do not tier any recovery points Possible values include: 'Invalid', 'TierRecommended', 'TierAfter', 'DoNotTier' + /// Supported values are: + /// 1. TierRecommended: Tier all recovery points recommended to be tiered + /// 2. TierAfter: Tier all recovery points after a fixed period, as specified + /// in duration + durationType below. + /// 3. DoNotTier: Do not tier any recovery points Possible values include: 'Invalid', 'TierRecommended', 'TierAfter', 'DoNotTier' /// [Newtonsoft.Json.JsonProperty(PropertyName = "tieringMode")] public string TieringMode {get; set; } /// /// Gets or sets number of days/weeks/months/years to retain backups in current - /// tier before tiering. Used only if TieringMode is set to TierAfter + /// tier before tiering. + /// Used only if TieringMode is set to TierAfter /// [Newtonsoft.Json.JsonProperty(PropertyName = "duration")] public int? Duration {get; set; } /// - /// Gets or sets retention duration type: days/weeks/months/years Used only if - /// TieringMode is set to TierAfter Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years' + /// Gets or sets retention duration type: days/weeks/months/years + /// Used only if TieringMode is set to TierAfter Possible values include: 'Invalid', 'Days', 'Weeks', 'Months', 'Years' /// [Newtonsoft.Json.JsonProperty(PropertyName = "durationType")] public string DurationType {get; set; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationResponse.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationResponse.cs index 1c7a7428bcb2..25c19499810b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationResponse.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationResponse.cs @@ -26,7 +26,7 @@ public ValidateOperationResponse() /// Gets the validation result /// - public ValidateOperationResponse(System.Collections.Generic.IList validationResults = default(System.Collections.Generic.IList)) + public ValidateOperationResponse(System.Collections.Generic.IList validationResults = default(System.Collections.Generic.IList)) { this.ValidationResults = validationResults; @@ -43,6 +43,6 @@ public ValidateOperationResponse() /// Gets or sets gets the validation result /// [Newtonsoft.Json.JsonProperty(PropertyName = "validationResults")] - public System.Collections.Generic.IList ValidationResults {get; set; } + public System.Collections.Generic.IList ValidationResults {get; set; } } } \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationTriggerHeaders.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationTriggerHeaders.cs new file mode 100644 index 000000000000..27c09d76cbc3 --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/ValidateOperationTriggerHeaders.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + public partial class ValidateOperationTriggerHeaders + { + /// + /// Initializes a new instance of the ValidateOperationTriggerHeaders class. + /// + public ValidateOperationTriggerHeaders() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the ValidateOperationTriggerHeaders class. + /// + + /// + /// + + /// + /// + public ValidateOperationTriggerHeaders(string location = default(string), int? retryAfter = default(int?)) + + { + this.Location = location; + this.RetryAfter = retryAfter; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Location")] + public string Location {get; set; } + + /// + /// Gets or sets + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "Retry-After")] + public int? RetryAfter {get; set; } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/VaultResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/VaultResource.cs new file mode 100644 index 000000000000..e03631163f0b --- /dev/null +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/VaultResource.cs @@ -0,0 +1,58 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.Management.RecoveryServices.Backup.Models +{ + using System.Linq; + + /// + /// Vault resource in Recovery Service. + /// + public partial class VaultResource + { + /// + /// Initializes a new instance of the VaultResource class. + /// + public VaultResource() + { + CustomInit(); + } + + /// + /// Initializes a new instance of the VaultResource class. + /// + + /// The name of the VaultResource + /// + public VaultResource(string name) + + { + this.Name = name; + CustomInit(); + } + + /// + /// An initialization method that performs custom operations like setting defaults + /// + partial void CustomInit(); + + + /// + /// Gets the name of the VaultResource + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "name")] + public string Name {get; private set; } + /// + /// Validate the object. + /// + /// + /// Thrown if validation fails + /// + public virtual void Validate() + { + + } + } +} \ No newline at end of file diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadItemResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadItemResource.cs index 4682c88c4bdc..ccf7a44acb6b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadItemResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadItemResource.cs @@ -25,14 +25,19 @@ public WorkloadItemResource() /// Initializes a new instance of the WorkloadItemResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -46,10 +51,13 @@ public WorkloadItemResource() /// WorkloadItemResource properties /// - public WorkloadItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), WorkloadItem properties = default(WorkloadItem)) + public WorkloadItemResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), WorkloadItem properties = default(WorkloadItem)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -60,6 +68,24 @@ public WorkloadItemResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets workloadItemResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadProtectableItemResource.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadProtectableItemResource.cs index 9e2dcbc0ad1f..d2d10c30f760 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadProtectableItemResource.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Models/WorkloadProtectableItemResource.cs @@ -25,14 +25,19 @@ public WorkloadProtectableItemResource() /// Initializes a new instance of the WorkloadProtectableItemResource class. /// - /// Resource Id represents the complete path to the resource. + /// Fully qualified resource ID for the resource. Ex - + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} /// - /// Resource name associated with the resource. + /// The name of the resource /// - /// Resource type represents the complete path of the form - /// Namespace/ResourceType/ResourceType/... + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + /// "Microsoft.Storage/storageAccounts" + /// + + /// Azure Resource Manager metadata containing createdBy and modifiedBy + /// information. /// /// Resource location. @@ -46,10 +51,13 @@ public WorkloadProtectableItemResource() /// WorkloadProtectableItemResource properties /// - public WorkloadProtectableItemResource(string id = default(string), string name = default(string), string type = default(string), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), WorkloadProtectableItem properties = default(WorkloadProtectableItem)) + public WorkloadProtectableItemResource(string id = default(string), string name = default(string), string type = default(string), SystemData systemData = default(SystemData), string location = default(string), System.Collections.Generic.IDictionary tags = default(System.Collections.Generic.IDictionary), string eTag = default(string), WorkloadProtectableItem properties = default(WorkloadProtectableItem)) - : base(id, name, type, location, tags, eTag) + : base(id, name, type, systemData) { + this.Location = location; + this.Tags = tags; + this.ETag = eTag; this.Properties = properties; CustomInit(); } @@ -60,6 +68,24 @@ public WorkloadProtectableItemResource() partial void CustomInit(); + /// + /// Gets or sets resource location. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "location")] + public string Location {get; set; } + + /// + /// Gets or sets resource tags. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "tags")] + public System.Collections.Generic.IDictionary Tags {get; set; } + + /// + /// Gets or sets optional ETag. + /// + [Newtonsoft.Json.JsonProperty(PropertyName = "eTag")] + public string ETag {get; set; } + /// /// Gets or sets workloadProtectableItemResource properties /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperations.cs index 78e9961c0f31..0fc079cf882f 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperations.cs @@ -46,8 +46,7 @@ internal OperationOperations (RecoveryServicesBackupClient client) /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. @@ -96,12 +95,28 @@ internal OperationOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } ValidateOperationRequestResource parameters = new ValidateOperationRequestResource(); if(id != null||properties != null) { @@ -202,14 +217,13 @@ internal OperationOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -219,10 +233,6 @@ internal OperationOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperationsExtensions.cs index 6d147bfb7d81..24891e8a218d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationOperationsExtensions.cs @@ -23,8 +23,7 @@ public static partial class OperationOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// public static ValidateOperationsResponse Validate(this IOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties) { @@ -42,8 +41,7 @@ public static ValidateOperationsResponse Validate(this IOperationOperations oper /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Operations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Operations.cs index a5fe2f5251a9..088270e5db41 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Operations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/Operations.cs @@ -39,7 +39,7 @@ internal Operations (RecoveryServicesBackupClient client) public RecoveryServicesBackupClient Client { get; private set; } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// Headers that will be added to request. @@ -155,14 +155,13 @@ internal Operations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -172,10 +171,6 @@ internal Operations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -226,7 +221,7 @@ internal Operations (RecoveryServicesBackupClient client) } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The NextLink from the previous successful call to List operation. @@ -337,14 +332,13 @@ internal Operations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -354,10 +348,6 @@ internal Operations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationsExtensions.cs index 1b0e0a0aee2e..0498bc19cbe9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/OperationsExtensions.cs @@ -13,7 +13,7 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public static partial class OperationsExtensions { /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -24,7 +24,7 @@ public static Microsoft.Rest.Azure.IPage List( } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -40,7 +40,7 @@ public static Microsoft.Rest.Azure.IPage List( } } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. @@ -54,7 +54,7 @@ public static Microsoft.Rest.Azure.IPage ListN } /// - /// Returns the list of available operations. + /// List the operations for the provider /// /// /// The operations group for this extension method. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperations.cs index e4b8d7d8a442..7d2602c5755d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperations.cs @@ -41,12 +41,11 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// Get Private Endpoint Connection. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -72,7 +71,7 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -83,19 +82,35 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (privateEndpointConnectionName == null) @@ -110,8 +125,8 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -122,9 +137,9 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -192,11 +207,11 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -261,12 +276,11 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// Approve or Reject Private Endpoint requests. This call is made by Backup /// Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -280,22 +294,21 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginPutWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Delete Private Endpoint requests. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -306,10 +319,10 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -317,12 +330,11 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// Approve or Reject Private Endpoint requests. This call is made by Backup /// Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -351,7 +363,7 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginPutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginPutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -367,19 +379,35 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (privateEndpointConnectionName == null) @@ -394,8 +422,8 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("parameters", parameters); @@ -407,9 +435,9 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -483,14 +511,13 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien if ((int)_statusCode != 200 && (int)_statusCode != 201) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -500,10 +527,6 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -516,7 +539,7 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -560,6 +583,19 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -574,12 +610,11 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// Delete Private Endpoint requests. This call is made by Backup Admin. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -602,7 +637,7 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -613,19 +648,35 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (privateEndpointConnectionName == null) @@ -640,8 +691,8 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); @@ -652,9 +703,9 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -722,14 +773,13 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -739,10 +789,6 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -755,7 +801,7 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -763,6 +809,19 @@ internal PrivateEndpointConnectionOperations (RecoveryServicesBackupClient clien { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperationsExtensions.cs index a66978b53c4f..eda7f6582a72 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointConnectionOperationsExtensions.cs @@ -18,19 +18,18 @@ public static partial class PrivateEndpointConnectionOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. /// - public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { - return ((IPrivateEndpointConnectionOperations)operations).GetAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionOperations)operations).GetAsync(resourceGroupName, vaultName, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -39,12 +38,11 @@ public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnect /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -52,9 +50,9 @@ public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnect /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -66,19 +64,18 @@ public static PrivateEndpointConnectionResource Get(this IPrivateEndpointConnect /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. /// - public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) + public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) { - return ((IPrivateEndpointConnectionOperations)operations).PutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionOperations)operations).PutAsync(resourceGroupName, vaultName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); } /// @@ -88,12 +85,11 @@ public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnect /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -101,9 +97,9 @@ public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnect /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PutAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task PutAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -114,19 +110,18 @@ public static PrivateEndpointConnectionResource Put(this IPrivateEndpointConnect /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. /// - public static void Delete(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + public static PrivateEndpointConnectionDeleteHeaders Delete(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { - ((IPrivateEndpointConnectionOperations)operations).DeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionOperations)operations).DeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -135,12 +130,11 @@ public static void Delete(this IPrivateEndpointConnectionOperations operations, /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -148,9 +142,12 @@ public static void Delete(this IPrivateEndpointConnectionOperations operations, /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Approve or Reject Private Endpoint requests. This call is made by Backup @@ -159,19 +156,18 @@ public static void Delete(this IPrivateEndpointConnectionOperations operations, /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. /// - public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) + public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters) { - return ((IPrivateEndpointConnectionOperations)operations).BeginPutAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionOperations)operations).BeginPutAsync(resourceGroupName, vaultName, privateEndpointConnectionName, parameters).GetAwaiter().GetResult(); } /// @@ -181,12 +177,11 @@ public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointCo /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -194,9 +189,9 @@ public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointCo /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginPutAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginPutAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, PrivateEndpointConnectionResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginPutWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginPutWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -207,19 +202,18 @@ public static PrivateEndpointConnectionResource BeginPut(this IPrivateEndpointCo /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. /// - public static void BeginDelete(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName) + public static PrivateEndpointConnectionDeleteHeaders BeginDelete(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { - ((IPrivateEndpointConnectionOperations)operations).BeginDeleteAsync(vaultName, resourceGroupName, privateEndpointConnectionName).GetAwaiter().GetResult(); + return ((IPrivateEndpointConnectionOperations)operations).BeginDeleteAsync(resourceGroupName, vaultName, privateEndpointConnectionName).GetAwaiter().GetResult(); } /// @@ -228,12 +222,11 @@ public static void BeginDelete(this IPrivateEndpointConnectionOperations operati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The name of the private endpoint connection. @@ -241,9 +234,12 @@ public static void BeginDelete(this IPrivateEndpointConnectionOperations operati /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateEndpointConnectionOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IPrivateEndpointConnectionOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperations.cs index 0c7037df2284..e05bee3e3eba 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperations.cs @@ -41,18 +41,17 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) /// /// Gets the operation status for a private endpoint connection. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// The name of the private endpoint connection. + /// The name of the PrivateEndpointConnectionResource /// /// - /// Operation id + /// The name of the PrivateEndpointConnectionResource /// /// /// Headers that will be added to request. @@ -75,7 +74,7 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string privateEndpointConnectionName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -86,19 +85,35 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (privateEndpointConnectionName == null) @@ -118,8 +133,8 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("privateEndpointConnectionName", privateEndpointConnectionName); tracingParameters.Add("operationId", operationId); @@ -131,9 +146,9 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{privateEndpointConnectionName}", System.Uri.EscapeDataString(privateEndpointConnectionName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -202,11 +217,11 @@ internal PrivateEndpointOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperationsExtensions.cs index ce6c615e22d2..8b88441317d6 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/PrivateEndpointOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class PrivateEndpointOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// The name of the private endpoint connection. + /// The name of the PrivateEndpointConnectionResource /// /// - /// Operation id + /// The name of the PrivateEndpointConnectionResource /// - public static OperationStatus GetOperationStatus(this IPrivateEndpointOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId) + public static OperationStatus GetOperationStatus(this IPrivateEndpointOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, string operationId) { - return ((IPrivateEndpointOperations)operations).GetOperationStatusAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId).GetAwaiter().GetResult(); + return ((IPrivateEndpointOperations)operations).GetOperationStatusAsync(resourceGroupName, vaultName, privateEndpointConnectionName, operationId).GetAwaiter().GetResult(); } /// @@ -42,25 +41,24 @@ public static OperationStatus GetOperationStatus(this IPrivateEndpointOperations /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// The name of the private endpoint connection. + /// The name of the PrivateEndpointConnectionResource /// /// - /// Operation id + /// The name of the PrivateEndpointConnectionResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IPrivateEndpointOperations operations, string vaultName, string resourceGroupName, string privateEndpointConnectionName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IPrivateEndpointOperations operations, string resourceGroupName, string vaultName, string privateEndpointConnectionName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(vaultName, resourceGroupName, privateEndpointConnectionName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(resourceGroupName, vaultName, privateEndpointConnectionName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperations.cs index f6ca8c882cf9..40ad10798ace 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperations.cs @@ -41,19 +41,18 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) /// /// Lists the containers that can be registered to Recovery Services Vault. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// /// + /// + /// OData filter options. + /// /// /// Headers that will be added to request. /// @@ -75,13 +74,12 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -96,17 +94,34 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (fabricName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,10 +129,10 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -133,18 +148,14 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsContainerQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsContainerQueryObject)) - { - _queryParameters.Add(_bmsContainerQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -205,14 +216,13 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -222,10 +232,6 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -387,14 +393,13 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -404,10 +409,6 @@ internal ProtectableContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperationsExtensions.cs index f7cfabf21324..1111c3273fb2 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectableContainersOperationsExtensions.cs @@ -18,22 +18,21 @@ public static partial class ProtectableContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// /// - public static Microsoft.Rest.Azure.IPage List(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// OData filter options. + /// + public static Microsoft.Rest.Azure.IPage List(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string filter = default(string)) { - return ((IProtectableContainersOperations)operations).ListAsync(vaultName, resourceGroupName, fabricName, odataQuery).GetAwaiter().GetResult(); + return ((IProtectableContainersOperations)operations).ListAsync(vaultName, resourceGroupName, fabricName, filter).GetAwaiter().GetResult(); } /// @@ -42,25 +41,24 @@ public static partial class ProtectableContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// /// + /// + /// OData filter options. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IProtectableContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperations.cs index 9773f361c647..9baa71826d33 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperations.cs @@ -41,25 +41,23 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c /// /// Fetches the result of any operation on the backup item. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectedItemResource /// /// /// Headers that will be added to request. @@ -82,7 +80,7 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -93,19 +91,35 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -135,8 +149,8 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -150,9 +164,9 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -223,14 +237,13 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -240,10 +253,6 @@ internal ProtectedItemOperationResultsOperations (RecoveryServicesBackupClient c } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperationsExtensions.cs index 1233606cab1e..adac13cc32d5 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationResultsOperationsExtensions.cs @@ -18,29 +18,27 @@ public static partial class ProtectedItemOperationResultsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectedItemResource /// - public static ProtectedItemResource Get(this IProtectedItemOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId) + public static ProtectedItemResource Get(this IProtectedItemOperationResultsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId) { - return ((IProtectedItemOperationResultsOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); + return ((IProtectedItemOperationResultsOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); } /// @@ -49,32 +47,30 @@ public static ProtectedItemResource Get(this IProtectedItemOperationResultsOpera /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectedItemResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemOperationResultsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperations.cs index c092f1e900c8..a5a28203d2f3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperations.cs @@ -40,29 +40,29 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of the operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with the operation. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID represents the operation whose status needs to be fetched. + /// The name of the ProtectedItemResource /// /// /// Headers that will be added to request. @@ -85,7 +85,7 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -96,19 +96,35 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -138,8 +154,8 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -153,9 +169,9 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -226,14 +242,13 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -243,10 +258,6 @@ internal ProtectedItemOperationStatusesOperations (RecoveryServicesBackupClient } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs index 68e90d1eb36d..d1a8abdb8838 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemOperationStatusesOperationsExtensions.cs @@ -14,73 +14,73 @@ public static partial class ProtectedItemOperationStatusesOperationsExtensions { /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of the operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with the operation. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID represents the operation whose status needs to be fetched. + /// The name of the ProtectedItemResource /// - public static OperationStatus Get(this IProtectedItemOperationStatusesOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId) + public static OperationStatus Get(this IProtectedItemOperationStatusesOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId) { - return ((IProtectedItemOperationStatusesOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); + return ((IProtectedItemOperationStatusesOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId).GetAwaiter().GetResult(); } /// /// Fetches the status of an operation such as triggering a backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// OperationStatus enum for all the possible states of the operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with the operation. + /// The status can be in progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. Some operations + /// create jobs. This method returns the list of jobs associated with the + /// operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the backup item. + /// backupFabrics /// /// - /// Container name associated with the backup item. + /// The name of the ProtectionContainerResource /// /// - /// Backup item name whose details are to be fetched. + /// The name of the ProtectedItemResource /// /// - /// OperationID represents the operation whose status needs to be fetched. + /// The name of the ProtectedItemResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemOperationStatusesOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemOperationStatusesOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperations.cs index 97f104b41de3..2bac7eea9b62 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperations.cs @@ -40,28 +40,27 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// Provides the details of the backed up item. This is an asynchronous - /// operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// /// Backed up item name whose details are to be fetched. /// + /// + /// OData filter options. + /// /// /// Headers that will be added to request. /// @@ -83,31 +82,46 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -125,6 +139,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -132,12 +147,12 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -147,26 +162,22 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _getProtectedItemQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_getProtectedItemQueryObject)) - { - _queryParameters.Add(_getProtectedItemQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -227,14 +238,13 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -244,10 +254,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -299,24 +305,24 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } /// /// Enables backup of an item or to modifies the backup policy information of - /// an already backed up item. This is an asynchronous operation. To know the - /// status of the operation, call the GetItemOperationResult API. + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Item name to be backed up. + /// Backed up item name whose details are to be fetched. /// /// /// @@ -330,12 +336,42 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// The cancellation token. /// + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Used to disable backup of an item within a container. This is an + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// 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 /// @@ -345,35 +381,46 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (parameters == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); - } - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -391,7 +438,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -399,25 +445,23 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); - tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); - tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "CreateOrUpdate", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); } // Construct URL var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -434,7 +478,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); + _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -449,14 +493,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } - if (xMsAuthorizationAuxiliary != null) - { - if (_httpRequest.Headers.Contains("x-ms-authorization-auxiliary")) - { - _httpRequest.Headers.Remove("x-ms-authorization-auxiliary"); - } - _httpRequest.Headers.TryAddWithoutValidation("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); - } if (customHeaders != null) { @@ -471,12 +507,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } // Serialize Request string _requestContent = null; - if(parameters != null) - { - _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); - _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); - _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); - } // Set Credentials if (this.Client.Credentials != null) { @@ -499,16 +529,15 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -518,10 +547,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -534,7 +559,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -542,24 +567,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); - } - catch (Newtonsoft.Json.JsonException ex) - { - _httpRequest.Dispose(); - if (_httpResponse != null) - { - _httpResponse.Dispose(); - } - throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); - } - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -572,25 +579,31 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } /// - /// Used to disable backup of an item within a container. This is an - /// asynchronous operation. To know the status of the request, call the + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the /// GetItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be deleted. + /// Backed up item name whose details are to be fetched. + /// + /// + /// + /// + /// + /// resource backed up item /// /// /// Headers that will be added to request. @@ -601,6 +614,9 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// Thrown when the operation returned an invalid status code /// + /// + /// Thrown when unable to deserialize the response + /// /// /// Thrown when a required parameter is null /// @@ -610,30 +626,51 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginCreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { + if (parameters == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); + } + if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -651,6 +688,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -658,23 +696,25 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); + tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "Delete", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginCreateOrUpdate", tracingParameters); } // Construct URL var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -691,7 +731,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) // Create HTTP transport objects var _httpRequest = new System.Net.Http.HttpRequestMessage(); System.Net.Http.HttpResponseMessage _httpResponse = null; - _httpRequest.Method = new System.Net.Http.HttpMethod("DELETE"); + _httpRequest.Method = new System.Net.Http.HttpMethod("PUT"); _httpRequest.RequestUri = new System.Uri(_url); // Set Headers if (this.Client.GenerateClientRequestId != null && this.Client.GenerateClientRequestId.Value) @@ -706,6 +746,14 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } _httpRequest.Headers.TryAddWithoutValidation("accept-language", this.Client.AcceptLanguage); } + if (xMsAuthorizationAuxiliary != null) + { + if (_httpRequest.Headers.Contains("x-ms-authorization-auxiliary")) + { + _httpRequest.Headers.Remove("x-ms-authorization-auxiliary"); + } + _httpRequest.Headers.TryAddWithoutValidation("x-ms-authorization-auxiliary", xMsAuthorizationAuxiliary); + } if (customHeaders != null) { @@ -720,6 +768,12 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } // Serialize Request string _requestContent = null; + if(parameters != null) + { + _requestContent = Microsoft.Rest.Serialization.SafeJsonConvert.SerializeObject(parameters, this.Client.SerializationSettings); + _httpRequest.Content = new System.Net.Http.StringContent(_requestContent, System.Text.Encoding.UTF8); + _httpRequest.Content.Headers.ContentType =System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json; charset=utf-8"); + } // Set Credentials if (this.Client.Credentials != null) { @@ -742,16 +796,15 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -761,10 +814,6 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -777,7 +826,7 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -785,6 +834,37 @@ internal ProtectedItemsOperations (RecoveryServicesBackupClient client) { _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 = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); + } + } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperationsExtensions.cs index 62af770923c1..6cb73e1bb85a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectedItemsOperationsExtensions.cs @@ -14,128 +14,126 @@ public static partial class ProtectedItemsOperationsExtensions { /// /// Provides the details of the backed up item. This is an asynchronous - /// operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// /// Backed up item name whose details are to be fetched. /// - public static ProtectedItemResource Get(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// OData filter options. + /// + public static ProtectedItemResource Get(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string)) { - return ((IProtectedItemsOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery).GetAwaiter().GetResult(); + return ((IProtectedItemsOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter).GetAwaiter().GetResult(); } /// /// Provides the details of the backed up item. This is an asynchronous - /// operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// /// Backed up item name whose details are to be fetched. /// + /// + /// OData filter options. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Enables backup of an item or to modifies the backup policy information of - /// an already backed up item. This is an asynchronous operation. To know the - /// status of the operation, call the GetItemOperationResult API. + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Item name to be backed up. + /// Backed up item name whose details are to be fetched. /// /// /// /// - public static ProtectedItemResource CreateOrUpdate(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static ProtectedItemResource CreateOrUpdate(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - return ((IProtectedItemsOperations)operations).CreateOrUpdateAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IProtectedItemsOperations)operations).CreateOrUpdateAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// /// Enables backup of an item or to modifies the backup policy information of - /// an already backed up item. This is an asynchronous operation. To know the - /// status of the operation, call the GetItemOperationResult API. + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backup item. + /// Name of the container whose details need to be fetched. /// /// - /// Item name to be backed up. + /// Backed up item name whose details are to be fetched. /// /// /// @@ -143,72 +141,139 @@ public static partial class ProtectedItemsOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Used to disable backup of an item within a container. This is an - /// asynchronous operation. To know the status of the request, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be deleted. + /// Backed up item name whose details are to be fetched. /// - public static void Delete(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName) + public static void Delete(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName) { - ((IProtectedItemsOperations)operations).DeleteAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName).GetAwaiter().GetResult(); + ((IProtectedItemsOperations)operations).DeleteAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName).GetAwaiter().GetResult(); } /// /// Used to disable backup of an item within a container. This is an - /// asynchronous operation. To know the status of the request, call the + /// asynchronous operation. To know the status of the + /// request, call the GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task DeleteAsync(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + } + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the /// GetItemOperationResult API. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// + /// + public static ProtectedItemResource BeginCreateOrUpdate(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string)) + { + return ((IProtectedItemsOperations)operations).BeginCreateOrUpdateAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + } + + /// + /// Enables backup of an item or to modifies the backup policy information of + /// an already backed up item. This is an + /// asynchronous operation. To know the status of the operation, call the + /// GetItemOperationResult API. + /// + /// + /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be deleted. + /// Backed up item name whose details are to be fetched. + /// + /// + /// /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IProtectedItemsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginCreateOrUpdateAsync(this IProtectedItemsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, ProtectedItemResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginCreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Body; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperations.cs index 4cbef96a2348..18710ffb4bfd 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperations.cs @@ -41,22 +41,20 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl /// /// Fetches the result of any operation on the container. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the container. + /// backupFabrics /// /// - /// Container name whose information should be fetched. + /// The name of the ProtectionContainerResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionContainerResource /// /// /// Headers that will be added to request. @@ -79,7 +77,7 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -90,19 +88,35 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -127,8 +141,8 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("operationId", operationId); @@ -141,9 +155,9 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -213,14 +227,13 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -230,10 +243,6 @@ internal ProtectionContainerOperationResultsOperations (RecoveryServicesBackupCl } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs index cf8fe709fb39..37935968d81d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerOperationResultsOperationsExtensions.cs @@ -18,26 +18,24 @@ public static partial class ProtectionContainerOperationResultsOperationsExtensi /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the container. + /// backupFabrics /// /// - /// Container name whose information should be fetched. + /// The name of the ProtectionContainerResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionContainerResource /// - public static ProtectionContainerResource Get(this IProtectionContainerOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId) + public static ProtectionContainerResource Get(this IProtectionContainerOperationResultsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string operationId) { - return ((IProtectionContainerOperationResultsOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName, operationId).GetAwaiter().GetResult(); + return ((IProtectionContainerOperationResultsOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName, operationId).GetAwaiter().GetResult(); } /// @@ -46,29 +44,27 @@ public static ProtectionContainerResource Get(this IProtectionContainerOperation /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Fabric name associated with the container. + /// backupFabrics /// /// - /// Container name whose information should be fetched. + /// The name of the ProtectionContainerResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionContainerResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionContainerOperationResultsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionContainerOperationResultsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperations.cs index 8ff0dc4f70d9..a0fad0b78427 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperations.cs @@ -46,8 +46,7 @@ internal ProtectionContainerRefreshOperationResultsOperations (RecoveryServicesB /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated with the container. @@ -94,12 +93,28 @@ internal ProtectionContainerRefreshOperationResultsOperations (RecoveryServicesB { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (fabricName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); @@ -201,14 +216,13 @@ internal ProtectionContainerRefreshOperationResultsOperations (RecoveryServicesB if ((int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -218,10 +232,6 @@ internal ProtectionContainerRefreshOperationResultsOperations (RecoveryServicesB } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs index 251b6a9bab97..f2ba4334808d 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainerRefreshOperationResultsOperationsExtensions.cs @@ -23,8 +23,7 @@ public static partial class ProtectionContainerRefreshOperationResultsOperations /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated with the container. @@ -49,8 +48,7 @@ public static void Get(this IProtectionContainerRefreshOperationResultsOperation /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated with the container. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperations.cs index cb074b76b206..7786d4df8730 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperations.cs @@ -42,15 +42,14 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// Gets details of the specific container registered to your Recovery Services /// Vault. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// /// Name of the container whose details need to be fetched. @@ -76,7 +75,7 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -87,19 +86,35 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -119,8 +134,8 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); @@ -132,9 +147,9 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); @@ -203,14 +218,13 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -220,10 +234,6 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -274,22 +284,22 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// Request body for operation @@ -300,31 +310,30 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> RegisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRegisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginRegisterWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPutOrPatchOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Unregisters the given container from your Recovery Services Vault. This is - /// an asynchronous operation. To determine whether the backend service has - /// finished processing the request, call Get Container Operation Result API. + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// - /// Name of the container which needs to be unregistered from the Recovery - /// Services Vault. + /// Name of the container whose details need to be fetched. /// /// /// Headers that will be added to request. @@ -344,7 +353,7 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task UnregisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task UnregisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -355,19 +364,35 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -387,8 +412,8 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); @@ -400,9 +425,9 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); @@ -471,14 +496,13 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -488,10 +512,6 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -527,21 +547,20 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// This is an async operation and the results should be tracked using location /// header or Azure-async-url. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric Name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container in which inquiry needs to be triggered. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// Headers that will be added to request. @@ -561,31 +580,46 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task InquireWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task InquireWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -598,6 +632,7 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -605,11 +640,11 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -619,25 +654,21 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsContainersInquiryQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsContainersInquiryQueryObject)) - { - _queryParameters.Add(_bmsContainersInquiryQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -698,14 +729,13 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -715,10 +745,6 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -752,22 +778,22 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } /// /// Discovers all the containers in the subscription that can be backed up to - /// Recovery Services Vault. This is an asynchronous operation. To know the - /// status of the operation, call GetRefreshOperationResult API. + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult API. /// - /// - /// - /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated the container. /// + /// + /// OData filter options. + /// /// /// Headers that will be added to request. /// @@ -786,13 +812,12 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task RefreshWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); @@ -807,17 +832,34 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (fabricName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -825,10 +867,10 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -844,18 +886,14 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsRefreshContainersQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsRefreshContainersQueryObject)) - { - _queryParameters.Add(_bmsRefreshContainersQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -916,14 +954,13 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -933,10 +970,6 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -969,22 +1002,22 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// Request body for operation @@ -1010,7 +1043,7 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> BeginRegisterWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginRegisterWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1026,19 +1059,35 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -1058,8 +1107,8 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); @@ -1072,9 +1121,9 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); @@ -1149,14 +1198,13 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1166,10 +1214,6 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1182,7 +1226,7 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1208,6 +1252,19 @@ internal ProtectionContainersOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.SerializationException("Unable to deserialize the response.", _responseContent, ex); } } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperationsExtensions.cs index 8cee7e1833e2..0d167edfa523 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionContainersOperationsExtensions.cs @@ -19,22 +19,21 @@ public static partial class ProtectionContainersOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// /// Name of the container whose details need to be fetched. /// - public static ProtectionContainerResource Get(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName) + public static ProtectionContainerResource Get(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName) { - return ((IProtectionContainersOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName).GetAwaiter().GetResult(); + return ((IProtectionContainersOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName).GetAwaiter().GetResult(); } /// @@ -44,15 +43,14 @@ public static ProtectionContainerResource Get(this IProtectionContainersOperatio /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// /// Name of the container whose details need to be fetched. @@ -60,125 +58,123 @@ public static ProtectionContainerResource Get(this IProtectionContainersOperatio /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// - public static ProtectionContainerResource Register(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters) + public static ProtectionContainerResource Register(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters) { - return ((IProtectionContainersOperations)operations).RegisterAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).GetAwaiter().GetResult(); + return ((IProtectionContainersOperations)operations).RegisterAsync(resourceGroupName, vaultName, fabricName, containerName, parameters).GetAwaiter().GetResult(); } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RegisterAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RegisterAsync(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.RegisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.RegisterWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Unregisters the given container from your Recovery Services Vault. This is - /// an asynchronous operation. To determine whether the backend service has - /// finished processing the request, call Get Container Operation Result API. + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// - /// Name of the container which needs to be unregistered from the Recovery - /// Services Vault. + /// Name of the container whose details need to be fetched. /// - public static void Unregister(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName) + public static void Unregister(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName) { - ((IProtectionContainersOperations)operations).UnregisterAsync(vaultName, resourceGroupName, fabricName, containerName).GetAwaiter().GetResult(); + ((IProtectionContainersOperations)operations).UnregisterAsync(resourceGroupName, vaultName, fabricName, containerName).GetAwaiter().GetResult(); } /// /// Unregisters the given container from your Recovery Services Vault. This is - /// an asynchronous operation. To determine whether the backend service has - /// finished processing the request, call Get Container Operation Result API. + /// an asynchronous operation. To determine + /// whether the backend service has finished processing the request, call Get + /// Container Operation Result 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Name of the fabric where the container belongs. + /// The name of the BackupFabricResource /// /// - /// Name of the container which needs to be unregistered from the Recovery - /// Services Vault. + /// Name of the container whose details need to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UnregisterAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UnregisterAsync(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.UnregisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.UnregisterWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// /// This is an async operation and the results should be tracked using location @@ -187,25 +183,24 @@ public static void Unregister(this IProtectionContainersOperations operations, s /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric Name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container in which inquiry needs to be triggered. + /// Name of the container whose details need to be fetched. /// - public static void Inquire(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// OData filter options. + /// + public static void Inquire(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string)) { - ((IProtectionContainersOperations)operations).InquireAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery).GetAwaiter().GetResult(); + ((IProtectionContainersOperations)operations).InquireAsync(resourceGroupName, vaultName, fabricName, containerName, filter).GetAwaiter().GetResult(); } /// @@ -215,136 +210,135 @@ public static void Unregister(this IProtectionContainersOperations operations, s /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric Name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container in which inquiry needs to be triggered. + /// Name of the container whose details need to be fetched. + /// + /// + /// OData filter options. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task InquireAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task InquireAsync(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.InquireWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.InquireWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, filter, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// /// Discovers all the containers in the subscription that can be backed up to - /// Recovery Services Vault. This is an asynchronous operation. To know the - /// status of the operation, call GetRefreshOperationResult API. + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult 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. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated the container. /// - public static void Refresh(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + /// + /// OData filter options. + /// + public static void Refresh(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string filter = default(string)) { - ((IProtectionContainersOperations)operations).RefreshAsync(vaultName, resourceGroupName, fabricName, odataQuery).GetAwaiter().GetResult(); + ((IProtectionContainersOperations)operations).RefreshAsync(vaultName, resourceGroupName, fabricName, filter).GetAwaiter().GetResult(); } /// /// Discovers all the containers in the subscription that can be backed up to - /// Recovery Services Vault. This is an asynchronous operation. To know the - /// status of the operation, call GetRefreshOperationResult API. + /// Recovery Services Vault. This is an + /// asynchronous operation. To know the status of the operation, call + /// GetRefreshOperationResult 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. + /// The name of the resource group. The name is case insensitive. /// /// /// Fabric name associated the container. /// + /// + /// OData filter options. + /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task RefreshAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task RefreshAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.RefreshWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, odataQuery, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.RefreshWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, filter, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// - public static ProtectionContainerResource BeginRegister(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters) + public static ProtectionContainerResource BeginRegister(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters) { - return ((IProtectionContainersOperations)operations).BeginRegisterAsync(vaultName, resourceGroupName, fabricName, containerName, parameters).GetAwaiter().GetResult(); + return ((IProtectionContainersOperations)operations).BeginRegisterAsync(resourceGroupName, vaultName, fabricName, containerName, parameters).GetAwaiter().GetResult(); } /// - /// Registers the container with Recovery Services vault. This is an - /// asynchronous operation. To track the operation status, use location header - /// to call get latest status of the operation. + /// Registers the container with Recovery Services vault. + /// This is an asynchronous operation. To track the operation status, use + /// location header to call get latest status of + /// the operation. /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the container. + /// The name of the BackupFabricResource /// /// - /// Name of the container to be registered. + /// Name of the container whose details need to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginRegisterAsync(this IProtectionContainersOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginRegisterAsync(this IProtectionContainersOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, ProtectionContainerResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.BeginRegisterWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.BeginRegisterWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperations.cs index b9352b8f3c31..2b54ee5b2c46 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperations.cs @@ -96,7 +96,13 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -114,7 +120,7 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.Client.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "Subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection").ToString(); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.RecoveryServices/locations/{azureRegion}/backupPreValidateProtection").ToString(); _url = _url.Replace("{azureRegion}", System.Uri.EscapeDataString(azureRegion)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); @@ -189,14 +195,13 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -206,10 +211,6 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -261,18 +262,17 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) } /// /// Provides the details of the protection intent up item. This is an - /// asynchronous operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// /// Backed up item name whose details are to be fetched. @@ -298,7 +298,7 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -309,19 +309,35 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -341,8 +357,8 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("intentObjectName", intentObjectName); @@ -353,10 +369,10 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.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}/backupProtectionIntent/{intentObjectName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); @@ -425,14 +441,13 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -442,10 +457,6 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -499,18 +510,17 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) /// Create Intent for Enabling backup of an item. This is a synchronous /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Intent object name. + /// Backed up item name whose details are to be fetched. /// /// /// resource backed up item @@ -536,7 +546,7 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -552,19 +562,35 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -584,8 +610,8 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("intentObjectName", intentObjectName); @@ -597,10 +623,10 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.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}/backupProtectionIntent/{intentObjectName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); @@ -675,14 +701,13 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -692,10 +717,6 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -748,18 +769,17 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// Used to remove intent from an item /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the intent. + /// The name of the BackupFabricResource /// /// - /// Intent to be deleted. + /// Backed up item name whose details are to be fetched. /// /// /// Headers that will be added to request. @@ -779,7 +799,7 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -790,19 +810,35 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -822,8 +858,8 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("intentObjectName", intentObjectName); @@ -834,10 +870,10 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) // Construct URL var _baseUrl = this.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}/backupProtectionIntent/{intentObjectName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/backupProtectionIntent/{intentObjectName}").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{intentObjectName}", System.Uri.EscapeDataString(intentObjectName)); @@ -906,14 +942,13 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -923,10 +958,6 @@ internal ProtectionIntentOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperationsExtensions.cs index d096fb1c908d..871f33916480 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionIntentOperationsExtensions.cs @@ -53,47 +53,45 @@ public static PreValidateEnableBackupResponse Validate(this IProtectionIntentOpe } /// /// Provides the details of the protection intent up item. This is an - /// asynchronous operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// /// Backed up item name whose details are to be fetched. /// - public static ProtectionIntentResource Get(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName) + public static ProtectionIntentResource Get(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName) { - return ((IProtectionIntentOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, intentObjectName).GetAwaiter().GetResult(); + return ((IProtectionIntentOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, intentObjectName).GetAwaiter().GetResult(); } /// /// Provides the details of the protection intent up item. This is an - /// asynchronous operation. To know the status of the operation, call the - /// GetItemOperationResult API. + /// asynchronous operation. To know the status of the operation, + /// call the GetItemOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// /// Backed up item name whose details are to be fetched. @@ -101,9 +99,9 @@ public static ProtectionIntentResource Get(this IProtectionIntentOperations oper /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -115,22 +113,21 @@ public static ProtectionIntentResource Get(this IProtectionIntentOperations oper /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Intent object name. + /// Backed up item name whose details are to be fetched. /// - public static ProtectionIntentResource CreateOrUpdate(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters) + public static ProtectionIntentResource CreateOrUpdate(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName, ProtectionIntentResource parameters) { - return ((IProtectionIntentOperations)operations).CreateOrUpdateAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters).GetAwaiter().GetResult(); + return ((IProtectionIntentOperations)operations).CreateOrUpdateAsync(resourceGroupName, vaultName, fabricName, intentObjectName, parameters).GetAwaiter().GetResult(); } /// @@ -140,25 +137,24 @@ public static ProtectionIntentResource CreateOrUpdate(this IProtectionIntentOper /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backup item. + /// The name of the BackupFabricResource /// /// - /// Intent object name. + /// Backed up item name whose details are to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName, ProtectionIntentResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, intentObjectName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -169,22 +165,21 @@ public static ProtectionIntentResource CreateOrUpdate(this IProtectionIntentOper /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the intent. + /// The name of the BackupFabricResource /// /// - /// Intent to be deleted. + /// Backed up item name whose details are to be fetched. /// - public static void Delete(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName) + public static void Delete(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName) { - ((IProtectionIntentOperations)operations).DeleteAsync(vaultName, resourceGroupName, fabricName, intentObjectName).GetAwaiter().GetResult(); + ((IProtectionIntentOperations)operations).DeleteAsync(resourceGroupName, vaultName, fabricName, intentObjectName).GetAwaiter().GetResult(); } /// @@ -193,25 +188,24 @@ public static void Delete(this IProtectionIntentOperations operations, string va /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the intent. + /// The name of the BackupFabricResource /// /// - /// Intent to be deleted. + /// Backed up item name whose details are to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IProtectionIntentOperations operations, string vaultName, string resourceGroupName, string fabricName, string intentObjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IProtectionIntentOperations operations, string resourceGroupName, string vaultName, string fabricName, string intentObjectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, intentObjectName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperations.cs index 667a4d2c62da..b9f2ab473c35 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperations.cs @@ -40,15 +40,15 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) /// /// Provides the details of the backup policies associated to Recovery Services - /// Vault. This is an asynchronous operation. Status of the operation can be - /// fetched using GetPolicyOperationResult API. + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Backup policy information to be fetched. @@ -74,7 +74,7 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -85,19 +85,35 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (policyName == null) @@ -112,8 +128,8 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("policyName", policyName); @@ -124,9 +140,9 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -194,14 +210,13 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -211,10 +226,6 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -266,17 +277,17 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) } /// /// Creates or modifies a backup policy. This is an asynchronous operation. - /// Status of the operation can be fetched using GetPolicyOperationResult API. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be created. + /// Backup policy information to be fetched. /// /// /// @@ -305,7 +316,7 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> CreateOrUpdateWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -321,19 +332,35 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (policyName == null) @@ -349,8 +376,8 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("policyName", policyName); tracingParameters.Add("xMsAuthorizationAuxiliary", xMsAuthorizationAuxiliary); @@ -363,9 +390,9 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -447,14 +474,13 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -464,10 +490,6 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -519,18 +541,17 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// Headers that will be added to request. @@ -538,27 +559,26 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// Headers that will be added to request. @@ -578,7 +598,7 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -589,19 +609,35 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (policyName == null) @@ -616,8 +652,8 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("policyName", policyName); @@ -628,9 +664,9 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -696,16 +732,15 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 204) + if ((int)_statusCode != 200 && (int)_statusCode != 202 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -715,10 +750,6 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -731,7 +762,7 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -739,6 +770,19 @@ internal ProtectionPoliciesOperations (RecoveryServicesBackupClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperationsExtensions.cs index e887bd5b148b..ee89709ded81 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPoliciesOperationsExtensions.cs @@ -14,41 +14,41 @@ public static partial class ProtectionPoliciesOperationsExtensions { /// /// Provides the details of the backup policies associated to Recovery Services - /// Vault. This is an asynchronous operation. Status of the operation can be - /// fetched using GetPolicyOperationResult API. + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Backup policy information to be fetched. /// - public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName) { - return ((IProtectionPoliciesOperations)operations).GetAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + return ((IProtectionPoliciesOperations)operations).GetAsync(resourceGroupName, vaultName, policyName).GetAwaiter().GetResult(); } /// /// Provides the details of the backup policies associated to Recovery Services - /// Vault. This is an asynchronous operation. Status of the operation can be - /// fetched using GetPolicyOperationResult API. + /// Vault. This is an asynchronous + /// operation. Status of the operation can be fetched using + /// GetPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Backup policy information to be fetched. @@ -56,54 +56,54 @@ public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations op /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Creates or modifies a backup policy. This is an asynchronous operation. - /// Status of the operation can be fetched using GetPolicyOperationResult API. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be created. + /// Backup policy information to be fetched. /// /// /// /// - public static ProtectionPolicyResource CreateOrUpdate(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static ProtectionPolicyResource CreateOrUpdate(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - return ((IProtectionPoliciesOperations)operations).CreateOrUpdateAsync(vaultName, resourceGroupName, policyName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IProtectionPoliciesOperations)operations).CreateOrUpdateAsync(resourceGroupName, vaultName, policyName, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// /// Creates or modifies a backup policy. This is an asynchronous operation. - /// Status of the operation can be fetched using GetPolicyOperationResult API. + /// Status of the operation can be fetched + /// using GetPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be created. + /// Backup policy information to be fetched. /// /// /// @@ -111,108 +111,110 @@ public static ProtectionPolicyResource Get(this IProtectionPoliciesOperations op /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task CreateOrUpdateAsync(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName, ProtectionPolicyResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// - public static void Delete(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + public static ProtectionPoliciesDeleteHeaders Delete(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName) { - ((IProtectionPoliciesOperations)operations).DeleteAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + return ((IProtectionPoliciesOperations)operations).DeleteAsync(resourceGroupName, vaultName, policyName).GetAwaiter().GetResult(); } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// - public static void BeginDelete(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName) + public static ProtectionPoliciesDeleteHeaders BeginDelete(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName) { - ((IProtectionPoliciesOperations)operations).BeginDeleteAsync(vaultName, resourceGroupName, policyName).GetAwaiter().GetResult(); + return ((IProtectionPoliciesOperations)operations).BeginDeleteAsync(resourceGroupName, vaultName, policyName).GetAwaiter().GetResult(); } /// /// Deletes specified backup policy from your Recovery Services Vault. This is - /// an asynchronous operation. Status of the operation can be fetched using - /// GetProtectionPolicyOperationResult API. + /// an asynchronous operation. Status of the + /// operation can be fetched using GetProtectionPolicyOperationResult 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Backup policy to be deleted. + /// Backup policy information to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginDeleteAsync(this IProtectionPoliciesOperations operations, string vaultName, string resourceGroupName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginDeleteAsync(this IProtectionPoliciesOperations operations, string resourceGroupName, string vaultName, string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperations.cs index 627235cb9bea..33b8916f0644 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperations.cs @@ -41,19 +41,17 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien /// /// Provides the result of an operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's result needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// Headers that will be added to request. @@ -76,7 +74,7 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -87,19 +85,35 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (policyName == null) @@ -119,8 +133,8 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("policyName", policyName); tracingParameters.Add("operationId", operationId); @@ -132,9 +146,9 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -203,14 +217,13 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -220,10 +233,6 @@ internal ProtectionPolicyOperationResultsOperations (RecoveryServicesBackupClien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs index 70eaaad24b4e..4d52014a18ec 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationResultsOperationsExtensions.cs @@ -18,23 +18,21 @@ public static partial class ProtectionPolicyOperationResultsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's result needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// - public static ProtectionPolicyResource Get(this IProtectionPolicyOperationResultsOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId) + public static ProtectionPolicyResource Get(this IProtectionPolicyOperationResultsOperations operations, string resourceGroupName, string vaultName, string policyName, string operationId) { - return ((IProtectionPolicyOperationResultsOperations)operations).GetAsync(vaultName, resourceGroupName, policyName, operationId).GetAwaiter().GetResult(); + return ((IProtectionPolicyOperationResultsOperations)operations).GetAsync(resourceGroupName, vaultName, policyName, operationId).GetAwaiter().GetResult(); } /// @@ -43,26 +41,24 @@ public static ProtectionPolicyResource Get(this IProtectionPolicyOperationResult /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's result needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents the operation whose result needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionPolicyOperationResultsOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionPolicyOperationResultsOperations operations, string resourceGroupName, string vaultName, string policyName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperations.cs index 261549519b4f..98df9aebc894 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperations.cs @@ -40,24 +40,23 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie /// /// Provides the status of the asynchronous operations like backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// Operation Status enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with operation. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// operation. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's status needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents an operation whose status needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// Headers that will be added to request. @@ -80,7 +79,7 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string policyName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -91,19 +90,35 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (policyName == null) @@ -123,8 +138,8 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("policyName", policyName); tracingParameters.Add("operationId", operationId); @@ -136,9 +151,9 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{policyName}", System.Uri.EscapeDataString(policyName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); @@ -207,14 +222,13 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -224,10 +238,6 @@ internal ProtectionPolicyOperationStatusesOperations (RecoveryServicesBackupClie } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs index c652cfd11b5a..fb1abbac49d3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ProtectionPolicyOperationStatusesOperationsExtensions.cs @@ -14,63 +14,61 @@ public static partial class ProtectionPolicyOperationStatusesOperationsExtension { /// /// Provides the status of the asynchronous operations like backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// Operation Status enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with operation. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's status needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents an operation whose status needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// - public static OperationStatus Get(this IProtectionPolicyOperationStatusesOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId) + public static OperationStatus Get(this IProtectionPolicyOperationStatusesOperations operations, string resourceGroupName, string vaultName, string policyName, string operationId) { - return ((IProtectionPolicyOperationStatusesOperations)operations).GetAsync(vaultName, resourceGroupName, policyName, operationId).GetAwaiter().GetResult(); + return ((IProtectionPolicyOperationStatusesOperations)operations).GetAsync(resourceGroupName, vaultName, policyName, operationId).GetAwaiter().GetResult(); } /// /// Provides the status of the asynchronous operations like backup, restore. - /// The status can be in progress, completed or failed. You can refer to the - /// Operation Status enum for all the possible states of an operation. Some - /// operations create jobs. This method returns the list of jobs associated - /// with operation. + /// The status can be in progress, completed + /// or failed. You can refer to the Operation Status enum for all the possible + /// states of an operation. Some operations + /// create jobs. This method returns the list of jobs associated with + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// Backup policy name whose operation's status needs to be fetched. + /// The name of the ProtectionPolicyResource /// /// - /// Operation ID which represents an operation whose status needs to be - /// fetched. + /// The name of the ProtectionPolicyResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IProtectionPolicyOperationStatusesOperations operations, string vaultName, string resourceGroupName, string policyName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IProtectionPolicyOperationStatusesOperations operations, string resourceGroupName, string vaultName, string policyName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, policyName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperations.cs index 8bed60c1cb8a..2ef9f0cad1b3 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperations.cs @@ -41,24 +41,23 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) /// /// Lists the backup copies for the backed up item. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item whose backup copies are to be fetched. + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData filter options. /// /// /// Headers that will be added to request. @@ -81,31 +80,46 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - if (this.Client.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -123,6 +137,7 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); } + // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -130,12 +145,12 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("odataQuery", odataQuery); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("filter", filter); tracingParameters.Add("cancellationToken", cancellationToken); @@ -145,26 +160,22 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); - if (odataQuery != null) - { - var _bmsrpQueryObject = odataQuery.ToString(); - if (!string.IsNullOrEmpty(_bmsrpQueryObject)) - { - _queryParameters.Add(_bmsrpQueryObject); - } - } if (this.Client.ApiVersion != null) { _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(this.Client.ApiVersion))); } + if (filter != null) + { + _queryParameters.Add(string.Format("$filter={0}", System.Uri.EscapeDataString(filter))); + } if (_queryParameters.Count > 0) { _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters); @@ -225,14 +236,13 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -242,10 +252,6 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -297,24 +303,24 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) } /// /// Provides the information of the backed up data identified using - /// RecoveryPointID. This is an asynchronous operation. To know the status of - /// the operation, call the GetProtectedItemOperationResult API. + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// GetProtectedItemOperationResult API. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose backup data needs to be fetched. + /// Backed up item name whose details are to be fetched. /// /// /// RecoveryPointID represents the backed up data to be fetched. @@ -340,7 +346,7 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -351,19 +357,35 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -393,8 +415,8 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -408,9 +430,9 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -481,14 +503,13 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -498,10 +519,6 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -663,14 +680,13 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -680,10 +696,6 @@ internal RecoveryPointsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperationsExtensions.cs index 3d134f25c09d..ce17fd21cc24 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsOperationsExtensions.cs @@ -18,28 +18,27 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item whose backup copies are to be fetched. + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData filter options. /// - public static Microsoft.Rest.Azure.IPage List(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery)) + public static Microsoft.Rest.Azure.IPage List(this IRecoveryPointsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string)) { - return ((IRecoveryPointsOperations)operations).ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery).GetAwaiter().GetResult(); + return ((IRecoveryPointsOperations)operations).ListAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter).GetAwaiter().GetResult(); } /// @@ -48,90 +47,89 @@ public static partial class RecoveryPointsOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// + /// + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item whose backup copies are to be fetched. + /// Backed up item name whose details are to be fetched. + /// + /// + /// OData filter options. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, Microsoft.Rest.Azure.OData.ODataQuery odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRecoveryPointsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string filter = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, odataQuery, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, filter, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// /// Provides the information of the backed up data identified using - /// RecoveryPointID. This is an asynchronous operation. To know the status of - /// the operation, call the GetProtectedItemOperationResult API. + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose backup data needs to be fetched. + /// Backed up item name whose details are to be fetched. /// /// /// RecoveryPointID represents the backed up data to be fetched. /// - public static RecoveryPointResource Get(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) + public static RecoveryPointResource Get(this IRecoveryPointsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId) { - return ((IRecoveryPointsOperations)operations).GetAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); + return ((IRecoveryPointsOperations)operations).GetAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId).GetAwaiter().GetResult(); } /// /// Provides the information of the backed up data identified using - /// RecoveryPointID. This is an asynchronous operation. To know the status of - /// the operation, call the GetProtectedItemOperationResult API. + /// RecoveryPointID. This is an asynchronous operation. + /// To know the status of the operation, call the + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with backed up item. + /// The name of the BackupFabricResource /// /// - /// Container name associated with backed up item. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item name whose backup data needs to be fetched. + /// Backed up item name whose details are to be fetched. /// /// /// RecoveryPointID represents the backed up data to be fetched. @@ -139,9 +137,9 @@ public static RecoveryPointResource Get(this IRecoveryPointsOperations operation /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IRecoveryPointsOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IRecoveryPointsOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperations.cs index 896800d06741..c855f5ccab75 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperations.cs @@ -41,21 +41,20 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// /// Gets the class type. @@ -84,7 +83,7 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> ListWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -95,19 +94,35 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -138,8 +153,8 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -153,9 +168,9 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien var _baseUrl = this.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(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -231,14 +246,13 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -248,10 +262,6 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -413,14 +423,13 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -430,10 +439,6 @@ internal RecoveryPointsRecommendedForMoveOperations (RecoveryServicesBackupClien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs index b3e64a553eb1..f3a8ab0a52de 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryPointsRecommendedForMoveOperationsExtensions.cs @@ -18,25 +18,24 @@ public static partial class RecoveryPointsRecommendedForMoveOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// - public static Microsoft.Rest.Azure.IPage List(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList)) + public static Microsoft.Rest.Azure.IPage List(this IRecoveryPointsRecommendedForMoveOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList)) { - return ((IRecoveryPointsRecommendedForMoveOperations)operations).ListAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, objectType, excludedRPList).GetAwaiter().GetResult(); + return ((IRecoveryPointsRecommendedForMoveOperations)operations).ListAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, objectType, excludedRPList).GetAwaiter().GetResult(); } /// @@ -45,28 +44,27 @@ public static partial class RecoveryPointsRecommendedForMoveOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> ListAsync(this IRecoveryPointsRecommendedForMoveOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> ListAsync(this IRecoveryPointsRecommendedForMoveOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string objectType = default(string), System.Collections.Generic.IList excludedRPList = default(System.Collections.Generic.IList), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.ListWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, objectType, excludedRPList, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.ListWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, objectType, excludedRPList, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClient.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClient.cs index 09980cb6863e..0e6a4530bd11 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClient.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClient.cs @@ -10,6 +10,9 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup using Microsoft.Rest.Azure; using Models; + /// + /// Open API 2.0 Specs for Azure RecoveryServices Backup service + /// public partial class RecoveryServicesBackupClient : Microsoft.Rest.ServiceClient, IRecoveryServicesBackupClient, IAzureClient { /// @@ -35,7 +38,7 @@ public partial class RecoveryServicesBackupClient : Microsoft.Rest.ServiceClient public string ApiVersion { get; private set; } /// - /// The subscription Id. + /// The ID of the target subscription. /// public string SubscriptionId { get; set;} @@ -58,9 +61,9 @@ public partial class RecoveryServicesBackupClient : Microsoft.Rest.ServiceClient public bool? GenerateClientRequestId { get; set;} /// - /// Gets the IBackupResourceStorageConfigsNonCrrOperations + /// Gets the IOperations /// - public virtual IBackupResourceStorageConfigsNonCrrOperations BackupResourceStorageConfigsNonCrr { get; private set; } + public virtual IOperations Operations { get; private set; } /// /// Gets the IProtectionIntentOperations /// @@ -74,65 +77,73 @@ public partial class RecoveryServicesBackupClient : Microsoft.Rest.ServiceClient /// public virtual IFeatureSupportOperations FeatureSupport { get; private set; } /// - /// Gets the IBackupProtectionIntentOperations + /// Gets the IDeletedProtectionContainersOperations /// - public virtual IBackupProtectionIntentOperations BackupProtectionIntent { get; private set; } + public virtual IDeletedProtectionContainersOperations DeletedProtectionContainers { get; private set; } /// - /// Gets the IBackupUsageSummariesOperations + /// Gets the IBackupResourceEncryptionConfigsOperations /// - public virtual IBackupUsageSummariesOperations BackupUsageSummaries { get; private set; } + public virtual IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; private set; } /// - /// Gets the IOperations + /// Gets the IBackupEnginesOperations /// - public virtual IOperations Operations { get; private set; } + public virtual IBackupEnginesOperations BackupEngines { get; private set; } /// - /// Gets the IBackupResourceVaultConfigsOperations + /// Gets the IProtectionContainerRefreshOperationResultsOperations /// - public virtual IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; private set; } + public virtual IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; private set; } /// - /// Gets the IBackupResourceEncryptionConfigsOperations + /// Gets the IProtectableContainersOperations /// - public virtual IBackupResourceEncryptionConfigsOperations BackupResourceEncryptionConfigs { get; private set; } + public virtual IProtectableContainersOperations ProtectableContainers { get; private set; } /// - /// Gets the IPrivateEndpointConnectionOperations + /// Gets the IProtectionContainersOperations /// - public virtual IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; private set; } + public virtual IProtectionContainersOperations ProtectionContainers { get; private set; } /// - /// Gets the IPrivateEndpointOperations + /// Gets the IBackupWorkloadItemsOperations /// - public virtual IPrivateEndpointOperations PrivateEndpoint { get; private set; } + public virtual IBackupWorkloadItemsOperations BackupWorkloadItems { get; private set; } /// - /// Gets the IBmsPrepareDataMoveOperationResultOperations + /// Gets the IProtectionContainerOperationResultsOperations /// - public virtual IBmsPrepareDataMoveOperationResultOperations BmsPrepareDataMoveOperationResult { get; private set; } + public virtual IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; private set; } /// /// Gets the IProtectedItemsOperations /// public virtual IProtectedItemsOperations ProtectedItems { get; private set; } /// + /// Gets the IBackupsOperations + /// + public virtual IBackupsOperations Backups { get; private set; } + /// + /// Gets the IConfigureSourceScanOperations + /// + public virtual IConfigureSourceScanOperations ConfigureSourceScan { get; private set; } + /// /// Gets the IProtectedItemOperationResultsOperations /// public virtual IProtectedItemOperationResultsOperations ProtectedItemOperationResults { get; private set; } /// - /// Gets the IRecoveryPointsOperations + /// Gets the IProtectedItemOperationStatusesOperations /// - public virtual IRecoveryPointsOperations RecoveryPoints { get; private set; } + public virtual IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; private set; } /// - /// Gets the IRestoresOperations + /// Gets the IRecoveryPointsOperations /// - public virtual IRestoresOperations Restores { get; private set; } + public virtual IRecoveryPointsOperations RecoveryPoints { get; private set; } /// - /// Gets the IBackupPoliciesOperations + /// Gets the IItemLevelRecoveryConnectionsOperations /// - public virtual IBackupPoliciesOperations BackupPolicies { get; private set; } + public virtual IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; private set; } /// - /// Gets the IProtectionPoliciesOperations + /// Gets the IRestoresOperations /// - public virtual IProtectionPoliciesOperations ProtectionPolicies { get; private set; } + public virtual IRestoresOperations Restores { get; private set; } /// - /// Gets the IProtectionPolicyOperationResultsOperations + /// Gets the IRecoveryPointsRecommendedForMoveOperations /// - public virtual IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; private set; } + public virtual IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; private set; } /// /// Gets the IBackupJobsOperations /// @@ -158,113 +169,109 @@ public partial class RecoveryServicesBackupClient : Microsoft.Rest.ServiceClient /// public virtual IJobsOperations Jobs { get; private set; } /// - /// Gets the IBackupProtectedItemsOperations - /// - public virtual IBackupProtectedItemsOperations BackupProtectedItems { get; private set; } - /// - /// Gets the IOperationOperations + /// Gets the IBackupOperationResultsOperations /// - public virtual IOperationOperations Operation { get; private set; } + public virtual IBackupOperationResultsOperations BackupOperationResults { get; private set; } /// - /// Gets the IValidateOperationOperations + /// Gets the IBackupOperationStatusesOperations /// - public virtual IValidateOperationOperations ValidateOperation { get; private set; } + public virtual IBackupOperationStatusesOperations BackupOperationStatuses { get; private set; } /// - /// Gets the IValidateOperationResultsOperations + /// Gets the IBackupPoliciesOperations /// - public virtual IValidateOperationResultsOperations ValidateOperationResults { get; private set; } + public virtual IBackupPoliciesOperations BackupPolicies { get; private set; } /// - /// Gets the IValidateOperationStatusesOperations + /// Gets the IProtectionPoliciesOperations /// - public virtual IValidateOperationStatusesOperations ValidateOperationStatuses { get; private set; } + public virtual IProtectionPoliciesOperations ProtectionPolicies { get; private set; } /// - /// Gets the IBackupEnginesOperations + /// Gets the IProtectionPolicyOperationResultsOperations /// - public virtual IBackupEnginesOperations BackupEngines { get; private set; } + public virtual IProtectionPolicyOperationResultsOperations ProtectionPolicyOperationResults { get; private set; } /// - /// Gets the IProtectionContainerRefreshOperationResultsOperations + /// Gets the IProtectionPolicyOperationStatusesOperations /// - public virtual IProtectionContainerRefreshOperationResultsOperations ProtectionContainerRefreshOperationResults { get; private set; } + public virtual IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; private set; } /// - /// Gets the IProtectableContainersOperations + /// Gets the IBackupProtectableItemsOperations /// - public virtual IProtectableContainersOperations ProtectableContainers { get; private set; } + public virtual IBackupProtectableItemsOperations BackupProtectableItems { get; private set; } /// - /// Gets the IProtectionContainersOperations + /// Gets the IBackupProtectedItemsOperations /// - public virtual IProtectionContainersOperations ProtectionContainers { get; private set; } + public virtual IBackupProtectedItemsOperations BackupProtectedItems { get; private set; } /// - /// Gets the IBackupWorkloadItemsOperations + /// Gets the IBackupProtectionContainersOperations /// - public virtual IBackupWorkloadItemsOperations BackupWorkloadItems { get; private set; } + public virtual IBackupProtectionContainersOperations BackupProtectionContainers { get; private set; } /// - /// Gets the IProtectionContainerOperationResultsOperations + /// Gets the IBackupProtectionIntentOperations /// - public virtual IProtectionContainerOperationResultsOperations ProtectionContainerOperationResults { get; private set; } + public virtual IBackupProtectionIntentOperations BackupProtectionIntent { get; private set; } /// - /// Gets the IBackupsOperations + /// Gets the IResourceGuardProxiesOperations /// - public virtual IBackupsOperations Backups { get; private set; } + public virtual IResourceGuardProxiesOperations ResourceGuardProxies { get; private set; } /// - /// Gets the IProtectedItemOperationStatusesOperations + /// Gets the IResourceGuardProxyOperations /// - public virtual IProtectedItemOperationStatusesOperations ProtectedItemOperationStatuses { get; private set; } + public virtual IResourceGuardProxyOperations ResourceGuardProxy { get; private set; } /// - /// Gets the IItemLevelRecoveryConnectionsOperations + /// Gets the ISecurityPiNsOperations /// - public virtual IItemLevelRecoveryConnectionsOperations ItemLevelRecoveryConnections { get; private set; } + public virtual ISecurityPiNsOperations SecurityPiNs { get; private set; } /// - /// Gets the IBackupOperationResultsOperations + /// Gets the IFetchTieringCostOperations /// - public virtual IBackupOperationResultsOperations BackupOperationResults { get; private set; } + public virtual IFetchTieringCostOperations FetchTieringCost { get; private set; } /// - /// Gets the IBackupOperationStatusesOperations + /// Gets the IGetTieringCostOperationResultOperations /// - public virtual IBackupOperationStatusesOperations BackupOperationStatuses { get; private set; } + public virtual IGetTieringCostOperationResultOperations GetTieringCostOperationResult { get; private set; } /// - /// Gets the IProtectionPolicyOperationStatusesOperations + /// Gets the ITieringCostOperationStatusOperations /// - public virtual IProtectionPolicyOperationStatusesOperations ProtectionPolicyOperationStatuses { get; private set; } + public virtual ITieringCostOperationStatusOperations TieringCostOperationStatus { get; private set; } /// - /// Gets the IBackupProtectableItemsOperations + /// Gets the IValidateOperationOperations /// - public virtual IBackupProtectableItemsOperations BackupProtectableItems { get; private set; } + public virtual IValidateOperationOperations ValidateOperation { get; private set; } /// - /// Gets the IBackupProtectionContainersOperations + /// Gets the IBackupUsageSummariesOperations /// - public virtual IBackupProtectionContainersOperations BackupProtectionContainers { get; private set; } + public virtual IBackupUsageSummariesOperations BackupUsageSummaries { get; private set; } /// - /// Gets the IDeletedProtectionContainersOperations + /// Gets the IOperationOperations /// - public virtual IDeletedProtectionContainersOperations DeletedProtectionContainers { get; private set; } + public virtual IOperationOperations Operation { get; private set; } /// - /// Gets the ISecurityPiNsOperations + /// Gets the IValidateOperationResultsOperations /// - public virtual ISecurityPiNsOperations SecurityPiNs { get; private set; } + public virtual IValidateOperationResultsOperations ValidateOperationResults { get; private set; } /// - /// Gets the IRecoveryPointsRecommendedForMoveOperations + /// Gets the IValidateOperationStatusesOperations /// - public virtual IRecoveryPointsRecommendedForMoveOperations RecoveryPointsRecommendedForMove { get; private set; } + public virtual IValidateOperationStatusesOperations ValidateOperationStatuses { get; private set; } /// - /// Gets the IResourceGuardProxiesOperations + /// Gets the IBackupResourceVaultConfigsOperations /// - public virtual IResourceGuardProxiesOperations ResourceGuardProxies { get; private set; } + public virtual IBackupResourceVaultConfigsOperations BackupResourceVaultConfigs { get; private set; } /// - /// Gets the IResourceGuardProxyOperations + /// Gets the IBackupResourceStorageConfigsNonCrrOperations /// - public virtual IResourceGuardProxyOperations ResourceGuardProxy { get; private set; } + public virtual IBackupResourceStorageConfigsNonCrrOperations BackupResourceStorageConfigsNonCrr { get; private set; } /// - /// Gets the IFetchTieringCostOperations + /// Gets the IBmsPrepareDataMoveOperationResultOperations /// - public virtual IFetchTieringCostOperations FetchTieringCost { get; private set; } + public virtual IBmsPrepareDataMoveOperationResultOperations BmsPrepareDataMoveOperationResult { get; private set; } /// - /// Gets the IGetTieringCostOperationResultOperations + /// Gets the IPrivateEndpointConnectionOperations /// - public virtual IGetTieringCostOperationResultOperations GetTieringCostOperationResult { get; private set; } + public virtual IPrivateEndpointConnectionOperations PrivateEndpointConnection { get; private set; } /// - /// Gets the ITieringCostOperationStatusOperations + /// Gets the IPrivateEndpointOperations /// - public virtual ITieringCostOperationStatusOperations TieringCostOperationStatus { get; private set; } + public virtual IPrivateEndpointOperations PrivateEndpoint { get; private set; } /// /// Initializes a new instance of the RecoveryServicesBackupClient class. /// @@ -503,60 +510,61 @@ public RecoveryServicesBackupClient(System.Uri baseUri, Microsoft.Rest.ServiceCl /// private void Initialize() { - this.BackupResourceStorageConfigsNonCrr = new BackupResourceStorageConfigsNonCrrOperations(this); + this.Operations = new Operations(this); this.ProtectionIntent = new ProtectionIntentOperations(this); this.BackupStatus = new BackupStatusOperations(this); this.FeatureSupport = new FeatureSupportOperations(this); - this.BackupProtectionIntent = new BackupProtectionIntentOperations(this); - this.BackupUsageSummaries = new BackupUsageSummariesOperations(this); - this.Operations = new Operations(this); - this.BackupResourceVaultConfigs = new BackupResourceVaultConfigsOperations(this); + this.DeletedProtectionContainers = new DeletedProtectionContainersOperations(this); this.BackupResourceEncryptionConfigs = new BackupResourceEncryptionConfigsOperations(this); - this.PrivateEndpointConnection = new PrivateEndpointConnectionOperations(this); - this.PrivateEndpoint = new PrivateEndpointOperations(this); - this.BmsPrepareDataMoveOperationResult = new BmsPrepareDataMoveOperationResultOperations(this); + this.BackupEngines = new BackupEnginesOperations(this); + this.ProtectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsOperations(this); + this.ProtectableContainers = new ProtectableContainersOperations(this); + this.ProtectionContainers = new ProtectionContainersOperations(this); + this.BackupWorkloadItems = new BackupWorkloadItemsOperations(this); + this.ProtectionContainerOperationResults = new ProtectionContainerOperationResultsOperations(this); this.ProtectedItems = new ProtectedItemsOperations(this); + this.Backups = new BackupsOperations(this); + this.ConfigureSourceScan = new ConfigureSourceScanOperations(this); this.ProtectedItemOperationResults = new ProtectedItemOperationResultsOperations(this); + this.ProtectedItemOperationStatuses = new ProtectedItemOperationStatusesOperations(this); this.RecoveryPoints = new RecoveryPointsOperations(this); + this.ItemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsOperations(this); this.Restores = new RestoresOperations(this); - this.BackupPolicies = new BackupPoliciesOperations(this); - this.ProtectionPolicies = new ProtectionPoliciesOperations(this); - this.ProtectionPolicyOperationResults = new ProtectionPolicyOperationResultsOperations(this); + this.RecoveryPointsRecommendedForMove = new RecoveryPointsRecommendedForMoveOperations(this); this.BackupJobs = new BackupJobsOperations(this); this.JobDetails = new JobDetailsOperations(this); this.JobCancellations = new JobCancellationsOperations(this); this.JobOperationResults = new JobOperationResultsOperations(this); this.ExportJobsOperationResults = new ExportJobsOperationResultsOperations(this); this.Jobs = new JobsOperations(this); - this.BackupProtectedItems = new BackupProtectedItemsOperations(this); - this.Operation = new OperationOperations(this); - this.ValidateOperation = new ValidateOperationOperations(this); - this.ValidateOperationResults = new ValidateOperationResultsOperations(this); - this.ValidateOperationStatuses = new ValidateOperationStatusesOperations(this); - this.BackupEngines = new BackupEnginesOperations(this); - this.ProtectionContainerRefreshOperationResults = new ProtectionContainerRefreshOperationResultsOperations(this); - this.ProtectableContainers = new ProtectableContainersOperations(this); - this.ProtectionContainers = new ProtectionContainersOperations(this); - this.BackupWorkloadItems = new BackupWorkloadItemsOperations(this); - this.ProtectionContainerOperationResults = new ProtectionContainerOperationResultsOperations(this); - this.Backups = new BackupsOperations(this); - this.ProtectedItemOperationStatuses = new ProtectedItemOperationStatusesOperations(this); - this.ItemLevelRecoveryConnections = new ItemLevelRecoveryConnectionsOperations(this); this.BackupOperationResults = new BackupOperationResultsOperations(this); this.BackupOperationStatuses = new BackupOperationStatusesOperations(this); + this.BackupPolicies = new BackupPoliciesOperations(this); + this.ProtectionPolicies = new ProtectionPoliciesOperations(this); + this.ProtectionPolicyOperationResults = new ProtectionPolicyOperationResultsOperations(this); this.ProtectionPolicyOperationStatuses = new ProtectionPolicyOperationStatusesOperations(this); this.BackupProtectableItems = new BackupProtectableItemsOperations(this); + this.BackupProtectedItems = new BackupProtectedItemsOperations(this); this.BackupProtectionContainers = new BackupProtectionContainersOperations(this); - this.DeletedProtectionContainers = new DeletedProtectionContainersOperations(this); - this.SecurityPiNs = new SecurityPiNsOperations(this); - this.RecoveryPointsRecommendedForMove = new RecoveryPointsRecommendedForMoveOperations(this); + this.BackupProtectionIntent = new BackupProtectionIntentOperations(this); this.ResourceGuardProxies = new ResourceGuardProxiesOperations(this); this.ResourceGuardProxy = new ResourceGuardProxyOperations(this); + this.SecurityPiNs = new SecurityPiNsOperations(this); this.FetchTieringCost = new FetchTieringCostOperations(this); this.GetTieringCostOperationResult = new GetTieringCostOperationResultOperations(this); this.TieringCostOperationStatus = new TieringCostOperationStatusOperations(this); + this.ValidateOperation = new ValidateOperationOperations(this); + this.BackupUsageSummaries = new BackupUsageSummariesOperations(this); + this.Operation = new OperationOperations(this); + this.ValidateOperationResults = new ValidateOperationResultsOperations(this); + this.ValidateOperationStatuses = new ValidateOperationStatusesOperations(this); + this.BackupResourceVaultConfigs = new BackupResourceVaultConfigsOperations(this); + this.BackupResourceStorageConfigsNonCrr = new BackupResourceStorageConfigsNonCrrOperations(this); + this.BmsPrepareDataMoveOperationResult = new BmsPrepareDataMoveOperationResultOperations(this); + this.PrivateEndpointConnection = new PrivateEndpointConnectionOperations(this); + this.PrivateEndpoint = new PrivateEndpointOperations(this); this.BaseUri = new System.Uri("https://management.azure.com"); - this.ApiVersion = "2025-02-01"; + this.ApiVersion = "2026-07-01"; this.AcceptLanguage = "en-US"; this.LongRunningOperationRetryTimeout = 30; this.GenerateClientRequestId = true; @@ -587,64 +595,80 @@ private void Initialize() }; SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("featureType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("featureType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("backupEngineType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("backupEngineType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectionIntentItemType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectionIntentItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableContainerType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableContainerType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("workloadItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("workloadItemType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectedItemType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectedItemType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("backupManagementType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("backupManagementType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("jobType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("jobType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("backupEngineType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("backupEngineType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableContainerType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableContainerType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("workloadItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("workloadItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("backupManagementType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("backupManagementType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableItemType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableItemType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("schedulePolicyType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("schedulePolicyType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("retentionPolicyType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("retentionPolicyType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableItemType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectedItemType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectedItemType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectionIntentItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectionIntentItemType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("workloadItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("workloadItemType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableItemType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectedItemType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectedItemType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectionIntentItemType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectionIntentItemType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); + SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); + DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); @@ -655,37 +679,57 @@ private void Initialize() DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("objectType")); DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("objectType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("containerType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("containerType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("workloadItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("workloadItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectableItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectableItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectionIntentItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectionIntentItemType")); - SerializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicSerializeJsonConverter("protectionIntentItemType")); - DeserializationSettings.Converters.Add(new Microsoft.Rest.Serialization.PolymorphicDeserializeJsonConverter("protectionIntentItemType")); CustomInitialize(); DeserializationSettings.Converters.Add(new Microsoft.Rest.Azure.CloudErrorJsonConverter()); } /// - /// Fetches operation status for data move operation on vault + /// Move recovery point from one datastore to another store. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// Move Resource Across Tiers Request + /// + /// + /// Headers that will be added to request. + /// + /// + /// The cancellation token. + /// + public async System.Threading.Tasks.Task> MoveRecoveryPointWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + // Send Request + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginMoveRecoveryPointWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + return await this.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); + } + + /// + /// Fetches Operation Result for Prepare Data Move + /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// Headers that will be added to request. @@ -708,7 +752,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetOperationStatusWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -718,20 +762,36 @@ private void Initialize() { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } - - if (vaultName == null) + + if (this.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (this.SubscriptionId != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + if (this.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (operationId == null) @@ -746,8 +806,8 @@ private void Initialize() { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("operationId", operationId); @@ -758,9 +818,9 @@ private void Initialize() var _baseUrl = this.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/operationStatus/{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(this.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{operationId}", System.Uri.EscapeDataString(operationId)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -828,11 +888,11 @@ private void Initialize() if ((int)_statusCode != 200) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -896,12 +956,11 @@ private void Initialize() /// /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Prepare data move request @@ -912,22 +971,21 @@ private void Initialize() /// /// The cancellation token. /// - public async System.Threading.Tasks.Task BMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BMSPrepareDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginBMSPrepareDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Trigger data move request @@ -938,34 +996,33 @@ private void Initialize() /// /// The cancellation token. /// - public async System.Threading.Tasks.Task BMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BMSTriggerDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginBMSTriggerDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// - /// + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// Move Resource Across Tiers Request @@ -976,32 +1033,6 @@ private void Initialize() /// /// The cancellation token. /// - public async System.Threading.Tasks.Task MoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) - { - // Send Request - Microsoft.Rest.Azure.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 - /// - /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// Prepare data move request - /// - /// - /// Headers that will be added to request. - /// - /// - /// The cancellation token. - /// /// /// Thrown when the operation returned an invalid status code /// @@ -1014,7 +1045,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginBMSPrepareDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginMoveRecoveryPointWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1024,28 +1055,61 @@ private void Initialize() { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - if (parameters != null) - { - parameters.Validate(); - } + if (this.ApiVersion == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } + if (this.SubscriptionId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (this.SubscriptionId != null) + { + if (this.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SubscriptionId", 1); + } + } + if (resourceGroupName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + } + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (vaultName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } - if (resourceGroupName == null) + if (fabricName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); } - if (this.SubscriptionId == null) + if (containerName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + } + + if (protectedItemName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); + } + + if (recoveryPointId == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "recoveryPointId"); } // Tracing @@ -1055,21 +1119,29 @@ private void Initialize() { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); + tracingParameters.Add("fabricName", fabricName); + tracingParameters.Add("containerName", containerName); + tracingParameters.Add("protectedItemName", protectedItemName); + tracingParameters.Add("recoveryPointId", recoveryPointId); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBMSPrepareDataMove", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMoveRecoveryPoint", tracingParameters); } // Construct URL var _baseUrl = this.BaseUri.AbsoluteUri; - var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupFabrics/{fabricName}/protectionContainers/{containerName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointId}/move").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); + _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)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.ApiVersion != null) @@ -1140,13 +1212,13 @@ private void Initialize() cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 200 && (int)_statusCode != 202) + if ((int)_statusCode != 202) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1170,7 +1242,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1178,6 +1250,19 @@ private void Initialize() { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1190,17 +1275,16 @@ private void Initialize() } /// - /// Triggers Data Move Operation on target vault + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Trigger data move request + /// Prepare data move request /// /// /// Headers that will be added to request. @@ -1220,7 +1304,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginBMSTriggerDataMoveWithHttpMessagesAsync(string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginBMSPrepareDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1239,19 +1323,35 @@ private void Initialize() throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } - if (vaultName == null) + if (this.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + } + if (this.SubscriptionId != null) + { + if (this.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -1261,21 +1361,21 @@ private void Initialize() { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBMSTriggerDataMove", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBMSPrepareDataMove", tracingParameters); } // Construct URL var _baseUrl = this.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)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/prepareDataMove").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.ApiVersion != null) @@ -1348,11 +1448,11 @@ private void Initialize() if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new NewErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - NewErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { ex.Body = _errorBody; @@ -1376,7 +1476,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1384,6 +1484,19 @@ private void Initialize() { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); @@ -1396,29 +1509,16 @@ private void Initialize() } /// - /// Move recovery point from one datastore to another store. + /// 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. - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// The name of the resource group. The name is case insensitive. /// - /// - /// + /// + /// The name of the VaultResource /// /// - /// Move Resource Across Tiers Request + /// Trigger data move request /// /// /// Headers that will be added to request. @@ -1438,7 +1538,7 @@ private void Initialize() /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginMoveRecoveryPointWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginBMSTriggerDataMoveWithHttpMessagesAsync(string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -1448,45 +1548,44 @@ private void Initialize() { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "parameters"); } - - if (this.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); - } - - if (vaultName == null) + if (parameters != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + parameters.Validate(); } - - if (resourceGroupName == null) + if (this.ApiVersion == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.ApiVersion"); } if (this.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.SubscriptionId"); } - - if (fabricName == null) + if (this.SubscriptionId != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "fabricName"); + if (this.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "SubscriptionId", 1); + } } - - if (containerName == null) + if (resourceGroupName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "containerName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (protectedItemName == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "protectedItemName"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } } - - if (recoveryPointId == null) + if (vaultName == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "recoveryPointId"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -1496,29 +1595,21 @@ private void Initialize() { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - 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("vaultName", vaultName); tracingParameters.Add("parameters", parameters); tracingParameters.Add("cancellationToken", cancellationToken); - Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginMoveRecoveryPoint", tracingParameters); + Microsoft.Rest.ServiceClientTracing.Enter(_invocationId, this, "BeginBMSTriggerDataMove", tracingParameters); } // Construct URL var _baseUrl = this.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}/move").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupstorageconfig/vaultstorageconfig/triggerDataMove").ToString(); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.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)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.ApiVersion != null) @@ -1589,16 +1680,15 @@ private void Initialize() cancellationToken.ThrowIfCancellationRequested(); string _responseContent = null; - if ((int)_statusCode != 202) + if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -1608,10 +1698,6 @@ private void Initialize() } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -1624,7 +1710,7 @@ private void Initialize() throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -1632,6 +1718,19 @@ private void Initialize() { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClientExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClientExtensions.cs index 04ba6d7ddd15..78820532848a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClientExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RecoveryServicesBackupClientExtensions.cs @@ -13,48 +13,109 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup public static partial class RecoveryServicesBackupClientExtensions { /// - /// Fetches operation status for data move operation on vault + /// Move recovery point from one datastore to another store. /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// The name of the recovery services vault. + /// The name of the VaultResource /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// + /// The name of the BackupFabricResource /// - /// - /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. /// - public static OperationStatus GetOperationStatus(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string operationId) + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + public static MoveRecoveryPointHeaders MoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) { - return ((IRecoveryServicesBackupClient)operations).GetOperationStatusAsync(vaultName, resourceGroupName, operationId).GetAwaiter().GetResult(); + return ((IRecoveryServicesBackupClient)operations).MoveRecoveryPointAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); } /// - /// Fetches operation status for data move operation on vault + /// Move recovery point from one datastore to another store. + /// + /// + /// The operations group for this extension method. + /// + /// + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource + /// + /// + /// The name of the BackupFabricResource + /// + /// + /// Name of the container whose details need to be fetched. + /// + /// + /// Backed up item name whose details are to be fetched. + /// + /// + /// RecoveryPointID represents the backed up data to be fetched. + /// + /// + /// The cancellation token. + /// + public static async System.Threading.Tasks.Task MoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + { + using (var _result = await operations.MoveRecoveryPointWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } + } + /// + /// Fetches Operation Result for Prepare Data Move /// /// /// The operations group for this extension method. /// + /// + /// The name of the resource group. The name is case insensitive. + /// /// - /// The name of the recovery services vault. + /// vaults + /// + /// + /// The name of the BackupResourceConfigResource + /// + public static OperationStatus GetOperationStatus(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string operationId) + { + return ((IRecoveryServicesBackupClient)operations).GetOperationStatusAsync(resourceGroupName, vaultName, operationId).GetAwaiter().GetResult(); + } + + /// + /// Fetches Operation Result for Prepare Data Move + /// + /// + /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// vaults /// /// - /// + /// The name of the BackupResourceConfigResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetOperationStatusAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(vaultName, resourceGroupName, operationId, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetOperationStatusWithHttpMessagesAsync(resourceGroupName, vaultName, operationId, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -65,16 +126,15 @@ public static OperationStatus GetOperationStatus(this IRecoveryServicesBackupCli /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - public static void BMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters) + /// + /// The name of the VaultResource + /// + public static BmsPrepareDataMoveHeaders BMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters) { - ((IRecoveryServicesBackupClient)operations).BMSPrepareDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return ((IRecoveryServicesBackupClient)operations).BMSPrepareDataMoveAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// @@ -83,19 +143,21 @@ public static void BMSPrepareDataMove(this IRecoveryServicesBackupClient operati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BMSPrepareDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Triggers Data Move Operation on target vault @@ -103,16 +165,15 @@ public static void BMSPrepareDataMove(this IRecoveryServicesBackupClient operati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - public static void BMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters) + /// + /// The name of the VaultResource + /// + public static BmsTriggerDataMoveHeaders BMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters) { - ((IRecoveryServicesBackupClient)operations).BMSTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); + return ((IRecoveryServicesBackupClient)operations).BMSTriggerDataMoveAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// @@ -121,19 +182,21 @@ public static void BMSTriggerDataMove(this IRecoveryServicesBackupClient operati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BMSTriggerDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Move recovery point from one datastore to another store. @@ -141,28 +204,27 @@ public static void BMSTriggerDataMove(this IRecoveryServicesBackupClient operati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// - /// + /// RecoveryPointID represents the backed up data to be fetched. /// - public static void MoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + public static MoveRecoveryPointHeaders BeginMoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) { - ((IRecoveryServicesBackupClient)operations).MoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + return ((IRecoveryServicesBackupClient)operations).BeginMoveRecoveryPointAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); } /// @@ -171,31 +233,33 @@ public static void MoveRecoveryPoint(this IRecoveryServicesBackupClient operatio /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// + /// The name of the BackupFabricResource /// /// - /// + /// Name of the container whose details need to be fetched. /// /// - /// + /// Backed up item name whose details are to be fetched. /// /// - /// + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task MoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginMoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.MoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginMoveRecoveryPointWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Prepares source vault for Data Move operation @@ -203,137 +267,77 @@ public static void MoveRecoveryPoint(this IRecoveryServicesBackupClient operatio /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - public static void BeginBMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters) - { - ((IRecoveryServicesBackupClient)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 resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// - /// - /// The cancellation token. - /// - public static async System.Threading.Tasks.Task BeginBMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, PrepareDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static BmsPrepareDataMoveHeaders BeginBMSPrepareDataMove(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters) { - (await operations.BeginBMSPrepareDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + return ((IRecoveryServicesBackupClient)operations).BeginBMSPrepareDataMoveAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } + /// - /// Triggers Data Move Operation on target vault + /// 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. - /// - public static void BeginBMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters) - { - ((IRecoveryServicesBackupClient)operations).BeginBMSTriggerDataMoveAsync(vaultName, resourceGroupName, parameters).GetAwaiter().GetResult(); - } - - /// - /// Triggers Data Move Operation on target vault - /// - /// - /// The operations group for this extension method. + /// The name of the resource group. The name is case insensitive. /// /// - /// The name of the recovery services vault. - /// - /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginBMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, TriggerDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginBMSPrepareDataMoveAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, PrepareDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginBMSTriggerDataMoveWithHttpMessagesAsync(vaultName, resourceGroupName, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginBMSPrepareDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// - /// Move recovery point from one datastore to another store. + /// Triggers Data Move Operation on target vault /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// The name of the VaultResource /// - public static void BeginMoveRecoveryPoint(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters) + public static BmsTriggerDataMoveHeaders BeginBMSTriggerDataMove(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters) { - ((IRecoveryServicesBackupClient)operations).BeginMoveRecoveryPointAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters).GetAwaiter().GetResult(); + return ((IRecoveryServicesBackupClient)operations).BeginBMSTriggerDataMoveAsync(resourceGroupName, vaultName, parameters).GetAwaiter().GetResult(); } /// - /// Move recovery point from one datastore to another store. + /// Triggers Data Move Operation on target vault /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. - /// - /// - /// + /// The name of the resource group. The name is case insensitive. /// - /// - /// - /// - /// - /// - /// - /// - /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginMoveRecoveryPointAsync(this IRecoveryServicesBackupClient operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, MoveRPAcrossTiersRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginBMSTriggerDataMoveAsync(this IRecoveryServicesBackupClient operations, string resourceGroupName, string vaultName, TriggerDataMoveRequest parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginMoveRecoveryPointWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginBMSTriggerDataMoveWithHttpMessagesAsync(resourceGroupName, vaultName, parameters, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperations.cs index 5346c8bc452c..d9845fd77b9a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperations.cs @@ -41,12 +41,11 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) /// /// List the ResourceGuardProxies under vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// Headers that will be added to request. @@ -69,7 +68,7 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task>> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -80,19 +79,35 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } // Tracing @@ -102,8 +117,8 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("cancellationToken", cancellationToken); @@ -113,9 +128,9 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); if (this.Client.ApiVersion != null) @@ -182,14 +197,13 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -199,10 +213,6 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -364,14 +374,13 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -381,10 +390,6 @@ internal ResourceGuardProxiesOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperationsExtensions.cs index 45482ec0596c..318144ef7950 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxiesOperationsExtensions.cs @@ -18,16 +18,15 @@ public static partial class ResourceGuardProxiesOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// - public static Microsoft.Rest.Azure.IPage Get(this IResourceGuardProxiesOperations operations, string vaultName, string resourceGroupName) + public static Microsoft.Rest.Azure.IPage Get(this IResourceGuardProxiesOperations operations, string resourceGroupName, string vaultName) { - return ((IResourceGuardProxiesOperations)operations).GetAsync(vaultName, resourceGroupName).GetAwaiter().GetResult(); + return ((IResourceGuardProxiesOperations)operations).GetAsync(resourceGroupName, vaultName).GetAwaiter().GetResult(); } /// @@ -36,19 +35,18 @@ public static Microsoft.Rest.Azure.IPage Get(thi /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task> GetAsync(this IResourceGuardProxiesOperations operations, string vaultName, string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task> GetAsync(this IResourceGuardProxiesOperations operations, string resourceGroupName, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperations.cs index 8a3c53d82eb2..e8156f33664a 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperations.cs @@ -42,12 +42,11 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// Returns ResourceGuardProxy under vault and with the name referenced in /// request /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -73,7 +72,7 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -84,19 +83,35 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (resourceGuardProxyName == null) @@ -111,8 +126,8 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -123,9 +138,9 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -193,14 +208,13 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -210,10 +224,6 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -264,15 +274,14 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) } /// - /// Add or Update ResourceGuardProxy under vault Secures vault critical - /// operations + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -301,7 +310,7 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> PutWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -320,19 +329,35 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (resourceGuardProxyName == null) @@ -347,8 +372,8 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); tracingParameters.Add("parameters", parameters); @@ -360,9 +385,9 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -436,14 +461,13 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -453,10 +477,6 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -509,12 +529,11 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// Delete ResourceGuardProxy under vault /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -537,7 +556,7 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task DeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -548,19 +567,35 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (resourceGuardProxyName == null) @@ -575,8 +610,8 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); @@ -587,9 +622,9 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -657,14 +692,13 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200 && (int)_statusCode != 204) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -674,10 +708,6 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -712,12 +742,11 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// Secures delete ResourceGuardProxy operations. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -749,7 +778,7 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task> UnlockDeleteWithHttpMessagesAsync(string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> UnlockDeleteWithHttpMessagesAsync(string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -760,19 +789,35 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (resourceGuardProxyName == null) @@ -793,8 +838,8 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGuardProxyName", resourceGuardProxyName); tracingParameters.Add("parameters", parameters); @@ -806,9 +851,9 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) var _baseUrl = this.Client.BaseUri.AbsoluteUri; var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RecoveryServices/vaults/{vaultName}/backupResourceGuardProxies/{resourceGuardProxyName}/unlockDelete").ToString(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{resourceGuardProxyName}", System.Uri.EscapeDataString(resourceGuardProxyName)); System.Collections.Generic.List _queryParameters = new System.Collections.Generic.List(); @@ -882,14 +927,13 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -899,10 +943,6 @@ internal ResourceGuardProxyOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperationsExtensions.cs index c6b2f7657002..16c8f26dbca9 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ResourceGuardProxyOperationsExtensions.cs @@ -19,19 +19,18 @@ public static partial class ResourceGuardProxyOperationsExtensions /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static ResourceGuardProxyBaseResource Get(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName) + public static ResourceGuardProxyBaseResource Get(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName) { - return ((IResourceGuardProxyOperations)operations).GetAsync(vaultName, resourceGroupName, resourceGuardProxyName).GetAwaiter().GetResult(); + return ((IResourceGuardProxyOperations)operations).GetAsync(resourceGroupName, vaultName, resourceGuardProxyName).GetAwaiter().GetResult(); } /// @@ -41,12 +40,11 @@ public static ResourceGuardProxyBaseResource Get(this IResourceGuardProxyOperati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -54,48 +52,46 @@ public static ResourceGuardProxyBaseResource Get(this IResourceGuardProxyOperati /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task GetAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task GetAsync(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.GetWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.GetWithHttpMessagesAsync(resourceGroupName, vaultName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } } /// - /// Add or Update ResourceGuardProxy under vault Secures vault critical - /// operations + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static ResourceGuardProxyBaseResource Put(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters) + public static ResourceGuardProxyBaseResource Put(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters) { - return ((IResourceGuardProxyOperations)operations).PutAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters).GetAwaiter().GetResult(); + return ((IResourceGuardProxyOperations)operations).PutAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters).GetAwaiter().GetResult(); } /// - /// Add or Update ResourceGuardProxy under vault Secures vault critical - /// operations + /// Add or Update ResourceGuardProxy under vault + /// Secures vault critical operations /// /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -103,9 +99,9 @@ public static ResourceGuardProxyBaseResource Put(this IResourceGuardProxyOperati /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task PutAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task PutAsync(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, ResourceGuardProxyBaseResource parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.PutWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, parameters, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.PutWithHttpMessagesAsync(resourceGroupName, vaultName, resourceGuardProxyName, parameters, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } @@ -116,19 +112,18 @@ public static ResourceGuardProxyBaseResource Put(this IResourceGuardProxyOperati /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static void Delete(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName) + public static void Delete(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName) { - ((IResourceGuardProxyOperations)operations).DeleteAsync(vaultName, resourceGroupName, resourceGuardProxyName).GetAwaiter().GetResult(); + ((IResourceGuardProxyOperations)operations).DeleteAsync(resourceGroupName, vaultName, resourceGuardProxyName).GetAwaiter().GetResult(); } /// @@ -137,12 +132,11 @@ public static void Delete(this IResourceGuardProxyOperations operations, string /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -150,9 +144,9 @@ public static void Delete(this IResourceGuardProxyOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task DeleteAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task DeleteAsync(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.DeleteWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); + (await operations.DeleteWithHttpMessagesAsync(resourceGroupName, vaultName, resourceGuardProxyName, null, cancellationToken).ConfigureAwait(false)).Dispose(); } /// /// Secures delete ResourceGuardProxy operations. @@ -160,19 +154,18 @@ public static void Delete(this IResourceGuardProxyOperations operations, string /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// /// - public static UnlockDeleteResponse UnlockDelete(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string)) + public static UnlockDeleteResponse UnlockDelete(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string)) { - return ((IResourceGuardProxyOperations)operations).UnlockDeleteAsync(vaultName, resourceGroupName, resourceGuardProxyName, resourceGuardOperationRequests, resourceToBeDeleted).GetAwaiter().GetResult(); + return ((IResourceGuardProxyOperations)operations).UnlockDeleteAsync(resourceGroupName, vaultName, resourceGuardProxyName, resourceGuardOperationRequests, resourceToBeDeleted).GetAwaiter().GetResult(); } /// @@ -181,12 +174,11 @@ public static void Delete(this IResourceGuardProxyOperations operations, string /// /// The operations group for this extension method. /// - /// - /// The name of the recovery services vault. - /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// /// @@ -194,9 +186,9 @@ public static void Delete(this IResourceGuardProxyOperations operations, string /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task UnlockDeleteAsync(this IResourceGuardProxyOperations operations, string vaultName, string resourceGroupName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task UnlockDeleteAsync(this IResourceGuardProxyOperations operations, string resourceGroupName, string vaultName, string resourceGuardProxyName, System.Collections.Generic.IList resourceGuardOperationRequests = default(System.Collections.Generic.IList), string resourceToBeDeleted = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - using (var _result = await operations.UnlockDeleteWithHttpMessagesAsync(vaultName, resourceGroupName, resourceGuardProxyName, resourceGuardOperationRequests, resourceToBeDeleted, null, cancellationToken).ConfigureAwait(false)) + using (var _result = await operations.UnlockDeleteWithHttpMessagesAsync(resourceGroupName, vaultName, resourceGuardProxyName, resourceGuardOperationRequests, resourceToBeDeleted, null, cancellationToken).ConfigureAwait(false)) { return _result.Body; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperations.cs index 80a4aa7bf661..44332b2fda33 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperations.cs @@ -40,27 +40,26 @@ internal RestoresOperations (RecoveryServicesBackupClient client) /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -74,36 +73,35 @@ internal RestoresOperations (RecoveryServicesBackupClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginTriggerWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, customHeaders, cancellationToken).ConfigureAwait(false); return await this.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 GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -129,7 +127,7 @@ internal RestoresOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginTriggerWithHttpMessagesAsync(string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -145,19 +143,35 @@ internal RestoresOperations (RecoveryServicesBackupClient client) throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); } - if (vaultName == null) + if (this.Client.SubscriptionId == null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + } + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } } - if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - - if (this.Client.SubscriptionId == null) + if (resourceGroupName != null) { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } + if (vaultName == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); } if (fabricName == null) @@ -188,8 +202,8 @@ internal RestoresOperations (RecoveryServicesBackupClient client) { _invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString(); System.Collections.Generic.Dictionary tracingParameters = new System.Collections.Generic.Dictionary(); - tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("resourceGroupName", resourceGroupName); + tracingParameters.Add("vaultName", vaultName); tracingParameters.Add("fabricName", fabricName); tracingParameters.Add("containerName", containerName); tracingParameters.Add("protectedItemName", protectedItemName); @@ -205,9 +219,9 @@ internal RestoresOperations (RecoveryServicesBackupClient client) var _baseUrl = this.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(); - _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); - _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(this.Client.SubscriptionId)); + _url = _url.Replace("{resourceGroupName}", System.Uri.EscapeDataString(resourceGroupName)); + _url = _url.Replace("{vaultName}", System.Uri.EscapeDataString(vaultName)); _url = _url.Replace("{fabricName}", System.Uri.EscapeDataString(fabricName)); _url = _url.Replace("{containerName}", System.Uri.EscapeDataString(containerName)); _url = _url.Replace("{protectedItemName}", System.Uri.EscapeDataString(protectedItemName)); @@ -292,14 +306,13 @@ internal RestoresOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -309,10 +322,6 @@ internal RestoresOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -325,7 +334,7 @@ internal RestoresOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -333,6 +342,19 @@ internal RestoresOperations (RecoveryServicesBackupClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperationsExtensions.cs index 3fc2b7983467..a22308871373 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/RestoresOperationsExtensions.cs @@ -14,65 +14,63 @@ public static partial class RestoresOperationsExtensions { /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// /// - public static void Trigger(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static RestoresTriggerHeaders Trigger(this IRestoresOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - ((IRestoresOperations)operations).TriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IRestoresOperations)operations).TriggerAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -80,71 +78,72 @@ public static partial class RestoresOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TriggerAsync(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task TriggerAsync(this IRestoresOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.TriggerWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// /// - public static void BeginTrigger(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string)) + public static RestoresTriggerHeaders BeginTrigger(this IRestoresOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string)) { - ((IRestoresOperations)operations).BeginTriggerAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); + return ((IRestoresOperations)operations).BeginTriggerAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary).GetAwaiter().GetResult(); } /// /// Restores the specified backed up data. This is an asynchronous operation. - /// To know the status of this API call, use GetProtectedItemOperationResult - /// API. + /// 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. + /// The name of the resource group. The name is case insensitive. + /// + /// + /// The name of the VaultResource /// /// - /// Fabric name associated with the backed up items. + /// The name of the BackupFabricResource /// /// - /// Container name associated with the backed up items. + /// Name of the container whose details need to be fetched. /// /// - /// Backed up item to be restored. + /// Backed up item name whose details are to be fetched. /// /// - /// Recovery point ID which represents the backed up data to be restored. + /// RecoveryPointID represents the backed up data to be fetched. /// /// /// @@ -152,9 +151,12 @@ public static partial class RestoresOperationsExtensions /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginTriggerAsync(this IRestoresOperations operations, string vaultName, string resourceGroupName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginTriggerAsync(this IRestoresOperations operations, string resourceGroupName, string vaultName, string fabricName, string containerName, string protectedItemName, string recoveryPointId, RestoreRequestResource parameters, string xMsAuthorizationAuxiliary = default(string), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginTriggerWithHttpMessagesAsync(resourceGroupName, vaultName, fabricName, containerName, protectedItemName, recoveryPointId, parameters, xMsAuthorizationAuxiliary, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperations.cs index 00dc78fea554..2b40d33817ce 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperations.cs @@ -45,8 +45,7 @@ internal SecurityPiNsOperations (RecoveryServicesBackupClient client) /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// @@ -95,12 +94,28 @@ internal SecurityPiNsOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } SecurityPinBase parameters = new SecurityPinBase(); if(resourceGuardOperationRequests != null) @@ -210,14 +225,13 @@ internal SecurityPiNsOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -227,10 +241,6 @@ internal SecurityPiNsOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperationsExtensions.cs index 0b0830f74b94..873f9a97c481 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/SecurityPINsOperationsExtensions.cs @@ -22,8 +22,7 @@ public static partial class SecurityPiNsOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// @@ -43,8 +42,7 @@ public static partial class SecurityPiNsOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperations.cs index 34435de51633..ba2ae07a413b 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperations.cs @@ -42,8 +42,7 @@ internal TieringCostOperationStatusOperations (RecoveryServicesBackupClient clie /// Gets the status of async operations of tiering cost /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -78,16 +77,37 @@ internal TieringCostOperationStatusOperations (RecoveryServicesBackupClient clie + if (this.Client.ApiVersion == null) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); + } + if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (resourceGroupName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (vaultName == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "vaultName"); @@ -112,11 +132,6 @@ internal TieringCostOperationStatusOperations (RecoveryServicesBackupClient clie throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); } - if (this.Client.ApiVersion == null) - { - throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.ApiVersion"); - } - // Tracing bool _shouldTrace = Microsoft.Rest.ServiceClientTracing.IsEnabled; string _invocationId = null; @@ -206,14 +221,13 @@ internal TieringCostOperationStatusOperations (RecoveryServicesBackupClient clie if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -223,10 +237,6 @@ internal TieringCostOperationStatusOperations (RecoveryServicesBackupClient clie } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperationsExtensions.cs index c2960dbeef53..d901c51f0601 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/TieringCostOperationStatusOperationsExtensions.cs @@ -19,8 +19,7 @@ public static partial class TieringCostOperationStatusOperationsExtensions /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. @@ -40,8 +39,7 @@ public static OperationStatus Get(this ITieringCostOperationStatusOperations ope /// The operations group for this extension method. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The name of the recovery services vault. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperations.cs index d76acc5902e0..9ca886901fdf 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperations.cs @@ -47,8 +47,7 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. @@ -62,10 +61,10 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) /// /// The cancellation token. /// - public async System.Threading.Tasks.Task TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> TriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // Send Request - Microsoft.Rest.Azure.AzureOperationResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, customHeaders, cancellationToken).ConfigureAwait(false); + Microsoft.Rest.Azure.AzureOperationHeaderResponse _response = await BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, customHeaders, cancellationToken).ConfigureAwait(false); return await this.Client.GetPostOrDeleteOperationResultAsync(_response, customHeaders, cancellationToken).ConfigureAwait(false); } @@ -78,8 +77,7 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// Recovery point ID. @@ -105,7 +103,7 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) /// /// A response object containing the response body and response headers. /// - public async System.Threading.Tasks.Task BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public async System.Threading.Tasks.Task> BeginTriggerWithHttpMessagesAsync(string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Collections.Generic.Dictionary> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { @@ -125,12 +123,28 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } ValidateOperationRequestResource parameters = new ValidateOperationRequestResource(); if(id != null||properties != null) { @@ -231,14 +245,13 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) if ((int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -248,10 +261,6 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); @@ -264,7 +273,7 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) throw ex; } // Create Result - var _result = new Microsoft.Rest.Azure.AzureOperationResponse(); + var _result = new Microsoft.Rest.Azure.AzureOperationHeaderResponse(); _result.Request = _httpRequest; _result.Response = _httpResponse; @@ -272,6 +281,19 @@ internal ValidateOperationOperations (RecoveryServicesBackupClient client) { _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); } + try + { + _result.Headers = _httpResponse.GetHeadersAsJson().ToObject(Newtonsoft.Json.JsonSerializer.Create(this.Client.DeserializationSettings)); + } + catch (Newtonsoft.Json.JsonException ex) + { + _httpRequest.Dispose(); + if (_httpResponse != null) + { + _httpResponse.Dispose(); + } + throw new Microsoft.Rest.SerializationException("Unable to deserialize the headers.", _httpResponse.GetHeadersAsJson().ToString(), ex); + } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Exit(_invocationId, _result); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperationsExtensions.cs index 4e28d7bf32e4..df40ae88aff4 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationOperationsExtensions.cs @@ -24,12 +24,11 @@ public static partial class ValidateOperationOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - public static void Trigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties) + public static ValidateOperationTriggerHeaders Trigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties) { - ((IValidateOperationOperations)operations).TriggerAsync(vaultName, resourceGroupName, id, properties).GetAwaiter().GetResult(); + return ((IValidateOperationOperations)operations).TriggerAsync(vaultName, resourceGroupName, id, properties).GetAwaiter().GetResult(); } /// @@ -44,15 +43,17 @@ public static void Trigger(this IValidateOperationOperations operations, string /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task TriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task TriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.TriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } /// /// Validate operation for specified backed up item in the form of an @@ -66,12 +67,11 @@ public static void Trigger(this IValidateOperationOperations operations, string /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// - public static void BeginTrigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties) + public static ValidateOperationTriggerHeaders BeginTrigger(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties) { - ((IValidateOperationOperations)operations).BeginTriggerAsync(vaultName, resourceGroupName, id, properties).GetAwaiter().GetResult(); + return ((IValidateOperationOperations)operations).BeginTriggerAsync(vaultName, resourceGroupName, id, properties).GetAwaiter().GetResult(); } /// @@ -86,15 +86,17 @@ public static void BeginTrigger(this IValidateOperationOperations operations, st /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// The cancellation token. /// - public static async System.Threading.Tasks.Task BeginTriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) + public static async System.Threading.Tasks.Task BeginTriggerAsync(this IValidateOperationOperations operations, string vaultName, string resourceGroupName, string id, ValidateOperationRequest properties, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { - (await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, null, cancellationToken).ConfigureAwait(false)).Dispose(); + using (var _result = await operations.BeginTriggerWithHttpMessagesAsync(vaultName, resourceGroupName, id, properties, null, cancellationToken).ConfigureAwait(false)) + { + return _result.Headers; + } } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperations.cs index b3f34cfe63bd..02ddfb3674a2 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperations.cs @@ -45,8 +45,7 @@ internal ValidateOperationResultsOperations (RecoveryServicesBackupClient client /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation whose result needs to be @@ -93,12 +92,28 @@ internal ValidateOperationResultsOperations (RecoveryServicesBackupClient client { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (operationId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); @@ -193,14 +208,13 @@ internal ValidateOperationResultsOperations (RecoveryServicesBackupClient client if ((int)_statusCode != 200 && (int)_statusCode != 202) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -210,10 +224,6 @@ internal ValidateOperationResultsOperations (RecoveryServicesBackupClient client } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperationsExtensions.cs index e890eb6b4c2d..c4e161b8b553 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationResultsOperationsExtensions.cs @@ -22,8 +22,7 @@ public static partial class ValidateOperationResultsOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation whose result needs to be @@ -44,8 +43,7 @@ public static ValidateOperationsResponse Get(this IValidateOperationResultsOpera /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID which represents the operation whose result needs to be diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperations.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperations.cs index 3686c2796d66..61ba1c5713fc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperations.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperations.cs @@ -40,17 +40,17 @@ internal ValidateOperationStatusesOperations (RecoveryServicesBackupClient clien /// /// Fetches the status of a triggered validate operation. The status can be in - /// progress, completed or failed. You can refer to the OperationStatus enum - /// for all the possible states of the operation. If operation has completed, - /// this method returns the list of errors obtained while validating the - /// operation. + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. /// /// /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID represents the operation whose status needs to be fetched. @@ -96,12 +96,28 @@ internal ValidateOperationStatusesOperations (RecoveryServicesBackupClient clien { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "resourceGroupName"); } - + if (resourceGroupName != null) + { + if (resourceGroupName.Length > 90) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MaxLength, "resourceGroupName", 90); + } + if (resourceGroupName.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "resourceGroupName", 1); + } + } if (this.Client.SubscriptionId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "this.Client.SubscriptionId"); } - + if (this.Client.SubscriptionId != null) + { + if (this.Client.SubscriptionId.Length < 1) + { + throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.MinLength, "Client.SubscriptionId", 1); + } + } if (operationId == null) { throw new Microsoft.Rest.ValidationException(Microsoft.Rest.ValidationRules.CannotBeNull, "operationId"); @@ -196,14 +212,13 @@ internal ValidateOperationStatusesOperations (RecoveryServicesBackupClient clien if ((int)_statusCode != 200) { - var ex = new Microsoft.Rest.Azure.CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); + var ex = new ErrorResponseException(string.Format("Operation returned an invalid status code '{0}'", _statusCode)); try { _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false); - CloudError _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); + ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, this.Client.DeserializationSettings); if (_errorBody != null) { - ex = new Microsoft.Rest.Azure.CloudException(_errorBody.Message); ex.Body = _errorBody; } } @@ -213,10 +228,6 @@ internal ValidateOperationStatusesOperations (RecoveryServicesBackupClient clien } ex.Request = new Microsoft.Rest.HttpRequestMessageWrapper(_httpRequest, _requestContent); ex.Response = new Microsoft.Rest.HttpResponseMessageWrapper(_httpResponse, _responseContent); - if (_httpResponse.Headers.Contains("x-ms-request-id")) - { - ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault(); - } if (_shouldTrace) { Microsoft.Rest.ServiceClientTracing.Error(_invocationId, ex); diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperationsExtensions.cs b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperationsExtensions.cs index 4ac7e44fbb81..efaac1da1941 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperationsExtensions.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/Generated/ValidateOperationStatusesOperationsExtensions.cs @@ -14,10 +14,11 @@ public static partial class ValidateOperationStatusesOperationsExtensions { /// /// Fetches the status of a triggered validate operation. The status can be in - /// progress, completed or failed. You can refer to the OperationStatus enum - /// for all the possible states of the operation. If operation has completed, - /// this method returns the list of errors obtained while validating the - /// operation. + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. /// /// /// The operations group for this extension method. @@ -26,8 +27,7 @@ public static partial class ValidateOperationStatusesOperationsExtensions /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID represents the operation whose status needs to be fetched. @@ -39,10 +39,11 @@ public static OperationStatus Get(this IValidateOperationStatusesOperations oper /// /// Fetches the status of a triggered validate operation. The status can be in - /// progress, completed or failed. You can refer to the OperationStatus enum - /// for all the possible states of the operation. If operation has completed, - /// this method returns the list of errors obtained while validating the - /// operation. + /// progress, completed + /// or failed. You can refer to the OperationStatus enum for all the possible + /// states of the operation. + /// If operation has completed, this method returns the list of errors obtained + /// while validating the operation. /// /// /// The operations group for this extension method. @@ -51,8 +52,7 @@ public static OperationStatus Get(this IValidateOperationStatusesOperations oper /// The name of the recovery services vault. /// /// - /// The name of the resource group where the recovery services vault is - /// present. + /// The name of the resource group. The name is case insensitive. /// /// /// OperationID represents the operation whose status needs to be fetched. diff --git a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/README.md b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/README.md index a60caab19322..d06ac96072d0 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/README.md +++ b/src/RecoveryServices/RecoveryServices.Backup.Management.Sdk/README.md @@ -23,9 +23,11 @@ payload-flattening-threshold: 2 ### ``` yaml -commit: 4a748a953cb8408283e3b5e9fd8773e012ca74ae +commit: 26c5d39ce59d33f9f08ebfc8205db653d6ac4bd9 input-file: - - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/stable/2025-02-01/bms.json + - https://github.com/Azure/azure-rest-api-specs/blob/$(commit)/specification/recoveryservicesbackup/resource-manager/Microsoft.RecoveryServices/RecoveryServicesBackup/stable/2026-07-01/bms.json + +title: RecoveryServicesBackupClient directive: - from: swagger-document diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSAPHanaDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSAPHanaDatabaseProtectedItem.cs index 5010735434b3..b7cee48e3a24 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSAPHanaDatabaseProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSAPHanaDatabaseProtectedItem.cs @@ -46,7 +46,7 @@ public class AzureWorkloadSAPHanaDatabaseProtectedItem : AzureItem /// /// error details in last backup /// - public ErrorDetail LastBackupErrorDetail { get; set; } + public ErrorDetailAutoGenerated LastBackupErrorDetail { get; set; } /// ///ID of the protected item. @@ -118,7 +118,7 @@ public AzureWorkloadSAPHanaDatabaseProtectedItem(CrrModel.ProtectedItemResource if (protectedItem.LastBackupErrorDetail != null) { - LastBackupErrorDetail = new ErrorDetail(protectedItem.LastBackupErrorDetail.Code, protectedItem.LastBackupErrorDetail.Message, protectedItem.LastBackupErrorDetail.Recommendations); + LastBackupErrorDetail = new ErrorDetailAutoGenerated(protectedItem.LastBackupErrorDetail.Code, protectedItem.LastBackupErrorDetail.Message, protectedItem.LastBackupErrorDetail.Recommendations); } ProtectedItemDataSourceId = protectedItem.ProtectedItemDataSourceId; diff --git a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSQLDatabaseProtectedItem.cs b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSQLDatabaseProtectedItem.cs index fb80f3546784..e3abf6182591 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSQLDatabaseProtectedItem.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.Models/AzureVmWorkloadModels/AzureWorkloadSQLDatabaseProtectedItem.cs @@ -47,7 +47,7 @@ public class AzureWorkloadSQLDatabaseProtectedItem : AzureItem /// /// error details in last backup /// - public ErrorDetail LastBackupErrorDetail { get; set; } + public ErrorDetailAutoGenerated LastBackupErrorDetail { get; set; } /// ///ID of the protected item. @@ -127,7 +127,7 @@ public AzureWorkloadSQLDatabaseProtectedItem(CrrModel.ProtectedItemResource prot if(protectedItem.LastBackupErrorDetail != null) { - LastBackupErrorDetail = new ErrorDetail(protectedItem.LastBackupErrorDetail.Code, protectedItem.LastBackupErrorDetail.Message, protectedItem.LastBackupErrorDetail.Recommendations); + LastBackupErrorDetail = new ErrorDetailAutoGenerated(protectedItem.LastBackupErrorDetail.Code, protectedItem.LastBackupErrorDetail.Message, protectedItem.LastBackupErrorDetail.Recommendations); } ProtectedItemDataSourceId = protectedItem.ProtectedItemDataSourceId; diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ContainerAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ContainerAPIs.cs index 5900abd950bc..1f162149f182 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ContainerAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ContainerAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,11 +39,11 @@ public RestAzureNS.AzureOperationResponse InquireContainer( string resourceGroupName = null) { return BmsAdapter.Client.ProtectionContainers.InquireWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -63,14 +63,14 @@ public IEnumerable ListContainers( { Func> listAsync = () => BmsAdapter.Client.BackupProtectionContainers.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupProtectionContainers.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -89,11 +89,11 @@ public ProtectionContainerResource GetContainer( string containerName = null) { ProtectionContainerResource container = BmsAdapter.Client.ProtectionContainers.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return container; } @@ -110,17 +110,18 @@ public IEnumerable ListBackupEngines( string vaultName = null, string resourceGroupName = null) { + // The regenerated SDK no longer exposes $top, so this value is not currently sent in the request. queryParams.Top = 200; Func> listAsync = () => BmsAdapter.Client.BackupEngines.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryParams, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryParams?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupEngines.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; var listResponse = HelperUtils.GetPagedList(listAsync, listNextAsync); return listResponse; @@ -140,15 +141,15 @@ public IEnumerable ListUnregisteredContainers( { Func> listAsync = () => BmsAdapter.Client.ProtectableContainers.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.ProtectableContainers.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -160,15 +161,21 @@ public IEnumerable ListUnregisteredContainers( /// public IEnumerable GetBackupUsageSummary(string vaultName, string resourceGroupName, ODataQuery queryFilter) - { - Func> listAsync = () => BmsAdapter.Client.BackupUsageSummaries.ListWithHttpMessagesAsync( - vaultName, - resourceGroupName, - queryFilter, + { + Func> listAsync = + () => BmsAdapter.Client.BackupUsageSummaries.ListWithHttpMessagesAsync( + vaultName: vaultName, + resourceGroupName: resourceGroupName, + filter: queryFilter?.Filter, skipToken: null, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; - - return listAsync(); + + Func> listNextAsync = + nextLink => BmsAdapter.Client.BackupUsageSummaries.ListNextWithHttpMessagesAsync( + nextPageLink: nextLink, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; + + return HelperUtils.GetPagedList(listAsync, listNextAsync); } /// @@ -181,10 +188,10 @@ public RestAzureNS.AzureOperationResponse RefreshContainers( ODataQuery queryParam = null) { var response = BmsAdapter.Client.ProtectionContainers.RefreshWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - queryParam, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + filter: queryParam?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; return response; } @@ -200,13 +207,19 @@ public RestAzureNS.AzureOperationResponse RegisterC string resourceGroupName = null) { var response = BmsAdapter.Client.ProtectionContainers.RegisterWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - parameters, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + parameters: parameters, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; - return response; + return new RestAzureNS.AzureOperationResponse + { + Body = response.Body, + Request = response.Request, + Response = response.Response, + RequestId = response.RequestId + }; } /// @@ -240,11 +253,11 @@ public RestAzureNS.AzureOperationResponse UnregisterWorkloadContainers( string resourceGroupName = null) { var response = BmsAdapter.Client.ProtectionContainers.UnregisterWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result; return response; } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ItemAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ItemAPIs.cs index 60217d9d23aa..0899189df2f0 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ItemAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ItemAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -94,17 +94,24 @@ public RestAzureNS.AzureOperationResponse CreateOrUpdateP } } - Logger.Instance.WriteDebug("Executing CreateOrUpdateWithHttpMessagesAsync"); - return BmsAdapter.Client.ProtectedItems.CreateOrUpdateWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - request, - null, - customHeaders, - cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + Logger.Instance.WriteDebug("Executing BeginCreateOrUpdateWithHttpMessagesAsync"); + var response = BmsAdapter.Client.ProtectedItems.BeginCreateOrUpdateWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + parameters: request, + xMsAuthorizationAuxiliary: null, + customHeaders: customHeaders, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + return new RestAzureNS.AzureOperationResponse + { + Body = response.Body, + Request = response.Request, + Response = response.Response, + RequestId = response.RequestId + }; } /// @@ -156,7 +163,13 @@ public RestAzureNS.AzureOperationResponse DeleteProtectedItem( } unlockDeleteRequest.ResourceToBeDeleted = protectedItemUri; - UnlockDeleteResponse unlockDeleteResponse = BmsAdapter.Client.ResourceGuardProxy.UnlockDeleteWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardMapping[0].Name, unlockDeleteRequest.ResourceGuardOperationRequests, unlockDeleteRequest.ResourceToBeDeleted , customHeaders).Result.Body; + UnlockDeleteResponse unlockDeleteResponse = BmsAdapter.Client.ResourceGuardProxy.UnlockDeleteWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + resourceGuardProxyName: resourceGuardMapping[0].Name, + resourceGuardOperationRequests: unlockDeleteRequest.ResourceGuardOperationRequests, + resourceToBeDeleted: unlockDeleteRequest.ResourceToBeDeleted, + customHeaders: customHeaders).Result.Body; } else if (auxiliaryAccessToken != null && auxiliaryAccessToken != "") { @@ -169,11 +182,11 @@ public RestAzureNS.AzureOperationResponse DeleteProtectedItem( } return BmsAdapter.Client.ProtectedItems.DeleteWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -194,12 +207,12 @@ public RestAzureNS.AzureOperationResponse GetProtectedIte string resourceGroupName = null) { return BmsAdapter.Client.ProtectedItems.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -220,15 +233,15 @@ public List ListProtectedItem( { Func> listAsync = () => BmsAdapter.Client.BackupProtectedItems.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, - skipToken, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, + skipToken: skipToken, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupProtectedItems.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -251,15 +264,15 @@ public List ListProtectedItem( { Func> listAsync = () => CrrAdapter.Client.BackupProtectedItemsCrr.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, - skipToken, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + odataQuery: queryFilter, + skipToken: skipToken, cancellationToken: CrrAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => CrrAdapter.Client.BackupProtectedItemsCrr.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: CrrAdapter.CmdletCancellationToken).Result.Body; var result = HelperUtils.GetPagedListCrr(listAsync, listNextAsync); @@ -284,12 +297,12 @@ public RestAzureNS.AzureOperationResponse TriggerBackup( string resourceGroupName = null) { return BmsAdapter.Client.Backups.TriggerWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - itemName, - triggerBackupRequest, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: itemName, + parameters: triggerBackupRequest, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -319,8 +332,8 @@ public RestAzureNS.AzureOperationResponse CheckBackupStatu } return BmsAdapter.Client.BackupStatus.GetWithHttpMessagesAsync( - resourceLocation, - request, + azureRegion: resourceLocation, + parameters: request, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -339,12 +352,12 @@ public RestAzureNS.AzureOperationResponse CreateOrUpda string resourceGroupName = null) { return BmsAdapter.Client.ProtectionIntent.CreateOrUpdateWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - protectedItemName, - request, - cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + intentObjectName: protectedItemName, + parameters: request, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } /// @@ -360,11 +373,11 @@ public RestAzureNS.AzureOperationResponse DeleteProtectionIntent( string resourceGroupName = null) { return BmsAdapter.Client.ProtectionIntent.DeleteWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - protectedItemName, - cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + intentObjectName: protectedItemName, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } /// @@ -383,15 +396,15 @@ public List ListProtectionIntent( { Func> listAsync = () => BmsAdapter.Client.BackupProtectionIntent.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, - skipToken, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, + skipToken: skipToken, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupProtectionIntent.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -415,16 +428,16 @@ public List ListWorkloadItem( { Func> listAsync = () => BmsAdapter.Client.BackupWorkloadItems.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupWorkloadItems.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/JobAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/JobAPIs.cs index 91ca8218a92d..6a347c9304af 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/JobAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/JobAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,7 +16,7 @@ using System.Collections.Generic; using Microsoft.Azure.Commands.RecoveryServices.Backup.Helpers; using Microsoft.Azure.Management.RecoveryServices.Backup.Models; -using CrrModel = Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore.Models; +using CrrModel = Microsoft.Azure.Management.RecoveryServices.Backup.CrossRegionRestore.Models; using Microsoft.Rest.Azure.OData; using RestAzureNS = Microsoft.Rest.Azure; using Microsoft.Azure.Commands.Common.Strategies; @@ -39,9 +39,9 @@ public JobResource GetJob( string resourceGroupName = null) { return BmsAdapter.Client.JobDetails.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - jobId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + jobName: jobId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; } @@ -56,7 +56,10 @@ public CrrModel.JobResource GetCRRJobDetails( CrrModel.CrrJobRequest jobRequest ) { - return CrrAdapter.Client.BackupCrrJobDetails.GetWithHttpMessagesAsync(secondaryRegion, jobRequest.ResourceId, jobRequest.JobName).Result.Body; + return CrrAdapter.Client.BackupCrrJobDetails.GetWithHttpMessagesAsync( + azureRegion: secondaryRegion, + resourceId: jobRequest.ResourceId, + jobName: jobRequest.JobName).Result.Body; } public List GetCrrJobs(string vaultId, @@ -65,7 +68,7 @@ CrrModel.CrrJobRequest jobRequest string operation, DateTime startTime, DateTime endTime, - string backupManagementType, + string backupManagementType, string azureRegion = null) { ODataQuery queryFilter = GetQueryObjectCrr( @@ -73,17 +76,22 @@ CrrModel.CrrJobRequest jobRequest startTime, endTime, jobId, - status, + status, operation); - + CrrModel.CrrJobRequest crrJobRequest = new CrrModel.CrrJobRequest(); crrJobRequest.ResourceId = vaultId; Func> listAsync = - () => CrrAdapter.Client.BackupCrrJobs.ListWithHttpMessagesAsync(azureRegion, crrJobRequest.ResourceId, crrJobRequest.JobName, queryFilter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; + () => CrrAdapter.Client.BackupCrrJobs.ListWithHttpMessagesAsync( + azureRegion: azureRegion, + resourceId: crrJobRequest.ResourceId, + jobName: crrJobRequest.JobName, + odataQuery: queryFilter, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => CrrAdapter.Client.BackupCrrJobs.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedListCrr(listAsync, listNextAsync); @@ -123,15 +131,15 @@ public List GetJobs( Func> listAsync = () => BmsAdapter.Client.BackupJobs.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, - skipToken, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, + skipToken: skipToken, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupJobs.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -150,9 +158,9 @@ public RestAzureNS.AzureOperationResponse CancelJob( string resourceGroupName = null) { return BmsAdapter.Client.JobCancellations.TriggerWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - jobId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + jobName: jobId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -171,10 +179,10 @@ public RestAzureNS.AzureOperationResponse GetJobOperationStatus( string resourceGroupName = null) { return BmsAdapter.Client.JobOperationResults.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - jobId, - operationId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + jobName: jobId, + operationId: operationId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/OperationStatusAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/OperationStatusAPIs.cs index a7a8bd048c7d..c4905c8836f0 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/OperationStatusAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/OperationStatusAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,9 +36,9 @@ public RestAzureNS.AzureOperationResponse string resourceGroupName = null) { return BmsAdapter.Client.BackupOperationStatuses.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - operationId).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + operationId: operationId).Result; } /// @@ -53,8 +53,8 @@ public RestAzureNS.AzureOperationResponse string operationId) { return CrrAdapter.Client.CrrOperationStatus.GetWithHttpMessagesAsync( - secondaryRegion, - operationId).Result; + azureRegion: secondaryRegion, + operationId: operationId).Result; } /// @@ -73,10 +73,10 @@ public RestAzureNS.AzureOperationResponse string resourceGroupName = null) { return BmsAdapter.Client.ProtectionPolicyOperationStatuses.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - policyName, - operationId).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + policyName: policyName, + operationId: operationId).Result; } /// @@ -95,10 +95,10 @@ public RestAzureNS.AzureOperationResponse GetContainerRefreshOrInquiryOperationR .Client .ProtectionContainerRefreshOperationResults .GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - operationId).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + operationId: operationId).Result; } /// @@ -120,11 +120,11 @@ public RestAzureNS.AzureOperationResponse @@ -141,9 +141,9 @@ public RestAzureNS.AzureOperationResponse string resourceGroupName = null) { return BmsAdapter.Client.GetOperationStatusWithHttpMessagesAsync( - vaultName, - resourceGroupName, - operationId).Result; + vaultName: vaultName, + resourceGroupName: resourceGroupName, + operationId: operationId).Result; } /// @@ -160,9 +160,9 @@ public PrepareDataMoveResponse string resourceGroupName = null) { var prepareResponseBase = BmsAdapter.Client.BmsPrepareDataMoveOperationResult.GetWithHttpMessagesAsync( - vaultName, - resourceGroupName, - operationId).Result.Body; + vaultName: vaultName, + resourceGroupName: resourceGroupName, + operationId: operationId).Result.Body; var prepareResponseSerialized = JsonConvert.SerializeObject(prepareResponseBase); PrepareDataMoveResponse prepareResponseDerived = JsonConvert.DeserializeObject(prepareResponseSerialized); @@ -183,10 +183,10 @@ public RestAzureNS.AzureOperationResponse GetCancelJobOperationResult( string resourceGroupName = null) { return BmsAdapter.Client.JobOperationResults.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - operationId).Result; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + jobName: AzureFabricName, + operationId: operationId).Result; } } } diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/PolicyAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/PolicyAPIs.cs index dc46d614f226..2fb4b5774354 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/PolicyAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/PolicyAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -82,12 +82,12 @@ public RestAzureNS.AzureOperationResponse } return BmsAdapter.Client.ProtectionPolicies.CreateOrUpdateWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - policyName, - request, - null, - customHeaders, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + policyName: policyName, + parameters: request, + xMsAuthorizationAuxiliary: null, + customHeaders: customHeaders, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; } @@ -104,9 +104,9 @@ public ProtectionPolicyResource GetProtectionPolicy( string resourceGroupName = null) { return BmsAdapter.Client.ProtectionPolicies.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - policyName, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + policyName: policyName, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; } @@ -126,14 +126,14 @@ public List ListProtectionPolicy( { Func> listAsync = () => BmsAdapter.Client.BackupPolicies.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupPolicies.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -151,11 +151,17 @@ public RestAzureNS.AzureOperationResponse RemoveProtectionPolicy( string vaultName = null, string resourceGroupName = null) { - return BmsAdapter.Client.ProtectionPolicies.DeleteWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - policyName, + var response = BmsAdapter.Client.ProtectionPolicies.DeleteWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + policyName: policyName, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; + return new RestAzureNS.AzureOperationResponse + { + Request = response.Request, + Response = response.Response, + RequestId = response.RequestId + }; } } -} \ No newline at end of file +} diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ProtectableItemAPI.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ProtectableItemAPI.cs index c9c327d69cf8..23e46dd51b56 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ProtectableItemAPI.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/ProtectableItemAPI.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -39,14 +39,14 @@ public List ListProtectableItem( { Func> listAsync = () => BmsAdapter.Client.BackupProtectableItems.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.BackupProtectableItems.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return HelperUtils.GetPagedList(listAsync, listNextAsync); diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RecoveryPointsAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RecoveryPointsAPIs.cs index 92c3902f3573..524d76376084 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RecoveryPointsAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RecoveryPointsAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,12 +42,12 @@ public RecoveryPointResource GetRecoveryPointDetails( string resourceGroupName = null) { var response = BmsAdapter.Client.RecoveryPoints.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - recoveryPointId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + recoveryPointId: recoveryPointId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return response; @@ -71,17 +71,17 @@ public List GetRecoveryPoints( { Func> listAsync = () => BmsAdapter.Client.RecoveryPoints.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + filter: queryFilter?.Filter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.RecoveryPoints.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; var response = HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -106,17 +106,17 @@ public List GetRecoveryPoints( { Func> listAsync = () => CrrAdapter.Client.RecoveryPointsCrr.ListWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - queryFilter, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + odataQuery: queryFilter, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; Func> listNextAsync = nextLink => CrrAdapter.Client.RecoveryPointsCrr.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; var response = HelperUtils.GetPagedListCrr(listAsync, listNextAsync); @@ -140,12 +140,12 @@ public CrrModel.RecoveryPointResource GetRecoveryPointDetailsFromSecondaryRegion string resourceGroupName = null) { var response = CrrAdapter.Client.RecoveryPointsCrr.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - recoveryPointId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + recoveryPointId: recoveryPointId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; return response; @@ -169,18 +169,17 @@ public List GetMoveRecommendedRecoveryPoints( { Func> listAsync = () => BmsAdapter.Client.RecoveryPointsRecommendedForMove.ListWithHttpMessagesAsync( - vaultName, - resourceGroupName, - AzureFabricName, - containerName, - protectedItemName, - moveRequest.ObjectType, - moveRequest.ExcludedRPList - ).Result.Body; + vaultName: vaultName, + resourceGroupName: resourceGroupName, + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + objectType: moveRequest.ObjectType, + excludedRPList: moveRequest.ExcludedRPList).Result.Body; Func> listNextAsync = nextLink => BmsAdapter.Client.RecoveryPointsRecommendedForMove.ListNextWithHttpMessagesAsync( - nextLink, + nextPageLink: nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; var response = HelperUtils.GetPagedList(listAsync, listNextAsync); @@ -205,15 +204,20 @@ public RestAzureNS.AzureOperationResponse MoveRecoveryPoint( string vaultName = null, string resourceGroupName = null) { - return BmsAdapter.Client.BeginMoveRecoveryPointWithHttpMessagesAsync( - vaultName, - resourceGroupName, - AzureFabricName, - containerName, - protectedItemName, - recoveryPointId, - moveRPAcrossTiersRequest - ).Result; + var response = BmsAdapter.Client.BeginMoveRecoveryPointWithHttpMessagesAsync( + vaultName: vaultName, + resourceGroupName: resourceGroupName, + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + recoveryPointId: recoveryPointId, + parameters: moveRPAcrossTiersRequest).Result; + return new RestAzureNS.AzureOperationResponse + { + Request = response.Request, + Response = response.Response, + RequestId = response.RequestId + }; } /// @@ -238,13 +242,13 @@ public RestAzureNS.AzureOperationResponse ProvisioninItemLevelRecoveryAccess( provisionRequest.Properties = registrationRequest; var response = BmsAdapter.Client.ItemLevelRecoveryConnections.ProvisionWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - recoveryPointId, - provisionRequest, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + recoveryPointId: recoveryPointId, + parameters: provisionRequest, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; return response; @@ -267,12 +271,12 @@ public RestAzureNS.AzureOperationResponse RevokeItemLevelRecoveryAccess( string resourceGroupName = null) { var response = BmsAdapter.Client.ItemLevelRecoveryConnections.RevokeWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerName, - protectedItemName, - recoveryPointId, + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerName, + protectedItemName: protectedItemName, + recoveryPointId: recoveryPointId, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; return response; diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RestoreDiskAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RestoreDiskAPIs.cs index 646416163899..910e30002968 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RestoreDiskAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/RestoreDiskAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -60,7 +60,7 @@ public RestAzureNS.AzureOperationResponse RestoreDisk( } } - #region MUA + #region MUA Dictionary> customHeaders = new Dictionary>(); string operationRequest = null; @@ -91,7 +91,7 @@ public RestAzureNS.AzureOperationResponse RestoreDisk( } else if (!isMUAProtected) { - // resx + // resx throw new ArgumentException(String.Format("operation not critical. please try without the Token parameter")); } else @@ -101,19 +101,24 @@ public RestAzureNS.AzureOperationResponse RestoreDisk( } #endregion - var response = BmsAdapter.Client.Restores.TriggerWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), - resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, - containerUri, - protectedItemUri, - recoveryPointId, - triggerRestoreRequest, - null, - customHeaders, + var response = BmsAdapter.Client.Restores.BeginTriggerWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerUri, + protectedItemName: protectedItemUri, + recoveryPointId: recoveryPointId, + parameters: triggerRestoreRequest, + xMsAuthorizationAuxiliary: null, + customHeaders: customHeaders, cancellationToken: BmsAdapter.CmdletCancellationToken).Result; - return response; + return new RestAzureNS.AzureOperationResponse + { + Request = response.Request, + Response = response.Response, + RequestId = response.RequestId + }; } @@ -145,15 +150,21 @@ public CrrModel.CrrAccessToken GetCRRAccessToken( throw new Exception(Resources.AADPropertiesCouldNotBeFetchedException); } - var accessToken = CrrAdapter.Client.RecoveryPoints.GetAccessTokenWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), - AzureFabricName, containerUri, protectedItemUri, recoveryPointId, userInfo).Result.Body; + var accessToken = CrrAdapter.Client.RecoveryPoints.GetAccessTokenWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + fabricName: AzureFabricName, + containerName: containerUri, + protectedItemName: protectedItemUri, + recoveryPointId: recoveryPointId, + parameters: userInfo).Result.Body; if(accessToken == null || accessToken.Properties == null) { throw new Exception(Resources.CRRAccessTokenCouldNotBeFetchedException); } - return accessToken.Properties; + return accessToken.Properties; } /// @@ -169,7 +180,7 @@ public RestAzureNS.AzureOperationResponse RestoreDiskSecondryRegion( CrrModel.CrossRegionRestoreRequest triggerCRRRestoreRequest, string storageAccountLocation = null, string secondaryRegion = null) - { + { //validation block if (!triggerCRRRestoreRequest.RestoreRequest.GetType().IsSubclassOf(typeof(CrrModel.AzureWorkloadRestoreRequest))) { @@ -178,9 +189,12 @@ public RestAzureNS.AzureOperationResponse RestoreDiskSecondryRegion( throw new Exception(Resources.CrossRegionRestoreIncorrectTargetRegion); } } - - var response = CrrAdapter.Client.CrossRegionRestore.TriggerWithHttpMessagesAsync(secondaryRegion, triggerCRRRestoreRequest.CrossRegionRestoreAccessDetails , triggerCRRRestoreRequest.RestoreRequest).Result; + + var response = CrrAdapter.Client.CrossRegionRestore.TriggerWithHttpMessagesAsync( + azureRegion: secondaryRegion, + crossRegionRestoreAccessDetails: triggerCRRRestoreRequest.CrossRegionRestoreAccessDetails, + restoreRequest: triggerCRRRestoreRequest.RestoreRequest).Result; return response; } } -} \ No newline at end of file +} diff --git a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/VaultAPIs.cs b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/VaultAPIs.cs index bae7392825e0..f9013017fd31 100644 --- a/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/VaultAPIs.cs +++ b/src/RecoveryServices/RecoveryServices.Backup.ServiceClientAdapter/BMSAPIs/VaultAPIs.cs @@ -1,4 +1,4 @@ -// ---------------------------------------------------------------------------------- +// ---------------------------------------------------------------------------------- // // Copyright Microsoft Corporation // Licensed under the Apache License, Version 2.0 (the "License"); @@ -76,13 +76,18 @@ public BackupResourceVaultConfigResource SetVaultProperty(string vaultName, stri } return BmsAdapter.Client.BackupResourceVaultConfigs.UpdateWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), param, null, customHeaders).Result.Body; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + parameters: param, + xMsAuthorizationAuxiliary: null, + customHeaders: customHeaders).Result.Body; } public BackupResourceVaultConfigResource GetVaultProperty(string vaultName, string resourceGroupName) { return BmsAdapter.Client.BackupResourceVaultConfigs.GetWithHttpMessagesAsync( - vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName()).Result.Body; + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName()).Result.Body; } /// @@ -94,7 +99,8 @@ public BackupResourceVaultConfigResource GetVaultProperty(string vaultName, stri public BackupResourceConfigResource GetVaultStorageType(string resouceGroupName, string vaultName) { return BmsAdapter.Client.BackupResourceStorageConfigsNonCrr.GetWithHttpMessagesAsync( - vaultName, resouceGroupName).Result.Body; + vaultName: vaultName, + resourceGroupName: resouceGroupName).Result.Body; } /// @@ -135,7 +141,9 @@ public RestAzureNS.AzureOperationResponse UpdateVaultEncryptionConfig(string res BackupResourceEncryptionConfigResource encryptionConfigResource) { return BmsAdapter.Client.BackupResourceEncryptionConfigs.UpdateWithHttpMessagesAsync( - vaultName, resouceGroupName, encryptionConfigResource).Result; + vaultName: vaultName, + resourceGroupName: resouceGroupName, + parameters: encryptionConfigResource).Result; } /// @@ -149,7 +157,9 @@ public RestAzureNS.AzureOperationResponse UpdateVaultEncryption(string resouceGr BackupResourceEncryptionConfigResource encryptionConfigResource) { return BmsAdapter.Client.BackupResourceEncryptionConfigs.UpdateWithHttpMessagesAsync( - vaultName, resouceGroupName, encryptionConfigResource).Result; + vaultName: vaultName, + resourceGroupName: resouceGroupName, + parameters: encryptionConfigResource).Result; } /// @@ -241,7 +251,9 @@ public CrrModel.AADPropertiesResource GetAADProperties(string azureRegion, strin queryParams = new ODataQuery(q => q.BackupManagementType == BackupManagementType.AzureStorage); } - CrrModel.AADPropertiesResource aadProperties = CrrAdapter.Client.AadProperties.GetWithHttpMessagesAsync(azureRegion, queryParams).Result.Body; + CrrModel.AADPropertiesResource aadProperties = CrrAdapter.Client.AadProperties.GetWithHttpMessagesAsync( + azureRegion: azureRegion, + odataQuery: queryParams).Result.Body; return aadProperties; } @@ -255,18 +267,26 @@ public string PrepareDataMove(string vaultName, string resourceGroupName, Prepar { // prepare move var prepareMoveOperationResponse = BmsAdapter.Client.BeginBMSPrepareDataMoveWithHttpMessagesAsync( - vaultName, resourceGroupName, prepareMoveRequest).Result; + vaultName: vaultName, + resourceGroupName: resourceGroupName, + parameters: prepareMoveRequest).Result; + var prepareMoveOperationResponseBase = new RestAzureNS.AzureOperationResponse + { + Request = prepareMoveOperationResponse.Request, + Response = prepareMoveOperationResponse.Response, + RequestId = prepareMoveOperationResponse.RequestId + }; // track prepare-move operation to success var operationStatus = TrackingHelpers.GetOperationStatusDataMove( - prepareMoveOperationResponse, + prepareMoveOperationResponseBase, operationId => GetDataMoveOperationStatus(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Prepare move operation: " + operationStatus.Body.Status); // get the correlation Id and return it for trigger data move var operationResult = TrackingHelpers.GetCorrelationId( - prepareMoveOperationResponse, + prepareMoveOperationResponseBase, operationId => GetPrepareDataMoveOperationResult(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Prepare move - correlationId:" + operationResult.CorrelationId); @@ -284,11 +304,19 @@ public void TriggerDataMove(string vaultName, string resourceGroupName, TriggerD { //trigger move var triggerMoveOperationResponse = BmsAdapter.Client.BeginBMSTriggerDataMoveWithHttpMessagesAsync( - vaultName, resourceGroupName, triggerMoveRequest).Result; + vaultName: vaultName, + resourceGroupName: resourceGroupName, + parameters: triggerMoveRequest).Result; + var triggerMoveOperationResponseBase = new RestAzureNS.AzureOperationResponse + { + Request = triggerMoveOperationResponse.Request, + Response = triggerMoveOperationResponse.Response, + RequestId = triggerMoveOperationResponse.RequestId + }; // track trigger-move operation to success var operationStatus = TrackingHelpers.GetOperationStatusDataMove( - triggerMoveOperationResponse, + triggerMoveOperationResponseBase, operationId => GetDataMoveOperationStatus(operationId, vaultName, resourceGroupName)); Logger.Instance.WriteDebug("Trigger move operation: " + operationStatus.Body.Status); @@ -306,7 +334,10 @@ public void TriggerDataMove(string vaultName, string resourceGroupName, TriggerD /// public ResourceGuardProxyBaseResource GetResourceGuardMapping(string vaultName, string resourceGroupName, string resourceGuardProxyName) { - return BmsAdapter.Client.ResourceGuardProxy.GetWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardProxyName).Result.Body; + return BmsAdapter.Client.ResourceGuardProxy.GetWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + resourceGuardProxyName: resourceGuardProxyName).Result.Body; } /// @@ -326,7 +357,12 @@ public ResourceGuardProxyBaseResource CreateResourceGuardMapping(string vaultNam customHeaders.Add("x-ms-authorization-auxiliary", new List { "Bearer " + auxiliaryAccessToken }); } - return BmsAdapter.Client.ResourceGuardProxy.PutWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardProxyName, param, customHeaders).Result.Body; + return BmsAdapter.Client.ResourceGuardProxy.PutWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + resourceGuardProxyName: resourceGuardProxyName, + parameters: param, + customHeaders: customHeaders).Result.Body; } /// @@ -364,7 +400,13 @@ public RestAzureNS.AzureOperationResponse DeleteResourceGuardMapping(string vaul unlockDeleteRequest.ResourceGuardOperationRequests = new List(); unlockDeleteRequest.ResourceGuardOperationRequests.Add(operationRequest); - UnlockDeleteResponse unlockDeleteResponse = BmsAdapter.Client.ResourceGuardProxy.UnlockDeleteWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardProxyName, unlockDeleteRequest.ResourceGuardOperationRequests, unlockDeleteRequest.ResourceToBeDeleted, customHeaders).Result.Body; + UnlockDeleteResponse unlockDeleteResponse = BmsAdapter.Client.ResourceGuardProxy.UnlockDeleteWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + resourceGuardProxyName: resourceGuardProxyName, + resourceGuardOperationRequests: unlockDeleteRequest.ResourceGuardOperationRequests, + resourceToBeDeleted: unlockDeleteRequest.ResourceToBeDeleted, + customHeaders: customHeaders).Result.Body; } } else if (auxiliaryAccessToken != null && auxiliaryAccessToken != "") @@ -372,7 +414,10 @@ public RestAzureNS.AzureOperationResponse DeleteResourceGuardMapping(string vaul throw new ArgumentException(String.Format(Resources.ResourceGuardMappingNotFound)); } - return BmsAdapter.Client.ResourceGuardProxy.DeleteWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName(), resourceGuardProxyName).Result; + return BmsAdapter.Client.ResourceGuardProxy.DeleteWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName(), + resourceGuardProxyName: resourceGuardProxyName).Result; } /// @@ -383,10 +428,13 @@ public RestAzureNS.AzureOperationResponse DeleteResourceGuardMapping(string vaul /// public List ListResourceGuardMapping(string vaultName, string resourceGroupName) { - Func> proxyPagedList = () => BmsAdapter.Client.ResourceGuardProxies.GetWithHttpMessagesAsync(vaultName ?? BmsAdapter.GetResourceName(), resourceGroupName ?? BmsAdapter.GetResourceGroupName()).Result.Body; + Func> proxyPagedList = () => BmsAdapter.Client.ResourceGuardProxies.GetWithHttpMessagesAsync( + vaultName: vaultName ?? BmsAdapter.GetResourceName(), + resourceGroupName: resourceGroupName ?? BmsAdapter.GetResourceGroupName()).Result.Body; Func> proxyPagedListNext = nextLink => BmsAdapter.Client.ResourceGuardProxies.GetNextWithHttpMessagesAsync( - nextLink, cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; + nextPageLink: nextLink, + cancellationToken: BmsAdapter.CmdletCancellationToken).Result.Body; var proxyList = HelperUtils.GetPagedList(proxyPagedList, proxyPagedListNext); diff --git a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/PolicyCmdletHelpers.cs b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/PolicyCmdletHelpers.cs index 065f6b52ca3a..fa1028da552e 100644 --- a/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/PolicyCmdletHelpers.cs +++ b/src/RecoveryServices/RecoveryServices.Backup/Cmdlets/ProtectionPolicy/PolicyCmdletHelpers.cs @@ -96,6 +96,16 @@ public static ProtectionPolicyResource GetProtectionPolicyByName( throw; } } + else if (exception.InnerException != null && + exception.InnerException is ErrorResponseException) + { + var errorResponseEx = exception.InnerException as ErrorResponseException; + if (errorResponseEx.Response == null || + errorResponseEx.Response.StatusCode != SystemNet.HttpStatusCode.NotFound) + { + throw; + } + } else { throw; diff --git a/src/RecoveryServices/RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs b/src/RecoveryServices/RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs index ad1689072771..c9049320edcc 100644 --- a/src/RecoveryServices/RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs +++ b/src/RecoveryServices/RecoveryServices.Backup/RecoveryServicesBackupCmdletBase.cs @@ -151,6 +151,28 @@ private void HandleException(Exception exception) targetErrorCategory = ErrorCategory.InvalidOperation; } } + else if (exception is ErrorResponseException) + { + var errorResponseEx = exception as ErrorResponseException; + if (errorResponseEx.Response != null && + errorResponseEx.Response.StatusCode == SystemNet.HttpStatusCode.NotFound) + { + WriteDebug(string.Format( + Resources.CloudExceptionCodeNotFound, + errorResponseEx.Response.StatusCode)); + + targetEx = new Exception(Resources.ResourceNotFoundMessage); + targetErrorCategory = ErrorCategory.InvalidArgument; + } + else if (errorResponseEx.Body != null && errorResponseEx.Body.Error != null) + { + var error = errorResponseEx.Body.Error; + WriteDebug(string.Format(Resources.CloudException, error.Code, error.Message)); + + targetErrorId = error.Code; + targetErrorCategory = ErrorCategory.InvalidOperation; + } + } else if (exception is SystemNet.WebException) { var webEx = exception as SystemNet.WebException; diff --git a/src/RecoveryServices/RecoveryServices/ChangeLog.md b/src/RecoveryServices/RecoveryServices/ChangeLog.md index 7c9635a29855..f8c552edb318 100644 --- a/src/RecoveryServices/RecoveryServices/ChangeLog.md +++ b/src/RecoveryServices/RecoveryServices/ChangeLog.md @@ -19,6 +19,8 @@ --> ## Upcoming Release +* Updated Recovery Services Backup commands to use management API version `2026-07-01` + - Preserved request filtering, continuation paging, operation tracking responses, and backup error details after SDK contract changes. * Added Cross Region Restore support for Azure File Share backup items (`Get-AzRecoveryServicesBackupItem -UseSecondaryRegion`, `Get-AzRecoveryServicesBackupRecoveryPoint -UseSecondaryRegion`, `Restore-AzRecoveryServicesBackupItem -RestoreToSecondaryRegion`) * Refined soft delete behavior for Azure File share backup items - `Undo-AzRecoveryServicesBackupItemDeletion` now throws a clear error when the target Azure File share item is not in the soft-deleted (`ToBeDeleted`) state instead of issuing an undelete request that cannot succeed. diff --git a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs index 0cd93a44b527..f82f95746d17 100644 --- a/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs +++ b/src/RecoveryServices/RecoveryServices/Common/PSRecoveryServicesVaultClient.cs @@ -158,7 +158,10 @@ public void UpdateVaultStorageType(string resouceGroupName, string vaultName, BackupResourceConfigResource backupStorageConfig) { GetRecoveryServicesBackupClient.BackupResourceStorageConfigsNonCrr.UpdateWithHttpMessagesAsync( - vaultName, resouceGroupName, backupStorageConfig, GetRequestHeaders()); + resourceGroupName: resouceGroupName, + vaultName: vaultName, + parameters: backupStorageConfig, + customHeaders: GetRequestHeaders()); } /// @@ -172,7 +175,10 @@ public void PatchVaultStorageConfigProperties(string resouceGroupName, string va BackupResourceConfigResource backupStorageConfig) { GetRecoveryServicesBackupClient.BackupResourceStorageConfigsNonCrr.PatchWithHttpMessagesAsync( - vaultName, resouceGroupName, backupStorageConfig, GetRequestHeaders()); + resourceGroupName: resouceGroupName, + vaultName: vaultName, + parameters: backupStorageConfig, + customHeaders: GetRequestHeaders()); } /// @@ -184,7 +190,9 @@ public void PatchVaultStorageConfigProperties(string resouceGroupName, string va public BackupResourceConfigResource GetVaultStorageConfig(string resouceGroupName, string vaultName) { return GetRecoveryServicesBackupClient.BackupResourceStorageConfigsNonCrr.GetWithHttpMessagesAsync( - vaultName, resouceGroupName, GetRequestHeaders()).Result.Body; + resourceGroupName: resouceGroupName, + vaultName: vaultName, + customHeaders: GetRequestHeaders()).Result.Body; } /// @@ -195,7 +203,9 @@ public BackupResourceConfigResource GetVaultStorageConfig(string resouceGroupNam /// public List ListResourceGuardMapping(string vaultName, string resourceGroupName) { - Func> proxyPagedList = () => GetRecoveryServicesBackupClient.ResourceGuardProxies.GetWithHttpMessagesAsync(vaultName, resourceGroupName).Result.Body; + Func> proxyPagedList = () => GetRecoveryServicesBackupClient.ResourceGuardProxies.GetWithHttpMessagesAsync( + resourceGroupName: resourceGroupName, + vaultName: vaultName).Result.Body; Func> proxyPagedListNext = nextLink => GetRecoveryServicesBackupClient.ResourceGuardProxies.GetNextWithHttpMessagesAsync( nextLink).Result.Body; diff --git a/src/RecoveryServices/RecoveryServices/Common/RecoveryServicesCmdletBase.cs b/src/RecoveryServices/RecoveryServices/Common/RecoveryServicesCmdletBase.cs index 32432851028e..553557caa70a 100644 --- a/src/RecoveryServices/RecoveryServices/Common/RecoveryServicesCmdletBase.cs +++ b/src/RecoveryServices/RecoveryServices/Common/RecoveryServicesCmdletBase.cs @@ -17,6 +17,7 @@ using System.Text; using System.Xml; using Microsoft.Azure.Commands.ResourceManager.Common; +using Microsoft.Azure.Management.RecoveryServices.Backup.Models; using Microsoft.Rest.Azure; using Newtonsoft.Json; @@ -64,12 +65,29 @@ protected void Initialize() /// Exception to handle. public void HandleException(Exception ex) { + ErrorResponseException errorResponseException = ex as ErrorResponseException; + AggregateException aggregateException = ex as AggregateException; + if (errorResponseException == null && aggregateException != null) + { + AggregateException flattenedException = aggregateException.Flatten(); + if (flattenedException.InnerExceptions.Count == 1) + { + errorResponseException = + flattenedException.InnerExceptions[0] as ErrorResponseException; + } + } + string clientRequestIdMsg = string.Empty; if (this.recoveryServicesClient != null) { clientRequestIdMsg = "ClientRequestId: " + this.recoveryServicesClient.ClientRequestId + "\n"; } + if (errorResponseException != null) + { + throw CreateErrorResponseException(errorResponseException, clientRequestIdMsg); + } + CloudException cloudException = ex as CloudException; if (cloudException != null) { @@ -142,6 +160,46 @@ public void HandleException(Exception ex) } } + private static Exception CreateErrorResponseException( + ErrorResponseException exception, + string clientRequestIdMessage) + { + ErrorDetail error = exception.Body?.Error; + if (error == null) + { + return new Exception( + string.Format( + Properties.Resources.InvalidCloudExceptionErrorMessage, + clientRequestIdMessage + exception.Message), + exception); + } + + StringBuilder exceptionMessage = new StringBuilder(); + exceptionMessage.Append(Properties.Resources.CloudExceptionDetails); + + if (error.Details != null) + { + foreach (ErrorDetail detail in error.Details) + { + if (!string.IsNullOrEmpty(detail.Code)) + exceptionMessage.AppendLine("ErrorCode: " + detail.Code); + if (!string.IsNullOrEmpty(detail.Message)) + exceptionMessage.AppendLine("Message: " + detail.Message); + + exceptionMessage.AppendLine(); + } + } + else + { + if (!string.IsNullOrEmpty(error.Code)) + exceptionMessage.AppendLine("ErrorCode: " + error.Code); + if (!string.IsNullOrEmpty(error.Message)) + exceptionMessage.AppendLine("Message: " + error.Message); + } + + return new InvalidOperationException(exceptionMessage.ToString()); + } + protected override void BeginProcessing() { base.BeginProcessing();