Class: AWSCDK::AppSync::ExtendedResolverProps

Inherits:
BaseResolverProps
  • Object
show all
Defined in:
app_sync/extended_resolver_props.rb

Overview

Additional property for an AppSync resolver for data source reference.

Direct Known Subclasses

ResolverProps

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) ⇒ ExtendedResolverProps

Returns a new instance of ExtendedResolverProps.

Parameters:

  • field_name (String)

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

  • type_name (String)

    name of the GraphQL type this resolver is attached to.

  • caching_config (AWSCDK::AppSync::CachingConfig, nil) (defaults to: nil)

    The caching configuration for this resolver.

  • code (AWSCDK::AppSync::Code, nil) (defaults to: nil)

    The function code.

  • max_batch_size (Numeric, nil) (defaults to: nil)

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

  • metrics_config (AWSCDK::AppSync::ResolverMetricsConfig, nil) (defaults to: nil)

    Whether to enable enhanced metrics Value will be ignored, if enhancedMetricsConfig.resolverLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_RESOLVER_METRICS.

  • pipeline_config (Array<AWSCDK::Interfaces::AWSAppsync::IFunctionConfigurationRef>, nil) (defaults to: nil)

    configuration of the pipeline resolver.

  • request_mapping_template (AWSCDK::AppSync::MappingTemplate, nil) (defaults to: nil)

    The request mapping template for this resolver.

  • response_mapping_template (AWSCDK::AppSync::MappingTemplate, nil) (defaults to: nil)

    The response mapping template for this resolver.

  • runtime (AWSCDK::AppSync::FunctionRuntime, nil) (defaults to: nil)

    The functions runtime.

  • data_source (AWSCDK::AppSync::BaseDataSource, nil) (defaults to: nil)

    The data source this resolver is using.



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

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)
  @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?
end

Instance Attribute Details

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

Note:

Default: - No caching configuration

The caching configuration for this resolver.



55
56
57
# File 'app_sync/extended_resolver_props.rb', line 55

def caching_config
  @caching_config
end

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

Note:

Default: - no code is used

The function code.

Returns:



60
61
62
# File 'app_sync/extended_resolver_props.rb', line 60

def code
  @code
end

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

Note:

Default: - No datasource

The data source this resolver is using.



95
96
97
# File 'app_sync/extended_resolver_props.rb', line 95

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)


46
47
48
# File 'app_sync/extended_resolver_props.rb', line 46

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)


65
66
67
# File 'app_sync/extended_resolver_props.rb', line 65

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.



70
71
72
# File 'app_sync/extended_resolver_props.rb', line 70

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.



75
76
77
# File 'app_sync/extended_resolver_props.rb', line 75

def pipeline_config
  @pipeline_config
end

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

Note:

Default: - No mapping template

The request mapping template for this resolver.



80
81
82
# File 'app_sync/extended_resolver_props.rb', line 80

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.



85
86
87
# File 'app_sync/extended_resolver_props.rb', line 85

def response_mapping_template
  @response_mapping_template
end

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

Note:

Default: - no function runtime, VTL mapping templates used

The functions runtime.



90
91
92
# File 'app_sync/extended_resolver_props.rb', line 90

def runtime
  @runtime
end

#type_nameString (readonly)

name of the GraphQL type this resolver is attached to.

Returns:

  • (String)


50
51
52
# File 'app_sync/extended_resolver_props.rb', line 50

def type_name
  @type_name
end

Class Method Details

.jsii_propertiesObject



97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# File 'app_sync/extended_resolver_props.rb', line 97

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",
  }
end

Instance Method Details

#to_jsiiObject



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# File 'app_sync/extended_resolver_props.rb', line 113

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,
  })
  result.compact
end