// 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 Run properties. */
@Fluent
public final class SoftwareUpdateConfigurationRunInner {
    /*
     * Name of the software update configuration run.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

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

    /*
     * Software update configuration Run properties.
     */
    @JsonProperty(value = "properties")
    private SoftwareUpdateConfigurationRunProperties innerProperties;

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

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

    /**
     * Get the innerProperties property: Software update configuration Run properties.
     *
     * @return the innerProperties value.
     */
    private SoftwareUpdateConfigurationRunProperties innerProperties() {
        return this.innerProperties;
    }

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

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

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

    /**
     * Get the configuredDuration property: Configured duration for the software update configuration run.
     *
     * @return the configuredDuration value.
     */
    public String configuredDuration() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().osType();
    }

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

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

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

    /**
     * Get the failedCount property: Number of computers with failed status.
     *
     * @return the failedCount value.
     */
    public Integer failedCount() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Get the createdBy property: CreatedBy property, which only appears in the response.
     *
     * @return the createdBy value.
     */
    public String createdBy() {
        return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

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

    /**
     * Get the tasks property: Software update configuration tasks triggered in this run.
     *
     * @return the tasks value.
     */
    public SoftwareUpdateConfigurationRunTasks tasks() {
        return this.innerProperties() == null ? null : this.innerProperties().tasks();
    }

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

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