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

package com.azure.resourcemanager.azureadexternalidentities.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 B2CTenants. */
public interface B2CTenants {
    /**
     * Checks the availability and validity of a domain name for the tenant.
     *
     * @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 response of the CheckNameAvailability operation.
     */
    NameAvailabilityResponse checkNameAvailability();

    /**
     * Checks the availability and validity of a domain name for the tenant.
     *
     * @param checkNameAvailabilityRequestBody The information required to check the availability of the name for the
     *     tenant.
     * @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 response of the CheckNameAvailability operation along with {@link Response}.
     */
    Response<NameAvailabilityResponse> checkNameAvailabilityWithResponse(
        CheckNameAvailabilityRequestBody checkNameAvailabilityRequestBody, Context context);

    /**
     * Get all the Azure AD B2C tenant resources in a resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @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 all the Azure AD B2C tenant resources in a resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<B2CTenantResource> listByResourceGroup(String resourceGroupName);

    /**
     * Get all the Azure AD B2C tenant resources in a resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @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 all the Azure AD B2C tenant resources in a resource group as paginated response with {@link
     *     PagedIterable}.
     */
    PagedIterable<B2CTenantResource> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Get all the Azure AD B2C tenant 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 all the Azure AD B2C tenant resources in a subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<B2CTenantResource> list();

    /**
     * Get all the Azure AD B2C tenant 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 all the Azure AD B2C tenant resources in a subscription as paginated response with {@link PagedIterable}.
     */
    PagedIterable<B2CTenantResource> list(Context context);

    /**
     * Get the Azure AD B2C tenant resource.
     *
     * @param resourceGroupName The name of the resource group.
     * @param resourceName The initial domain name of the Azure AD B2C tenant.
     * @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 Azure AD B2C tenant resource.
     */
    B2CTenantResource getByResourceGroup(String resourceGroupName, String resourceName);

    /**
     * Get the Azure AD B2C tenant resource.
     *
     * @param resourceGroupName The name of the resource group.
     * @param resourceName The initial domain name of the Azure AD B2C tenant.
     * @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 Azure AD B2C tenant resource along with {@link Response}.
     */
    Response<B2CTenantResource> getByResourceGroupWithResponse(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Initiates an async operation to delete the Azure AD B2C tenant and Azure resource. The resource deletion can only
     * happen as the last step in [the tenant deletion process](https://aka.ms/deleteB2Ctenant).
     *
     * @param resourceGroupName The name of the resource group.
     * @param resourceName The initial domain name of the Azure AD B2C tenant.
     * @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 resourceName);

    /**
     * Initiates an async operation to delete the Azure AD B2C tenant and Azure resource. The resource deletion can only
     * happen as the last step in [the tenant deletion process](https://aka.ms/deleteB2Ctenant).
     *
     * @param resourceGroupName The name of the resource group.
     * @param resourceName The initial domain name of the Azure AD B2C tenant.
     * @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 resourceName, Context context);

    /**
     * Get the Azure AD B2C tenant resource.
     *
     * @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 Azure AD B2C tenant resource along with {@link Response}.
     */
    B2CTenantResource getById(String id);

    /**
     * Get the Azure AD B2C tenant resource.
     *
     * @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 Azure AD B2C tenant resource along with {@link Response}.
     */
    Response<B2CTenantResource> getByIdWithResponse(String id, Context context);

    /**
     * Initiates an async operation to delete the Azure AD B2C tenant and Azure resource. The resource deletion can only
     * happen as the last step in [the tenant deletion process](https://aka.ms/deleteB2Ctenant).
     *
     * @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);

    /**
     * Initiates an async operation to delete the Azure AD B2C tenant and Azure resource. The resource deletion can only
     * happen as the last step in [the tenant deletion process](https://aka.ms/deleteB2Ctenant).
     *
     * @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 B2CTenantResource resource.
     *
     * @param name resource name.
     * @return the first stage of the new B2CTenantResource definition.
     */
    B2CTenantResource.DefinitionStages.Blank define(String name);
}
