Class IntegrationTrait.Builder
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTraitBuilder<IntegrationTrait,IntegrationTrait.Builder>
-
- software.amazon.smithy.aws.apigateway.traits.IntegrationTrait.Builder
-
- All Implemented Interfaces:
SmithyBuilder<IntegrationTrait>
- Enclosing class:
- IntegrationTrait
public static final class IntegrationTrait.Builder extends AbstractTraitBuilder<IntegrationTrait,IntegrationTrait.Builder>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegrationTrait.Builder
addCacheKeyParameter(java.lang.String cacheKeyParameter)
Adds a cache key parameter.IntegrationTrait
build()
Creates an immutable object that is created from the properties that have been set on the builder.IntegrationTrait.Builder
cacheKeyParameters(java.util.List<java.lang.String> cacheKeyParameters)
Sets a list of request parameters whose values are to be cached.IntegrationTrait.Builder
cacheNamespace(java.lang.String cacheNamespace)
Set an API-specific tag group of related cached parameters.IntegrationTrait.Builder
clearCacheKeyParameters()
Clears all cache key parameters.IntegrationTrait.Builder
connectionId(java.lang.String connectionId)
Sets the ID of a VpcLink when using a private integration.IntegrationTrait.Builder
connectionType(java.lang.String connectionType)
Sets the connection type.IntegrationTrait.Builder
contentHandling(java.lang.String contentHandling)
Set the Request payload encoding conversion types.IntegrationTrait.Builder
credentials(java.lang.String credentials)
Specifies the credentials used by the integration, if any.IntegrationTrait.Builder
httpMethod(java.lang.String httpMethod)
Specifies the integration's HTTP method type.IntegrationTrait.Builder
passThroughBehavior(java.lang.String passThroughBehavior)
Configures the pass through behavior of the integration.IntegrationTrait.Builder
payloadFormatVersion(java.lang.String payloadFormatVersion)
Sets the payload format version.IntegrationTrait.Builder
putRequestParameter(java.lang.String input, java.lang.String output)
Adds a request parameter.IntegrationTrait.Builder
putRequestTemplate(java.lang.String mimeType, java.lang.String template)
Adds a request template.IntegrationTrait.Builder
putResponse(java.lang.String statusCodeRegex, IntegrationResponse integrationResponse)
Adds a response for the given response regex.IntegrationTrait.Builder
removeCacheKeyParameter(java.lang.String cacheKeyParameter)
Removes a specific cache key parameter.IntegrationTrait.Builder
removeRequestParameter(java.lang.String expression)
Remove a request parameter by expression.IntegrationTrait.Builder
removeRequestTemplate(java.lang.String mimeType)
Removes a request template by MIME type.IntegrationTrait.Builder
removeResponse(java.lang.String statusCodeRegex)
Removes a response by status code regex.IntegrationTrait.Builder
requestParameters(java.util.Map<java.lang.String,java.lang.String> requestParameters)
Sets request parameters.IntegrationTrait.Builder
requestTemplates(java.util.Map<java.lang.String,java.lang.String> requestTemplates)
Sets request templates.IntegrationTrait.Builder
responses(java.util.Map<java.lang.String,IntegrationResponse> responses)
Sets responses for the given response regular expressions.IntegrationTrait.Builder
timeoutInMillis(java.lang.Integer timeoutInMillis)
Set the timeout in milliseconds.IntegrationTrait.Builder
type(java.lang.String type)
Sets the integration type.IntegrationTrait.Builder
uri(java.lang.String uri)
Sets the URI of the integration endpoint.-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTraitBuilder
getSourceLocation, sourceLocation
-
-
-
-
Method Detail
-
build
public IntegrationTrait build()
Description copied from interface:SmithyBuilder
Creates an immutable object that is created from the properties that have been set on the builder.- Returns:
- an instance of T
-
type
public IntegrationTrait.Builder type(java.lang.String type)
Sets the integration type.- Parameters:
type
- Type to set (aws, aws_proxy, http, http_proxy).- Returns:
- Returns the builder.
-
uri
public IntegrationTrait.Builder uri(java.lang.String uri)
Sets the URI of the integration endpoint.- Parameters:
uri
- The URI of the integration.- Returns:
- Returns the builder.
-
credentials
public IntegrationTrait.Builder credentials(java.lang.String credentials)
Specifies the credentials used by the integration, if any.- Parameters:
credentials
- Credentials to use.- Returns:
- Returns the builder.
-
httpMethod
public IntegrationTrait.Builder httpMethod(java.lang.String httpMethod)
Specifies the integration's HTTP method type.- Parameters:
httpMethod
- HTTP method to use.- Returns:
- Returns the builder.
-
passThroughBehavior
public IntegrationTrait.Builder passThroughBehavior(java.lang.String passThroughBehavior)
Configures the pass through behavior of the integration.- Parameters:
passThroughBehavior
- Pass through behavior setting.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getPassThroughBehavior()
-
contentHandling
public IntegrationTrait.Builder contentHandling(java.lang.String contentHandling)
Set 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 blob or passing through a binary payload natively without modification.
- Parameters:
contentHandling
- Content handling property.- Returns:
- Returns the builder.
-
timeoutInMillis
public IntegrationTrait.Builder timeoutInMillis(java.lang.Integer timeoutInMillis)
Set 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).
- Parameters:
timeoutInMillis
- Timeout in milliseconds.- Returns:
- Returns the builder.
-
connectionId
public IntegrationTrait.Builder connectionId(java.lang.String connectionId)
Sets the ID of a VpcLink when using a private integration.- Parameters:
connectionId
- VPC link ID.- Returns:
- Returns the builder.
-
connectionType
public IntegrationTrait.Builder connectionType(java.lang.String connectionType)
Sets the connection type.- Parameters:
connectionType
- Connection type to set.- Returns:
- Returns the builder.
-
cacheNamespace
public IntegrationTrait.Builder cacheNamespace(java.lang.String cacheNamespace)
Set an API-specific tag group of related cached parameters.- Parameters:
cacheNamespace
- Cache namespace to set.- Returns:
- Returns the builder.
-
payloadFormatVersion
public IntegrationTrait.Builder payloadFormatVersion(java.lang.String payloadFormatVersion)
Sets the payload format version. Required for HTTP APIs.- Parameters:
payloadFormatVersion
- Payload format version to set.- Returns:
- Returns the builder.
-
addCacheKeyParameter
public IntegrationTrait.Builder addCacheKeyParameter(java.lang.String cacheKeyParameter)
Adds a cache key parameter.- Parameters:
cacheKeyParameter
- Parameter to add.- Returns:
- Returns the builder.
-
cacheKeyParameters
public IntegrationTrait.Builder cacheKeyParameters(java.util.List<java.lang.String> cacheKeyParameters)
Sets a list of request parameters whose values are to be cached.- Parameters:
cacheKeyParameters
- Parameters to use in the cache.- Returns:
- Returns the builder.
-
removeCacheKeyParameter
public IntegrationTrait.Builder removeCacheKeyParameter(java.lang.String cacheKeyParameter)
Removes a specific cache key parameter.- Parameters:
cacheKeyParameter
- Parameter to remove.- Returns:
- Returns the builder.
-
clearCacheKeyParameters
public IntegrationTrait.Builder clearCacheKeyParameters()
Clears all cache key parameters.- Returns:
- Returns the builder.
-
putRequestParameter
public IntegrationTrait.Builder putRequestParameter(java.lang.String input, java.lang.String output)
Adds a request parameter.- Parameters:
input
- Input request expression.output
- Output request expression.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getRequestParameters()
-
requestParameters
public IntegrationTrait.Builder requestParameters(java.util.Map<java.lang.String,java.lang.String> requestParameters)
Sets request parameters.- Parameters:
requestParameters
- Map of parameters to add.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getRequestParameters()
-
removeRequestParameter
public IntegrationTrait.Builder removeRequestParameter(java.lang.String expression)
Remove a request parameter by expression.- Parameters:
expression
- Expression to remove.- Returns:
- Returns the builder.
-
putRequestTemplate
public IntegrationTrait.Builder putRequestTemplate(java.lang.String mimeType, java.lang.String template)
Adds a request template.- Parameters:
mimeType
- MIME type of the request template to set.template
- Request template to set.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getRequestTemplates()
-
requestTemplates
public IntegrationTrait.Builder requestTemplates(java.util.Map<java.lang.String,java.lang.String> requestTemplates)
Sets request templates.- Parameters:
requestTemplates
- Map of MIME types to the corresponding template.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getRequestTemplates()
-
removeRequestTemplate
public IntegrationTrait.Builder removeRequestTemplate(java.lang.String mimeType)
Removes a request template by MIME type.- Parameters:
mimeType
- MIME type to remove.- Returns:
- Returns the builder.
-
putResponse
public IntegrationTrait.Builder putResponse(java.lang.String statusCodeRegex, IntegrationResponse integrationResponse)
Adds a response for the given response regex.- Parameters:
statusCodeRegex
- Status code regular expression.integrationResponse
- Integration response to set.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getResponses()
-
responses
public IntegrationTrait.Builder responses(java.util.Map<java.lang.String,IntegrationResponse> responses)
Sets responses for the given response regular expressions.- Parameters:
responses
- Map of regular expressions to responses.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getResponses()
-
removeResponse
public IntegrationTrait.Builder removeResponse(java.lang.String statusCodeRegex)
Removes a response by status code regex.- Parameters:
statusCodeRegex
- Status code regular expression to remove.- Returns:
- Returns the builder.
-
-