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

package com.azure.resourcemanager.extendedlocation.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.extendedlocation.fluent.models.ResourceSyncRuleInner;
import com.azure.resourcemanager.extendedlocation.models.PatchableResourceSyncRule;

/** An instance of this class provides access to all the operations defined in ResourceSyncRulesClient. */
public interface ResourceSyncRulesClient {
    /**
     * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each
     * Resource Sync Rule.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @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 list of Resource Sync Rules in the specified subscription as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ResourceSyncRuleInner> listByCustomLocationId(String resourceGroupName, String resourceName);

    /**
     * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties of each
     * Resource Sync Rule.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @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 list of Resource Sync Rules in the specified subscription as paginated response with {@link
     *     PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ResourceSyncRuleInner> listByCustomLocationId(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location
     * resource name and Resource Sync Rule name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @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 details of the resourceSyncRule with a specified resource group, subscription id Custom Location
     *     resource name and Resource Sync Rule name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceSyncRuleInner get(String resourceGroupName, String resourceName, String childResourceName);

    /**
     * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom Location
     * resource name and Resource Sync Rule name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @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 details of the resourceSyncRule with a specified resource group, subscription id Custom Location
     *     resource name and Resource Sync Rule name along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ResourceSyncRuleInner> getWithResponse(
        String resourceGroupName, String resourceName, String childResourceName, Context context);

    /**
     * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters Parameters supplied to create or update a Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ResourceSyncRuleInner>, ResourceSyncRuleInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters);

    /**
     * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters Parameters supplied to create or update a Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ResourceSyncRuleInner>, ResourceSyncRuleInner> beginCreateOrUpdate(
        String resourceGroupName,
        String resourceName,
        String childResourceName,
        ResourceSyncRuleInner parameters,
        Context context);

    /**
     * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters Parameters supplied to create or update a Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceSyncRuleInner createOrUpdate(
        String resourceGroupName, String resourceName, String childResourceName, ResourceSyncRuleInner parameters);

    /**
     * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource Group.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters Parameters supplied to create or update a Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceSyncRuleInner createOrUpdate(
        String resourceGroupName,
        String resourceName,
        String childResourceName,
        ResourceSyncRuleInner parameters,
        Context context);

    /**
     * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name,
     * Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @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 resourceName, String childResourceName);

    /**
     * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource Name,
     * Resource Group, and Subscription Id.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @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 resourceName, String childResourceName, Context context);

    /**
     * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group,
     * Subscription and Custom Location name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters The updatable fields of an existing Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ResourceSyncRuleInner>, ResourceSyncRuleInner> beginUpdate(
        String resourceGroupName, String resourceName, String childResourceName, PatchableResourceSyncRule parameters);

    /**
     * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group,
     * Subscription and Custom Location name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters The updatable fields of an existing Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ResourceSyncRuleInner>, ResourceSyncRuleInner> beginUpdate(
        String resourceGroupName,
        String resourceName,
        String childResourceName,
        PatchableResourceSyncRule parameters,
        Context context);

    /**
     * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group,
     * Subscription and Custom Location name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters The updatable fields of an existing Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceSyncRuleInner update(
        String resourceGroupName, String resourceName, String childResourceName, PatchableResourceSyncRule parameters);

    /**
     * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource Group,
     * Subscription and Custom Location name.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param resourceName Custom Locations name.
     * @param childResourceName Resource Sync Rule name.
     * @param parameters The updatable fields of an existing Resource Sync Rule.
     * @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 resource Sync Rules definition.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ResourceSyncRuleInner update(
        String resourceGroupName,
        String resourceName,
        String childResourceName,
        PatchableResourceSyncRule parameters,
        Context context);
}
