com.azure.resourcemanager.automation.fluent.models.SoftwareUpdateConfigurationMachineRunInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-automation Show documentation
Show all versions of azure-resourcemanager-automation Show documentation
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.core.management.exception.ManagementError;
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.JobNavigation;
import com.azure.resourcemanager.automation.models.UpdateConfigurationNavigation;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.UUID;
/**
* Software update configuration machine run model.
*/
@Fluent
public final class SoftwareUpdateConfigurationMachineRunInner
implements JsonSerializable {
/*
* Name of the software update configuration machine run
*/
private String name;
/*
* Resource Id of the software update configuration machine run
*/
private String id;
/*
* Software update configuration machine run properties.
*/
private UpdateConfigurationMachineRunProperties innerProperties;
/**
* Creates an instance of SoftwareUpdateConfigurationMachineRunInner class.
*/
public SoftwareUpdateConfigurationMachineRunInner() {
}
/**
* Get the name property: Name of the software update configuration machine run.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Get the id property: Resource Id of the software update configuration machine run.
*
* @return the id value.
*/
public String id() {
return this.id;
}
/**
* Get the innerProperties property: Software update configuration machine run properties.
*
* @return the innerProperties value.
*/
private UpdateConfigurationMachineRunProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the targetComputer property: name of the updated computer.
*
* @return the targetComputer value.
*/
public String targetComputer() {
return this.innerProperties() == null ? null : this.innerProperties().targetComputer();
}
/**
* Get the targetComputerType property: type of the updated computer.
*
* @return the targetComputerType value.
*/
public String targetComputerType() {
return this.innerProperties() == null ? null : this.innerProperties().targetComputerType();
}
/**
* 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 SoftwareUpdateConfigurationMachineRunInner object itself.
*/
public SoftwareUpdateConfigurationMachineRunInner
withSoftwareUpdateConfiguration(UpdateConfigurationNavigation softwareUpdateConfiguration) {
if (this.innerProperties() == null) {
this.innerProperties = new UpdateConfigurationMachineRunProperties();
}
this.innerProperties().withSoftwareUpdateConfiguration(softwareUpdateConfiguration);
return this;
}
/**
* Get the status property: Status of the software update configuration machine run.
*
* @return the status value.
*/
public String status() {
return this.innerProperties() == null ? null : this.innerProperties().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.innerProperties() == null ? null : this.innerProperties().osType();
}
/**
* Get the correlationId property: correlation id of the software update configuration machine run.
*
* @return the correlationId value.
*/
public UUID correlationId() {
return this.innerProperties() == null ? null : this.innerProperties().correlationId();
}
/**
* Get the sourceComputerId property: source computer id of the software update configuration machine run.
*
* @return the sourceComputerId value.
*/
public UUID sourceComputerId() {
return this.innerProperties() == null ? null : this.innerProperties().sourceComputerId();
}
/**
* Get the startTime property: Start time of the software update configuration machine 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 machine run.
*
* @return the endTime value.
*/
public OffsetDateTime endTime() {
return this.innerProperties() == null ? null : this.innerProperties().endTime();
}
/**
* 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 job property: Job associated with the software update configuration machine run.
*
* @return the job value.
*/
public JobNavigation job() {
return this.innerProperties() == null ? null : this.innerProperties().job();
}
/**
* Set the job property: Job associated with the software update configuration machine run.
*
* @param job the job value to set.
* @return the SoftwareUpdateConfigurationMachineRunInner object itself.
*/
public SoftwareUpdateConfigurationMachineRunInner withJob(JobNavigation job) {
if (this.innerProperties() == null) {
this.innerProperties = new UpdateConfigurationMachineRunProperties();
}
this.innerProperties().withJob(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.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 error property: Details of provisioning error.
*
* @return the error value.
*/
public ManagementError error() {
return this.innerProperties() == null ? null : this.innerProperties().error();
}
/**
* Set the error property: Details of provisioning error.
*
* @param error the error value to set.
* @return the SoftwareUpdateConfigurationMachineRunInner object itself.
*/
public SoftwareUpdateConfigurationMachineRunInner withError(ManagementError error) {
if (this.innerProperties() == null) {
this.innerProperties = new UpdateConfigurationMachineRunProperties();
}
this.innerProperties().withError(error);
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 SoftwareUpdateConfigurationMachineRunInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SoftwareUpdateConfigurationMachineRunInner 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 SoftwareUpdateConfigurationMachineRunInner.
*/
public static SoftwareUpdateConfigurationMachineRunInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SoftwareUpdateConfigurationMachineRunInner deserializedSoftwareUpdateConfigurationMachineRunInner
= new SoftwareUpdateConfigurationMachineRunInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedSoftwareUpdateConfigurationMachineRunInner.name = reader.getString();
} else if ("id".equals(fieldName)) {
deserializedSoftwareUpdateConfigurationMachineRunInner.id = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedSoftwareUpdateConfigurationMachineRunInner.innerProperties
= UpdateConfigurationMachineRunProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedSoftwareUpdateConfigurationMachineRunInner;
});
}
}