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

package com.azure.resourcemanager.storagemover.models;

import com.azure.core.http.rest.Response;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.storagemover.fluent.models.JobDefinitionInner;

/** An immutable client-side representation of JobDefinition. */
public interface JobDefinition {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the systemData property: Resource system metadata.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the description property: A description for the Job Definition.
     *
     * @return the description value.
     */
    String description();

    /**
     * Gets the copyMode property: Strategy to use for copy.
     *
     * @return the copyMode value.
     */
    CopyMode copyMode();

    /**
     * Gets the sourceName property: The name of the source Endpoint.
     *
     * @return the sourceName value.
     */
    String sourceName();

    /**
     * Gets the sourceResourceId property: Fully qualified resource ID of the source Endpoint.
     *
     * @return the sourceResourceId value.
     */
    String sourceResourceId();

    /**
     * Gets the sourceSubpath property: The subpath to use when reading from the source Endpoint.
     *
     * @return the sourceSubpath value.
     */
    String sourceSubpath();

    /**
     * Gets the targetName property: The name of the target Endpoint.
     *
     * @return the targetName value.
     */
    String targetName();

    /**
     * Gets the targetResourceId property: Fully qualified resource ID of the target Endpoint.
     *
     * @return the targetResourceId value.
     */
    String targetResourceId();

    /**
     * Gets the targetSubpath property: The subpath to use when writing to the target Endpoint.
     *
     * @return the targetSubpath value.
     */
    String targetSubpath();

    /**
     * Gets the latestJobRunName property: The name of the Job Run in a non-terminal state, if exists.
     *
     * @return the latestJobRunName value.
     */
    String latestJobRunName();

    /**
     * Gets the latestJobRunResourceId property: The fully qualified resource ID of the Job Run in a non-terminal state,
     * if exists.
     *
     * @return the latestJobRunResourceId value.
     */
    String latestJobRunResourceId();

    /**
     * Gets the latestJobRunStatus property: The current status of the Job Run in a non-terminal state, if exists.
     *
     * @return the latestJobRunStatus value.
     */
    JobRunStatus latestJobRunStatus();

    /**
     * Gets the agentName property: Name of the Agent to assign for new Job Runs of this Job Definition.
     *
     * @return the agentName value.
     */
    String agentName();

    /**
     * Gets the agentResourceId property: Fully qualified resource id of the Agent to assign for new Job Runs of this
     * Job Definition.
     *
     * @return the agentResourceId value.
     */
    String agentResourceId();

    /**
     * Gets the provisioningState property: The provisioning state of this resource.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.storagemover.fluent.models.JobDefinitionInner object.
     *
     * @return the inner object.
     */
    JobDefinitionInner innerModel();

