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

package com.azure.resourcemanager.communication.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 CommunicationServices. */
public interface CommunicationServices {
    /**
     * Check Name Availability
     *
     * <p>Checks that the CommunicationService name is valid and is not already in use.
     *
     * @param nameAvailabilityParameters Parameters supplied to the operation.
     * @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 check availability result along with {@link Response}.
     */
    Response<CheckNameAvailabilityResponse> checkNameAvailabilityWithResponse(
        NameAvailabilityParameters nameAvailabilityParameters, Context context);

    /**
     * Check Name Availability
     *
     * <p>Checks that the CommunicationService name is valid and is not already in use.
     *
     * @param nameAvailabilityParameters Parameters supplied to the 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 check availability result.
     */
    CheckNameAvailabilityResponse checkNameAvailability(NameAvailabilityParameters nameAvailabilityParameters);

    /**
     * Link Notification Hub
     *
     * <p>Links an Azure Notification Hub to this communication service.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @param linkNotificationHubParameters Parameters supplied to the operation.
     * @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 a notification hub that has been linked to the communication service along with {@link Response}.
     */
    Response<LinkedNotificationHub> linkNotificationHubWithResponse(
        String resourceGroupName,
        String communicationServiceName,
        LinkNotificationHubParameters linkNotificationHubParameters,
        Context context);

    /**
     * Link Notification Hub
     *
     * <p>Links an Azure Notification Hub to this communication service.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 a notification hub that has been linked to the communication service.
     */
    LinkedNotificationHub linkNotificationHub(String resourceGroupName, String communicationServiceName);

    /**
     * List By Subscription
     *
     * <p>Handles requests to list all resources in a subscription.
     *
     * @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 object that includes an array of CommunicationServices and a possible link for next set as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<CommunicationServiceResource> list();

    /**
     * List By Subscription
     *
     * <p>Handles requests to list all resources in a subscription.
     *
     * @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 object that includes an array of CommunicationServices and a possible link for next set as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<CommunicationServiceResource> list(Context context);

    /**
     * List By Resource Group
     *
     * <p>Handles requests to list all resources in a resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 object that includes an array of CommunicationServices and a possible link for next set as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<CommunicationServiceResource> listByResourceGroup(String resourceGroupName);

    /**
     * List By Resource Group
     *
     * <p>Handles requests to list all resources in a resource group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @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 object that includes an array of CommunicationServices and a possible link for next set as paginated
     *     response with {@link PagedIterable}.
     */
    PagedIterable<CommunicationServiceResource> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Get
     *
     * <p>Get the CommunicationService and its properties.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 CommunicationService and its properties along with {@link Response}.
     */
    Response<CommunicationServiceResource> getByResourceGroupWithResponse(
        String resourceGroupName, String communicationServiceName, Context context);

    /**
     * Get
     *
     * <p>Get the CommunicationService and its properties.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 CommunicationService and its properties.
     */
    CommunicationServiceResource getByResourceGroup(String resourceGroupName, String communicationServiceName);

    /**
     * Delete
     *
     * <p>Operation to delete a CommunicationService.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 deleteByResourceGroup(String resourceGroupName, String communicationServiceName);

    /**
     * Delete
     *
     * <p>Operation to delete a CommunicationService.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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.
     */
    void delete(String resourceGroupName, String communicationServiceName, Context context);

    /**
     * List Keys
     *
     * <p>Get the access keys of the CommunicationService resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 access keys of the CommunicationService resource along with {@link Response}.
     */
    Response<CommunicationServiceKeys> listKeysWithResponse(
        String resourceGroupName, String communicationServiceName, Context context);

    /**
     * List Keys
     *
     * <p>Get the access keys of the CommunicationService resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @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 access keys of the CommunicationService resource.
     */
    CommunicationServiceKeys listKeys(String resourceGroupName, String communicationServiceName);

    /**
     * Regenerate Key
     *
     * <p>Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same
     * time.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @param parameters Parameter that describes the Regenerate Key Operation.
     * @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 a class representing the access keys of a CommunicationService along with {@link Response}.
     */
    Response<CommunicationServiceKeys> regenerateKeyWithResponse(
        String resourceGroupName, String communicationServiceName, RegenerateKeyParameters parameters, Context context);

    /**
     * Regenerate Key
     *
     * <p>Regenerate CommunicationService access key. PrimaryKey and SecondaryKey cannot be regenerated at the same
     * time.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param communicationServiceName The name of the CommunicationService resource.
     * @param parameters Parameter that describes the Regenerate Key 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 a class representing the access keys of a CommunicationService.
     */
    CommunicationServiceKeys regenerateKey(
        String resourceGroupName, String communicationServiceName, RegenerateKeyParameters parameters);

    /**
     * Get
     *
     * <p>Get the CommunicationService and its properties.
     *
     * @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 the CommunicationService and its properties along with {@link Response}.
     */
    CommunicationServiceResource getById(String id);

    /**
     * Get
     *
     * <p>Get the CommunicationService and its properties.
     *
     * @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 CommunicationService and its properties along with {@link Response}.
     */
    Response<CommunicationServiceResource> getByIdWithResponse(String id, Context context);

    /**
     * Delete
     *
     * <p>Operation to delete a CommunicationService.
     *
     * @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);

    /**
     * Delete
     *
     * <p>Operation to delete a CommunicationService.
     *
     * @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.
     */
    void deleteByIdWithResponse(String id, Context context);

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