com.azure.resourcemanager.servicelinker.models.DryrunPatch Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.servicelinker.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.servicelinker.fluent.models.DryrunProperties;
import java.io.IOException;
import java.util.List;
/**
* a dryrun job to be updated.
*/
@Fluent
public final class DryrunPatch implements JsonSerializable {
/*
* The properties of the dryrun job.
*/
private DryrunProperties innerProperties;
/**
* Creates an instance of DryrunPatch class.
*/
public DryrunPatch() {
}
/**
* Get the innerProperties property: The properties of the dryrun job.
*
* @return the innerProperties value.
*/
private DryrunProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the parameters property: The parameters of the dryrun.
*
* @return the parameters value.
*/
public DryrunParameters parameters() {
return this.innerProperties() == null ? null : this.innerProperties().parameters();
}
/**
* Set the parameters property: The parameters of the dryrun.
*
* @param parameters the parameters value to set.
* @return the DryrunPatch object itself.
*/
public DryrunPatch withParameters(DryrunParameters parameters) {
if (this.innerProperties() == null) {
this.innerProperties = new DryrunProperties();
}
this.innerProperties().withParameters(parameters);
return this;
}
/**
* Get the prerequisiteResults property: the result of the dryrun.
*
* @return the prerequisiteResults value.
*/
public List prerequisiteResults() {
return this.innerProperties() == null ? null : this.innerProperties().prerequisiteResults();
}
/**
* Get the operationPreviews property: the preview of the operations for creation.
*
* @return the operationPreviews value.
*/
public List operationPreviews() {
return this.innerProperties() == null ? null : this.innerProperties().operationPreviews();
}
/**
* Get the provisioningState property: The provisioning state.
*
* @return the provisioningState value.
*/
public String provisioningState() {
return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
}
/**
* 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 DryrunPatch from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DryrunPatch 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 DryrunPatch.
*/
public static DryrunPatch fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DryrunPatch deserializedDryrunPatch = new DryrunPatch();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("properties".equals(fieldName)) {
deserializedDryrunPatch.innerProperties = DryrunProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedDryrunPatch;
});
}
}