Class: AWSCDK::AppSync::LambdaDataSource
- Inherits:
-
BackedDataSource
- Object
- BackedDataSource
- AWSCDK::AppSync::LambdaDataSource
- Defined in:
- app_sync/lambda_data_source.rb
Overview
An AppSync datasource backed by a Lambda function.
Class Method Summary collapse
- .jsii_overridable_methods ⇒ Object
-
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
Instance Method Summary collapse
-
#api ⇒ AWSCDK::AppSync::IGraphqlAPI
The API this data source is attached to Set the API this data source is attached to.
- #api=(value) ⇒ Object
-
#create_function(id, props) ⇒ AWSCDK::AppSync::AppsyncFunction
creates a new appsync function for this datasource and API using the given properties.
-
#create_resolver(id, props) ⇒ AWSCDK::AppSync::Resolver
creates a new resolver for this datasource and API using the given properties.
-
#ds ⇒ AWSCDK::AppSync::CfnDataSource
the underlying CFN data source resource.
-
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
the principal of the data source to be IGrantable.
-
#initialize(scope, id, props) ⇒ LambdaDataSource
constructor
A new instance of LambdaDataSource.
-
#name ⇒ String
the name of the data source.
-
#node ⇒ Constructs::Node
The tree node.
- #service_role ⇒ AWSCDK::IAM::IRole?
- #service_role=(value) ⇒ Object
-
#to_string ⇒ String
Returns a string representation of this construct.
-
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Constructor Details
#initialize(scope, id, props) ⇒ LambdaDataSource
Returns a new instance of LambdaDataSource.
11 12 13 14 15 16 17 |
# File 'app_sync/lambda_data_source.rb', line 11 def initialize(scope, id, props) props = props.is_a?(Hash) ? ::AWSCDK::AppSync::LambdaDataSourceProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(scope, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLkNvbnN0cnVjdCJ9")), "scope") Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5MYW1iZGFEYXRhU291cmNlUHJvcHMifQ==")), "props") Jsii::Object.instance_method(:initialize).bind(self).call(scope, id, props) end |
Class Method Details
.jsii_overridable_methods ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app_sync/lambda_data_source.rb', line 19 def self.jsii_overridable_methods { :node => { kind: :property, name: "node", is_optional: false }, :ds => { kind: :property, name: "ds", is_optional: false }, :name => { kind: :property, name: "name", is_optional: false }, :api => { kind: :property, name: "api", is_optional: false }, :service_role => { kind: :property, name: "serviceRole", is_optional: true }, :grant_principal => { kind: :property, name: "grantPrincipal", is_optional: false }, :to_string => { kind: :method, name: "toString", is_optional: false }, :with => { kind: :method, name: "with", is_optional: false }, :create_function => { kind: :method, name: "createFunction", is_optional: false }, :create_resolver => { kind: :method, name: "createResolver", is_optional: false }, } end |
.PROPERTY_INJECTION_ID ⇒ String
Uniquely identifies this class.
87 88 89 |
# File 'app_sync/lambda_data_source.rb', line 87 def self.PROPERTY_INJECTION_ID() Jsii::Kernel.instance.get_static("aws-cdk-lib.aws_appsync.LambdaDataSource", "PROPERTY_INJECTION_ID") end |
Instance Method Details
#api ⇒ AWSCDK::AppSync::IGraphqlAPI
The API this data source is attached to Set the API this data source is attached to.
58 59 60 |
# File 'app_sync/lambda_data_source.rb', line 58 def api() jsii_get_property("api") end |
#api=(value) ⇒ Object
62 63 64 65 |
# File 'app_sync/lambda_data_source.rb', line 62 def api=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5JR3JhcGhxbEFwaSJ9")), "api") jsii_set_property("api", value) end |
#create_function(id, props) ⇒ AWSCDK::AppSync::AppsyncFunction
creates a new appsync function for this datasource and API using the given properties.
119 120 121 122 123 124 |
# File 'app_sync/lambda_data_source.rb', line 119 def create_function(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::AppSync::BaseAppsyncFunctionProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5CYXNlQXBwc3luY0Z1bmN0aW9uUHJvcHMifQ==")), "props") jsii_call_method("createFunction", [id, props]) end |
#create_resolver(id, props) ⇒ AWSCDK::AppSync::Resolver
creates a new resolver for this datasource and API using the given properties.
131 132 133 134 135 136 |
# File 'app_sync/lambda_data_source.rb', line 131 def create_resolver(id, props) Jsii::Type.check_type(id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "id") props = props.is_a?(Hash) ? ::AWSCDK::AppSync::BaseResolverProps.new(**props.transform_keys(&:to_sym)) : props Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5CYXNlUmVzb2x2ZXJQcm9wcyJ9")), "props") jsii_call_method("createResolver", [id, props]) end |
#ds ⇒ AWSCDK::AppSync::CfnDataSource
the underlying CFN data source resource.
44 45 46 |
# File 'app_sync/lambda_data_source.rb', line 44 def ds() jsii_get_property("ds") end |
#grant_principal ⇒ AWSCDK::IAM::IPrincipal
the principal of the data source to be IGrantable.
80 81 82 |
# File 'app_sync/lambda_data_source.rb', line 80 def grant_principal() jsii_get_property("grantPrincipal") end |
#name ⇒ String
the name of the data source.
51 52 53 |
# File 'app_sync/lambda_data_source.rb', line 51 def name() jsii_get_property("name") end |
#node ⇒ Constructs::Node
The tree node.
37 38 39 |
# File 'app_sync/lambda_data_source.rb', line 37 def node() jsii_get_property("node") end |
#service_role ⇒ AWSCDK::IAM::IRole?
68 69 70 |
# File 'app_sync/lambda_data_source.rb', line 68 def service_role() jsii_get_property("serviceRole") end |
#service_role=(value) ⇒ Object
72 73 74 75 |
# File 'app_sync/lambda_data_source.rb', line 72 def service_role=(value) Jsii::Type.check_type(value, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "serviceRole") unless value.nil? jsii_set_property("serviceRole", value) end |
#to_string ⇒ String
Returns a string representation of this construct.
94 95 96 |
# File 'app_sync/lambda_data_source.rb', line 94 def to_string() jsii_call_method("toString", []) end |
#with(*mixins) ⇒ Constructs::IConstruct
Applies one or more mixins to this construct.
Mixins are applied in order. The list of constructs is captured at the
start of the call, so constructs added by a mixin will not be visited.
Use multiple with() calls if subsequent mixins should apply to added
constructs.
107 108 109 110 111 112 |
# File 'app_sync/lambda_data_source.rb', line 107 def with(*mixins) mixins.each_with_index do |item, index| Jsii::Type.check_type(item, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJjb25zdHJ1Y3RzLklNaXhpbiJ9")), "mixins[#{index}]") end jsii_call_method("with", [*mixins]) end |