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

package com.azure.resourcemanager.recoveryservicessiterecovery.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.recoveryservicessiterecovery.fluent.models.JobInner;
import com.azure.resourcemanager.recoveryservicessiterecovery.models.JobQueryParameter;
import com.azure.resourcemanager.recoveryservicessiterecovery.models.ResumeJobParams;

/** An instance of this class provides access to all the operations defined in ReplicationJobsClient. */
public interface ReplicationJobsClient {
    /**
     * Gets the list of jobs.
     *
     * <p>Gets the list of Azure Site Recovery Jobs for the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobInner> list(String resourceName, String resourceGroupName);

    /**
     * Gets the list of jobs.
     *
     * <p>Gets the list of Azure Site Recovery Jobs for the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param filter OData filter options.
     * @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 Azure Site Recovery Jobs for the vault as paginated response with {@link PagedIterable}.
     */
    @ServiceMethod(returns = ReturnType.COLLECTION)
    PagedIterable<JobInner> list(String resourceName, String resourceGroupName, String filter, Context context);

    /**
     * Gets the job details.
     *
     * <p>Get the details of an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details of an Azure Site Recovery job along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    Response<JobInner> getWithResponse(String resourceName, String resourceGroupName, String jobName, Context context);

    /**
     * Gets the job details.
     *
     * <p>Get the details of an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details of an Azure Site Recovery job.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner get(String resourceName, String resourceGroupName, String jobName);

    /**
     * Cancels the specified job.
     *
     * <p>The operation to cancel an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginCancel(
        String resourceName, String resourceGroupName, String jobName);

    /**
     * Cancels the specified job.
     *
     * <p>The operation to cancel an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginCancel(
        String resourceName, String resourceGroupName, String jobName, Context context);

    /**
     * Cancels the specified job.
     *
     * <p>The operation to cancel an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner cancel(String resourceName, String resourceGroupName, String jobName);

    /**
     * Cancels the specified job.
     *
     * <p>The operation to cancel an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner cancel(String resourceName, String resourceGroupName, String jobName, Context context);

    /**
     * Restarts the specified job.
     *
     * <p>The operation to restart an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginRestart(
        String resourceName, String resourceGroupName, String jobName);

    /**
     * Restarts the specified job.
     *
     * <p>The operation to restart an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginRestart(
        String resourceName, String resourceGroupName, String jobName, Context context);

    /**
     * Restarts the specified job.
     *
     * <p>The operation to restart an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner restart(String resourceName, String resourceGroupName, String jobName);

    /**
     * Restarts the specified job.
     *
     * <p>The operation to restart an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner restart(String resourceName, String resourceGroupName, String jobName, Context context);

    /**
     * Resumes the specified job.
     *
     * <p>The operation to resume an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @param resumeJobParams Resume rob comments.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginResume(
        String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams);

    /**
     * Resumes the specified job.
     *
     * <p>The operation to resume an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @param resumeJobParams Resume rob comments.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginResume(
        String resourceName,
        String resourceGroupName,
        String jobName,
        ResumeJobParams resumeJobParams,
        Context context);

    /**
     * Resumes the specified job.
     *
     * <p>The operation to resume an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @param resumeJobParams Resume rob comments.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner resume(String resourceName, String resourceGroupName, String jobName, ResumeJobParams resumeJobParams);

    /**
     * Resumes the specified job.
     *
     * <p>The operation to resume an Azure Site Recovery job.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobName Job identifier.
     * @param resumeJobParams Resume rob comments.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner resume(
        String resourceName,
        String resourceGroupName,
        String jobName,
        ResumeJobParams resumeJobParams,
        Context context);

    /**
     * Exports the details of the Azure Site Recovery jobs of the vault.
     *
     * <p>The operation to export the details of the Azure Site Recovery jobs of the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobQueryParameter job query filter.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginExport(
        String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter);

    /**
     * Exports the details of the Azure Site Recovery jobs of the vault.
     *
     * <p>The operation to export the details of the Azure Site Recovery jobs of the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobQueryParameter job query filter.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
    SyncPoller<PollResult<JobInner>, JobInner> beginExport(
        String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context);

    /**
     * Exports the details of the Azure Site Recovery jobs of the vault.
     *
     * <p>The operation to export the details of the Azure Site Recovery jobs of the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobQueryParameter job query filter.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner export(String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter);

    /**
     * Exports the details of the Azure Site Recovery jobs of the vault.
     *
     * <p>The operation to export the details of the Azure Site Recovery jobs of the vault.
     *
     * @param resourceName The name of the recovery services vault.
     * @param resourceGroupName The name of the resource group where the recovery services vault is present.
     * @param jobQueryParameter job query filter.
     * @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 details.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    JobInner export(
        String resourceName, String resourceGroupName, JobQueryParameter jobQueryParameter, Context context);
}
