/// <summary> /// The get authorization rule operation gets an authorization rule for /// a namespace by name. /// </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> /// <param name='entityName'> /// The entity name to get the authorization rule for. /// </param> /// <returns> /// A response to a request for a particular authorization rule. /// </returns> public static ServiceBusAuthorizationRuleResponse GetAuthorizationRule(this INamespaceOperations operations, string namespaceName, string entityName) { try { return(operations.GetAuthorizationRuleAsync(namespaceName, entityName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// The get authorization rule operation gets an authorization rule for /// a namespace by name. /// </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> /// <param name='entityName'> /// The entity name to get the authorization rule for. /// </param> /// <returns> /// A response to a request for a particular authorization rule. /// </returns> public static Task <ServiceBusAuthorizationRuleResponse> GetAuthorizationRuleAsync(this INamespaceOperations operations, string namespaceName, string entityName) { return(operations.GetAuthorizationRuleAsync(namespaceName, entityName, CancellationToken.None)); }
/// <summary> /// The get authorization rule operation gets an authorization rule for /// a namespace by name. /// </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> /// <param name='authorizationRuleName'> /// Required. The entity name to get the authorization rule for. /// </param> /// <returns> /// The response of the Get Namespace operation. /// </returns> public static Task <SharedAccessAuthorizationRuleGetResponse> GetAuthorizationRuleAsync(this INamespaceOperations operations, string resourceGroupName, string namespaceName, string authorizationRuleName) { return(operations.GetAuthorizationRuleAsync(resourceGroupName, namespaceName, authorizationRuleName, CancellationToken.None)); }