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

package com.azure.resourcemanager.databox.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.databox.fluent.models.JobResourceInner;
import com.azure.resourcemanager.databox.fluent.models.ShipmentPickUpResponseInner;
import com.azure.resourcemanager.databox.fluent.models.UnencryptedCredentialsInner;
import com.azure.resourcemanager.databox.models.CancellationReason;
import com.azure.resourcemanager.databox.models.JobResourceUpdateParameter;
import com.azure.resourcemanager.databox.models.MarkDevicesShippedRequest;
import com.azure.resourcemanager.databox.models.ShipmentPickUpRequest;

/** An instance of this class provides access to all the operations defined in JobsClient. */
public interface JobsClient {
    /**
     * Lists all the jobs available under the 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 job Resource Collection as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobResourceInner> list();

    /**
     * Lists all the jobs available under the subscription.
     *
     * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs.
     * @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 job Resource Collection as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobResourceInner> list(String skipToken, Context context);

    /**
     * Request to mark devices for a given job as shipped.
     *
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param resourceGroupName The Resource Group Name.
     * @param markDevicesShippedRequest Mark Devices Shipped Request.
     * @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> markDevicesShippedWithResponse(
        String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest, Context context);

    /**
     * Request to mark devices for a given job as shipped.
     *
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param resourceGroupName The Resource Group Name.
     * @param markDevicesShippedRequest Mark Devices Shipped Request.
     * @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 markDevicesShipped(
        String jobName, String resourceGroupName, MarkDevicesShippedRequest markDevicesShippedRequest);

    /**
     * Lists all the jobs available under the given resource group.
     *
     * @param resourceGroupName The Resource Group Name.
     * @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 job Resource Collection as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobResourceInner> listByResourceGroup(String resourceGroupName);

    /**
     * Lists all the jobs available under the given resource group.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param skipToken $skipToken is supported on Get list of jobs, which provides the next page in the list of jobs.
     * @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 job Resource Collection as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobResourceInner> listByResourceGroup(String resourceGroupName, String skipToken, Context context);

    /**
     * Gets information about the specified job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param expand $expand is supported on details parameter for job, which provides details on the job stages.
     * @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 the specified job along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<JobResourceInner> getByResourceGroupWithResponse(
        String resourceGroupName, String jobName, String expand, Context context);

    /**
     * Gets information about the specified job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 the specified job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobResourceInner getByResourceGroup(String resourceGroupName, String jobName);

    /**
     * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead
     * be updated with the Update job API.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResource Job details from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobResourceInner>, JobResourceInner> beginCreate(
        String resourceGroupName, String jobName, JobResourceInner jobResource);

    /**
     * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead
     * be updated with the Update job API.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResource Job details from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobResourceInner>, JobResourceInner> beginCreate(
        String resourceGroupName, String jobName, JobResourceInner jobResource, Context context);

    /**
     * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead
     * be updated with the Update job API.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResource Job details from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobResourceInner create(String resourceGroupName, String jobName, JobResourceInner jobResource);

    /**
     * Creates a new job with the specified parameters. Existing job cannot be updated with this API and should instead
     * be updated with the Update job API.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResource Job details from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobResourceInner create(String resourceGroupName, String jobName, JobResourceInner jobResource, Context context);

    /**
     * Deletes a job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String jobName);

    /**
     * Deletes a job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 long-running operation.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String jobName, Context context);

    /**
     * Deletes a job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 jobName);

    /**
     * Deletes a job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 jobName, Context context);

    /**
     * Updates the properties of an existing job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResourceUpdateParameter Job update parameters from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobResourceInner>, JobResourceInner> beginUpdate(
        String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter);

    /**
     * Updates the properties of an existing job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResourceUpdateParameter Job update parameters from request body.
     * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the
     *     server matches this value.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobResourceInner>, JobResourceInner> beginUpdate(
        String resourceGroupName,
        String jobName,
        JobResourceUpdateParameter jobResourceUpdateParameter,
        String ifMatch,
        Context context);

    /**
     * Updates the properties of an existing job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResourceUpdateParameter Job update parameters from request body.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobResourceInner update(
        String resourceGroupName, String jobName, JobResourceUpdateParameter jobResourceUpdateParameter);

    /**
     * Updates the properties of an existing job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param jobResourceUpdateParameter Job update parameters from request body.
     * @param ifMatch Defines the If-Match condition. The patch will be performed only if the ETag of the job on the
     *     server matches this value.
     * @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 job Resource.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobResourceInner update(
        String resourceGroupName,
        String jobName,
        JobResourceUpdateParameter jobResourceUpdateParameter,
        String ifMatch,
        Context context);

    /**
     * Book shipment pick up.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param shipmentPickUpRequest Details of shipment pick up request.
     * @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 shipment pick up response along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<ShipmentPickUpResponseInner> bookShipmentPickUpWithResponse(
        String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest, Context context);

    /**
     * Book shipment pick up.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param shipmentPickUpRequest Details of shipment pick up request.
     * @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 shipment pick up response.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    ShipmentPickUpResponseInner bookShipmentPickUp(
        String resourceGroupName, String jobName, ShipmentPickUpRequest shipmentPickUpRequest);

    /**
     * CancelJob.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param cancellationReason Reason for cancellation.
     * @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> cancelWithResponse(
        String resourceGroupName, String jobName, CancellationReason cancellationReason, Context context);

    /**
     * CancelJob.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @param cancellationReason Reason for cancellation.
     * @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 cancel(String resourceGroupName, String jobName, CancellationReason cancellationReason);

    /**
     * This method gets the unencrypted secrets related to the job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<UnencryptedCredentialsInner> listCredentials(String resourceGroupName, String jobName);

    /**
     * This method gets the unencrypted secrets related to the job.
     *
     * @param resourceGroupName The Resource Group Name.
     * @param jobName The name of the job Resource within the specified resource group. job names must be between 3 and
     *     24 characters in length and use any alphanumeric and underscore only.
     * @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 list of unencrypted credentials for accessing device as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<UnencryptedCredentialsInner> listCredentials(
        String resourceGroupName, String jobName, Context context);
}
