Class: AWSCDK::AppSync::Code
- Inherits:
-
Jsii::Object
- Object
- Jsii::Object
- AWSCDK::AppSync::Code
- Defined in:
- app_sync/code.rb
Overview
Represents source code for an AppSync Function or Resolver.
Direct Known Subclasses
Class Method Summary collapse
-
.from_asset(path, options = nil) ⇒ AWSCDK::AppSync::AssetCode
Loads the function code from a local disk path.
-
.from_inline(code) ⇒ AWSCDK::AppSync::InlineCode
Inline code for AppSync function.
- .jsii_overridable_methods ⇒ Object
Instance Method Summary collapse
-
#bind(scope) ⇒ AWSCDK::AppSync::CodeConfig
Bind source code to an AppSync Function or resolver.
-
#initialize ⇒ Code
constructor
A new instance of Code.
Constructor Details
#initialize ⇒ Code
Returns a new instance of Code.
8 9 10 |
# File 'app_sync/code.rb', line 8 def initialize Jsii::Object.instance_method(:initialize).bind(self).call end |
Class Method Details
.from_asset(path, options = nil) ⇒ AWSCDK::AppSync::AssetCode
Loads the function code from a local disk path.
23 24 25 26 27 28 |
# File 'app_sync/code.rb', line 23 def self.from_asset(path, = nil) Jsii::Type.check_type(path, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "path") = .is_a?(Hash) ? ::AWSCDK::S3Assets::AssetOptions.new(**.transform_keys(&:to_sym)) : Jsii::Type.check_type(, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczNfYXNzZXRzLkFzc2V0T3B0aW9ucyJ9")), "options") unless .nil? Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.Code", "fromAsset", [path, ]) end |
.from_inline(code) ⇒ AWSCDK::AppSync::InlineCode
Inline code for AppSync function.
34 35 36 37 |
# File 'app_sync/code.rb', line 34 def self.from_inline(code) Jsii::Type.check_type(code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "code") Jsii::Kernel.instance.call_static("aws-cdk-lib.aws_appsync.Code", "fromInline", [code]) end |
.jsii_overridable_methods ⇒ Object
12 13 14 15 16 |
# File 'app_sync/code.rb', line 12 def self.jsii_overridable_methods { :bind => { kind: :method, name: "bind", is_optional: false }, } end |
Instance Method Details
#bind(scope) ⇒ AWSCDK::AppSync::CodeConfig
Bind source code to an AppSync Function or resolver.
43 44 45 46 |
# File 'app_sync/code.rb', line 43 def bind(scope) Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") jsii_call_method("bind", [scope]) end |