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

package com.azure.resourcemanager.digitaltwins.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.digitaltwins.fluent.models.CheckNameResultInner;
import com.azure.resourcemanager.digitaltwins.fluent.models.DigitalTwinsDescriptionInner;
import com.azure.resourcemanager.digitaltwins.models.CheckNameRequest;
import com.azure.resourcemanager.digitaltwins.models.DigitalTwinsPatchDescription;

/** An instance of this class provides access to all the operations defined in DigitalTwinsClient. */
public interface DigitalTwinsClient {
    /**
     * Get DigitalTwinsInstances resource.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 digitalTwinsInstances resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<DigitalTwinsDescriptionInner> getByResourceGroupWithResponse(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Get DigitalTwinsInstances resource.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 digitalTwinsInstances resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner getByResourceGroup(String resourceGroupName, String resourceName);

    /**
     * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve
     * the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to
     * update the DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginCreateOrUpdate(
        String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate);

    /**
     * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve
     * the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to
     * update the DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginCreateOrUpdate(
        String resourceGroupName,
        String resourceName,
        DigitalTwinsDescriptionInner digitalTwinsCreate,
        Context context);

    /**
     * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve
     * the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to
     * update the DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner createOrUpdate(
        String resourceGroupName, String resourceName, DigitalTwinsDescriptionInner digitalTwinsCreate);

    /**
     * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is to retrieve
     * the DigitalTwinsInstance and security metadata, and then combine them with the modified values in a new body to
     * update the DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner createOrUpdate(
        String resourceGroupName,
        String resourceName,
        DigitalTwinsDescriptionInner digitalTwinsCreate,
        Context context);

    /**
     * Update metadata of DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginUpdate(
        String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription);

    /**
     * Update metadata of DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginUpdate(
        String resourceGroupName,
        String resourceName,
        DigitalTwinsPatchDescription digitalTwinsPatchDescription,
        Context context);

    /**
     * Update metadata of DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner update(
        String resourceGroupName, String resourceName, DigitalTwinsPatchDescription digitalTwinsPatchDescription);

    /**
     * Update metadata of DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner update(
        String resourceGroupName,
        String resourceName,
        DigitalTwinsPatchDescription digitalTwinsPatchDescription,
        Context context);

    /**
     * Delete a DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginDelete(
        String resourceGroupName, String resourceName);

    /**
     * Delete a DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<DigitalTwinsDescriptionInner>, DigitalTwinsDescriptionInner> beginDelete(
        String resourceGroupName, String resourceName, Context context);

    /**
     * Delete a DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner delete(String resourceGroupName, String resourceName);

    /**
     * Delete a DigitalTwinsInstance.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @param resourceName The name of the DigitalTwinsInstance.
     * @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 description of the DigitalTwins service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    DigitalTwinsDescriptionInner delete(String resourceGroupName, String resourceName, Context context);

    /**
     * Get all the DigitalTwinsInstances in a 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 all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DigitalTwinsDescriptionInner> list();

    /**
     * Get all the DigitalTwinsInstances in a 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 all the DigitalTwinsInstances in a subscription as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DigitalTwinsDescriptionInner> list(Context context);

    /**
     * Get all the DigitalTwinsInstances in a resource group.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @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 all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DigitalTwinsDescriptionInner> listByResourceGroup(String resourceGroupName);

    /**
     * Get all the DigitalTwinsInstances in a resource group.
     *
     * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
     * @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 all the DigitalTwinsInstances in a resource group as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<DigitalTwinsDescriptionInner> listByResourceGroup(String resourceGroupName, Context context);

    /**
     * Check if a DigitalTwinsInstance name is available.
     *
     * @param location Location of DigitalTwinsInstance.
     * @param digitalTwinsInstanceCheckName Set the name parameter in the DigitalTwinsInstanceCheckName structure to the
     *     name of the DigitalTwinsInstance to check.
     * @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 result returned from a check name availability request along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<CheckNameResultInner> checkNameAvailabilityWithResponse(
        String location, CheckNameRequest digitalTwinsInstanceCheckName, Context context);

    /**
     * Check if a DigitalTwinsInstance name is available.
     *
     * @param location Location of DigitalTwinsInstance.
     * @param digitalTwinsInstanceCheckName Set the name parameter in the DigitalTwinsInstanceCheckName structure to the
     *     name of the DigitalTwinsInstance to check.
     * @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 result returned from a check name availability request.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    CheckNameResultInner checkNameAvailability(String location, CheckNameRequest digitalTwinsInstanceCheckName);
}
