Class ErrorResponseBody
java.lang.Object
com.azure.resourcemanager.apimanagement.models.ErrorResponseBody
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ErrorResponseBody>
public final class ErrorResponseBody
extends Object
implements com.azure.json.JsonSerializable<ErrorResponseBody>
Error Body contract.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncode()Get the code property: Service-defined error code.details()Get the details property: The list of invalid fields send in request, in case of validation error.static ErrorResponseBodyfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of ErrorResponseBody from the JsonReader.message()Get the message property: Human-readable representation of the error.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Set the code property: Service-defined error code.withDetails(List<ErrorFieldContract> details) Set the details property: The list of invalid fields send in request, in case of validation error.withMessage(String message) Set the message property: Human-readable representation of the error.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
ErrorResponseBody
public ErrorResponseBody()Creates an instance of ErrorResponseBody class.
-
-
Method Details
-
code
Get the code property: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.- Returns:
- the code value.
-
withCode
Set the code property: Service-defined error code. This code serves as a sub-status for the HTTP error code specified in the response.- Parameters:
code- the code value to set.- Returns:
- the ErrorResponseBody object itself.
-
message
Get the message property: Human-readable representation of the error.- Returns:
- the message value.
-
withMessage
Set the message property: Human-readable representation of the error.- Parameters:
message- the message value to set.- Returns:
- the ErrorResponseBody object itself.
-
details
Get the details property: The list of invalid fields send in request, in case of validation error.- Returns:
- the details value.
-
withDetails
Set the details property: The list of invalid fields send in request, in case of validation error.- Parameters:
details- the details value to set.- Returns:
- the ErrorResponseBody object itself.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ErrorResponseBody>- Throws:
IOException
-
fromJson
Reads an instance of ErrorResponseBody from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of ErrorResponseBody 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 ErrorResponseBody.
-