Class: AWSCDK::AppSync::DataSourceOptions

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

Overview

Optional configuration for data sources.

Direct Known Subclasses

HttpDataSourceOptions

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, metrics_config: nil, name: nil) ⇒ DataSourceOptions

Returns a new instance of DataSourceOptions.

Parameters:

  • description (String, nil) (defaults to: nil)

    The description of the data source.

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

    Whether to enable enhanced metrics of the data source Value will be ignored, if enhancedMetricsConfig.dataSourceLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_DATA_SOURCE_METRICS.

  • name (String, nil) (defaults to: nil)

    The name of the data source, overrides the id given by cdk.



10
11
12
13
14
15
16
17
# File 'app_sync/data_source_options.rb', line 10

def initialize(description: nil, metrics_config: nil, name: nil)
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @metrics_config = metrics_config
  Jsii::Type.check_type(@metrics_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5EYXRhU291cmNlTWV0cmljc0NvbmZpZyJ9")), "metricsConfig") unless @metrics_config.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

Note:

Default: - No description

The description of the data source.

Returns:

  • (String, nil)


23
24
25
# File 'app_sync/data_source_options.rb', line 23

def description
  @description
end

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

Note:

Default: - Enhance metrics are disabled

Whether to enable enhanced metrics of the data source Value will be ignored, if enhancedMetricsConfig.dataSourceLevelMetricsBehavior on AppSync GraphqlApi construct is set to FULL_REQUEST_DATA_SOURCE_METRICS.



28
29
30
# File 'app_sync/data_source_options.rb', line 28

def metrics_config
  @metrics_config
end

#nameString? (readonly)

Note:

Default: - generated by cdk given the id

The name of the data source, overrides the id given by cdk.

Returns:

  • (String, nil)


33
34
35
# File 'app_sync/data_source_options.rb', line 33

def name
  @name
end

Class Method Details

.jsii_propertiesObject



35
36
37
38
39
40
41
# File 'app_sync/data_source_options.rb', line 35

def self.jsii_properties
  {
    :description => "description",
    :metrics_config => "metricsConfig",
    :name => "name",
  }
end

Instance Method Details

#to_jsiiObject



43
44
45
46
47
48
49
50
51
# File 'app_sync/data_source_options.rb', line 43

def to_jsii
  result = {}
  result.merge!({
    "description" => @description,
    "metricsConfig" => @metrics_config,
    "name" => @name,
  })
  result.compact
end