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

package com.azure.resourcemanager.automation.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.automation.models.JobStatus;
import com.azure.resourcemanager.automation.models.RunbookAssociationProperty;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.UUID;

/** Job collection item properties. */
@Fluent
public final class JobCollectionItemProperties {
    /*
     * The runbook association.
     */
    @JsonProperty(value = "runbook", access = JsonProperty.Access.WRITE_ONLY)
    private RunbookAssociationProperty runbook;

    /*
     * The id of the job.
     */
    @JsonProperty(value = "jobId", access = JsonProperty.Access.WRITE_ONLY)
    private UUID jobId;

    /*
     * The creation time of the job.
     */
    @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime creationTime;

    /*
     * The status of the job.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private JobStatus status;

    /*
     * The start time of the job.
     */
    @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startTime;

    /*
     * The end time of the job.
     */
    @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime endTime;

    /*
     * The last modified time of the job.
     */
    @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastModifiedTime;

    /*
     * The provisioning state of a resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * Specifies the runOn group name where the job was executed.
     */
    @JsonProperty(value = "runOn")
    private String runOn;

    /**
     * Get the runbook property: The runbook association.
     *
     * @return the runbook value.
     */
    public RunbookAssociationProperty runbook() {
        return this.runbook;
    }

    /**
     * Get the jobId property: The id of the job.
     *
     * @return the jobId value.
     */
    public UUID jobId() {
        return this.jobId;
    }

    /**
     * Get the creationTime property: The creation time of the job.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.creationTime;
    }

    /**
     * Get the status property: The status of the job.
     *
     * @return the status value.
     */
    public JobStatus status() {
        return this.status;
    }

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

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

    /**
     * Get the lastModifiedTime property: The last modified time of the job.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Get the provisioningState property: The provisioning state of a resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the runOn property: Specifies the runOn group name where the job was executed.
     *
     * @return the runOn value.
     */
    public String runOn() {
        return this.runOn;
    }

    /**
     * Set the runOn property: Specifies the runOn group name where the job was executed.
     *
     * @param runOn the runOn value to set.
     * @return the JobCollectionItemProperties object itself.
     */
    public JobCollectionItemProperties withRunOn(String runOn) {
        this.runOn = runOn;
        return this;
    }

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