com.azure.resourcemanager.databoxedge.models.AlertErrorDetails Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-databoxedge Show documentation
Show all versions of azure-resourcemanager-databoxedge Show documentation
This package contains Microsoft Azure SDK for DataBoxEdge Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2019-08.
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.databoxedge.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;
/**
* Error details for the alert.
*/
@Immutable
public final class AlertErrorDetails implements JsonSerializable {
/*
* Error code.
*/
private String errorCode;
/*
* Error Message.
*/
private String errorMessage;
/*
* Number of occurrences.
*/
private Integer occurrences;
/**
* Creates an instance of AlertErrorDetails class.
*/
public AlertErrorDetails() {
}
/**
* Get the errorCode property: Error code.
*
* @return the errorCode value.
*/
public String errorCode() {
return this.errorCode;
}
/**
* Get the errorMessage property: Error Message.
*
* @return the errorMessage value.
*/
public String errorMessage() {
return this.errorMessage;
}
/**
* Get the occurrences property: Number of occurrences.
*
* @return the occurrences value.
*/
public Integer occurrences() {
return this.occurrences;
}
/**
* 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 AlertErrorDetails from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AlertErrorDetails 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 AlertErrorDetails.
*/
public static AlertErrorDetails fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AlertErrorDetails deserializedAlertErrorDetails = new AlertErrorDetails();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("errorCode".equals(fieldName)) {
deserializedAlertErrorDetails.errorCode = reader.getString();
} else if ("errorMessage".equals(fieldName)) {
deserializedAlertErrorDetails.errorMessage = reader.getString();
} else if ("occurrences".equals(fieldName)) {
deserializedAlertErrorDetails.occurrences = reader.getNullable(JsonReader::getInt);
} else {
reader.skipChildren();
}
}
return deserializedAlertErrorDetails;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy