Class GatewayResponsesTrait
java.lang.Object
software.amazon.smithy.model.traits.AbstractTrait
software.amazon.smithy.aws.apigateway.traits.GatewayResponsesTrait
- All Implemented Interfaces:
FromSourceLocation,ToNode,ToShapeId,Trait,ToSmithyBuilder<GatewayResponsesTrait>
public final class GatewayResponsesTrait
extends AbstractTrait
implements ToSmithyBuilder<GatewayResponsesTrait>
Defines custom gateway responses for an API Gateway REST API. Gateway
responses customize error responses for authentication failures,
integration errors, and other API Gateway-generated errors.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilds aGatewayResponsesTrait.static final class -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Creates a builder for the trait.protected NodeThe result of toNode is used for hashCodes and equality.getResponse(String type) Gets a specific gateway response by type key.Gets all gateway responses.getValue()Gets the gateway responses as an ObjectNode.Take this object and create a builder that contains all of the current property values of this object.Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
Field Details
-
ID
-
-
Method Details
-
builder
Creates a builder for the trait.- Returns:
- Returns the created builder.
-
getResponses
Gets all gateway responses.- Returns:
- Returns the immutable map of response type keys to definitions.
-
getResponse
Gets a specific gateway response by type key.- Parameters:
type- Response type key (e.g.,DEFAULT_4XX).- Returns:
- Returns the optionally found gateway response.
-
getValue
Gets the gateway responses as an ObjectNode.- Returns:
- Returns the gateway responses map as a Node.
-
toBuilder
Description copied from interface:ToSmithyBuilderTake this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilderin interfaceToSmithyBuilder<GatewayResponsesTrait>- Returns:
- a builder for type T
-
createNode
Description copied from class:AbstractTraitThe result of toNode is used for hashCodes and equality. Subclasses must implement createNode to turn the trait into a Node. This is then cached for subsequent retrievals.- Specified by:
createNodein classAbstractTrait- Returns:
- Returns the trait as a node.
-