// 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.IpPrefixInner;
import com.azure.resourcemanager.managednetworkfabric.models.IpPrefixPatch;

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

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

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

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

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

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

    /**
     * Updates the IP Prefix.
     *
     * <p>API to update certain properties of the IP Prefix resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipPrefixName Name of the IP Prefix.
     * @param body IP Prefix 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 IP Prefix resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpPrefixInner>, IpPrefixInner> beginUpdate(
        String resourceGroupName, String ipPrefixName, IpPrefixPatch body);

    /**
     * Updates the IP Prefix.
     *
     * <p>API to update certain properties of the IP Prefix resource.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param ipPrefixName Name of the IP Prefix.
     * @param body IP Prefix 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 IP Prefix resource definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<IpPrefixInner>, IpPrefixInner> beginUpdate(
        String resourceGroupName, String ipPrefixName, IpPrefixPatch body, Context context);

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

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

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

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

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

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

    /**
     * List IpPrefixes by resource group.
     *
     * <p>Implements IpPrefixes 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 IP Prefixes as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpPrefixInner> listByResourceGroup(String resourceGroupName);

    /**
     * List IpPrefixes by resource group.
     *
     * <p>Implements IpPrefixes 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 IP Prefixes as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpPrefixInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * List IpPrefixes by subscription.
     *
     * <p>Implements IpPrefixes 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 IP Prefixes as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpPrefixInner> list();

    /**
     * List IpPrefixes by subscription.
     *
     * <p>Implements IpPrefixes 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 IP Prefixes as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<IpPrefixInner> list(Context context);
}
