Class: AWSCDK::AppSync::AppSyncHttpDataSourceProps

Inherits:
AppSyncBackedDataSourceProps
  • Object
show all
Defined in:
app_sync/app_sync_http_data_source_props.rb

Overview

Properties for an AppSync http datasource.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api:, description: nil, name: nil, service_role: nil, endpoint:, authorization_config: nil) ⇒ AppSyncHttpDataSourceProps

Returns a new instance of AppSyncHttpDataSourceProps.

Parameters:

  • api (AWSCDK::Interfaces::AWSAppsync::IAPIRef)

    The API to attach this data source to.

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

    The description of the data source.

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

    The name of the data source.

  • service_role (AWSCDK::IAM::IRole, nil) (defaults to: nil)

    The IAM service role to be assumed by AppSync to interact with the data source.

  • endpoint (String)

    The http endpoint.

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

    The authorization config in case the HTTP endpoint requires authorization.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'app_sync/app_sync_http_data_source_props.rb', line 13

def initialize(api:, description: nil, name: nil, service_role: nil, endpoint:, authorization_config: nil)
  @api = api
  Jsii::Type.check_type(@api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5pbnRlcmZhY2VzLmF3c19hcHBzeW5jLklBcGlSZWYifQ==")), "api")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name") unless @name.nil?
  @service_role = service_role
  Jsii::Type.check_type(@service_role, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfaWFtLklSb2xlIn0=")), "serviceRole") unless @service_role.nil?
  @endpoint = endpoint
  Jsii::Type.check_type(@endpoint, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "endpoint")
  @authorization_config = authorization_config.is_a?(Hash) ? ::AWSCDK::AppSync::AppSyncAWSIAMConfig.new(**authorization_config.transform_keys(&:to_sym)) : authorization_config
  Jsii::Type.check_type(@authorization_config, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5BcHBTeW5jQXdzSWFtQ29uZmlnIn0=")), "authorizationConfig") unless @authorization_config.nil?
end

Instance Attribute Details

#apiAWSCDK::Interfaces::AWSAppsync::IAPIRef (readonly)

The API to attach this data source to.



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

def api
  @api
end

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

Note:

Default: - none

The authorization config in case the HTTP endpoint requires authorization.



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

def authorization_config
  @authorization_config
end

#descriptionString? (readonly)

Note:

Default: - None

The description of the data source.

Returns:

  • (String, nil)


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

def description
  @description
end

#endpointString (readonly)

The http endpoint.

Returns:

  • (String)


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

def endpoint
  @endpoint
end

#nameString? (readonly)

Note:

Default: - id of data source

The name of the data source.

The only allowed pattern is: [_A-Za-z][_0-9A-Za-z]*. Any invalid characters will be automatically removed.

Returns:

  • (String, nil)


44
45
46
# File 'app_sync/app_sync_http_data_source_props.rb', line 44

def name
  @name
end

#service_roleAWSCDK::IAM::IRole? (readonly)

Note:

Default: - Create a new role

The IAM service role to be assumed by AppSync to interact with the data source.

Returns:



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

def service_role
  @service_role
end

Class Method Details

.jsii_propertiesObject



60
61
62
63
64
65
66
67
68
69
# File 'app_sync/app_sync_http_data_source_props.rb', line 60

def self.jsii_properties
  {
    :api => "api",
    :description => "description",
    :name => "name",
    :service_role => "serviceRole",
    :endpoint => "endpoint",
    :authorization_config => "authorizationConfig",
  }
end

Instance Method Details

#to_jsiiObject



71
72
73
74
75
76
77
78
79
80
81
82
83
# File 'app_sync/app_sync_http_data_source_props.rb', line 71

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "api" => @api,
    "description" => @description,
    "name" => @name,
    "serviceRole" => @service_role,
    "endpoint" => @endpoint,
    "authorizationConfig" => @authorization_config,
  })
  result.compact
end