Class MockIntegrationTrait

All Implemented Interfaces:
FromSourceLocation, ToNode, ToShapeId, Trait, ToSmithyBuilder<MockIntegrationTrait>

public final class MockIntegrationTrait extends AbstractTrait implements ToSmithyBuilder<MockIntegrationTrait>
API Gateway mock integration.
  • Field Details

    • ID

      public static final ShapeId ID
  • Method Details

    • builder

      public static MockIntegrationTrait.Builder builder()
    • getPassThroughBehavior

      public Optional<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 the pass through setting.
      See Also:
    • getRequestParameters

      public Map<String,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 the request parameters.
      See Also:
    • getRequestParameter

      public Optional<String> getRequestParameter(String expression)
      Get a specific request parameter by input expression.
      expression - Expression to get.
      Returns the optionally found request parameter.
    • getRequestTemplates

      public Map<String,String> getRequestTemplates()
      Gets all request templates of the integration.
      Returns a map of MIME types to request templates.
      See Also:
    • getRequestTemplate

      public Optional<String> getRequestTemplate(String mimeType)
      Gets a specific request template by MIME type.
      mimeType - MIME type to get.
      Returns the optionally found template.
    • getResponses

      public Map<String,IntegrationResponse> getResponses()
      Gets all integration responses.
      Returns a map of status code regular expressions to responses.
      See Also:
    • getResponse

      public Optional<IntegrationResponse> getResponse(String statusCode)
      Get a specific integration response by status code expression.
      statusCode - Status code regular expression to search for.
      Returns the optionally found response object.
    • getContentHandling

      public Optional<String> getContentHandling()
      Gets the contentHandling property of the integration.
      Returns the contentHandling property.
    • 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 class AbstractTrait
      Returns the trait as a node.
    • toBuilder

      public MockIntegrationTrait.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 interface ToSmithyBuilder<MockIntegrationTrait>
      a builder for type T