Class: AWSCDK::AppSync::ResolverProps

Inherits:
ExtendedResolverProps
  • Object
show all
Defined in:
app_sync/resolver_props.rb

Overview

Additional property for an AppSync resolver for GraphQL API reference.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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, data_source: nil, api:) ⇒ ResolverProps

Returns a new instance of ResolverProps.

Parameters:



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'app_sync/resolver_props.rb', line 19

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, data_source: nil, api:)
  @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?
  @data_source = data_source
  Jsii::Type.check_type(@data_source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5CYXNlRGF0YVNvdXJjZSJ9")), "dataSource") unless @data_source.nil?
  @api = api
  Jsii::Type.check_type(@api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5JR3JhcGhxbEFwaSJ9")), "api")
end

Instance Attribute Details

#apiAWSCDK::AppSync::IGraphqlAPI (readonly)

The API this resolver is attached to.



102
103
104
# File 'app_sync/resolver_props.rb', line 102

def api
  @api
end

#caching_configAWSCDK::AppSync::CachingConfig? (readonly)

Note:

Default: - No caching configuration

The caching configuration for this resolver.



58
59
60
# File 'app_sync/resolver_props.rb', line 58

def caching_config
  @caching_config
end

#codeAWSCDK::AppSync::Code? (readonly)

Note:

Default: - no code is used

The function code.

Returns:



63
64
65
# File 'app_sync/resolver_props.rb', line 63

def code
  @code
end

#data_sourceAWSCDK::AppSync::BaseDataSource? (readonly)

Note:

Default: - No datasource

The data source this resolver is using.



98
99
100
# File 'app_sync/resolver_props.rb', line 98

def data_source
  @data_source
end

#field_nameString (readonly)

name of the GraphQL field in the given type this resolver is attached to.

Returns:

  • (String)


49
50
51
# File 'app_sync/resolver_props.rb', line 49

def field_name
  @field_name
end

#max_batch_sizeNumeric? (readonly)

Note:

Default: - No max batch size

The maximum number of elements per batch, when using batch invoke.

Returns:

  • (Numeric, nil)


68
69
70
# File 'app_sync/resolver_props.rb', line 68

def max_batch_size
  @max_batch_size
end

#metrics_configAWSCDK::AppSync::ResolverMetricsConfig? (readonly)

Note:

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.



73
74
75
# File 'app_sync/resolver_props.rb', line 73

def metrics_config
  @metrics_config
end

#pipeline_configArray<AWSCDK::Interfaces::AWSAppsync::IFunctionConfigurationRef>? (readonly)

Note:

Default: - no pipeline resolver configuration An empty array | undefined sets resolver to be of kind, unit

configuration of the pipeline resolver.



78
79
80
# File 'app_sync/resolver_props.rb', line 78

def pipeline_config
  @pipeline_config
end

#request_mapping_templateAWSCDK::AppSync::MappingTemplate? (readonly)

Note:

Default: - No mapping template

The request mapping template for this resolver.



83
84
85
# File 'app_sync/resolver_props.rb', line 83

def request_mapping_template
  @request_mapping_template
end

#response_mapping_templateAWSCDK::AppSync::MappingTemplate? (readonly)

Note:

Default: - No mapping template

The response mapping template for this resolver.



88
89
90
# File 'app_sync/resolver_props.rb', line 88

def response_mapping_template
  @response_mapping_template
end

#runtimeAWSCDK::AppSync::FunctionRuntime? (readonly)

Note:

Default: - no function runtime, VTL mapping templates used

The functions runtime.



93
94
95
# File 'app_sync/resolver_props.rb', line 93

def runtime
  @runtime
end

#type_nameString (readonly)

name of the GraphQL type this resolver is attached to.

Returns:

  • (String)


53
54
55
# File 'app_sync/resolver_props.rb', line 53

def type_name
  @type_name
end

Class Method Details

.jsii_propertiesObject



104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# File 'app_sync/resolver_props.rb', line 104

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",
    :data_source => "dataSource",
    :api => "api",
  }
end

Instance Method Details

#to_jsiiObject



121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
# File 'app_sync/resolver_props.rb', line 121

def to_jsii
  result = {}
  result.merge!(super)
  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,
    "dataSource" => @data_source,
    "api" => @api,
  })
  result.compact
end