Class: AWSCDK::AppSync::BaseResolverProps
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::AppSync::BaseResolverProps
- Defined in:
- app_sync/base_resolver_props.rb
Overview
Basic properties for an AppSync resolver.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#caching_config ⇒ AWSCDK::AppSync::CachingConfig?
readonly
The caching configuration for this resolver.
-
#code ⇒ AWSCDK::AppSync::Code?
readonly
The function code.
-
#field_name ⇒ String
readonly
name of the GraphQL field in the given type this resolver is attached to.
-
#max_batch_size ⇒ Numeric?
readonly
The maximum number of elements per batch, when using batch invoke.
-
#metrics_config ⇒ AWSCDK::AppSync::ResolverMetricsConfig?
readonly
Whether to enable enhanced metrics Value will be ignored, if
enhancedMetricsConfig.resolverLevelMetricsBehavioron AppSync GraphqlApi construct is set toFULL_REQUEST_RESOLVER_METRICS. -
#pipeline_config ⇒ Array<AWSCDK::Interfaces::AWSAppsync::IFunctionConfigurationRef>?
readonly
configuration of the pipeline resolver.
-
#request_mapping_template ⇒ AWSCDK::AppSync::MappingTemplate?
readonly
The request mapping template for this resolver.
-
#response_mapping_template ⇒ AWSCDK::AppSync::MappingTemplate?
readonly
The response mapping template for this resolver.
-
#runtime ⇒ AWSCDK::AppSync::FunctionRuntime?
readonly
The functions runtime.
-
#type_name ⇒ String
readonly
name of the GraphQL type this resolver is attached to.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(field_name:, type_name:, caching_config: nil, code: nil, max_batch_size: nil, metrics_config: nil, pipeline_config: nil, request_mapping_template: nil, response_mapping_template: nil, runtime: nil) ⇒ BaseResolverProps
constructor
A new instance of BaseResolverProps.
- #to_jsii ⇒ Object
Constructor Details
#initialize(field_name:, type_name:, caching_config: nil, code: nil, max_batch_size: nil, metrics_config: nil, pipeline_config: nil, request_mapping_template: nil, response_mapping_template: nil, runtime: nil) ⇒ BaseResolverProps
Returns a new instance of BaseResolverProps.
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'app_sync/base_resolver_props.rb', line 17 def initialize(field_name:, type_name:, caching_config: nil, code: nil, max_batch_size: nil, metrics_config: nil, pipeline_config: nil, request_mapping_template: nil, response_mapping_template: nil, runtime: nil) @field_name = field_name Jsii::Type.check_type(@field_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "fieldName") @type_name = type_name Jsii::Type.check_type(@type_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "typeName") @caching_config = caching_config.is_a?(Hash) ? ::AWSCDK::AppSync::CachingConfig.new(**caching_config.transform_keys(&:to_sym)) : caching_config Jsii::Type.check_type(@caching_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5DYWNoaW5nQ29uZmlnIn0=")), "cachingConfig") unless @caching_config.nil? @code = code Jsii::Type.check_type(@code, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5Db2RlIn0=")), "code") unless @code.nil? @max_batch_size = max_batch_size Jsii::Type.check_type(@max_batch_size, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "maxBatchSize") unless @max_batch_size.nil? @metrics_config = metrics_config Jsii::Type.check_type(@metrics_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5SZXNvbHZlck1ldHJpY3NDb25maWcifQ==")), "metricsConfig") unless @metrics_config.nil? @pipeline_config = pipeline_config Jsii::Type.check_type(@pipeline_config, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLmludGVyZmFjZXMuYXdzX2FwcHN5bmMuSUZ1bmN0aW9uQ29uZmlndXJhdGlvblJlZiJ9LCJraW5kIjoiYXJyYXkifX0=")), "pipelineConfig") unless @pipeline_config.nil? @request_mapping_template = request_mapping_template Jsii::Type.check_type(@request_mapping_template, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5NYXBwaW5nVGVtcGxhdGUifQ==")), "requestMappingTemplate") unless @request_mapping_template.nil? @response_mapping_template = response_mapping_template Jsii::Type.check_type(@response_mapping_template, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5NYXBwaW5nVGVtcGxhdGUifQ==")), "responseMappingTemplate") unless @response_mapping_template.nil? @runtime = runtime Jsii::Type.check_type(@runtime, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5GdW5jdGlvblJ1bnRpbWUifQ==")), "runtime") unless @runtime.nil? end |
Instance Attribute Details
#caching_config ⇒ AWSCDK::AppSync::CachingConfig? (readonly)
Default: - No caching configuration
The caching configuration for this resolver.
52 53 54 |
# File 'app_sync/base_resolver_props.rb', line 52 def caching_config @caching_config end |
#code ⇒ AWSCDK::AppSync::Code? (readonly)
Default: - no code is used
The function code.
57 58 59 |
# File 'app_sync/base_resolver_props.rb', line 57 def code @code end |
#field_name ⇒ String (readonly)
name of the GraphQL field in the given type this resolver is attached to.
43 44 45 |
# File 'app_sync/base_resolver_props.rb', line 43 def field_name @field_name end |
#max_batch_size ⇒ Numeric? (readonly)
Default: - No max batch size
The maximum number of elements per batch, when using batch invoke.
62 63 64 |
# File 'app_sync/base_resolver_props.rb', line 62 def max_batch_size @max_batch_size end |
#metrics_config ⇒ AWSCDK::AppSync::ResolverMetricsConfig? (readonly)
Default: - no metrics configuration
Whether to enable enhanced metrics Value will be ignored, if enhancedMetricsConfig.resolverLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_RESOLVER_METRICS.
67 68 69 |
# File 'app_sync/base_resolver_props.rb', line 67 def metrics_config @metrics_config end |
#pipeline_config ⇒ Array<AWSCDK::Interfaces::AWSAppsync::IFunctionConfigurationRef>? (readonly)
Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit
configuration of the pipeline resolver.
72 73 74 |
# File 'app_sync/base_resolver_props.rb', line 72 def pipeline_config @pipeline_config end |
#request_mapping_template ⇒ AWSCDK::AppSync::MappingTemplate? (readonly)
Default: - No mapping template
The request mapping template for this resolver.
77 78 79 |
# File 'app_sync/base_resolver_props.rb', line 77 def request_mapping_template @request_mapping_template end |
#response_mapping_template ⇒ AWSCDK::AppSync::MappingTemplate? (readonly)
Default: - No mapping template
The response mapping template for this resolver.
82 83 84 |
# File 'app_sync/base_resolver_props.rb', line 82 def response_mapping_template @response_mapping_template end |
#runtime ⇒ AWSCDK::AppSync::FunctionRuntime? (readonly)
Default: - no function runtime, VTL mapping templates used
The functions runtime.
87 88 89 |
# File 'app_sync/base_resolver_props.rb', line 87 def runtime @runtime end |
#type_name ⇒ String (readonly)
name of the GraphQL type this resolver is attached to.
47 48 49 |
# File 'app_sync/base_resolver_props.rb', line 47 def type_name @type_name end |
Class Method Details
.jsii_properties ⇒ Object
89 90 91 92 93 94 95 96 97 98 99 100 101 102 |
# File 'app_sync/base_resolver_props.rb', line 89 def self.jsii_properties { :field_name => "fieldName", :type_name => "typeName", :caching_config => "cachingConfig", :code => "code", :max_batch_size => "maxBatchSize", :metrics_config => "metricsConfig", :pipeline_config => "pipelineConfig", :request_mapping_template => "requestMappingTemplate", :response_mapping_template => "responseMappingTemplate", :runtime => "runtime", } end |
Instance Method Details
#to_jsii ⇒ Object
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'app_sync/base_resolver_props.rb', line 104 def to_jsii result = {} result.merge!({ "fieldName" => @field_name, "typeName" => @type_name, "cachingConfig" => @caching_config, "code" => @code, "maxBatchSize" => @max_batch_size, "metricsConfig" => @metrics_config, "pipelineConfig" => @pipeline_config, "requestMappingTemplate" => @request_mapping_template, "responseMappingTemplate" => @response_mapping_template, "runtime" => @runtime, }) result.compact end |