Class: AWSCDK::AppSync::BaseResolverProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
app_sync/base_resolver_props.rb

Overview

Basic properties for an AppSync resolver.

Direct Known Subclasses

ExtendedResolverProps

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

Returns a new instance of BaseResolverProps.

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.



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_configAWSCDK::AppSync::CachingConfig? (readonly)

Note:

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

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

Note:

Default: - no code is used

The function code.

Returns:



57
58
59
# File 'app_sync/base_resolver_props.rb', line 57

def code
  @code
end

#field_nameString (readonly)

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

Returns:

  • (String)


43
44
45
# File 'app_sync/base_resolver_props.rb', line 43

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)


62
63
64
# File 'app_sync/base_resolver_props.rb', line 62

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.



67
68
69
# File 'app_sync/base_resolver_props.rb', line 67

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.



72
73
74
# File 'app_sync/base_resolver_props.rb', line 72

def pipeline_config
  @pipeline_config
end

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

Note:

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_templateAWSCDK::AppSync::MappingTemplate? (readonly)

Note:

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

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

Note:

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_nameString (readonly)

name of the GraphQL type this resolver is attached to.

Returns:

  • (String)


47
48
49
# File 'app_sync/base_resolver_props.rb', line 47

def type_name
  @type_name
end

Class Method Details

.jsii_propertiesObject



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_jsiiObject



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