/// <summary>
 /// The update authorization rule operation updates an authorization
 /// rule for a namespace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// Required. The namespace name.
 /// </param>
 /// <param name='rule'>
 /// Optional. Updated access authorization rule.
 /// </param>
 /// <returns>
 /// A response to a request for a particular authorization rule.
 /// </returns>
 public static ServiceBusAuthorizationRuleResponse UpdateAuthorizationRule(this INamespaceOperations operations, string namespaceName, ServiceBusSharedAccessAuthorizationRule rule)
 {
     return Task.Factory.StartNew((object s) => 
     {
         return ((INamespaceOperations)s).UpdateAuthorizationRuleAsync(namespaceName, rule);
     }
     , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult();
 }
 /// <summary>
 /// The update authorization rule operation updates an authorization
 /// rule for a namespace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// Required. The namespace name.
 /// </param>
 /// <param name='rule'>
 /// Optional. Updated access authorization rule.
 /// </param>
 /// <returns>
 /// A response to a request for a particular authorization rule.
 /// </returns>
 public static Task<ServiceBusAuthorizationRuleResponse> UpdateAuthorizationRuleAsync(this INamespaceOperations operations, string namespaceName, ServiceBusSharedAccessAuthorizationRule rule)
 {
     return operations.UpdateAuthorizationRuleAsync(namespaceName, rule, CancellationToken.None);
 }
 /// <summary>
 /// The update authorization rule operation updates an authorization
 /// rule for a namespace.
 /// </summary>
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations.
 /// </param>
 /// <param name='namespaceName'>
 /// The namespace name.
 /// </param>
 /// <param name='rule'>
 /// Updated access authorization rule.
 /// </param>
 /// <returns>
 /// A response to a request for a particular authorization rule.
 /// </returns>
 public static ServiceBusAuthorizationRuleResponse UpdateAuthorizationRule(this INamespaceOperations operations, string namespaceName, ServiceBusSharedAccessAuthorizationRule rule)
 {
     try
     {
         return operations.UpdateAuthorizationRuleAsync(namespaceName, rule).Result;
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }