Class: AWSCDK::APIGateway::IntegrationOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
api_gateway/integration_options.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cache_key_parameters: nil, cache_namespace: nil, connection_type: nil, content_handling: nil, credentials_passthrough: nil, credentials_role: nil, integration_responses: nil, passthrough_behavior: nil, request_parameters: nil, request_templates: nil, response_transfer_mode: nil, timeout: nil, vpc_link: nil) ⇒ IntegrationOptions

Returns a new instance of IntegrationOptions.

Parameters:

  • cache_key_parameters (Array<String>, nil) (defaults to: nil)

    A list of request parameters whose values are to be cached.

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

    An API-specific tag group of related cached parameters.

  • connection_type (AWSCDK::APIGateway::ConnectionType, nil) (defaults to: nil)

    The type of network connection to the integration endpoint.

  • content_handling (AWSCDK::APIGateway::ContentHandling, nil) (defaults to: nil)

    Specifies how to handle request payload content type conversions.

  • credentials_passthrough (Boolean, nil) (defaults to: nil)

    Requires that the caller's identity be passed through from the request.

  • credentials_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    An IAM role that API Gateway assumes.

  • integration_responses (Array<AWSCDK::APIGateway::IntegrationResponse>, nil) (defaults to: nil)

    The response that API Gateway provides after a method's backend completes processing a request.

  • passthrough_behavior (AWSCDK::APIGateway::PassthroughBehavior, nil) (defaults to: nil)

    Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource.

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

    The request parameters that API Gateway sends with the backend request.

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

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

  • response_transfer_mode (AWSCDK::APIGateway::ResponseTransferMode, nil) (defaults to: nil)

    The response transfer mode for the integration.

  • timeout (AWSCDK::Duration, nil) (defaults to: nil)

    The maximum amount of time an integration will run before it returns without a response.

  • vpc_link (AWSCDK::APIGateway::IVPCLink, nil) (defaults to: nil)

    The VpcLink used for the integration.



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'api_gateway/integration_options.rb', line 19

