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

/** Software update configuration properties. */
@Fluent
public final class SoftwareUpdateConfigurationRunProperties {
    /*
     * software update configuration triggered this run
     */
    @JsonProperty(value = "softwareUpdateConfiguration")
    private UpdateConfigurationNavigation softwareUpdateConfiguration;

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

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

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

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

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

    /*
     * Number of computers in the software update configuration run.
     */
    @JsonProperty(value = "computerCount", access = JsonProperty.Access.WRITE_ONLY)
    private Integer computerCount;

    /*
     * Number of computers with failed status.
     */
    @JsonProperty(value = "failedCount", access = JsonProperty.Access.WRITE_ONLY)
    private Integer failedCount;

    /*
     * 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;

    /*
     * Software update configuration tasks triggered in this run
     */
    @JsonProperty(value = "tasks")
    private SoftwareUpdateConfigurationRunTasks tasks;

    /**
     * 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 SoftwareUpdateConfigurationRunProperties object itself.
     */
    public SoftwareUpdateConfigurationRunProperties withSoftwareUpdateConfiguration(
        UpdateConfigurationNavigation softwareUpdateConfiguration) {
        this.softwareUpdateConfiguration = softwareUpdateConfiguration;
        return this;
    }

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

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

    /**
     * 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 startTime property: Start time of the software update configuration run.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

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

    /**
     * Get the computerCount property: Number of computers in the software update configuration run.
     *
     * @return the computerCount value.
     */
    public Integer computerCount() {
        return this.computerCount;
    }

    /**
     * Get the failedCount property: Number of computers with failed status.
     *
     * @return the failedCount value.
     */
    public Integer failedCount() {
        return this.failedCount;
    }

    /**
     * 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 tasks property: Software update configuration tasks triggered in this run.
     *
     * @return the tasks value.
     */
    public SoftwareUpdateConfigurationRunTasks tasks() {
        return this.tasks;
    }

    /**
     * Set the tasks property: Software update configuration tasks triggered in this run.
     *
     * @param tasks the tasks value to set.
     * @return the SoftwareUpdateConfigurationRunProperties object itself.
     */
    public SoftwareUpdateConfigurationRunProperties withTasks(SoftwareUpdateConfigurationRunTasks tasks) {
        this.tasks = tasks;
        return this;
    }

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