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

package com.azure.resourcemanager.datamigration.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.util.Context;
import com.azure.resourcemanager.datamigration.fluent.models.ProjectTaskInner;

/** An instance of this class provides access to all the operations defined in TasksClient. */
public interface TasksClient {
    /**
     * Get tasks in a service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates
     * that an error occurred while querying the status of that task.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @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 oData page of tasks as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ProjectTaskInner> list(String groupName, String serviceName, String projectName);

    /**
     * Get tasks in a service
     *
     * <p>The services resource is the top-level resource that represents the Database Migration Service. This method
     * returns a list of tasks owned by a service resource. Some tasks may have a status of Unknown, which indicates
     * that an error occurred while querying the status of that task.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskType Filter tasks by task type.
     * @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 oData page of tasks as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<ProjectTaskInner> list(
        String groupName, String serviceName, String projectName, String taskType, Context context);

    /**
     * Create or update task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT
     * method creates a new task or updates an existing one, although since tasks have no mutable custom properties,
     * there is little reason to update an existing one.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param parameters Information about the task.
     * @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 task resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ProjectTaskInner> createOrUpdateWithResponse(
        String groupName,
        String serviceName,
        String projectName,
        String taskName,
        ProjectTaskInner parameters,
        Context context);

    /**
     * Create or update task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PUT
     * method creates a new task or updates an existing one, although since tasks have no mutable custom properties,
     * there is little reason to update an existing one.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param parameters Information about the task.
     * @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 task resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ProjectTaskInner createOrUpdate(
        String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters);

    /**
     * Get task information
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET
     * method retrieves information about a task.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param expand Expand 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 a task resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ProjectTaskInner> getWithResponse(
        String groupName, String serviceName, String projectName, String taskName, String expand, Context context);

    /**
     * Get task information
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The GET
     * method retrieves information about a task.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @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 task resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ProjectTaskInner get(String groupName, String serviceName, String projectName, String taskName);

    /**
     * Delete task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE
     * method deletes a task, canceling it first if it's running.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param deleteRunningTasks Delete the resource even if it contains running tasks.
     * @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 groupName,
        String serviceName,
        String projectName,
        String taskName,
        Boolean deleteRunningTasks,
        Context context);

    /**
     * Delete task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The DELETE
     * method deletes a task, canceling it first if it's running.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @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 groupName, String serviceName, String projectName, String taskName);

    /**
     * Create or update task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH
     * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do
     * so.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param parameters Information about the task.
     * @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 task resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ProjectTaskInner> updateWithResponse(
        String groupName,
        String serviceName,
        String projectName,
        String taskName,
        ProjectTaskInner parameters,
        Context context);

    /**
     * Create or update task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. The PATCH
     * method updates an existing task, but since tasks have no mutable custom properties, there is little reason to do
     * so.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @param parameters Information about the task.
     * @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 task resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ProjectTaskInner update(
        String groupName, String serviceName, String projectName, String taskName, ProjectTaskInner parameters);

    /**
     * Cancel a task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method
     * cancels a task if it's currently queued or running.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @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 task resource along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ProjectTaskInner> cancelWithResponse(
        String groupName, String serviceName, String projectName, String taskName, Context context);

    /**
     * Cancel a task
     *
     * <p>The tasks resource is a nested, proxy-only resource representing work performed by a DMS instance. This method
     * cancels a task if it's currently queued or running.
     *
     * @param groupName Name of the resource group.
     * @param serviceName Name of the service.
     * @param projectName Name of the project.
     * @param taskName Name of the Task.
     * @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 task resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ProjectTaskInner cancel(String groupName, String serviceName, String projectName, String taskName);
}
