Class MockIntegrationTrait
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTrait
-
- software.amazon.smithy.aws.traits.apigateway.MockIntegrationTrait
-
- All Implemented Interfaces:
software.amazon.smithy.model.FromSourceLocation
,software.amazon.smithy.model.node.ToNode
,software.amazon.smithy.model.shapes.ToShapeId
,software.amazon.smithy.model.traits.Trait
,software.amazon.smithy.utils.ToSmithyBuilder<MockIntegrationTrait>
public final class MockIntegrationTrait extends software.amazon.smithy.model.traits.AbstractTrait implements software.amazon.smithy.utils.ToSmithyBuilder<MockIntegrationTrait>
API Gateway mock integration.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MockIntegrationTrait.Builder
static class
MockIntegrationTrait.Provider
-
Field Summary
Fields Modifier and Type Field Description static software.amazon.smithy.model.shapes.ShapeId
ID
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MockIntegrationTrait.Builder
builder()
protected software.amazon.smithy.model.node.ObjectNode
createNode()
java.util.Map<java.lang.String,java.lang.String>
getAllRequestParameters()
Gets the request parameter mappings of the integration.java.util.Map<java.lang.String,java.lang.String>
getAllRequestTemplates()
Gets all request templates of the integration.java.util.Map<java.lang.String,IntegrationResponse>
getAllResponses()
Gets all integration responses.java.util.Optional<java.lang.String>
getPassThroughBehavior()
Gets the pass through behavior of the integration.java.util.Optional<java.lang.String>
getRequestParameter(java.lang.String expression)
Get a specific request parameter by input expression.java.util.Optional<java.lang.String>
getRequestTemplate(java.lang.String mimeType)
Gets a specific request template by MIME type.java.util.Optional<IntegrationResponse>
getResponse(java.lang.String statusCode)
Get a specific integration response by status code expression.MockIntegrationTrait.Builder
toBuilder()
-
-
-
Method Detail
-
builder
public static MockIntegrationTrait.Builder builder()
-
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
-
getAllRequestParameters
public java.util.Map<java.lang.String,java.lang.String> getAllRequestParameters()
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.
-
getAllRequestTemplates
public java.util.Map<java.lang.String,java.lang.String> getAllRequestTemplates()
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.
-
getAllResponses
public java.util.Map<java.lang.String,IntegrationResponse> getAllResponses()
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.
-
createNode
protected software.amazon.smithy.model.node.ObjectNode createNode()
- Specified by:
createNode
in classsoftware.amazon.smithy.model.traits.AbstractTrait
-
toBuilder
public MockIntegrationTrait.Builder toBuilder()
- Specified by:
toBuilder
in interfacesoftware.amazon.smithy.utils.ToSmithyBuilder<MockIntegrationTrait>
-
-