Class: AWSCDK::APIGateway::GatewayResponseOptions
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGateway::GatewayResponseOptions
- Defined in:
- api_gateway/gateway_response_options.rb
Overview
Options to add gateway response.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#response_headers ⇒ Hash{String => String}?
readonly
Custom headers parameters for response.
-
#status_code ⇒ String?
readonly
Http status code for response.
-
#templates ⇒ Hash{String => String}?
readonly
Custom templates to get mapped as response.
-
#type ⇒ AWSCDK::APIGateway::ResponseType
readonly
Response type to associate with gateway response.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(type:, response_headers: nil, status_code: nil, templates: nil) ⇒ GatewayResponseOptions
constructor
A new instance of GatewayResponseOptions.
- #to_jsii ⇒ Object
Constructor Details
#initialize(type:, response_headers: nil, status_code: nil, templates: nil) ⇒ GatewayResponseOptions
Returns a new instance of GatewayResponseOptions.
11 12 13 14 15 16 17 18 19 20 |
# File 'api_gateway/gateway_response_options.rb', line 11 def initialize(type:, response_headers: nil, status_code: nil, templates: nil) @type = type Jsii::Type.check_type(@type, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5SZXNwb25zZVR5cGUifQ==")), "type") @response_headers = response_headers Jsii::Type.check_type(@response_headers, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "responseHeaders") unless @response_headers.nil? @status_code = status_code Jsii::Type.check_type(@status_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statusCode") unless @status_code.nil? @templates = templates Jsii::Type.check_type(@templates, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoibWFwIn19")), "templates") unless @templates.nil? end |
Instance Attribute Details
#response_headers ⇒ Hash{String => String}? (readonly)
Note:
Default: - no headers
Custom headers parameters for response.
31 32 33 |
# File 'api_gateway/gateway_response_options.rb', line 31 def response_headers @response_headers end |
#status_code ⇒ String? (readonly)
Note:
Default: - standard http status code for the response type.
Http status code for response.
36 37 38 |
# File 'api_gateway/gateway_response_options.rb', line 36 def status_code @status_code end |
#templates ⇒ Hash{String => String}? (readonly)
Note:
Default: - Response from api will be returned without applying any transformation.
Custom templates to get mapped as response.
41 42 43 |
# File 'api_gateway/gateway_response_options.rb', line 41 def templates @templates end |
#type ⇒ AWSCDK::APIGateway::ResponseType (readonly)
Response type to associate with gateway response.
26 27 28 |
# File 'api_gateway/gateway_response_options.rb', line 26 def type @type end |
Class Method Details
.jsii_properties ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'api_gateway/gateway_response_options.rb', line 43 def self.jsii_properties { :type => "type", :response_headers => "responseHeaders", :status_code => "statusCode", :templates => "templates", } end |
Instance Method Details
#to_jsii ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'api_gateway/gateway_response_options.rb', line 52 def to_jsii result = {} result.merge!({ "type" => @type, "responseHeaders" => @response_headers, "statusCode" => @status_code, "templates" => @templates, }) result.compact end |