com.azure.resourcemanager.security.fluent.models.AutomationValidationStatusInner 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.security.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 java.io.IOException;
/**
* The security automation model state property bag.
*/
@Fluent
public final class AutomationValidationStatusInner implements JsonSerializable {
/*
* Indicates whether the model is valid or not.
*/
private Boolean isValid;
/*
* The validation message.
*/
private String message;
/**
* Creates an instance of AutomationValidationStatusInner class.
*/
public AutomationValidationStatusInner() {
}
/**
* Get the isValid property: Indicates whether the model is valid or not.
*
* @return the isValid value.
*/
public Boolean isValid() {
return this.isValid;
}
/**
* Set the isValid property: Indicates whether the model is valid or not.
*
* @param isValid the isValid value to set.
* @return the AutomationValidationStatusInner object itself.
*/
public AutomationValidationStatusInner withIsValid(Boolean isValid) {
this.isValid = isValid;
return this;
}
/**
* Get the message property: The validation message.
*
* @return the message value.
*/
public String message() {
return this.message;
}
/**
* Set the message property: The validation message.
*
* @param message the message value to set.
* @return the AutomationValidationStatusInner object itself.
*/
public AutomationValidationStatusInner withMessage(String message) {
this.message = message;
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.writeBooleanField("isValid", this.isValid);
jsonWriter.writeStringField("message", this.message);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AutomationValidationStatusInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AutomationValidationStatusInner 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 AutomationValidationStatusInner.
*/
public static AutomationValidationStatusInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AutomationValidationStatusInner deserializedAutomationValidationStatusInner
= new AutomationValidationStatusInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("isValid".equals(fieldName)) {
deserializedAutomationValidationStatusInner.isValid = reader.getNullable(JsonReader::getBoolean);
} else if ("message".equals(fieldName)) {
deserializedAutomationValidationStatusInner.message = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedAutomationValidationStatusInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy