Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ public static List<T> GetPagedListCrr<T>(
/// <returns>List of objects returned by the API</returns>
public static List<T> GetPagedList<T>(
Func<IPage<T>> listResources, Func<string, IPage<T>> listNext)
where T : ServiceClientModel.Resource
where T : class
{
var resources = new List<T>();
string nextLink = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,16 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie
public RecoveryServicesBackupClient Client { get; private set; }

/// <summary>
/// Fetches Operation Result for Prepare Data Move
/// Fetches operation status for data move operation on vault
/// </summary>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='vaultName'>
/// vaults
/// </param>
/// <param name='operationId'>
///
/// The name of the BackupResourceConfigResource
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
Expand All @@ -72,7 +71,7 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<VaultStorageConfigOperationResultResponse>> GetWithHttpMessagesAsync(string vaultName, string resourceGroupName, string operationId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
public async System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<VaultStorageConfigOperationResultResponse>> GetWithHttpMessagesAsync(string resourceGroupName, string vaultName, string operationId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
{


Expand All @@ -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)
Expand All @@ -110,8 +125,8 @@ internal BmsPrepareDataMoveOperationResultOperations (RecoveryServicesBackupClie
{
_invocationId = Microsoft.Rest.ServiceClientTracing.NextInvocationId.ToString();
System.Collections.Generic.Dictionary<string, object> tracingParameters = new System.Collections.Generic.Dictionary<string, object>();
tracingParameters.Add("vaultName", vaultName);
tracingParameters.Add("resourceGroupName", resourceGroupName);
tracingParameters.Add("vaultName", vaultName);
tracingParameters.Add("operationId", operationId);


Expand All @@ -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<string> _queryParameters = new System.Collections.Generic.List<string>();
Expand Down Expand Up @@ -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<NewErrorResponse>(_responseContent, this.Client.DeserializationSettings);
ErrorResponse _errorBody = Microsoft.Rest.Serialization.SafeJsonConvert.DeserializeObject<ErrorResponse>(_responseContent, this.Client.DeserializationSettings);
if (_errorBody != null)
{
ex.Body = _errorBody;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,48 +13,46 @@ namespace Microsoft.Azure.Management.RecoveryServices.Backup
public static partial class BmsPrepareDataMoveOperationResultOperationsExtensions
{
/// <summary>
/// Fetches Operation Result for Prepare Data Move
/// Fetches operation status for data move operation on vault
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='vaultName'>
/// vaults
/// </param>
/// <param name='operationId'>
///
/// The name of the BackupResourceConfigResource
/// </param>
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();
}

/// <summary>
/// Fetches Operation Result for Prepare Data Move
/// Fetches operation status for data move operation on vault
/// </summary>
/// <param name='operations'>
/// The operations group for this extension method.
/// </param>
/// <param name='vaultName'>
/// The name of the recovery services vault.
/// </param>
/// <param name='resourceGroupName'>
/// The name of the resource group where the recovery services vault is
/// present.
/// The name of the resource group. The name is case insensitive.
/// </param>
/// <param name='vaultName'>
/// vaults
/// </param>
/// <param name='operationId'>
///
/// The name of the BackupResourceConfigResource
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async System.Threading.Tasks.Task<VaultStorageConfigOperationResultResponse> 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<VaultStorageConfigOperationResultResponse> 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;
}
Expand Down
Loading