Class: AWSCDK::APIGatewayv2::CfnIntegrationResponseProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gatewayv2/cfn_integration_response_props.rb

Overview

Properties for defining a CfnIntegrationResponse.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_id:, integration_id:, integration_response_key:, content_handling_strategy: nil, response_parameters: nil, response_templates: nil, template_selection_expression: nil) ⇒ CfnIntegrationResponseProps

Returns a new instance of CfnIntegrationResponseProps.

Parameters:

  • api_id (String, AWSCDK::Interfaces::AWSApigatewayv2::IAPIRef)

    The API identifier.

  • integration_id (String, AWSCDK::Interfaces::AWSApigatewayv2::IIntegrationRef)

    The integration ID.

  • integration_response_key (String)

    The integration response key.

  • content_handling_strategy (String, nil) (defaults to: nil)

    Supported only for WebSocket APIs.

  • response_parameters (Object, nil) (defaults to: nil)

    A key-value map specifying response parameters that are passed to the method response from the backend.

  • response_templates (Object, nil) (defaults to: nil)

    The collection of response templates for the integration response as a string-to-string map of key-value pairs.

  • template_selection_expression (String, nil) (defaults to: nil)

    The template selection expression for the integration response.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 16

def initialize(api_id:, integration_id:, integration_response_key:, content_handling_strategy: nil, response_parameters: nil, response_templates: nil, template_selection_expression: nil)
  @api_id = api_id
  Jsii::Type.check_type(@api_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5djIuSUFwaVJlZiJ9XX19")), "apiId")
  @integration_id = integration_id
  Jsii::Type.check_type(@integration_id, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoic3RyaW5nIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5djIuSUludGVncmF0aW9uUmVmIn1dfX0=")), "integrationId")
  @integration_response_key = integration_response_key
  Jsii::Type.check_type(@integration_response_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "integrationResponseKey")
  @content_handling_strategy = content_handling_strategy
  Jsii::Type.check_type(@content_handling_strategy, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "contentHandlingStrategy") unless @content_handling_strategy.nil?
  @response_parameters = response_parameters
  Jsii::Type.check_type(@response_parameters, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "responseParameters") unless @response_parameters.nil?
  @response_templates = response_templates
  Jsii::Type.check_type(@response_templates, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "responseTemplates") unless @response_templates.nil?
  @template_selection_expression = template_selection_expression
  Jsii::Type.check_type(@template_selection_expression, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "templateSelectionExpression") unless @template_selection_expression.nil?
end

Instance Attribute Details

#api_idString, AWSCDK::Interfaces::AWSApigatewayv2::IAPIRef (readonly)

The API identifier.



37
38
39
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 37

def api_id
  @api_id
end

#content_handling_strategyString? (readonly)

Supported only for WebSocket APIs.

Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT , with the following behaviors:

CONVERT_TO_BINARY : Converts a response payload from a Base64-encoded string to the corresponding binary blob.

CONVERT_TO_TEXT : Converts a response payload from a binary blob to a Base64-encoded string.

If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.



60
61
62
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 60

def content_handling_strategy
  @content_handling_strategy
end

#integration_idString, AWSCDK::Interfaces::AWSApigatewayv2::IIntegrationRef (readonly)

The integration ID.



42
43
44
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 42

def integration_id
  @integration_id
end

#integration_response_keyString (readonly)

The integration response key.



47
48
49
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 47

def integration_response_key
  @integration_response_key
end

#response_parametersObject? (readonly)

A key-value map specifying response parameters that are passed to the method response from the backend.

The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header. *{name}* , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header. *{name}* or integration.response.body. *{JSON-expression}* , where *{name}* is a valid and unique response header name and *{JSON-expression}* is a valid JSON expression without the $ prefix.



67
68
69
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 67

def response_parameters
  @response_parameters
end

#response_templatesObject? (readonly)

The collection of response templates for the integration response as a string-to-string map of key-value pairs.

Response templates are represented as a key/value map, with a content-type as the key and a template as the value.



74
75
76
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 74

def response_templates
  @response_templates
end

#template_selection_expressionString? (readonly)

The template selection expression for the integration response.

Supported only for WebSocket APIs.



81
82
83
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 81

def template_selection_expression
  @template_selection_expression
end

Class Method Details

.jsii_propertiesObject



83
84
85
86
87
88
89
90
91
92
93
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 83

def self.jsii_properties
  {
    :api_id => "apiId",
    :integration_id => "integrationId",
    :integration_response_key => "integrationResponseKey",
    :content_handling_strategy => "contentHandlingStrategy",
    :response_parameters => "responseParameters",
    :response_templates => "responseTemplates",
    :template_selection_expression => "templateSelectionExpression",
  }
end

Instance Method Details

#to_jsiiObject



95
96
97
98
99
100
101
102
103
104
105
106
107
# File 'api_gatewayv2/cfn_integration_response_props.rb', line 95

def to_jsii
  result = {}
  result.merge!({
    "apiId" => @api_id,
    "integrationId" => @integration_id,
    "integrationResponseKey" => @integration_response_key,
    "contentHandlingStrategy" => @content_handling_strategy,
    "responseParameters" => @response_parameters,
    "responseTemplates" => @response_templates,
    "templateSelectionExpression" => @template_selection_expression,
  })
  result.compact
end