Class: AWSCDK::APIGateway::MethodResponse
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGateway::MethodResponse
- Defined in:
- api_gateway/method_response.rb
Instance Attribute Summary collapse
-
#response_models ⇒ Hash{String => AWSCDK::APIGateway::IModel}?
readonly
The resources used for the response's content type.
-
#response_parameters ⇒ Hash{String => Boolean}?
readonly
Response parameters that API Gateway sends to the client that called a method.
-
#status_code ⇒ String
readonly
The method response's status code, which you map to an IntegrationResponse.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(status_code:, response_models: nil, response_parameters: nil) ⇒ MethodResponse
constructor
A new instance of MethodResponse.
- #to_jsii ⇒ Object
Constructor Details
#initialize(status_code:, response_models: nil, response_parameters: nil) ⇒ MethodResponse
Returns a new instance of MethodResponse.
9 10 11 12 13 14 15 16 |
# File 'api_gateway/method_response.rb', line 9 def initialize(status_code:, response_models: nil, response_parameters: nil) @status_code = status_code Jsii::Type.check_type(@status_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "statusCode") @response_models = response_models Jsii::Type.check_type(@response_models, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmF3c19hcGlnYXRld2F5LklNb2RlbCJ9LCJraW5kIjoibWFwIn19")), "responseModels") unless @response_models.nil? @response_parameters = response_parameters Jsii::Type.check_type(@response_parameters, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6ImJvb2xlYW4ifSwia2luZCI6Im1hcCJ9fQ==")), "responseParameters") unless @response_parameters.nil? end |
Instance Attribute Details
#response_models ⇒ Hash{String => AWSCDK::APIGateway::IModel}? (readonly)
Default: None
The resources used for the response's content type.
Specify response models as key-value pairs (string-to-string maps), with a content type as the key and a Model resource name as the value.
32 33 34 |
# File 'api_gateway/method_response.rb', line 32 def response_models @response_models end |
#response_parameters ⇒ Hash{String => Boolean}? (readonly)
Default: None
Response parameters that API Gateway sends to the client that called a method.
Specify response parameters as key-value pairs (string-to-Boolean maps), with a destination as the key and a Boolean as the value. Specify the destination using the following pattern: method.response.header.name, where the name is a valid, unique header name. The Boolean specifies whether a parameter is required.
42 43 44 |
# File 'api_gateway/method_response.rb', line 42 def response_parameters @response_parameters end |
#status_code ⇒ String (readonly)
The method response's status code, which you map to an IntegrationResponse.
Required.
23 24 25 |
# File 'api_gateway/method_response.rb', line 23 def status_code @status_code end |
Class Method Details
.jsii_properties ⇒ Object
44 45 46 47 48 49 50 |
# File 'api_gateway/method_response.rb', line 44 def self.jsii_properties { :status_code => "statusCode", :response_models => "responseModels", :response_parameters => "responseParameters", } end |
Instance Method Details
#to_jsii ⇒ Object
52 53 54 55 56 57 58 59 60 |
# File 'api_gateway/method_response.rb', line 52 def to_jsii result = {} result.merge!({ "statusCode" => @status_code, "responseModels" => @response_models, "responseParameters" => @response_parameters, }) result.compact end |