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

package com.azure.resourcemanager.machinelearningservices.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.machinelearningservices.fluent.models.ServiceResourceInner;
import com.azure.resourcemanager.machinelearningservices.models.CreateServiceRequest;
import com.azure.resourcemanager.machinelearningservices.models.OrderString;

/** An instance of this class provides access to all the operations defined in MachineLearningServicesClient. */
public interface MachineLearningServicesClient {
    /**
     * Gets services in specified workspace.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @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 services in specified workspace.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ServiceResourceInner> listByWorkspace(String resourceGroupName, String workspaceName);

    /**
     * Gets services in specified workspace.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param skip Continuation token for pagination.
     * @param modelId The Model Id.
     * @param modelName The Model name.
     * @param tag The object tag.
     * @param tags A set of tags with which to filter the returned services. It is a comma separated string of tags key
     *     or tags key=value Example: tagKey1,tagKey2,tagKey3=value3 .
     * @param properties A set of properties with which to filter the returned services. It is a comma separated string
     *     of properties key and/or properties key=value Example: propKey1,propKey2,propKey3=value3 .
     * @param runId runId for model associated with service.
     * @param expand Set to True to include Model details.
     * @param orderby The option to order the response.
     * @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 services in specified workspace.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ServiceResourceInner> listByWorkspace(
        String resourceGroupName,
        String workspaceName,
        String skip,
        String modelId,
        String modelName,
        String tag,
        String tags,
        String properties,
        String runId,
        Boolean expand,
        OrderString orderby,
        Context context);

    /**
     * Get a Service by name.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @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 Service by name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceResourceInner get(String resourceGroupName, String workspaceName, String serviceName);

    /**
     * Get a Service by name.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @param expand Set to True to include Model details.
     * @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 Service by name.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ServiceResourceInner> getWithResponse(
        String resourceGroupName, String workspaceName, String serviceName, Boolean expand, Context context);

    /**
     * Delete a specific Service..
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @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 workspaceName, String serviceName);

    /**
     * Delete a specific Service..
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @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 response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<Void> deleteWithResponse(
        String resourceGroupName, String workspaceName, String serviceName, Context context);

    /**
     * Creates or updates service. This call will update a service if it exists. This is a nonrecoverable operation. If
     * your intent is to create a new service, do a GET first to verify that it does not exist yet.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @param properties The payload that is used to create or update the Service.
     * @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 machine Learning service object wrapped into ARM resource envelope.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ServiceResourceInner>, ServiceResourceInner> beginCreateOrUpdate(
        String resourceGroupName, String workspaceName, String serviceName, CreateServiceRequest properties);

    /**
     * Creates or updates service. This call will update a service if it exists. This is a nonrecoverable operation. If
     * your intent is to create a new service, do a GET first to verify that it does not exist yet.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @param properties The payload that is used to create or update the Service.
     * @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 machine Learning service object wrapped into ARM resource envelope.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<ServiceResourceInner>, ServiceResourceInner> beginCreateOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String serviceName,
        CreateServiceRequest properties,
        Context context);

    /**
     * Creates or updates service. This call will update a service if it exists. This is a nonrecoverable operation. If
     * your intent is to create a new service, do a GET first to verify that it does not exist yet.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @param properties The payload that is used to create or update the Service.
     * @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 machine Learning service object wrapped into ARM resource envelope.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceResourceInner createOrUpdate(
        String resourceGroupName, String workspaceName, String serviceName, CreateServiceRequest properties);

    /**
     * Creates or updates service. This call will update a service if it exists. This is a nonrecoverable operation. If
     * your intent is to create a new service, do a GET first to verify that it does not exist yet.
     *
     * @param resourceGroupName Name of the resource group in which workspace is located.
     * @param workspaceName Name of Azure Machine Learning workspace.
     * @param serviceName Name of the Azure Machine Learning service.
     * @param properties The payload that is used to create or update the Service.
     * @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 machine Learning service object wrapped into ARM resource envelope.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ServiceResourceInner createOrUpdate(
        String resourceGroupName,
        String workspaceName,
        String serviceName,
        CreateServiceRequest properties,
        Context context);
}
