Class: AWSCDK::APIGateway::MethodProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::APIGateway::MethodProps
- Defined in:
- api_gateway/method_props.rb
Instance Attribute Summary collapse
-
#http_method ⇒ String
readonly
The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.
-
#integration ⇒ AWSCDK::APIGateway::Integration?
readonly
The backend system that the method calls when it receives a request.
-
#options ⇒ AWSCDK::APIGateway::MethodOptions?
readonly
Method options.
-
#resource ⇒ AWSCDK::APIGateway::IResource
readonly
The resource this method is associated with.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_method:, resource:, integration: nil, options: nil) ⇒ MethodProps
constructor
A new instance of MethodProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(http_method:, resource:, integration: nil, options: nil) ⇒ MethodProps
Returns a new instance of MethodProps.
10 11 12 13 14 15 16 17 18 19 |
# File 'api_gateway/method_props.rb', line 10 def initialize(http_method:, resource:, integration: nil, options: nil) @http_method = http_method Jsii::Type.check_type(@http_method, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpMethod") @resource = resource Jsii::Type.check_type(@resource, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JUmVzb3VyY2UifQ==")), "resource") @integration = integration Jsii::Type.check_type(@integration, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5JbnRlZ3JhdGlvbiJ9")), "integration") unless @integration.nil? @options = .is_a?(Hash) ? ::AWSCDK::APIGateway::MethodOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(@options, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2RPcHRpb25zIn0=")), "options") unless @options.nil? end |
Instance Attribute Details
#http_method ⇒ String (readonly)
The HTTP method ("GET", "POST", "PUT", ...) that clients use to call this method.
24 25 26 |
# File 'api_gateway/method_props.rb', line 24 def http_method @http_method end |
#integration ⇒ AWSCDK::APIGateway::Integration? (readonly)
Note:
Default: - a new MockIntegration.
The backend system that the method calls when it receives a request.
36 37 38 |
# File 'api_gateway/method_props.rb', line 36 def integration @integration end |
#options ⇒ AWSCDK::APIGateway::MethodOptions? (readonly)
Note:
Default: - No options.
Method options.
41 42 43 |
# File 'api_gateway/method_props.rb', line 41 def @options end |
#resource ⇒ AWSCDK::APIGateway::IResource (readonly)
The resource this method is associated with.
For root resource methods,
specify the RestApi object.
31 32 33 |
# File 'api_gateway/method_props.rb', line 31 def resource @resource end |
Class Method Details
.jsii_properties ⇒ Object
43 44 45 46 47 48 49 50 |
# File 'api_gateway/method_props.rb', line 43 def self.jsii_properties { :http_method => "httpMethod", :resource => "resource", :integration => "integration", :options => "options", } end |
Instance Method Details
#to_jsii ⇒ Object
52 53 54 55 56 57 58 59 60 61 |
# File 'api_gateway/method_props.rb', line 52 def to_jsii result = {} result.merge!({ "httpMethod" => @http_method, "resource" => @resource, "integration" => @integration, "options" => @options, }) result.compact end |