All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.resourcemanager.automation.fluent.models.SoftwareUpdateConfigurationRunInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Automation Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Automation Client. Package tag package-2022-02-22.

The newest version!
// 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.automation.models.SoftwareUpdateConfigurationRunTasks;
import com.azure.resourcemanager.automation.models.UpdateConfigurationNavigation;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * Software update configuration Run properties.
 */
@Fluent
public final class SoftwareUpdateConfigurationRunInner
    implements JsonSerializable {
    /*
     * Name of the software update configuration run.
     */
    private String name;

    /*
     * Resource Id of the software update configuration run
     */
    private String id;

    /*
     * Software update configuration Run properties.
     */
    private SoftwareUpdateConfigurationRunProperties innerProperties;

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

    /**
     * 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();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of SoftwareUpdateConfigurationRunInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of SoftwareUpdateConfigurationRunInner if the JsonReader was pointing to an instance of it,
     * or null if it was pointing to JSON null.
     * @throws IOException If an error occurs while reading the SoftwareUpdateConfigurationRunInner.
     */
    public static SoftwareUpdateConfigurationRunInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            SoftwareUpdateConfigurationRunInner deserializedSoftwareUpdateConfigurationRunInner
                = new SoftwareUpdateConfigurationRunInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("name".equals(fieldName)) {
                    deserializedSoftwareUpdateConfigurationRunInner.name = reader.getString();
                } else if ("id".equals(fieldName)) {
                    deserializedSoftwareUpdateConfigurationRunInner.id = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedSoftwareUpdateConfigurationRunInner.innerProperties
                        = SoftwareUpdateConfigurationRunProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSoftwareUpdateConfigurationRunInner;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy