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

package com.azure.resourcemanager.deploymentmanager.fluent;

import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
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.deploymentmanager.fluent.models.ServiceUnitResourceInner;
import java.util.List;

/** An instance of this class provides access to all the operations defined in ServiceUnitsClient. */
public interface ServiceUnitsClient {
    /**
     * Creates or updates a service unit under the service in the service topology.
     *
     * <p>This is an asynchronous operation and can be polled to completion using the operation resource returned by
     * this operation.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @param serviceUnitInfo The service unit resource object.
     * @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 represents the response of a service unit resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ServiceUnitResourceInner>, ServiceUnitResourceInner> beginCreateOrUpdate(
        String resourceGroupName,
        String serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        ServiceUnitResourceInner serviceUnitInfo);

    /**
     * Creates or updates a service unit under the service in the service topology.
     *
     * <p>This is an asynchronous operation and can be polled to completion using the operation resource returned by
     * this operation.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @param serviceUnitInfo The service unit resource object.
     * @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 represents the response of a service unit resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<ServiceUnitResourceInner>, ServiceUnitResourceInner> beginCreateOrUpdate(
        String resourceGroupName,
        String serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        ServiceUnitResourceInner serviceUnitInfo,
        Context context);

    /**
     * Creates or updates a service unit under the service in the service topology.
     *
     * <p>This is an asynchronous operation and can be polled to completion using the operation resource returned by
     * this operation.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @param serviceUnitInfo The service unit resource object.
     * @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 represents the response of a service unit resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceUnitResourceInner createOrUpdate(
        String resourceGroupName,
        String serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        ServiceUnitResourceInner serviceUnitInfo);

    /**
     * Creates or updates a service unit under the service in the service topology.
     *
     * <p>This is an asynchronous operation and can be polled to completion using the operation resource returned by
     * this operation.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @param serviceUnitInfo The service unit resource object.
     * @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 represents the response of a service unit resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceUnitResourceInner createOrUpdate(
        String resourceGroupName,
        String serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        ServiceUnitResourceInner serviceUnitInfo,
        Context context);

    /**
     * Gets the service unit.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @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 service unit along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ServiceUnitResourceInner> getWithResponse(
        String resourceGroupName,
        String serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        Context context);

    /**
     * Gets the service unit.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @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 service unit.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceUnitResourceInner get(
        String resourceGroupName, String serviceTopologyName, String serviceName, String serviceUnitName);

    /**
     * Deletes the service unit.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @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 serviceTopologyName,
        String serviceName,
        String serviceUnitName,
        Context context);

    /**
     * Deletes the service unit.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @param serviceUnitName The name of the service unit resource.
     * @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 serviceTopologyName, String serviceName, String serviceUnitName);

    /**
     * Lists the service units under a service in the service topology.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @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 list of service units along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<List<ServiceUnitResourceInner>> listWithResponse(
        String resourceGroupName, String serviceTopologyName, String serviceName, Context context);

    /**
     * Lists the service units under a service in the service topology.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param serviceTopologyName The name of the service topology .
     * @param serviceName The name of the service resource.
     * @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 list of service units.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    List<ServiceUnitResourceInner> list(String resourceGroupName, String serviceTopologyName, String serviceName);
}
