Class: AWSCDK::AppSync::HttpDataSourceOptions

Inherits:
DataSourceOptions
  • Object
show all
Defined in:
app_sync/http_data_source_options.rb

Overview

Optional configuration for Http data sources.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(description: nil, metrics_config: nil, name: nil, authorization_config: nil) ⇒ HttpDataSourceOptions

Returns a new instance of HttpDataSourceOptions.

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.

  • authorization_config (AWSCDK::AppSync::AWSIAMConfig, nil) (defaults to: nil)

    The authorization config in case the HTTP endpoint requires authorization.



11
12
13
14
15
16
17
18
19
20
# File 'app_sync/http_data_source_options.rb', line 11

def initialize(description: nil, metrics_config: nil, name: nil, authorization_config: 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?
  @authorization_config = authorization_config.is_a?(Hash) ? ::AWSCDK::AppSync::AWSIAMConfig.new(**authorization_config.transform_keys(&:to_sym)) : authorization_config
  Jsii::Type.check_type(@authorization_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5Bd3NJYW1Db25maWcifQ==")), "authorizationConfig") unless @authorization_config.nil?
end

Instance Attribute Details

#authorization_configAWSCDK::AppSync::AWSIAMConfig? (readonly)

Note:

Default: - none

The authorization config in case the HTTP endpoint requires authorization.



41
42
43
# File 'app_sync/http_data_source_options.rb', line 41

def authorization_config
  @authorization_config
end

#descriptionString? (readonly)

Note:

Default: - No description

The description of the data source.

Returns:

  • (String, nil)


26
27
28
# File 'app_sync/http_data_source_options.rb', line 26

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.



31
32
33
# File 'app_sync/http_data_source_options.rb', line 31

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)


36
37
38
# File 'app_sync/http_data_source_options.rb', line 36

def name
  @name
end

Class Method Details

.jsii_propertiesObject



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

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

Instance Method Details

#to_jsiiObject



52
53
54
55
56
57
58
59
60
61
62
# File 'app_sync/http_data_source_options.rb', line 52

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