
com.azure.resourcemanager.billing.models.ValidationResultProperties 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.billing.models;
import com.azure.core.annotation.Immutable;
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 properties of the validation result.
*/
@Immutable
public final class ValidationResultProperties implements JsonSerializable {
/*
* Result Level.
*/
private String level;
/*
* Result Code.
*/
private String code;
/*
* The validation message.
*/
private String message;
/**
* Creates an instance of ValidationResultProperties class.
*/
public ValidationResultProperties() {
}
/**
* Get the level property: Result Level.
*
* @return the level value.
*/
public String level() {
return this.level;
}
/**
* Get the code property: Result Code.
*
* @return the code value.
*/
public String code() {
return this.code;
}
/**
* Get the message property: The validation message.
*
* @return the message value.
*/
public String message() {
return this.message;
}
/**
* 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();
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ValidationResultProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ValidationResultProperties 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 ValidationResultProperties.
*/
public static ValidationResultProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ValidationResultProperties deserializedValidationResultProperties = new ValidationResultProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("level".equals(fieldName)) {
deserializedValidationResultProperties.level = reader.getString();
} else if ("code".equals(fieldName)) {
deserializedValidationResultProperties.code = reader.getString();
} else if ("message".equals(fieldName)) {
deserializedValidationResultProperties.message = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedValidationResultProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy