// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.notificationhubs.models;

import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;

/** Resource collection API of NotificationHubs. */
public interface NotificationHubs {
    /**
     * Checks the availability of the given notificationHub in a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param parameters The notificationHub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a CheckAvailability resource.
     */
    CheckAvailabilityResult checkNotificationHubAvailability(
        String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters);

    /**
     * Checks the availability of the given notificationHub in a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param parameters The notificationHub name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a CheckAvailability resource.
     */
    Response<CheckAvailabilityResult> checkNotificationHubAvailabilityWithResponse(
        String resourceGroupName, String namespaceName, CheckAvailabilityParameters parameters, Context context);

    /**
     * Deletes a notification hub associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void delete(String resourceGroupName, String namespaceName, String notificationHubName);

    /**
     * Deletes a notification hub associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    Response<Void> deleteWithResponse(
        String resourceGroupName, String namespaceName, String notificationHubName, Context context);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    NotificationHubResource get(String resourceGroupName, String namespaceName, String notificationHubName);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    Response<NotificationHubResource> getWithResponse(
        String resourceGroupName, String namespaceName, String notificationHubName, Context context);

    /**
     * test send a push notification.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    DebugSendResponse debugSend(String resourceGroupName, String namespaceName, String notificationHubName);

    /**
     * test send a push notification.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param parameters Debug send parameters.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    Response<DebugSendResponse> debugSendWithResponse(
        String resourceGroupName, String namespaceName, String notificationHubName, Object parameters, Context context);

    /**
     * Creates/Updates an authorization rule for a NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName Authorization Rule Name.
     * @param parameters The shared access authorization rule.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a Namespace AuthorizationRules.
     */
    SharedAccessAuthorizationRuleResource createOrUpdateAuthorizationRule(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters);

    /**
     * Creates/Updates an authorization rule for a NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName Authorization Rule Name.
     * @param parameters The shared access authorization rule.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a Namespace AuthorizationRules.
     */
    Response<SharedAccessAuthorizationRuleResource> createOrUpdateAuthorizationRuleWithResponse(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        SharedAccessAuthorizationRuleCreateOrUpdateParameters parameters,
        Context context);

    /**
     * Deletes a notificationHub authorization rule.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName Authorization Rule Name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteAuthorizationRule(
        String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName);

    /**
     * Deletes a notificationHub authorization rule.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName Authorization Rule Name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    Response<Void> deleteAuthorizationRuleWithResponse(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        Context context);

    /**
     * Gets an authorization rule for a NotificationHub by name.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName authorization rule name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return an authorization rule for a NotificationHub by name.
     */
    SharedAccessAuthorizationRuleResource getAuthorizationRule(
        String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName);

    /**
     * Gets an authorization rule for a NotificationHub by name.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName authorization rule name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return an authorization rule for a NotificationHub by name.
     */
    Response<SharedAccessAuthorizationRuleResource> getAuthorizationRuleWithResponse(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        Context context);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the List NotificationHub operation.
     */
    PagedIterable<NotificationHubResource> list(String resourceGroupName, String namespaceName);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response of the List NotificationHub operation.
     */
    PagedIterable<NotificationHubResource> list(String resourceGroupName, String namespaceName, Context context);

    /**
     * Gets the authorization rules for a NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the authorization rules for a NotificationHub.
     */
    PagedIterable<SharedAccessAuthorizationRuleResource> listAuthorizationRules(
        String resourceGroupName, String namespaceName, String notificationHubName);

    /**
     * Gets the authorization rules for a NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the authorization rules for a NotificationHub.
     */
    PagedIterable<SharedAccessAuthorizationRuleResource> listAuthorizationRules(
        String resourceGroupName, String namespaceName, String notificationHubName, Context context);

    /**
     * Gets the Primary and Secondary ConnectionStrings to the NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Primary and Secondary ConnectionStrings to the NotificationHub.
     */
    ResourceListKeys listKeys(
        String resourceGroupName, String namespaceName, String notificationHubName, String authorizationRuleName);

    /**
     * Gets the Primary and Secondary ConnectionStrings to the NotificationHub.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the Primary and Secondary ConnectionStrings to the NotificationHub.
     */
    Response<ResourceListKeys> listKeysWithResponse(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        Context context);

    /**
     * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule.
     * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return namespace/NotificationHub Connection String.
     */
    ResourceListKeys regenerateKeys(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        PolicykeyResource parameters);

    /**
     * Regenerates the Primary/Secondary Keys to the NotificationHub Authorization Rule.
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param authorizationRuleName The connection string of the NotificationHub for the specified authorizationRule.
     * @param parameters Parameters supplied to regenerate the NotificationHub Authorization Rule Key.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return namespace/NotificationHub Connection String.
     */
    Response<ResourceListKeys> regenerateKeysWithResponse(
        String resourceGroupName,
        String namespaceName,
        String notificationHubName,
        String authorizationRuleName,
        PolicykeyResource parameters,
        Context context);

    /**
     * Lists the PNS Credentials associated with a notification hub .
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub PNS Credentials.
     */
    PnsCredentialsResource getPnsCredentials(
        String resourceGroupName, String namespaceName, String notificationHubName);

    /**
     * Lists the PNS Credentials associated with a notification hub .
     *
     * @param resourceGroupName The name of the resource group.
     * @param namespaceName The namespace name.
     * @param notificationHubName The notification hub name.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub PNS Credentials.
     */
    Response<PnsCredentialsResource> getPnsCredentialsWithResponse(
        String resourceGroupName, String namespaceName, String notificationHubName, Context context);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    NotificationHubResource getById(String id);

    /**
     * Lists the notification hubs associated with a namespace.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return description of a NotificationHub Resource.
     */
    Response<NotificationHubResource> getByIdWithResponse(String id, Context context);

    /**
     * Deletes a notification hub associated with a namespace.
     *
     * @param id the resource ID.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void deleteById(String id);

    /**
     * Deletes a notification hub associated with a namespace.
     *
     * @param id the resource ID.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the response.
     */
    Response<Void> deleteByIdWithResponse(String id, Context context);

    /**
     * Begins definition for a new NotificationHubResource resource.
     *
     * @param name resource name.
     * @return the first stage of the new NotificationHubResource definition.
     */
    NotificationHubResource.DefinitionStages.Blank define(String name);
}
