Class: AWSCDK::StepFunctions::S3CsvItemReader

Inherits:
Jsii::Object
  • Object
show all
Includes:
IItemReader
Defined in:
step_functions/s3_csv_item_reader.rb

Overview

Item Reader configuration for iterating over items in a CSV file stored in S3.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(props) ⇒ S3CsvItemReader

Returns a new instance of S3CsvItemReader.



10
11
12
13
14
# File 'step_functions/s3_csv_item_reader.rb', line 10

def initialize(props)
  props = props.is_a?(Hash) ? ::AWSCDK::StepFunctions::S3CsvItemReaderProps.new(**props.transform_keys(&:to_sym)) : props
  Jsii::Type.check_type(props, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5TM0Nzdkl0ZW1SZWFkZXJQcm9wcyJ9")), "props")
  Jsii::Object.instance_method(:initialize).bind(self).call(props)
end

Class Method Details

.jsii_overridable_methodsObject



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'step_functions/s3_csv_item_reader.rb', line 16

def self.jsii_overridable_methods
  {
    :bucket => { kind: :property, name: "bucket", is_optional: false },
    :csv_headers => { kind: :property, name: "csvHeaders", is_optional: false },
    :input_type => { kind: :property, name: "inputType", is_optional: false },
    :key => { kind: :property, name: "key", is_optional: false },
    :resource => { kind: :property, name: "resource", is_optional: false },
    :bucket_name_path => { kind: :property, name: "bucketNamePath", is_optional: true },
    :csv_delimiter => { kind: :property, name: "csvDelimiter", is_optional: true },
    :max_items => { kind: :property, name: "maxItems", is_optional: true },
    :provide_policy_statements => { kind: :method, name: "providePolicyStatements", is_optional: false },
    :render => { kind: :method, name: "render", is_optional: false },
    :validate_item_reader => { kind: :method, name: "validateItemReader", is_optional: false },
  }
end

Instance Method Details

#bucketAWSCDK::S3::IBucket

S3 Bucket containing a file with a list to iterate over.

Returns:



35
36
37
# File 'step_functions/s3_csv_item_reader.rb', line 35

def bucket()
  jsii_get_property("bucket")
end

#bucket_name_pathString?

S3 bucket name containing objects to iterate over or a file with a list to iterate over, as JsonPath.

Returns:

  • (String, nil)


68
69
70
# File 'step_functions/s3_csv_item_reader.rb', line 68

def bucket_name_path()
  jsii_get_property("bucketNamePath")
end

#csv_delimiterAWSCDK::StepFunctions::CsvDelimiter?

Delimiter used in CSV file.



75
76
77
# File 'step_functions/s3_csv_item_reader.rb', line 75

def csv_delimiter()
  jsii_get_property("csvDelimiter")
end

#csv_headersAWSCDK::StepFunctions::CsvHeaders

CSV headers configuration.



42
43
44
# File 'step_functions/s3_csv_item_reader.rb', line 42

def csv_headers()
  jsii_get_property("csvHeaders")
end

#input_typeString

Returns:

  • (String)


47
48
49
# File 'step_functions/s3_csv_item_reader.rb', line 47

def input_type()
  jsii_get_property("inputType")
end

#keyString

S3 key of a file with a list to iterate over.

Returns:

  • (String)


54
55
56
# File 'step_functions/s3_csv_item_reader.rb', line 54

def key()
  jsii_get_property("key")
end

#max_itemsNumeric?

Note:

Default: - No maxItems

Limits the number of items passed to the Distributed Map state.

Returns:

  • (Numeric, nil)


83
84
85
# File 'step_functions/s3_csv_item_reader.rb', line 83

def max_items()
  jsii_get_property("maxItems")
end

#provide_policy_statementsArray<AWSCDK::IAM::PolicyStatement>

Compile policy statements to provide relevent permissions to the state machine.

Returns:



90
91
92
# File 'step_functions/s3_csv_item_reader.rb', line 90

def provide_policy_statements()
  jsii_call_method("providePolicyStatements", [])
end

#render(query_language = nil) ⇒ Object

Renders the ItemReader configuration as JSON object.

Parameters:

Returns:

  • (Object)


98
99
100
101
# File 'step_functions/s3_csv_item_reader.rb', line 98

def render(query_language = nil)
  Jsii::Type.check_type(query_language, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3Nfc3RlcGZ1bmN0aW9ucy5RdWVyeUxhbmd1YWdlIn0=")), "queryLanguage") unless query_language.nil?
  jsii_call_method("render", [query_language])
end

#resourceString

ARN for the getObject method of the S3 API This API method is used to iterate all objects in the S3 bucket/prefix.

Returns:

  • (String)


61
62
63
# File 'step_functions/s3_csv_item_reader.rb', line 61

def resource()
  jsii_get_property("resource")
end

#validate_item_readerArray<String>

Validate that ItemReader contains exactly either.

Returns:

  • (Array<String>)

See Also:

  • bucketNamePath


107
108
109
# File 'step_functions/s3_csv_item_reader.rb', line 107

def validate_item_reader()
  jsii_call_method("validateItemReader", [])
end