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