/// <summary>
 /// The Check Name Availability operation checks if a storage account
 /// name is available for use in Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154125.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='accountName'>
 /// Required. The desired storage account name to check for
 /// availability.
 /// </param>
 /// <returns>
 /// The response to a storage account check name availability request.
 /// </returns>
 public static Task<CheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IStorageAccountOperations operations, string accountName)
 {
     return operations.CheckNameAvailabilityAsync(accountName, CancellationToken.None);
 }
 /// <summary>
 /// The Check Name Availability operation checks if a storage account
 /// name is available for use in Windows Azure.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154125.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Storage.IStorageAccountOperations.
 /// </param>
 /// <param name='serviceName'>
 /// The desired storage account name to check for availability.
 /// </param>
 /// <returns>
 /// The response to a storage account check name availability request.
 /// </returns>
 public static CheckNameAvailabilityResponse CheckNameAvailability(this IStorageAccountOperations operations, string serviceName)
 {
     try
     {
         return operations.CheckNameAvailabilityAsync(serviceName).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Check Hosted Service Name Availability operation checks for the
 /// availability of the specified cloud service name.  (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/jj154116.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Compute.IHostedServiceOperations.
 /// </param>
 /// <param name='serviceName'>
 /// Required. The cloud service name that you would like to use.
 /// </param>
 /// <returns>
 /// The Check Hosted Service Name Availability operation response.
 /// </returns>
 public static Task<HostedServiceCheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IHostedServiceOperations operations, string serviceName)
 {
     return operations.CheckNameAvailabilityAsync(serviceName, CancellationToken.None);
 }
 /// <summary>
 /// Determine if the JobCollection name is available to be used.
 /// JobCollection names must be unique within a cloud-service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// A name for the JobCollection. The name must be unique as scoped
 /// within the CloudService.  The name can be up to 100 characters in
 /// length.
 /// </param>
 /// <returns>
 /// The Check Name Availability operation response.
 /// </returns>
 public static Task<JobCollectionCheckNameAvailabilityResponse> CheckNameAvailabilityAsync(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     return operations.CheckNameAvailabilityAsync(cloudServiceName, jobCollectionName, CancellationToken.None);
 }
 /// <summary>
 /// Determine if the JobCollection name is available to be used.
 /// JobCollection names must be unique within a cloud-service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Scheduler.IJobCollectionOperations.
 /// </param>
 /// <param name='cloudServiceName'>
 /// The name of the cloud service.
 /// </param>
 /// <param name='jobCollectionName'>
 /// A name for the JobCollection. The name must be unique as scoped
 /// within the CloudService.  The name can be up to 100 characters in
 /// length.
 /// </param>
 /// <returns>
 /// The Check Name Availability operation response.
 /// </returns>
 public static JobCollectionCheckNameAvailabilityResponse CheckNameAvailability(this IJobCollectionOperations operations, string cloudServiceName, string jobCollectionName)
 {
     try
     {
         return operations.CheckNameAvailabilityAsync(cloudServiceName, jobCollectionName).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// Checks availability and correctness of a name for an Api Management
 /// service.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.ApiManagement.IResourceProviderOperations.
 /// </param>
 /// <param name='parameters'>
 /// Required. Parameters supplied to the CheckNameAvailability
 /// operation.
 /// </param>
 /// <returns>
 /// Response of the CheckNameAvailability operation.
 /// </returns>
 public static Task<ApiServiceNameAvailabilityResponse> CheckNameAvailabilityAsync(this IResourceProviderOperations operations, ApiServiceCheckNameAvailabilityParameters parameters)
 {
     return operations.CheckNameAvailabilityAsync(parameters, CancellationToken.None);
 }