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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.time.OffsetDateTime;

/** Defines workload agnostic properties for a job. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "jobType",
    defaultImpl = Job.class)
@JsonTypeName("Job")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "AzureIaaSVMJob", value = AzureIaaSvmJob.class),
    @JsonSubTypes.Type(name = "AzureIaaSVMJobV2", value = AzureIaaSvmJobV2.class),
    @JsonSubTypes.Type(name = "AzureStorageJob", value = AzureStorageJob.class),
    @JsonSubTypes.Type(name = "AzureWorkloadJob", value = AzureWorkloadJob.class),
    @JsonSubTypes.Type(name = "DpmJob", value = DpmJob.class),
    @JsonSubTypes.Type(name = "MabJob", value = MabJob.class),
    @JsonSubTypes.Type(name = "VaultJob", value = VaultJob.class)
})
@Fluent
public class Job {
    /*
     * Friendly name of the entity on which the current job is executing.
     */
    @JsonProperty(value = "entityFriendlyName")
    private String entityFriendlyName;

    /*
     * Backup management type to execute the current job.
     */
    @JsonProperty(value = "backupManagementType")
    private BackupManagementType backupManagementType;

    /*
     * The operation name.
     */
    @JsonProperty(value = "operation")
    private String operation;

    /*
     * Job status.
     */
    @JsonProperty(value = "status")
    private String status;

    /*
     * The start time.
     */
    @JsonProperty(value = "startTime")
    private OffsetDateTime startTime;

    /*
     * The end time.
     */
    @JsonProperty(value = "endTime")
    private OffsetDateTime endTime;

    /*
     * ActivityId of job.
     */
    @JsonProperty(value = "activityId")
    private String activityId;

    /** Creates an instance of Job class. */
    public Job() {
    }

    /**
     * Get the entityFriendlyName property: Friendly name of the entity on which the current job is executing.
     *
     * @return the entityFriendlyName value.
     */
    public String entityFriendlyName() {
        return this.entityFriendlyName;
    }

    /**
     * Set the entityFriendlyName property: Friendly name of the entity on which the current job is executing.
     *
     * @param entityFriendlyName the entityFriendlyName value to set.
     * @return the Job object itself.
     */
    public Job withEntityFriendlyName(String entityFriendlyName) {
        this.entityFriendlyName = entityFriendlyName;
        return this;
    }

    /**
     * Get the backupManagementType property: Backup management type to execute the current job.
     *
     * @return the backupManagementType value.
     */
    public BackupManagementType backupManagementType() {
        return this.backupManagementType;
    }

    /**
     * Set the backupManagementType property: Backup management type to execute the current job.
     *
     * @param backupManagementType the backupManagementType value to set.
     * @return the Job object itself.
     */
    public Job withBackupManagementType(BackupManagementType backupManagementType) {
        this.backupManagementType = backupManagementType;
        return this;
    }

    /**
     * Get the operation property: The operation name.
     *
     * @return the operation value.
     */
    public String operation() {
        return this.operation;
    }

    /**
     * Set the operation property: The operation name.
     *
     * @param operation the operation value to set.
     * @return the Job object itself.
     */
    public Job withOperation(String operation) {
        this.operation = operation;
        return this;
    }

    /**
     * Get the status property: Job status.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Set the status property: Job status.
     *
     * @param status the status value to set.
     * @return the Job object itself.
     */
    public Job withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the startTime property: The start time.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: The start time.
     *
     * @param startTime the startTime value to set.
     * @return the Job object itself.
     */
    public Job withStartTime(OffsetDateTime startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: The end time.
     *
     * @return the endTime value.
     */
    public OffsetDateTime endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: The end time.
     *
     * @param endTime the endTime value to set.
     * @return the Job object itself.
     */
    public Job withEndTime(OffsetDateTime endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * Get the activityId property: ActivityId of job.
     *
     * @return the activityId value.
     */
    public String activityId() {
        return this.activityId;
    }

    /**
     * Set the activityId property: ActivityId of job.
     *
     * @param activityId the activityId value to set.
     * @return the Job object itself.
     */
    public Job withActivityId(String activityId) {
        this.activityId = activityId;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
