com.azure.resourcemanager.automation.fluent.models.TestJobInner 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.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Map;
/**
* Definition of the test job.
*/
@Fluent
public final class TestJobInner implements JsonSerializable {
/*
* Gets or sets the creation time of the test job.
*/
private OffsetDateTime creationTime;
/*
* Gets or sets the status of the test job.
*/
private String status;
/*
* Gets or sets the status details of the test job.
*/
private String statusDetails;
/*
* Gets or sets the runOn which specifies the group name where the job is to be executed.
*/
private String runOn;
/*
* Gets or sets the start time of the test job.
*/
private OffsetDateTime startTime;
/*
* Gets or sets the end time of the test job.
*/
private OffsetDateTime endTime;
/*
* Gets or sets the exception of the test job.
*/
private String exception;
/*
* Gets or sets the last modified time of the test job.
*/
private OffsetDateTime lastModifiedTime;
/*
* Gets or sets the last status modified time of the test job.
*/
private OffsetDateTime lastStatusModifiedTime;
/*
* Gets or sets the parameters of the test job.
*/
private Map parameters;
/*
* The activity-level tracing options of the runbook.
*/
private Integer logActivityTrace;
/**
* Creates an instance of TestJobInner class.
*/
public TestJobInner() {
}
/**
* Get the creationTime property: Gets or sets the creation time of the test job.
*
* @return the creationTime value.
*/
public OffsetDateTime creationTime() {
return this.creationTime;
}
/**
* Set the creationTime property: Gets or sets the creation time of the test job.
*
* @param creationTime the creationTime value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withCreationTime(OffsetDateTime creationTime) {
this.creationTime = creationTime;
return this;
}
/**
* Get the status property: Gets or sets the status of the test job.
*
* @return the status value.
*/
public String status() {
return this.status;
}
/**
* Set the status property: Gets or sets the status of the test job.
*
* @param status the status value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withStatus(String status) {
this.status = status;
return this;
}
/**
* Get the statusDetails property: Gets or sets the status details of the test job.
*
* @return the statusDetails value.
*/
public String statusDetails() {
return this.statusDetails;
}
/**
* Set the statusDetails property: Gets or sets the status details of the test job.
*
* @param statusDetails the statusDetails value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withStatusDetails(String statusDetails) {
this.statusDetails = statusDetails;
return this;
}
/**
* Get the runOn property: Gets or sets the runOn which specifies the group name where the job is to be executed.
*
* @return the runOn value.
*/
public String runOn() {
return this.runOn;
}
/**
* Set the runOn property: Gets or sets the runOn which specifies the group name where the job is to be executed.
*
* @param runOn the runOn value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withRunOn(String runOn) {
this.runOn = runOn;
return this;
}
/**
* Get the startTime property: Gets or sets the start time of the test job.
*
* @return the startTime value.
*/
public OffsetDateTime startTime() {
return this.startTime;
}
/**
* Set the startTime property: Gets or sets the start time of the test job.
*
* @param startTime the startTime value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withStartTime(OffsetDateTime startTime) {
this.startTime = startTime;
return this;
}
/**
* Get the endTime property: Gets or sets the end time of the test job.
*
* @return the endTime value.
*/
public OffsetDateTime endTime() {
return this.endTime;
}
/**
* Set the endTime property: Gets or sets the end time of the test job.
*
* @param endTime the endTime value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withEndTime(OffsetDateTime endTime) {
this.endTime = endTime;
return this;
}
/**
* Get the exception property: Gets or sets the exception of the test job.
*
* @return the exception value.
*/
public String exception() {
return this.exception;
}
/**
* Set the exception property: Gets or sets the exception of the test job.
*
* @param exception the exception value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withException(String exception) {
this.exception = exception;
return this;
}
/**
* Get the lastModifiedTime property: Gets or sets the last modified time of the test job.
*
* @return the lastModifiedTime value.
*/
public OffsetDateTime lastModifiedTime() {
return this.lastModifiedTime;
}
/**
* Set the lastModifiedTime property: Gets or sets the last modified time of the test job.
*
* @param lastModifiedTime the lastModifiedTime value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
this.lastModifiedTime = lastModifiedTime;
return this;
}
/**
* Get the lastStatusModifiedTime property: Gets or sets the last status modified time of the test job.
*
* @return the lastStatusModifiedTime value.
*/
public OffsetDateTime lastStatusModifiedTime() {
return this.lastStatusModifiedTime;
}
/**
* Set the lastStatusModifiedTime property: Gets or sets the last status modified time of the test job.
*
* @param lastStatusModifiedTime the lastStatusModifiedTime value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withLastStatusModifiedTime(OffsetDateTime lastStatusModifiedTime) {
this.lastStatusModifiedTime = lastStatusModifiedTime;
return this;
}
/**
* Get the parameters property: Gets or sets the parameters of the test job.
*
* @return the parameters value.
*/
public Map parameters() {
return this.parameters;
}
/**
* Set the parameters property: Gets or sets the parameters of the test job.
*
* @param parameters the parameters value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withParameters(Map parameters) {
this.parameters = parameters;
return this;
}
/**
* Get the logActivityTrace property: The activity-level tracing options of the runbook.
*
* @return the logActivityTrace value.
*/
public Integer logActivityTrace() {
return this.logActivityTrace;
}
/**
* Set the logActivityTrace property: The activity-level tracing options of the runbook.
*
* @param logActivityTrace the logActivityTrace value to set.
* @return the TestJobInner object itself.
*/
public TestJobInner withLogActivityTrace(Integer logActivityTrace) {
this.logActivityTrace = logActivityTrace;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("creationTime",
this.creationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationTime));
jsonWriter.writeStringField("status", this.status);
jsonWriter.writeStringField("statusDetails", this.statusDetails);
jsonWriter.writeStringField("runOn", this.runOn);
jsonWriter.writeStringField("startTime",
this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime));
jsonWriter.writeStringField("endTime",
this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime));
jsonWriter.writeStringField("exception", this.exception);
jsonWriter.writeStringField("lastModifiedTime",
this.lastModifiedTime == null
? null
: DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastModifiedTime));
jsonWriter.writeStringField("lastStatusModifiedTime",
this.lastStatusModifiedTime == null
? null
: DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.lastStatusModifiedTime));
jsonWriter.writeMapField("parameters", this.parameters, (writer, element) -> writer.writeString(element));
jsonWriter.writeNumberField("logActivityTrace", this.logActivityTrace);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of TestJobInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of TestJobInner 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 TestJobInner.
*/
public static TestJobInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
TestJobInner deserializedTestJobInner = new TestJobInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("creationTime".equals(fieldName)) {
deserializedTestJobInner.creationTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("status".equals(fieldName)) {
deserializedTestJobInner.status = reader.getString();
} else if ("statusDetails".equals(fieldName)) {
deserializedTestJobInner.statusDetails = reader.getString();
} else if ("runOn".equals(fieldName)) {
deserializedTestJobInner.runOn = reader.getString();
} else if ("startTime".equals(fieldName)) {
deserializedTestJobInner.startTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("endTime".equals(fieldName)) {
deserializedTestJobInner.endTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("exception".equals(fieldName)) {
deserializedTestJobInner.exception = reader.getString();
} else if ("lastModifiedTime".equals(fieldName)) {
deserializedTestJobInner.lastModifiedTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("lastStatusModifiedTime".equals(fieldName)) {
deserializedTestJobInner.lastStatusModifiedTime = reader
.getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
} else if ("parameters".equals(fieldName)) {
Map parameters = reader.readMap(reader1 -> reader1.getString());
deserializedTestJobInner.parameters = parameters;
} else if ("logActivityTrace".equals(fieldName)) {
deserializedTestJobInner.logActivityTrace = reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
return deserializedTestJobInner;
});
}
}