Class AwsJsonProtocolErrorUnmarshaller.Builder
java.lang.Object
software.amazon.awssdk.protocols.json.internal.unmarshall.AwsJsonProtocolErrorUnmarshaller.Builder
- Enclosing class:
AwsJsonProtocolErrorUnmarshaller
Builder for
AwsJsonProtocolErrorUnmarshaller
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
defaultExceptionSupplier
(Supplier<SdkPojo> defaultExceptionSupplier) Default exception type if "error code" does not match any known modeled exception.errorCodeParser
(ErrorCodeParser errorCodeParser) Implementation ofErrorCodeParser
that can extract an error code or type from the JSON response.errorMessageParser
(ErrorMessageParser errorMessageParser) Implementation that can extract an error message from the JSON response.exceptions
(List<ExceptionMetadata> exceptions) List ofExceptionMetadata
to represent the modeled exceptions for the service.hasAwsQueryCompatible
(boolean hasAwsQueryCompatible) Provides a check on whether AwsQueryCompatible trait is found in Metadata.jsonFactory
(software.amazon.awssdk.thirdparty.jackson.core.JsonFactory jsonFactory) JSON Factory to create a JSON parser.jsonProtocolUnmarshaller
(JsonProtocolUnmarshaller jsonProtocolUnmarshaller) Underlying response unmarshaller.
-
Method Details
-
jsonProtocolUnmarshaller
public AwsJsonProtocolErrorUnmarshaller.Builder jsonProtocolUnmarshaller(JsonProtocolUnmarshaller jsonProtocolUnmarshaller) Underlying response unmarshaller. Exceptions for the JSON protocol are follow the same unmarshalling logic as success responses but with an additional "error type" that allows for polymorphic deserialization.- Returns:
- This builder for method chaining.
-
exceptions
List ofExceptionMetadata
to represent the modeled exceptions for the service. For AWS services the error type is a string representing the type of the modeled exception.- Returns:
- This builder for method chaining.
-
errorMessageParser
public AwsJsonProtocolErrorUnmarshaller.Builder errorMessageParser(ErrorMessageParser errorMessageParser) Implementation that can extract an error message from the JSON response. Implementations may look for a specific field in the JSON document or a specific header for example.- Returns:
- This builder for method chaining.
-
jsonFactory
public AwsJsonProtocolErrorUnmarshaller.Builder jsonFactory(software.amazon.awssdk.thirdparty.jackson.core.JsonFactory jsonFactory) JSON Factory to create a JSON parser.- Returns:
- This builder for method chaining.
-
defaultExceptionSupplier
public AwsJsonProtocolErrorUnmarshaller.Builder defaultExceptionSupplier(Supplier<SdkPojo> defaultExceptionSupplier) Default exception type if "error code" does not match any known modeled exception. This is the generated base exception for the service (i.e. DynamoDbException).- Returns:
- This builder for method chaining.
-
errorCodeParser
Implementation ofErrorCodeParser
that can extract an error code or type from the JSON response. Implementations may look for a specific field in the JSON document or a specific header for example.- Returns:
- This builder for method chaining.
-
build
-
hasAwsQueryCompatible
public AwsJsonProtocolErrorUnmarshaller.Builder hasAwsQueryCompatible(boolean hasAwsQueryCompatible) Provides a check on whether AwsQueryCompatible trait is found in Metadata. If true, error code will be derived from custom header. Otherwise, error code will be retrieved from its original source- Parameters:
hasAwsQueryCompatible
- boolean of whether the AwsQueryCompatible trait is found- Returns:
- This builder for method chaining.
-