/// <summary> /// Lists the notification hubs associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INotificationHubOperations. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static ServiceBusNotificationHubsResponse List(this INotificationHubOperations operations, string namespaceName) { return(Task.Factory.StartNew((object s) => { return ((INotificationHubOperations)s).ListAsync(namespaceName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Gets the Primary and Secondary ConnectionStrings to the /// NotificationHub (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj873988.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='authorizationRuleName'> /// Required. The connection string of the NotificationHub for the /// specified authorizationRule. /// </param> /// <returns> /// Namespace/NotificationHub Connection String /// </returns> public static ResourceListKeys ListKeys(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, string authorizationRuleName) { return(Task.Factory.StartNew((object s) => { return ((INotificationHubOperations)s).ListKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Checks the availability of the given notificationHub in a /// namespace. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj870968.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='parameters'> /// Required. The notificationHub name. /// </param> /// <returns> /// Response of the Check NameAvailability operation. /// </returns> public static CheckAvailabilityResponse CheckAvailability(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, CheckAvailabilityParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((INotificationHubOperations)s).CheckAvailabilityAsync(resourceGroupName, namespaceName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Deletes a notification hub associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INotificationHubOperations. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static AzureOperationResponse Delete(this INotificationHubOperations operations, string namespaceName, string notificationHubName) { return(Task.Factory.StartNew((object s) => { return ((INotificationHubOperations)s).DeleteAsync(namespaceName, notificationHubName); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Creates a new NotificationHub in a namespace. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj856303.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the create a Namespace Resource. /// </param> /// <returns> /// Response of the CreateOrUpdate operation on the NotificationHub /// </returns> public static NotificationHubCreateOrUpdateResponse Update(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { return(Task.Factory.StartNew((object s) => { return ((INotificationHubOperations)s).UpdateAsync(resourceGroupName, namespaceName, notificationHubName, parameters); } , operations, CancellationToken.None, TaskCreationOptions.None, TaskScheduler.Default).Unwrap().GetAwaiter().GetResult()); }
/// <summary> /// Initializes a new instance of the ServiceBusManagementClient class. /// </summary> private ServiceBusManagementClient() : base() { this._namespaces = new NamespaceOperations(this); this._notificationHubs = new NotificationHubOperations(this); this._queues = new QueueOperations(this); this._relays = new RelayOperations(this); this._topics = new TopicOperations(this); this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the NotificationHubsManagementClient /// class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public NotificationHubsManagementClient(HttpClient httpClient) : base(httpClient) { this._namespaces = new NamespaceOperations(this); this._notificationHubs = new NotificationHubOperations(this); this._apiVersion = "2014-09-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Initializes a new instance of the ServiceBusManagementClient class. /// </summary> /// <param name='httpClient'> /// The Http client /// </param> public ServiceBusManagementClient(HttpClient httpClient) : base(httpClient) { this._namespaces = new NamespaceOperations(this); this._notificationHubs = new NotificationHubOperations(this); this._queues = new QueueOperations(this); this._relays = new RelayOperations(this); this._topics = new TopicOperations(this); this._apiVersion = "2013-08-01"; this._longRunningOperationInitialTimeout = -1; this._longRunningOperationRetryTimeout = -1; this.HttpClient.Timeout = TimeSpan.FromSeconds(300); }
/// <summary> /// Lists the notification hubs associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INotificationHubOperations. /// </param> /// <param name='namespaceName'> /// The namespace name. /// </param> /// <param name='notificationHubName'> /// The notification hub name. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static ServiceBusNotificationHubResponse Get(this INotificationHubOperations operations, string namespaceName, string notificationHubName) { try { return(operations.GetAsync(namespaceName, notificationHubName).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 1) { throw; } else { throw ex.InnerException; } } }
/// <summary> /// Lists the PNS Credentials associated with a notification hub . /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <returns> /// The response of the Get NotificationHub operation. /// </returns> public static Task <NotificationHubGetResponse> GetPnsCredentialsAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName) { return(operations.GetPnsCredentialsAsync(resourceGroupName, namespaceName, notificationHubName, CancellationToken.None)); }
/// <summary> /// Lists the notification hubs associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <returns> /// The response of the List NotificationHub operation. /// </returns> public static Task <NotificationHubListResponse> ListAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName) { return(operations.ListAsync(resourceGroupName, namespaceName, CancellationToken.None)); }
/// <summary> /// Deletes a notification hub associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INotificationHubOperations. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> DeleteAsync(this INotificationHubOperations operations, string namespaceName, string notificationHubName) { return(operations.DeleteAsync(namespaceName, notificationHubName, CancellationToken.None)); }
/// <summary> /// The get authorization rules operation gets the authorization rules /// for a NotificationHub. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The NotificationHub to get the authorization rule for. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <returns> /// The response of the List Namespace operation. /// </returns> public static Task <SharedAccessAuthorizationRuleListResponse> ListAuthorizationRulesAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName) { return(operations.ListAuthorizationRulesAsync(resourceGroupName, namespaceName, notificationHubName, CancellationToken.None)); }
/// <summary> /// Gets the Primary and Secondary ConnectionStrings to the /// NotificationHub (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj873988.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='authorizationRuleName'> /// Required. The connection string of the NotificationHub for the /// specified authorizationRule. /// </param> /// <returns> /// Namespace/NotificationHub Connection String /// </returns> public static Task <ResourceListKeys> ListKeysAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, string authorizationRuleName) { return(operations.ListKeysAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, CancellationToken.None)); }
/// <summary> /// Checks the availability of the given notificationHub in a /// namespace. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj870968.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='parameters'> /// Required. The notificationHub name. /// </param> /// <returns> /// Response of the Check NameAvailability operation. /// </returns> public static Task <CheckAvailabilityResponse> CheckAvailabilityAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, CheckAvailabilityParameters parameters) { return(operations.CheckAvailabilityAsync(resourceGroupName, namespaceName, parameters, CancellationToken.None)); }
/// <summary> /// The delete a notificationHub authorization rule operation /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='authorizationRuleName'> /// Required. The namespace authorizationRuleName name. /// </param> /// <returns> /// A standard service response including an HTTP status code and /// request ID. /// </returns> public static Task <AzureOperationResponse> DeleteAuthorizationRuleAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, string authorizationRuleName) { return(operations.DeleteAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, CancellationToken.None)); }
/// <summary> /// Lists the notification hubs associated with a namespace. /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.WindowsAzure.Management.ServiceBus.INotificationHubOperations. /// </param> /// <param name='namespaceName'> /// The namespace name. /// </param> /// <param name='notificationHubName'> /// The notification hub name. /// </param> /// <returns> /// A standard storage response including an HTTP status code and /// request ID. /// </returns> public static Task <ServiceBusNotificationHubResponse> GetAsync(this INotificationHubOperations operations, string namespaceName, string notificationHubName) { return(operations.GetAsync(namespaceName, notificationHubName, CancellationToken.None)); }
/// <summary> /// Creates a new NotificationHub in a namespace. (see /// http://msdn.microsoft.com/en-us/library/windowsazure/jj856303.aspx /// for more information) /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='parameters'> /// Required. Parameters supplied to the create a Namespace Resource. /// </param> /// <returns> /// Response of the CreateOrUpdate operation on the NotificationHub /// </returns> public static Task <NotificationHubCreateOrUpdateResponse> UpdateAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, NotificationHubCreateOrUpdateParameters parameters) { return(operations.UpdateAsync(resourceGroupName, namespaceName, notificationHubName, parameters, CancellationToken.None)); }
/// <summary> /// The create NotificationHub authorization rule operation creates an /// authorization rule for a NotificationHub /// </summary> /// <param name='operations'> /// Reference to the /// Microsoft.Azure.Management.NotificationHubs.INotificationHubOperations. /// </param> /// <param name='resourceGroupName'> /// Required. The name of the resource group. /// </param> /// <param name='namespaceName'> /// Required. The namespace name. /// </param> /// <param name='notificationHubName'> /// Required. The notification hub name. /// </param> /// <param name='authorizationRuleName'> /// Required. The namespace authorizationRuleName name. /// </param> /// <param name='parameters'> /// Required. The shared access authorization rule. /// </param> /// <returns> /// Response of the CreateOrUpdate operation on the AuthorizationRules /// </returns> public static Task <SharedAccessAuthorizationRuleCreateOrUpdateResponse> CreateOrUpdateAuthorizationRuleAsync(this INotificationHubOperations operations, string resourceGroupName, string namespaceName, string notificationHubName, string authorizationRuleName, SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters) { return(operations.CreateOrUpdateAuthorizationRuleAsync(resourceGroupName, namespaceName, notificationHubName, authorizationRuleName, parameters, CancellationToken.None)); }