/// <summary>
 /// The Regenerate Media Services Account Key operation regenerates an
 /// account key for the given Media Services account in Windows Azure.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167010.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.MediaServices.IAccountOperations.
 /// </param>
 /// <param name='accountName'>
 /// The name of the Media Services Account.
 /// </param>
 /// <param name='keyType'>
 /// The type of key to regenerate (primary or secondary)
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static OperationResponse RegenerateKey(this IAccountOperations operations, string accountName, MediaServicesKeyType keyType)
 {
     try
     {
         return(operations.RegenerateKeyAsync(accountName, keyType).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <summary>
 /// The Regenerate Media Services Account Key operation regenerates an
 /// account key for the given Media Services account in Windows Azure.
 /// (see
 /// http://msdn.microsoft.com/en-us/library/windowsazure/dn167010.aspx
 /// for more information)
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.MediaServices.IAccountOperations.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the Media Services Account.
 /// </param>
 /// <param name='keyType'>
 /// Required. The type of key to regenerate (primary or secondary)
 /// </param>
 /// <returns>
 /// A standard service response including an HTTP status code and
 /// request ID.
 /// </returns>
 public static Task <AzureOperationResponse> RegenerateKeyAsync(this IAccountOperations operations, string accountName, MediaServicesKeyType keyType)
 {
     return(operations.RegenerateKeyAsync(accountName, keyType, CancellationToken.None));
 }
 /// <summary>
 /// The RegenerateKey operation regenerates the specified account key
 /// for the given Batch account.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.Azure.Management.Batch.IAccountOperations.
 /// </param>
 /// <param name='resourceGroupName'>
 /// Required. The name of the resource group that contains the Batch
 /// account.
 /// </param>
 /// <param name='accountName'>
 /// Required. The name of the account.
 /// </param>
 /// <param name='parameters'>
 /// Required. The type of key to regenerate
 /// </param>
 /// <returns>
 /// Values returned by the RegenerateKey operation.
 /// </returns>
 public static Task <BatchAccountRegenerateKeyResponse> RegenerateKeyAsync(this IAccountOperations operations, string resourceGroupName, string accountName, BatchAccountRegenerateKeyParameters parameters)
 {
     return(operations.RegenerateKeyAsync(resourceGroupName, accountName, parameters, CancellationToken.None));
 }