/// <summary> /// The get authorization rules operation gets the authorization rules /// for a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations. /// </param> /// <param name='namespaceName'> /// The namespace to get the authorization rule for. /// </param> /// <returns> /// A response to a request for a list of authorization rules. /// </returns> public static ServiceBusAuthorizationRulesResponse ListAuthorizationRules(this INamespaceOperations operations, string namespaceName) { try { return(operations.ListAuthorizationRulesAsync(namespaceName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The get authorization rules operation gets the authorization rules /// for a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INamespaceOperations. /// </param> /// <param name='namespaceName'> /// The namespace to get the authorization rule for. /// </param> /// <returns> /// A response to a request for a list of authorization rules. /// </returns> public static Task <ServiceBusAuthorizationRulesResponse> ListAuthorizationRulesAsync(this INamespaceOperations operations, string namespaceName) { return(operations.ListAuthorizationRulesAsync(namespaceName, CancellationToken.None)); }
/// <summary> /// The get authorization rules operation gets the authorization rules /// for a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INamespaceOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace to get the authorization rule for. /// </param> /// <returns> /// The response of the List Namespace operation. /// </returns> public static Task <SharedAccessAuthorizationRuleListResponse> ListAuthorizationRulesAsync(this INamespaceOperations operations, string resourceGroupName, string namespaceName) { return(operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, CancellationToken.None)); }