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 Details

    • ErrorResponseBody

      public ErrorResponseBody()
      Creates an instance of ErrorResponseBody class.
  • Method Details

    • code

      public String 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

      public ErrorResponseBody withCode(String code)
      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

      public String message()
      Get the message property: Human-readable representation of the error.
      Returns:
      the message value.
    • withMessage

      public ErrorResponseBody withMessage(String message)
      Set the message property: Human-readable representation of the error.
      Parameters:
      message - the message value to set.
      Returns:
      the ErrorResponseBody object itself.
    • details

      public List<ErrorFieldContract> details()
      Get the details property: The list of invalid fields send in request, in case of validation error.
      Returns:
      the details value.
    • withDetails

      public ErrorResponseBody withDetails(List<ErrorFieldContract> details)
      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

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<ErrorResponseBody>
      Throws:
      IOException
    • fromJson

      public static ErrorResponseBody fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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.