Class: AWSCDK::APIGateway::HttpIntegration
- Inherits:
-
Integration
- Object
- Integration
- AWSCDK::APIGateway::HttpIntegration
- Defined in:
- api_gateway/http_integration.rb
Overview
You can integrate an API method with an HTTP endpoint using the HTTP proxy integration or the HTTP custom integration,.
With the proxy integration, the setup is simple. You only need to set the HTTP method and the HTTP endpoint URI, according to the backend requirements, if you are not concerned with content encoding or caching.
With the custom integration, the setup is more involved. In addition to the proxy integration setup steps, you need to specify how the incoming request data is mapped to the integration request and how the resulting integration response data is mapped to the method response.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(method) ⇒ AWSCDK::APIGateway::IntegrationConfig
Can be overridden by subclasses to allow the integration to interact with the method being integrated, access the REST API object, method ARNs, etc.
-
#initialize(url, props = nil) ⇒ HttpIntegration
constructor
A new instance of HttpIntegration.
Constructor Details
#initialize(url, props = nil) ⇒ HttpIntegration
Returns a new instance of HttpIntegration.
19 20 21 22 23 24 |
# File 'api_gateway/http_integration.rb', line 19 def initialize(url, props = nil) props = props.is_a?(Hash) ? ::AWSCDK::APIGateway::HttpIntegrationProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(url, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "url") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5IdHRwSW50ZWdyYXRpb25Qcm9wcyJ9")), "props") unless props.nil? Jsii::Object.instance_method(:initialize).bind(self).call(url, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
26 27 28 29 30 |
# File 'api_gateway/http_integration.rb', line 26 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(method) ⇒ AWSCDK::APIGateway::IntegrationConfig
Can be overridden by subclasses to allow the integration to interact with the method being integrated, access the REST API object, method ARNs, etc.
36 37 38 39 |
# File 'api_gateway/http_integration.rb', line 36 def bind(method) Jsii::Type.check_type(method, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBpZ2F0ZXdheS5NZXRob2QifQ==")), "method") jsii_call_method("bind", [method]) end |