// 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.ProvisioningState;
import com.azure.resourcemanager.automation.models.SyncType;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Definition of the source control sync job. */
@Fluent
public final class SourceControlSyncJobByIdInner {
    /*
     * The id of the job.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * The properties of the source control sync job.
     */
    @JsonProperty(value = "properties")
    private SourceControlSyncJobByIdProperties innerProperties;

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

    /**
     * Set the id property: The id of the job.
     *
     * @param id the id value to set.
     * @return the SourceControlSyncJobByIdInner object itself.
     */
    public SourceControlSyncJobByIdInner withId(String id) {
        this.id = id;
        return this;
    }

    /**
     * Get the innerProperties property: The properties of the source control sync job.
     *
     * @return the innerProperties value.
     */
    private SourceControlSyncJobByIdProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the sourceControlSyncJobId property: The source control sync job id.
     *
     * @return the sourceControlSyncJobId value.
     */
    public String sourceControlSyncJobId() {
        return this.innerProperties() == null ? null : this.innerProperties().sourceControlSyncJobId();
    }

    /**
     * Set the sourceControlSyncJobId property: The source control sync job id.
     *
     * @param sourceControlSyncJobId the sourceControlSyncJobId value to set.
     * @return the SourceControlSyncJobByIdInner object itself.
     */
    public SourceControlSyncJobByIdInner withSourceControlSyncJobId(String sourceControlSyncJobId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlSyncJobByIdProperties();
        }
        this.innerProperties().withSourceControlSyncJobId(sourceControlSyncJobId);
        return this;
    }

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

    /**
     * Get the provisioningState property: The provisioning state of the job.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Set the provisioningState property: The provisioning state of the job.
     *
     * @param provisioningState the provisioningState value to set.
     * @return the SourceControlSyncJobByIdInner object itself.
     */
    public SourceControlSyncJobByIdInner withProvisioningState(ProvisioningState provisioningState) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlSyncJobByIdProperties();
        }
        this.innerProperties().withProvisioningState(provisioningState);
        return this;
    }

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

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

    /**
     * Get the syncType property: The sync type.
     *
     * @return the syncType value.
     */
    public SyncType syncType() {
        return this.innerProperties() == null ? null : this.innerProperties().syncType();
    }

    /**
     * Set the syncType property: The sync type.
     *
     * @param syncType the syncType value to set.
     * @return the SourceControlSyncJobByIdInner object itself.
     */
    public SourceControlSyncJobByIdInner withSyncType(SyncType syncType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlSyncJobByIdProperties();
        }
        this.innerProperties().withSyncType(syncType);
        return this;
    }

    /**
     * Get the exception property: The exceptions that occurred while running the sync job.
     *
     * @return the exception value.
     */
    public String exception() {
        return this.innerProperties() == null ? null : this.innerProperties().exception();
    }

    /**
     * Set the exception property: The exceptions that occurred while running the sync job.
     *
     * @param exception the exception value to set.
     * @return the SourceControlSyncJobByIdInner object itself.
     */
    public SourceControlSyncJobByIdInner withException(String exception) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SourceControlSyncJobByIdProperties();
        }
        this.innerProperties().withException(exception);
        return this;
    }

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