Class IntegrationTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.aws.apigateway.traits.IntegrationTrait
-
- All Implemented Interfaces:
FromSourceLocation
,ToNode
,ToShapeId
,Trait
,ToSmithyBuilder<IntegrationTrait>
public final class IntegrationTrait extends AbstractTrait implements ToSmithyBuilder<IntegrationTrait>
API Gateway integration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IntegrationTrait.Builder
static class
IntegrationTrait.Provider
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static IntegrationTrait.Builder
builder()
protected ObjectNode
createNode()
The result of toNode is used for hashCodes and equality.static java.lang.String
formatComponent(ToShapeId service, ToShapeId operation, java.lang.String component)
Replaces templated placeholders in an Integration trait.java.util.List<java.lang.String>
getCacheKeyParameters()
A list of request parameters whose values are to be cached.java.util.Optional<java.lang.String>
getCacheNamespace()
Gets an API-specific tag group of related cached parameters.java.util.Optional<java.lang.String>
getConnectionId()
Gets the ID of a VpcLink when using a private integration.java.util.Optional<java.lang.String>
getConnectionType()
Gets the connection type used by this integration.java.util.Optional<java.lang.String>
getContentHandling()
Get the Request payload encoding conversion types.java.util.Optional<java.lang.String>
getCredentials()
Gets the credentials required for the integration, if any.java.lang.String
getHttpMethod()
Gets the integration's HTTP method type.java.util.Optional<java.lang.String>
getPassThroughBehavior()
Gets the pass through behavior of the integration.java.util.Optional<java.lang.String>
getPayloadFormatVersion()
Gets the payload format version.java.util.Optional<java.lang.String>
getRequestParameter(java.lang.String expression)
Get a specific request parameter by input expression.java.util.Map<java.lang.String,java.lang.String>
getRequestParameters()
Gets the request parameter mappings of the integration.java.util.Optional<java.lang.String>
getRequestTemplate(java.lang.String mimeType)
Gets a specific request template by MIME type.java.util.Map<java.lang.String,java.lang.String>
getRequestTemplates()
Gets all request templates of the integration.java.util.Optional<IntegrationResponse>
getResponse(java.lang.String statusCode)
Get a specific integration response by status code expression.java.util.Map<java.lang.String,IntegrationResponse>
getResponses()
Gets all integration responses.java.util.Optional<java.lang.Integer>
getTimeoutInMillis()
Get the timeout in milliseconds.java.lang.String
getType()
Gets the integration type.java.lang.String
getUri()
Gets the Uniform Resource Identifier (URI) of the integration endpoint.IntegrationTrait.Builder
toBuilder()
Take this object and create a builder that contains all of the current property values of this object.ObjectNode
toExpandedNode(ToShapeId service, ToShapeId operation)
Converts the trait an ObjectNode that finds and replaces the templated serviceName and operationName labels in the "uri" and "credentials" key-value pairs.-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTrait
equals, getSourceLocation, hashCode, setNodeCache, toNode, toShapeId, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface software.amazon.smithy.model.traits.Trait
isSynthetic
-
-
-
-
Field Detail
-
ID
public static final ShapeId ID
-
-
Method Detail
-
builder
public static IntegrationTrait.Builder builder()
-
getType
public java.lang.String getType()
Gets the integration type.- Returns:
- Returns the integration type.
-
getUri
public java.lang.String getUri()
Gets the Uniform Resource Identifier (URI) of the integration endpoint.- Returns:
- Returns the set URI of the integration.
-
getCredentials
public java.util.Optional<java.lang.String> getCredentials()
Gets the credentials required for the integration, if any.For AWS integrations, three options are available. To specify an IAM Role for API Gateway to assume, use the role's Amazon Resource Name (ARN). To require that the caller's identity be passed through from the request, specify the string
arn:aws:iam::*:user/*
. Resource-based permissions are used if no credentials are provided.- Returns:
- Returns the optionally present credentials.
-
getHttpMethod
public java.lang.String getHttpMethod()
Gets the integration's HTTP method type.- Returns:
- Get the set HTTP method.
-
getPassThroughBehavior
public java.util.Optional<java.lang.String> getPassThroughBehavior()
Gets the pass through behavior of the integration.Specifies how a request payload of unmapped content type is passed through the integration request without modification. Supported values are when_no_templates, when_no_match, and never.
- Returns:
- Returns the pass through setting.
- See Also:
- Pass through behavior
-
getContentHandling
public java.util.Optional<java.lang.String> getContentHandling()
Get the Request payload encoding conversion types.Valid values are:
- CONVERT_TO_TEXT, for converting a binary payload into a Base64-encoded string or converting a text payload into a utf-8-encoded string or passing through the text payload natively without modification
- CONVERT_TO_BINARY, for converting a text payload into Base64-decoded blobor passing through a binary payload natively without modification.
- Returns:
- Returns the content-handling.
-
getTimeoutInMillis
public java.util.Optional<java.lang.Integer> getTimeoutInMillis()
Get the timeout in milliseconds.Integration timeouts between 50 ms and 29,000 ms. The default setting used by API Gateway is 29,000 (or, 29 seconds).
- Returns:
- Returns the optionally set timeout setting.
-
getConnectionId
public java.util.Optional<java.lang.String> getConnectionId()
Gets the ID of a VpcLink when using a private integration.- Returns:
- Returns the optionally present connection ID.
- See Also:
- VPC Link
-
getConnectionType
public java.util.Optional<java.lang.String> getConnectionType()
Gets the connection type used by this integration.- Returns:
- Returns the connection type.
-
getCacheNamespace
public java.util.Optional<java.lang.String> getCacheNamespace()
Gets an API-specific tag group of related cached parameters.- Returns:
- Returns the optionally present cache namespace.
-
getPayloadFormatVersion
public java.util.Optional<java.lang.String> getPayloadFormatVersion()
Gets the payload format version. Only used in HTTP APIs.- Returns:
- Returns the optional payload format version.
-
getCacheKeyParameters
public java.util.List<java.lang.String> getCacheKeyParameters()
A list of request parameters whose values are to be cached.- Returns:
- Returns the cache key parameters.
-
getRequestParameters
public java.util.Map<java.lang.String,java.lang.String> getRequestParameters()
Gets the request parameter mappings of the integration.Each key is an expression used to extract a value from the request, and each value is an expression of where to place the value in the downstream request. Supported request parameters are querystring, path, header, and body.
- Returns:
- Returns the request parameters.
- See Also:
- Request parameters
-
getRequestParameter
public java.util.Optional<java.lang.String> getRequestParameter(java.lang.String expression)
Get a specific request parameter by input expression.- Parameters:
expression
- Expression to get.- Returns:
- Returns the optionally found request parameter.
-
getRequestTemplates
public java.util.Map<java.lang.String,java.lang.String> getRequestTemplates()
Gets all request templates of the integration.- Returns:
- Returns a map of MIME types to request templates.
- See Also:
- Request templates
-
getRequestTemplate
public java.util.Optional<java.lang.String> getRequestTemplate(java.lang.String mimeType)
Gets a specific request template by MIME type.- Parameters:
mimeType
- MIME type to get.- Returns:
- Returns the optionally found template.
-
getResponses
public java.util.Map<java.lang.String,IntegrationResponse> getResponses()
Gets all integration responses.- Returns:
- Returns a map of status code regular expressions to responses.
- See Also:
- Integration responses
-
getResponse
public java.util.Optional<IntegrationResponse> getResponse(java.lang.String statusCode)
Get a specific integration response by status code expression.- Parameters:
statusCode
- Status code regular expression to search for.- Returns:
- Returns the optionally found response object.
-
toExpandedNode
public ObjectNode toExpandedNode(ToShapeId service, ToShapeId operation)
Converts the trait an ObjectNode that finds and replaces the templated serviceName and operationName labels in the "uri" and "credentials" key-value pairs.- Parameters:
service
- Service shape ID to use when replacing{serviceName}
.operation
- Operation shape ID to use when replacing{operationName}
.- Returns:
- Returns the expanded Node.
-
formatComponent
public static java.lang.String formatComponent(ToShapeId service, ToShapeId operation, java.lang.String component)
Replaces templated placeholders in an Integration trait.- Parameters:
service
- Service shape ID to use when replacing{serviceName}
.operation
- Operation shape ID to use when replacing{operationName}
.component
- Templatized component to expand.- Returns:
- Returns the expanded string.
-
createNode
protected ObjectNode createNode()
Description copied from class:AbstractTrait
The 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:
createNode
in classAbstractTrait
- Returns:
- Returns the trait as a node.
-
toBuilder
public IntegrationTrait.Builder toBuilder()
Description copied from interface:ToSmithyBuilder
Take this object and create a builder that contains all of the current property values of this object.- Specified by:
toBuilder
in interfaceToSmithyBuilder<IntegrationTrait>
- Returns:
- a builder for type T
-
-