def initialize(cache_key_parameters: nil, cache_namespace: nil, connection_type: nil, content_handling: nil, credentials_passthrough: nil, credentials_role: nil, integration_responses: nil, passthrough_behavior: nil, request_parameters: nil, request_templates: nil, response_transfer_mode: nil, timeout: nil, vpc_link: nil)
  @cache_key_parameters = cache_key_parameters
  Jsii::Type.check_type(@cache_key_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "cacheKeyParameters") unless @cache_key_parameters.nil?
  @cache_namespace = cache_namespace
  Jsii::Type.check_type(@cache_namespace, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "cacheNamespace") unless @cache_namespace.nil?
  @connection_type = connection_type
  Jsii::Type.check_type(@connection_type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Db25uZWN0aW9uVHlwZSJ9")), "connectionType") unless @connection_type.nil?
  @content_handling = content_handling
  Jsii::Type.check_type(@content_handling, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5Db250ZW50SGFuZGxpbmcifQ==")), "contentHandling") unless @content_handling.nil?
  @credentials_passthrough = credentials_passthrough
  Jsii::Type.check_type(@credentials_passthrough, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJib29sZWFuIn0=")), "credentialsPassthrough") unless @credentials_passthrough.nil?
  @credentials_role = credentials_role
  Jsii::Type.check_type(@credentials_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "credentialsRole") unless @credentials_role.nil?
  @integration_responses = integration_responses.is_a?(Array) ? integration_responses.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::APIGateway::IntegrationResponse.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : integration_responses
  Jsii::Type.check_type(@integration_responses, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LkludGVncmF0aW9uUmVzcG9uc2UifSwia2luZCI6ImFycmF5In19")), "integrationResponses") unless @integration_responses.nil?
  @passthrough_behavior = passthrough_behavior
  Jsii::Type.check_type(@passthrough_behavior, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5QYXNzdGhyb3VnaEJlaGF2aW9yIn0=")), "passthroughBehavior") unless @passthrough_behavior.nil?
  @request_parameters = request_parameters
  Jsii::Type.check_type(@request_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "requestParameters") unless @request_parameters.nil?
  @request_templates = request_templates
  Jsii::Type.check_type(@request_templates, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "requestTemplates") unless @request_templates.nil?
  @response_transfer_mode = response_transfer_mode
  Jsii::Type.check_type(@response_transfer_mode, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5SZXNwb25zZVRyYW5zZmVyTW9kZSJ9")), "responseTransferMode") unless @response_transfer_mode.nil?
  @timeout = timeout
  Jsii::Type.check_type(@timeout, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5EdXJhdGlvbiJ9")), "timeout") unless @timeout.nil?
  @vpc_link = vpc_link
  Jsii::Type.check_type(@vpc_link, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JVnBjTGluayJ9")), "vpcLink") unless @vpc_link.nil?
end

Instance Attribute Details

#cache_key_parametersArray<String>? (readonly)

A list of request parameters whose values are to be cached.

It determines request parameters that will make it into the cache key.

Returns:

  • (Array<String>, nil)


54
55
56
# File 'api_gateway/integration_options.rb', line 54

def cache_key_parameters
  @cache_key_parameters
end

#cache_namespaceString? (readonly)

An API-specific tag group of related cached parameters.

Returns:

  • (String, nil)


58
59
60
# File 'api_gateway/integration_options.rb', line 58

def cache_namespace
  @cache_namespace
end

#connection_typeAWSCDK::APIGateway::ConnectionType? (readonly)

Note:

Default: - ConnectionType.VPC_LINK if vpcLink property is configured; ConnectionType.Internet otherwise.

The type of network connection to the integration endpoint.



63
64
65
# File 'api_gateway/integration_options.rb', line 63

def connection_type
  @connection_type
end

#content_handlingAWSCDK::APIGateway::ContentHandling? (readonly)

Note:

Default: none if this property isn't defined, the request payload is passed through from the method request to the integration request without modification, provided that the passthroughBehaviors property is configured to support payload pass-through.

Specifies how to handle request payload content type conversions.



68
69
70
# File 'api_gateway/integration_options.rb', line 68

def content_handling
  @content_handling
end

#credentials_passthroughBoolean? (readonly)

Note:

Default: Caller identity is not passed through

Requires that the caller's identity be passed through from the request.

Returns:

  • (Boolean, nil)


73
74
75
# File 'api_gateway/integration_options.rb', line 73

def credentials_passthrough
  @credentials_passthrough
end

#credentials_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: A role is not assumed

An IAM role that API Gateway assumes.

Mutually exclusive with credentials_pass_through.

Returns:



80
81
82
# File 'api_gateway/integration_options.rb', line 80

def credentials_role
  @credentials_role
end

#integration_responsesArray<AWSCDK::APIGateway::IntegrationResponse>? (readonly)

The response that API Gateway provides after a method's backend completes processing a request.

API Gateway intercepts the response from the backend so that you can control how API Gateway surfaces backend responses. For example, you can map the backend status codes to codes that you define.



89
90
91
# File 'api_gateway/integration_options.rb', line 89

def integration_responses
  @integration_responses
end

#passthrough_behaviorAWSCDK::APIGateway::PassthroughBehavior? (readonly)

Specifies the pass-through behavior for incoming requests based on the Content-Type header in the request, and the available mapping templates specified as the requestTemplates property on the Integration resource.

There are three valid values: WHEN_NO_MATCH, WHEN_NO_TEMPLATES, and NEVER.



96
97
98
# File 'api_gateway/integration_options.rb', line 96

def passthrough_behavior
  @passthrough_behavior
end

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

The request parameters that API Gateway sends with the backend request.

Specify request parameters as key-value pairs (string-to-string mappings), with a destination as the key and a source as the value.

Specify the destination by using the following pattern integration.request.location.name, where location is querystring, path, or header, and name is a valid, unique parameter name.

The source must be an existing method request parameter or a static value. You must enclose static values in single quotation marks and pre-encode these values based on their destination in the request.

Returns:

  • (Hash{String => String}, nil)


111
112
113
# File 'api_gateway/integration_options.rb', line 111

def request_parameters
  @request_parameters
end

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

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

The template that API Gateway uses is based on the value of the Content-Type header that's sent by the client. The content type value is the key, and the template is the value (specified as a string), such as the following snippet:

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


125
126
127
# File 'api_gateway/integration_options.rb', line 125

def request_templates
  @request_templates
end

#response_transfer_modeAWSCDK::APIGateway::ResponseTransferMode? (readonly)

Note:

Default: ResponseTransferMode.BUFFERED

The response transfer mode for the integration.

To enable response streaming, set this value to ResponseTransferMode.STREAM.



132
133
134
# File 'api_gateway/integration_options.rb', line 132

def response_transfer_mode
  @response_transfer_mode
end

#timeoutAWSCDK::Duration? (readonly)

Note:

Default: Duration.seconds(29)

The maximum amount of time an integration will run before it returns without a response.

By default, the value must be between 50 milliseconds and 29 seconds. The upper bound can be increased for regional and private Rest APIs only, via a quota increase request for your account. This increase might require a reduction in your account-level throttle quota limit.

See https://docs.aws.amazon.com/apigateway/latest/developerguide/limits.html Amazon API Gateway quotas for more details.

Returns:



144
145
146
# File 'api_gateway/integration_options.rb', line 144

def timeout
  @timeout
end

The VpcLink used for the integration.

Required if connectionType is VPC_LINK



150
151
152
# File 'api_gateway/integration_options.rb', line 150

def vpc_link
  @vpc_link
end

Class Method Details

.jsii_propertiesObject



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
# File 'api_gateway/integration_options.rb', line 152

def self.jsii_properties
  {
    :cache_key_parameters => "cacheKeyParameters",
    :cache_namespace => "cacheNamespace",
    :connection_type => "connectionType",
    :content_handling => "contentHandling",
    :credentials_passthrough => "credentialsPassthrough",
    :credentials_role => "credentialsRole",
    :integration_responses => "integrationResponses",
    :passthrough_behavior => "passthroughBehavior",
    :request_parameters => "requestParameters",
    :request_templates => "requestTemplates",
    :response_transfer_mode => "responseTransferMode",
    :timeout => "timeout",
    :vpc_link => "vpcLink",
  }
end

Instance Method Details

#to_jsiiObject



170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
# File 'api_gateway/integration_options.rb', line 170

def to_jsii
  result = {}
  result.merge!({
    "cacheKeyParameters" => @cache_key_parameters,
    "cacheNamespace" => @cache_namespace,
    "connectionType" => @connection_type,
    "contentHandling" => @content_handling,
    "credentialsPassthrough" => @credentials_passthrough,
    "credentialsRole" => @credentials_role,
    "integrationResponses" => @integration_responses,
    "passthroughBehavior" => @passthrough_behavior,
    "requestParameters" => @request_parameters,
    "requestTemplates" => @request_templates,
    "responseTransferMode" => @response_transfer_mode,
    "timeout" => @timeout,
    "vpcLink" => @vpc_link,
  })
  result.compact
end