// 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.core.management.exception.ManagementError;
import com.azure.resourcemanager.automation.models.JobNavigation;
import com.azure.resourcemanager.automation.models.UpdateConfigurationNavigation;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.UUID;

/** Software update configuration machine run properties. */
@Fluent
public final class UpdateConfigurationMachineRunProperties {
    /*
     * name of the updated computer
     */
    @JsonProperty(value = "targetComputer", access = JsonProperty.Access.WRITE_ONLY)
    private String targetComputer;

    /*
     * type of the updated computer.
     */
    @JsonProperty(value = "targetComputerType", access = JsonProperty.Access.WRITE_ONLY)
    private String targetComputerType;

    /*
     * software update configuration triggered this run
     */
    @JsonProperty(value = "softwareUpdateConfiguration")
    private UpdateConfigurationNavigation softwareUpdateConfiguration;

    /*
     * Status of the software update configuration machine run.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private String status;

    /*
     * Operating system target of the software update configuration triggered this run
     */
    @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
    private String osType;

    /*
     * correlation id of the software update configuration machine run
     */
    @JsonProperty(value = "correlationId", access = JsonProperty.Access.WRITE_ONLY)
    private UUID correlationId;

    /*
     * source computer id of the software update configuration machine run
     */
    @JsonProperty(value = "sourceComputerId", access = JsonProperty.Access.WRITE_ONLY)
    private UUID sourceComputerId;

    /*
     * Start time of the software update configuration machine run.
     */
    @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startTime;

    /*
     * End time of the software update configuration machine run.
     */
    @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime endTime;

    /*
     * configured duration for the software update configuration run.
     */
    @JsonProperty(value = "configuredDuration", access = JsonProperty.Access.WRITE_ONLY)
    private String configuredDuration;

    /*
     * Job associated with the software update configuration machine run
     */
    @JsonProperty(value = "job")
    private JobNavigation job;

    /*
     * Creation time of the resource, which only appears in the response.
     */
    @JsonProperty(value = "creationTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime creationTime;

    /*
     * createdBy property, which only appears in the response.
     */
    @JsonProperty(value = "createdBy", access = JsonProperty.Access.WRITE_ONLY)
    private String createdBy;

    /*
     * Last time resource was modified, which only appears in the response.
     */
    @JsonProperty(value = "lastModifiedTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastModifiedTime;

    /*
     * lastModifiedBy property, which only appears in the response.
     */
    @JsonProperty(value = "lastModifiedBy", access = JsonProperty.Access.WRITE_ONLY)
    private String lastModifiedBy;

    /*
     * Details of provisioning error
     */
    @JsonProperty(value = "error")
    private ManagementError error;

    /**
     * Get the targetComputer property: name of the updated computer.
     *
     * @return the targetComputer value.
     */
    public String targetComputer() {
        return this.targetComputer;
    }

    /**
     * Get the targetComputerType property: type of the updated computer.
     *
     * @return the targetComputerType value.
     */
    public String targetComputerType() {
        return this.targetComputerType;
    }

    /**
     * Get the softwareUpdateConfiguration property: software update configuration triggered this run.
     *
     * @return the softwareUpdateConfiguration value.
     */
    public UpdateConfigurationNavigation softwareUpdateConfiguration() {
        return this.softwareUpdateConfiguration;
    }

    /**
     * Set the softwareUpdateConfiguration property: software update configuration triggered this run.
     *
     * @param softwareUpdateConfiguration the softwareUpdateConfiguration value to set.
     * @return the UpdateConfigurationMachineRunProperties object itself.
     */
    public UpdateConfigurationMachineRunProperties withSoftwareUpdateConfiguration(
        UpdateConfigurationNavigation softwareUpdateConfiguration) {
        this.softwareUpdateConfiguration = softwareUpdateConfiguration;
        return this;
    }

    /**
     * Get the status property: Status of the software update configuration machine run.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Get the osType property: Operating system target of the software update configuration triggered this run.
     *
     * @return the osType value.
     */
    public String osType() {
        return this.osType;
    }

    /**
     * Get the correlationId property: correlation id of the software update configuration machine run.
     *
     * @return the correlationId value.
     */
    public UUID correlationId() {
        return this.correlationId;
    }

    /**
     * Get the sourceComputerId property: source computer id of the software update configuration machine run.
     *
     * @return the sourceComputerId value.
     */
    public UUID sourceComputerId() {
        return this.sourceComputerId;
    }

    /**
     * Get the startTime property: Start time of the software update configuration machine run.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

    /**
     * Get the endTime property: End time of the software update configuration machine run.
     *
     * @return the endTime value.
     */
    public OffsetDateTime endTime() {
        return this.endTime;
    }

    /**
     * Get the configuredDuration property: configured duration for the software update configuration run.
     *
     * @return the configuredDuration value.
     */
    public String configuredDuration() {
        return this.configuredDuration;
    }

    /**
     * Get the job property: Job associated with the software update configuration machine run.
     *
     * @return the job value.
     */
    public JobNavigation job() {
        return this.job;
    }

    /**
     * Set the job property: Job associated with the software update configuration machine run.
     *
     * @param job the job value to set.
     * @return the UpdateConfigurationMachineRunProperties object itself.
     */
    public UpdateConfigurationMachineRunProperties withJob(JobNavigation job) {
        this.job = job;
        return this;
    }

    /**
     * Get the creationTime property: Creation time of the resource, which only appears in the response.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.creationTime;
    }

    /**
     * Get the createdBy property: createdBy property, which only appears in the response.
     *
     * @return the createdBy value.
     */
    public String createdBy() {
        return this.createdBy;
    }

    /**
     * Get the lastModifiedTime property: Last time resource was modified, which only appears in the response.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * Get the lastModifiedBy property: lastModifiedBy property, which only appears in the response.
     *
     * @return the lastModifiedBy value.
     */
    public String lastModifiedBy() {
        return this.lastModifiedBy;
    }

    /**
     * Get the error property: Details of provisioning error.
     *
     * @return the error value.
     */
    public ManagementError error() {
        return this.error;
    }

    /**
     * Set the error property: Details of provisioning error.
     *
     * @param error the error value to set.
     * @return the UpdateConfigurationMachineRunProperties object itself.
     */
    public UpdateConfigurationMachineRunProperties withError(ManagementError error) {
        this.error = error;
        return this;
    }

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