Class MockIntegrationTrait.Builder
- java.lang.Object
-
- software.amazon.smithy.model.traits.AbstractTraitBuilder<MockIntegrationTrait,MockIntegrationTrait.Builder>
-
- software.amazon.smithy.aws.apigateway.traits.MockIntegrationTrait.Builder
-
- All Implemented Interfaces:
SmithyBuilder<MockIntegrationTrait>
- Enclosing class:
- MockIntegrationTrait
public static final class MockIntegrationTrait.Builder extends AbstractTraitBuilder<MockIntegrationTrait,MockIntegrationTrait.Builder>
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MockIntegrationTrait
build()
Creates an immutable object that is created from the properties that have been set on the builder.MockIntegrationTrait.Builder
contentHandling(java.lang.String contentHandling)
Set the Request payload encoding conversion types.MockIntegrationTrait.Builder
passThroughBehavior(java.lang.String passThroughBehavior)
Configures the pass through behavior of the integration.MockIntegrationTrait.Builder
putRequestParameter(java.lang.String input, java.lang.String output)
Adds a request parameters.MockIntegrationTrait.Builder
putRequestTemplate(java.lang.String mimeType, java.lang.String template)
Adds a request template.MockIntegrationTrait.Builder
putResponse(java.lang.String statusCodeRegex, IntegrationResponse integrationResponse)
Adds a response for the given response regex.MockIntegrationTrait.Builder
removeRequestParameter(java.lang.String expression)
Remove a request parameter by expression.MockIntegrationTrait.Builder
removeRequestTemplate(java.lang.String mimeType)
Removes a request template by MIME type.MockIntegrationTrait.Builder
removeResponse(java.lang.String statusCodeRegex)
Removes a response by status code regex.MockIntegrationTrait.Builder
requestParameters(java.util.Map<java.lang.String,java.lang.String> requestParameters)
Sets request parameters.MockIntegrationTrait.Builder
requestTemplates(java.util.Map<java.lang.String,java.lang.String> requestTemplates)
Sets request templates.MockIntegrationTrait.Builder
responses(java.util.Map<java.lang.String,IntegrationResponse> responses)
Sets responses for the given response regular expressions.-
Methods inherited from class software.amazon.smithy.model.traits.AbstractTraitBuilder
getSourceLocation, sourceLocation
-
-
-
-
Method Detail
-
build
public MockIntegrationTrait 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
-
passThroughBehavior
public MockIntegrationTrait.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 MockIntegrationTrait.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.
-
putRequestParameter
public MockIntegrationTrait.Builder putRequestParameter(java.lang.String input, java.lang.String output)
Adds a request parameters.- Parameters:
input
- Input request expression.output
- Output request expression.- Returns:
- Returns the builder.
- See Also:
IntegrationTrait.getRequestParameters()
-
requestParameters
public MockIntegrationTrait.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 MockIntegrationTrait.Builder removeRequestParameter(java.lang.String expression)
Remove a request parameter by expression.- Parameters:
expression
- Expression to remove.- Returns:
- Returns the builder.
-
putRequestTemplate
public MockIntegrationTrait.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 MockIntegrationTrait.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 MockIntegrationTrait.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 MockIntegrationTrait.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 MockIntegrationTrait.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 MockIntegrationTrait.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.
-
-