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

package com.azure.resourcemanager.peering.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 Prefixes. */
public interface Prefixes {
    /**
     * Gets an existing prefix with the specified name under the given subscription, resource group and peering service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param prefixName The name of the prefix.
     * @param expand The properties to be expanded.
     * @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 existing prefix with the specified name under the given subscription, resource group and peering
     *     service along with {@link Response}.
     */
    Response<PeeringServicePrefix> getWithResponse(
        String resourceGroupName, String peeringServiceName, String prefixName, String expand, Context context);

    /**
     * Gets an existing prefix with the specified name under the given subscription, resource group and peering service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param prefixName The name of the prefix.
     * @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 existing prefix with the specified name under the given subscription, resource group and peering
     *     service.
     */
    PeeringServicePrefix get(String resourceGroupName, String peeringServiceName, String prefixName);

    /**
     * Deletes an existing prefix with the specified name under the given subscription, resource group and peering
     * service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param prefixName The name of the prefix.
     * @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}.
     */
    Response<Void> deleteWithResponse(
        String resourceGroupName, String peeringServiceName, String prefixName, Context context);

    /**
     * Deletes an existing prefix with the specified name under the given subscription, resource group and peering
     * service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param prefixName The name of the prefix.
     * @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 peeringServiceName, String prefixName);

    /**
     * Lists all prefixes under the given subscription, resource group and peering service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @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 paginated list of peering service prefixes as paginated response with {@link PagedIterable}.
     */
    PagedIterable<PeeringServicePrefix> listByPeeringService(String resourceGroupName, String peeringServiceName);

    /**
     * Lists all prefixes under the given subscription, resource group and peering service.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param expand The properties to be expanded.
     * @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 paginated list of peering service prefixes as paginated response with {@link PagedIterable}.
     */
    PagedIterable<PeeringServicePrefix> listByPeeringService(
        String resourceGroupName, String peeringServiceName, String expand, Context context);

    /**
     * Gets an existing prefix with the specified name under the given subscription, resource group and peering service.
     *
     * @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 an existing prefix with the specified name under the given subscription, resource group and peering
     *     service along with {@link Response}.
     */
    PeeringServicePrefix getById(String id);

    /**
     * Gets an existing prefix with the specified name under the given subscription, resource group and peering service.
     *
     * @param id the resource ID.
     * @param expand The properties to be expanded.
     * @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 existing prefix with the specified name under the given subscription, resource group and peering
     *     service along with {@link Response}.
     */
    Response<PeeringServicePrefix> getByIdWithResponse(String id, String expand, Context context);

    /**
     * Deletes an existing prefix with the specified name under the given subscription, resource group and peering
     * service.
     *
     * @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 an existing prefix with the specified name under the given subscription, resource group and peering
     * service.
     *
     * @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 {@link Response}.
     */
    Response<Void> deleteByIdWithResponse(String id, Context context);

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