Class: AWSCDK::APIGatewayv2Integrations::WebSocketMockIntegrationProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gatewayv2_integrations/web_socket_mock_integration_props.rb

Overview

Props for Mock type integration for a WebSocket Api.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(request_templates: nil, template_selection_expression: nil) ⇒ WebSocketMockIntegrationProps

Returns a new instance of WebSocketMockIntegrationProps.

Parameters:

  • request_templates (Hash{String => String}, nil) (defaults to: nil)

    A map of Apache Velocity templates that are applied on the request payload.

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

    The template selection expression for the integration.



9
10
11
12
13
14
# File 'api_gatewayv2_integrations/web_socket_mock_integration_props.rb', line 9

def initialize(request_templates: nil, template_selection_expression: nil)
  @request_templates = request_templates
  Jsii::Type.check_type(@request_templates, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "requestTemplates") unless @request_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

#request_templatesHash{String => String}? (readonly)

Note:

Default: - No request template provided to the integration.

A map of Apache Velocity templates that are applied on the request payload.

  { "application/json": "{ \"statusCode\": 200 }" }


25
26
27
# File 'api_gatewayv2_integrations/web_socket_mock_integration_props.rb', line 25

def request_templates
  @request_templates
end

#template_selection_expressionString? (readonly)

Note:

Default: - No template selection expression provided.

The template selection expression for the integration.

Returns:

  • (String, nil)


30
31
32
# File 'api_gatewayv2_integrations/web_socket_mock_integration_props.rb', line 30

def template_selection_expression
  @template_selection_expression
end

Class Method Details

.jsii_propertiesObject



32
33
34
35
36
37
# File 'api_gatewayv2_integrations/web_socket_mock_integration_props.rb', line 32

def self.jsii_properties
  {
    :request_templates => "requestTemplates",
    :template_selection_expression => "templateSelectionExpression",
  }
end

Instance Method Details

#to_jsiiObject



39
40
41
42
43
44
45
46
# File 'api_gatewayv2_integrations/web_socket_mock_integration_props.rb', line 39

def to_jsii
  result = {}
  result.merge!({
    "requestTemplates" => @request_templates,
    "templateSelectionExpression" => @template_selection_expression,
  })
  result.compact
end