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

package com.azure.resourcemanager.batchai.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.batchai.fluent.models.FileInner;
import com.azure.resourcemanager.batchai.fluent.models.JobInner;
import com.azure.resourcemanager.batchai.fluent.models.RemoteLoginInformationInner;
import com.azure.resourcemanager.batchai.models.JobCreateParameters;

/** An instance of this class provides access to all the operations defined in JobsClient. */
public interface JobsClient {
    /**
     * Gets a list of Jobs within the specified Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @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 Jobs within the specified Experiment.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobInner> listByExperiment(String resourceGroupName, String workspaceName, String experimentName);

    /**
     * Gets a list of Jobs within the specified Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
     * @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 Jobs within the specified Experiment.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobInner> listByExperiment(
        String resourceGroupName, String workspaceName, String experimentName, Integer maxResults, Context context);

    /**
     * Creates a Job in the given Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param parameters The parameters to provide for job creation.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<JobInner>, JobInner> beginCreate(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        JobCreateParameters parameters);

    /**
     * Creates a Job in the given Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param parameters The parameters to provide for job creation.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<JobInner>, JobInner> beginCreate(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        JobCreateParameters parameters,
        Context context);

    /**
     * Creates a Job in the given Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param parameters The parameters to provide for job creation.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner create(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        JobCreateParameters parameters);

    /**
     * Creates a Job in the given Experiment.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param parameters The parameters to provide for job creation.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner create(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        JobCreateParameters parameters,
        Context context);

    /**
     * Deletes a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String workspaceName, String experimentName, String jobName);

    /**
     * Deletes a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginDelete(
        String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);

    /**
     * Deletes a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 experimentName, String jobName);

    /**
     * Deletes a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void delete(String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);

    /**
     * Gets information about a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner get(String resourceGroupName, String workspaceName, String experimentName, String jobName);

    /**
     * Gets information about a Job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 information about a Job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<JobInner> getWithResponse(
        String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);

    /**
     * List all directories and files inside the given directory of the Job's output directory (if the output directory
     * is on Azure File Share or Azure Storage Container).
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param outputdirectoryid Id of the job output directory. This is the OutputDirectory--&gt;id parameter that is
     *     given by the user during Create Job.
     * @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 values returned by the List operation.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<FileInner> listOutputFiles(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        String outputdirectoryid);

    /**
     * List all directories and files inside the given directory of the Job's output directory (if the output directory
     * is on Azure File Share or Azure Storage Container).
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @param outputdirectoryid Id of the job output directory. This is the OutputDirectory--&gt;id parameter that is
     *     given by the user during Create Job.
     * @param directory The path to the directory.
     * @param linkexpiryinminutes The number of minutes after which the download link will expire.
     * @param maxResults The maximum number of items to return in the response. A maximum of 1000 files can be returned.
     * @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 values returned by the List operation.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<FileInner> listOutputFiles(
        String resourceGroupName,
        String workspaceName,
        String experimentName,
        String jobName,
        String outputdirectoryid,
        String directory,
        Integer linkexpiryinminutes,
        Integer maxResults,
        Context context);

    /**
     * Gets a list of currently existing nodes which were used for the Job execution. The returned information contains
     * the node ID, its public IP and SSH port.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 currently existing nodes which were used for the Job execution.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RemoteLoginInformationInner> listRemoteLoginInformation(
        String resourceGroupName, String workspaceName, String experimentName, String jobName);

    /**
     * Gets a list of currently existing nodes which were used for the Job execution. The returned information contains
     * the node ID, its public IP and SSH port.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 currently existing nodes which were used for the Job execution.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<RemoteLoginInformationInner> listRemoteLoginInformation(
        String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);

    /**
     * Terminates a job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginTerminate(
        String resourceGroupName, String workspaceName, String experimentName, String jobName);

    /**
     * Terminates a job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 completion.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    SyncPoller<PollResult<Void>, Void> beginTerminate(
        String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);

    /**
     * Terminates a job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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 terminate(String resourceGroupName, String workspaceName, String experimentName, String jobName);

    /**
     * Terminates a job.
     *
     * @param resourceGroupName Name of the resource group to which the resource belongs.
     * @param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param experimentName The name of the experiment. Experiment names can only contain a combination of alphanumeric
     *     characters along with dash (-) and underscore (_). The name must be from 1 through 64 characters long.
     * @param jobName The name of the job within the specified resource group. Job names can only contain a combination
     *     of alphanumeric characters along with dash (-) and underscore (_). The name must be from 1 through 64
     *     characters long.
     * @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.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    void terminate(
        String resourceGroupName, String workspaceName, String experimentName, String jobName, Context context);
}
