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

package com.azure.resourcemanager.managednetworkfabric.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.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.managednetworkfabric.fluent.models.IpCommunityInner;
import com.azure.resourcemanager.managednetworkfabric.models.IpCommunityPatch;

/** An instance of this class provides access to all the operations defined in IpCommunitiesClient. */
public interface IpCommunitiesClient {
    /**
     * Create an IP Community.
     *
     * <p>Implements an IP Community PUT method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body Request payload.
     * @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 SyncPoller} for polling of the IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpCommunityInner>, IpCommunityInner> beginCreate(
        String resourceGroupName, String ipCommunityName, IpCommunityInner body);

    /**
     * Create an IP Community.
     *
     * <p>Implements an IP Community PUT method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body Request payload.
     * @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 SyncPoller} for polling of the IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpCommunityInner>, IpCommunityInner> beginCreate(
        String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context);

    /**
     * Create an IP Community.
     *
     * <p>Implements an IP Community PUT method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body Request payload.
     * @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 IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    IpCommunityInner create(String resourceGroupName, String ipCommunityName, IpCommunityInner body);

    /**
     * Create an IP Community.
     *
     * <p>Implements an IP Community PUT method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body Request payload.
     * @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 IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    IpCommunityInner create(String resourceGroupName, String ipCommunityName, IpCommunityInner body, Context context);

    /**
     * Gets an IP Community.
     *
     * <p>Implements an IP Community GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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 IpCommunity resource definition along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<IpCommunityInner> getByResourceGroupWithResponse(
        String resourceGroupName, String ipCommunityName, Context context);

    /**
     * Gets an IP Community.
     *
     * <p>Implements an IP Community GET method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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 IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    IpCommunityInner getByResourceGroup(String resourceGroupName, String ipCommunityName);

    /**
     * Updates an IP Community.
     *
     * <p>API to update certain properties of the IP Community resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body IP Community properties to update.
     * @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 SyncPoller} for polling of the IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpCommunityInner>, IpCommunityInner> beginUpdate(
        String resourceGroupName, String ipCommunityName, IpCommunityPatch body);

    /**
     * Updates an IP Community.
     *
     * <p>API to update certain properties of the IP Community resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body IP Community properties to update.
     * @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 SyncPoller} for polling of the IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpCommunityInner>, IpCommunityInner> beginUpdate(
        String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context);

    /**
     * Updates an IP Community.
     *
     * <p>API to update certain properties of the IP Community resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body IP Community properties to update.
     * @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 IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    IpCommunityInner update(String resourceGroupName, String ipCommunityName, IpCommunityPatch body);

    /**
     * Updates an IP Community.
     *
     * <p>API to update certain properties of the IP Community resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @param body IP Community properties to update.
     * @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 IpCommunity resource definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    IpCommunityInner update(String resourceGroupName, String ipCommunityName, IpCommunityPatch body, Context context);

    /**
     * Deletes an IP Community.
     *
     * <p>Implements IP Community DELETE method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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 SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String ipCommunityName);

    /**
     * Deletes an IP Community.
     *
     * <p>Implements IP Community DELETE method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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 SyncPoller} for polling of long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String ipCommunityName, Context context);

    /**
     * Deletes an IP Community.
     *
     * <p>Implements IP Community DELETE method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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 ipCommunityName);

    /**
     * Deletes an IP Community.
     *
     * <p>Implements IP Community DELETE method.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipCommunityName Name of the IP Community.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String ipCommunityName, Context context);

    /**
     * List IpCommunities by resource group.
     *
     * <p>Implements IpCommunities list by resource group GET method.
     *
     * @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 list of IPCommunities as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpCommunityInner> listByResourceGroup(String resourceGroupName);

    /**
     * List IpCommunities by resource group.
     *
     * <p>Implements IpCommunities list by resource group GET method.
     *
     * @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 list of IPCommunities as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpCommunityInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * List IpCommunities by subscription.
     *
     * <p>Implements IpCommunities list by subscription GET method.
     *
     * @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 list of IPCommunities as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpCommunityInner> list();

    /**
     * List IpCommunities by subscription.
     *
     * <p>Implements IpCommunities list by subscription GET method.
     *
     * @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 list of IPCommunities as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpCommunityInner> list(Context context);
}
