Class: AWSCDK::APIGateway::AssetAPIDefinition
- Inherits:
-
APIDefinition
- Object
- APIDefinition
- AWSCDK::APIGateway::AssetAPIDefinition
- Defined in:
- api_gateway/asset_api_definition.rb
Overview
OpenAPI specification from a local file.
Class Method Summary collapse
Instance Method Summary collapse
-
#bind(scope) ⇒ AWSCDK::APIGateway::APIDefinitionConfig
Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun.
-
#bind_after_create(scope, rest_api) ⇒ void
Called after the CFN RestApi resource has been created to allow the Api Definition to bind to it.
-
#initialize(path, options = nil) ⇒ AssetAPIDefinition
constructor
A new instance of AssetAPIDefinition.
Constructor Details
#initialize(path, options = nil) ⇒ AssetAPIDefinition
Returns a new instance of AssetAPIDefinition.
10 11 12 13 14 15 |
# File 'api_gateway/asset_api_definition.rb', line 10 def initialize(path, = nil) = .is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless .nil? Jsii::Object.instance_method(:initialize).bind(self).call(path, ) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
17 18 19 20 21 22 |
# File 'api_gateway/asset_api_definition.rb', line 17 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, :bind_after_create => { kind: :method, name: "bindAfterCreate", is_optional: false }, } end |
Instance Method Details
#bind(scope) ⇒ AWSCDK::APIGateway::APIDefinitionConfig
Called when the specification is initialized to allow this object to bind to the stack, add resources and have fun.
28 29 30 31 |
# File 'api_gateway/asset_api_definition.rb', line 28 def bind(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("bind", [scope]) end |
#bind_after_create(scope, rest_api) ⇒ void
This method returns an undefined value.
Called after the CFN RestApi resource has been created to allow the Api Definition to bind to it.
Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.
41 42 43 44 45 |
# File 'api_gateway/asset_api_definition.rb', line 41 def bind_after_create(scope, rest_api) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(rest_api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcGlnYXRld2F5LklSZXN0QXBpUmVmIn0=")), "restApi") jsii_call_method("bindAfterCreate", [scope, rest_api]) end |