// 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.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.util.Context;
import com.azure.resourcemanager.communication.fluent.models.SenderUsernameResourceInner;

/** An instance of this class provides access to all the operations defined in SenderUsernamesClient. */
public interface SenderUsernamesClient {
    /**
     * ListBy_Domains
     *
     * <p>List all valid sender usernames for a domains resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains 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 class representing a Domains SenderUsernames collection as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<SenderUsernameResourceInner> listByDomains(
        String resourceGroupName, String emailServiceName, String domainName);

    /**
     * ListBy_Domains
     *
     * <p>List all valid sender usernames for a domains resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains 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 a class representing a Domains SenderUsernames collection as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<SenderUsernameResourceInner> listByDomains(
        String resourceGroupName, String emailServiceName, String domainName, Context context);

    /**
     * Get
     *
     * <p>Get a valid sender username for a domains resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @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 valid sender username for a domains resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<SenderUsernameResourceInner> getWithResponse(
        String resourceGroupName, String emailServiceName, String domainName, String senderUsername, Context context);

    /**
     * Get
     *
     * <p>Get a valid sender username for a domains resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @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 valid sender username for a domains resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SenderUsernameResourceInner get(
        String resourceGroupName, String emailServiceName, String domainName, String senderUsername);

    /**
     * Create Or Update
     *
     * <p>Add a new SenderUsername resource under the parent Domains resource or update an existing SenderUsername
     * resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @param parameters Parameters for the create or update 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 a SenderUsername resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<SenderUsernameResourceInner> createOrUpdateWithResponse(
        String resourceGroupName,
        String emailServiceName,
        String domainName,
        String senderUsername,
        SenderUsernameResourceInner parameters,
        Context context);

    /**
     * Create Or Update
     *
     * <p>Add a new SenderUsername resource under the parent Domains resource or update an existing SenderUsername
     * resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @param parameters Parameters for the create or update 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 a SenderUsername resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SenderUsernameResourceInner createOrUpdate(
        String resourceGroupName,
        String emailServiceName,
        String domainName,
        String senderUsername,
        SenderUsernameResourceInner parameters);

    /**
     * Delete
     *
     * <p>Operation to delete a SenderUsernames resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @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 {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<Void> deleteWithResponse(
        String resourceGroupName, String emailServiceName, String domainName, String senderUsername, Context context);

    /**
     * Delete
     *
     * <p>Operation to delete a SenderUsernames resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param emailServiceName The name of the EmailService resource.
     * @param domainName The name of the Domains resource.
     * @param senderUsername The valid sender Username.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String emailServiceName, String domainName, String senderUsername);
}
