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

package com.azure.resourcemanager.datamigration.models;

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

/**
 * AgentJob level output for the task that validates connection to SQL Server and also validates source server
 * requirements.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "resultType")
@JsonTypeName("AgentJobLevelOutput")
@Immutable
public final class ConnectToSourceSqlServerTaskOutputAgentJobLevel extends ConnectToSourceSqlServerTaskOutput {
    /*
     * AgentJob name
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The type of AgentJob.
     */
    @JsonProperty(value = "jobCategory", access = JsonProperty.Access.WRITE_ONLY)
    private String jobCategory;

    /*
     * The state of the original AgentJob.
     */
    @JsonProperty(value = "isEnabled", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean isEnabled;

    /*
     * The owner of the AgentJob
     */
    @JsonProperty(value = "jobOwner", access = JsonProperty.Access.WRITE_ONLY)
    private String jobOwner;

    /*
     * UTC Date and time when the AgentJob was last executed.
     */
    @JsonProperty(value = "lastExecutedOn", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastExecutedOn;

    /*
     * Information about eligibility of agent job for migration.
     */
    @JsonProperty(value = "migrationEligibility", access = JsonProperty.Access.WRITE_ONLY)
    private MigrationEligibilityInfo migrationEligibility;

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

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

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

    /**
     * Get the isEnabled property: The state of the original AgentJob.
     *
     * @return the isEnabled value.
     */
    public Boolean isEnabled() {
        return this.isEnabled;
    }

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

    /**
     * Get the lastExecutedOn property: UTC Date and time when the AgentJob was last executed.
     *
     * @return the lastExecutedOn value.
     */
    public OffsetDateTime lastExecutedOn() {
        return this.lastExecutedOn;
    }

    /**
     * Get the migrationEligibility property: Information about eligibility of agent job for migration.
     *
     * @return the migrationEligibility value.
     */
    public MigrationEligibilityInfo migrationEligibility() {
        return this.migrationEligibility;
    }

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