Class: AWSCDK::AppSync::AppsyncFunctionProps

Inherits:
BaseAppsyncFunctionProps
  • Object
show all
Defined in:
app_sync/appsync_function_props.rb

Overview

the CDK properties for AppSync Functions.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, code: nil, description: nil, max_batch_size: nil, request_mapping_template: nil, response_mapping_template: nil, runtime: nil, api:, data_source:) ⇒ AppsyncFunctionProps

Returns a new instance of AppsyncFunctionProps.

Parameters:

  • name (String)

    the name of the AppSync Function.

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

    The function code.

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

    the description for this AppSync Function.

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

    The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.

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

    the request mapping template for the AppSync Function.

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

    the response mapping template for the AppSync Function.

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

    The functions runtime.

  • api (AWSCDK::AppSync::IGraphqlAPI)

    the GraphQL Api linked to this AppSync Function.

  • data_source (AWSCDK::AppSync::BaseDataSource)

    the data source linked to this AppSync Function.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'app_sync/appsync_function_props.rb', line 16

def initialize(name:, code: nil, description: nil, max_batch_size: nil, request_mapping_template: nil, response_mapping_template: nil, runtime: nil, api:, data_source:)
  @name = name
  Jsii::Type.check_type(@name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "name")
  @code = code
  Jsii::Type.check_type(@code, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5Db2RlIn0=")), "code") unless @code.nil?
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.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?
  @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?
  @api = api
  Jsii::Type.check_type(@api, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5JR3JhcGhxbEFwaSJ9")), "api")
  @data_source = data_source
  Jsii::Type.check_type(@data_source, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYXBwc3luYy5CYXNlRGF0YVNvdXJjZSJ9")), "dataSource")
end

Instance Attribute Details

#apiAWSCDK::AppSync::IGraphqlAPI (readonly)

the GraphQL Api linked to this AppSync Function.



76
77
78
# File 'app_sync/appsync_function_props.rb', line 76

def api
  @api
end

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

Note:

Default: - no code is used

The function code.

Returns:



45
46
47
# File 'app_sync/appsync_function_props.rb', line 45

def code
  @code
end

#data_sourceAWSCDK::AppSync::BaseDataSource (readonly)

the data source linked to this AppSync Function.



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

def data_source
  @data_source
end

#descriptionString? (readonly)

Note:

Default: - no description

the description for this AppSync Function.

Returns:

  • (String, nil)


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

def description
  @description
end

#max_batch_sizeNumeric? (readonly)

Note:

Default: - No max batch size

The maximum number of resolver request inputs that will be sent to a single AWS Lambda function in a BatchInvoke operation.

Can only be set when using LambdaDataSource.

Returns:

  • (Numeric, nil)


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

def max_batch_size
  @max_batch_size
end

#nameString (readonly)

the name of the AppSync Function.

Returns:

  • (String)


40
41
42
# File 'app_sync/appsync_function_props.rb', line 40

def name
  @name
end

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

Note:

Default: - no request mapping template

the request mapping template for the AppSync Function.



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

def request_mapping_template
  @request_mapping_template
end

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

Note:

Default: - no response mapping template

the response mapping template for the AppSync Function.



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

def response_mapping_template
  @response_mapping_template
end

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

Note:

Default: - no function runtime, VTL mapping templates used

The functions runtime.



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

def runtime
  @runtime
end

Class Method Details

.jsii_propertiesObject



82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'app_sync/appsync_function_props.rb', line 82

def self.jsii_properties
  {
    :name => "name",
    :code => "code",
    :description => "description",
    :max_batch_size => "maxBatchSize",
    :request_mapping_template => "requestMappingTemplate",
    :response_mapping_template => "responseMappingTemplate",
    :runtime => "runtime",
    :api => "api",
    :data_source => "dataSource",
  }
end

Instance Method Details

#to_jsiiObject



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

def to_jsii
  result = {}
  result.merge!(super)
  result.merge!({
    "name" => @name,
    "code" => @code,
    "description" => @description,
    "maxBatchSize" => @max_batch_size,
    "requestMappingTemplate" => @request_mapping_template,
    "responseMappingTemplate" => @response_mapping_template,
    "runtime" => @runtime,
    "api" => @api,
    "dataSource" => @data_source,
  })
  result.compact
end