// 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.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.peering.fluent.models.PeeringServiceInner;
import com.azure.resourcemanager.peering.models.ResourceTags;

/** An instance of this class provides access to all the operations defined in PeeringServicesClient. */
public interface PeeringServicesClient {
    /**
     * Gets an existing peering service with the specified name under the given subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering.
     * @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 peering service with the specified name under the given subscription and resource group along
     *     with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PeeringServiceInner> getByResourceGroupWithResponse(
        String resourceGroupName, String peeringServiceName, Context context);

    /**
     * Gets an existing peering service with the specified name under the given subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering.
     * @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 peering service with the specified name under the given subscription and resource group.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PeeringServiceInner getByResourceGroup(String resourceGroupName, String peeringServiceName);

    /**
     * Creates a new peering service or updates an existing peering with the specified name under the given subscription
     * and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param peeringService The properties needed to create or update a peering service.
     * @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 peering Service along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PeeringServiceInner> createOrUpdateWithResponse(
        String resourceGroupName, String peeringServiceName, PeeringServiceInner peeringService, Context context);

    /**
     * Creates a new peering service or updates an existing peering with the specified name under the given subscription
     * and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param peeringService The properties needed to create or update a 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 peering Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PeeringServiceInner createOrUpdate(
        String resourceGroupName, String peeringServiceName, PeeringServiceInner peeringService);

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

    /**
     * Deletes an existing peering service with the specified name under the given subscription and resource group.
     *
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String peeringServiceName);

    /**
     * Updates tags for a peering service with the specified name under the given subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param tags The resource tags.
     * @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 peering Service along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<PeeringServiceInner> updateWithResponse(
        String resourceGroupName, String peeringServiceName, ResourceTags tags, Context context);

    /**
     * Updates tags for a peering service with the specified name under the given subscription and resource group.
     *
     * @param resourceGroupName The name of the resource group.
     * @param peeringServiceName The name of the peering service.
     * @param tags The resource tags.
     * @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 peering Service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    PeeringServiceInner update(String resourceGroupName, String peeringServiceName, ResourceTags tags);

    /**
     * Lists all of the peering services under the given subscription and 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 the paginated list of peering services as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PeeringServiceInner> listByResourceGroup(String resourceGroupName);

    /**
     * Lists all of the peering services under the given subscription and 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 the paginated list of peering services as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PeeringServiceInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Lists all of the peerings under the given 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 the paginated list of peering services as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PeeringServiceInner> list();

    /**
     * Lists all of the peerings under the given 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 the paginated list of peering services as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<PeeringServiceInner> list(Context context);
}