    /** The entirety of the JobDefinition definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithCopyMode,
            DefinitionStages.WithSourceName,
            DefinitionStages.WithTargetName,
            DefinitionStages.WithCreate {
    }
    /** The JobDefinition definition stages. */
    interface DefinitionStages {
        /** The first stage of the JobDefinition definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the JobDefinition definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, storageMoverName, projectName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param storageMoverName The name of the Storage Mover resource.
             * @param projectName The name of the Project resource.
             * @return the next definition stage.
             */
            WithCopyMode withExistingProject(String resourceGroupName, String storageMoverName, String projectName);
        }
        /** The stage of the JobDefinition definition allowing to specify copyMode. */
        interface WithCopyMode {
            /**
             * Specifies the copyMode property: Strategy to use for copy..
             *
             * @param copyMode Strategy to use for copy.
             * @return the next definition stage.
             */
            WithSourceName withCopyMode(CopyMode copyMode);
        }
        /** The stage of the JobDefinition definition allowing to specify sourceName. */
        interface WithSourceName {
            /**
             * Specifies the sourceName property: The name of the source Endpoint..
             *
             * @param sourceName The name of the source Endpoint.
             * @return the next definition stage.
             */
            WithTargetName withSourceName(String sourceName);
        }
        /** The stage of the JobDefinition definition allowing to specify targetName. */
        interface WithTargetName {
            /**
             * Specifies the targetName property: The name of the target Endpoint..
             *
             * @param targetName The name of the target Endpoint.
             * @return the next definition stage.
             */
            WithCreate withTargetName(String targetName);
        }
        /**
         * The stage of the JobDefinition definition which contains all the minimum required properties for the resource
         * to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithDescription,
                DefinitionStages.WithSourceSubpath,
                DefinitionStages.WithTargetSubpath,
                DefinitionStages.WithAgentName {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            JobDefinition create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            JobDefinition create(Context context);
        }
        /** The stage of the JobDefinition definition allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: A description for the Job Definition..
             *
             * @param description A description for the Job Definition.
             * @return the next definition stage.
             */
            WithCreate withDescription(String description);
        }
        /** The stage of the JobDefinition definition allowing to specify sourceSubpath. */
        interface WithSourceSubpath {
            /**
             * Specifies the sourceSubpath property: The subpath to use when reading from the source Endpoint..
             *
             * @param sourceSubpath The subpath to use when reading from the source Endpoint.
             * @return the next definition stage.
             */
            WithCreate withSourceSubpath(String sourceSubpath);
        }
        /** The stage of the JobDefinition definition allowing to specify targetSubpath. */
        interface WithTargetSubpath {
            /**
             * Specifies the targetSubpath property: The subpath to use when writing to the target Endpoint..
             *
             * @param targetSubpath The subpath to use when writing to the target Endpoint.
             * @return the next definition stage.
             */
            WithCreate withTargetSubpath(String targetSubpath);
        }
        /** The stage of the JobDefinition definition allowing to specify agentName. */
        interface WithAgentName {
            /**
             * Specifies the agentName property: Name of the Agent to assign for new Job Runs of this Job Definition..
             *
             * @param agentName Name of the Agent to assign for new Job Runs of this Job Definition.
             * @return the next definition stage.
             */
            WithCreate withAgentName(String agentName);
        }
    }
    /**
     * Begins update for the JobDefinition resource.
     *
     * @return the stage of resource update.
     */
    JobDefinition.Update update();

    /** The template for JobDefinition update. */
    interface Update extends UpdateStages.WithDescription, UpdateStages.WithCopyMode, UpdateStages.WithAgentName {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        JobDefinition apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        JobDefinition apply(Context context);
    }
    /** The JobDefinition update stages. */
    interface UpdateStages {
        /** The stage of the JobDefinition update allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: A description for the Job Definition..
             *
             * @param description A description for the Job Definition.
             * @return the next definition stage.
             */
            Update withDescription(String description);
        }
        /** The stage of the JobDefinition update allowing to specify copyMode. */
        interface WithCopyMode {
            /**
             * Specifies the copyMode property: Strategy to use for copy..
             *
             * @param copyMode Strategy to use for copy.
             * @return the next definition stage.
             */
            Update withCopyMode(CopyMode copyMode);
        }
        /** The stage of the JobDefinition update allowing to specify agentName. */
        interface WithAgentName {
            /**
             * Specifies the agentName property: Name of the Agent to assign for new Job Runs of this Job Definition..
             *
             * @param agentName Name of the Agent to assign for new Job Runs of this Job Definition.
             * @return the next definition stage.
             */
            Update withAgentName(String agentName);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    JobDefinition refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    JobDefinition refresh(Context context);

    /**
     * Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource.
     *
     * @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 response that identifies a Job Run along with {@link Response}.
     */
    Response<JobRunResourceId> startJobWithResponse(Context context);

    /**
     * Requests an Agent to start a new instance of this Job Definition, generating a new Job Run resource.
     *
     * @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 response that identifies a Job Run.
     */
    JobRunResourceId startJob();

    /**
     * Requests the Agent of any active instance of this Job Definition to stop.
     *
     * @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 response that identifies a Job Run along with {@link Response}.
     */
    Response<JobRunResourceId> stopJobWithResponse(Context context);

    /**
     * Requests the Agent of any active instance of this Job Definition to stop.
     *
     * @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 response that identifies a Job Run.
     */
    JobRunResourceId stopJob();
}
