Class: AWSCDK::DynamoDB::CsvOptions

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
dynamo_db/csv_options.rb

Overview

The options for imported source files in CSV format.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(delimiter: nil, header_list: nil) ⇒ CsvOptions

Returns a new instance of CsvOptions.

Parameters:

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

    The delimiter used for separating items in the CSV file being imported.

  • header_list (Array<String>, nil) (defaults to: nil)

    List of the headers used to specify a common header for all source CSV files being imported.



9
10
11
12
13
14
# File 'dynamo_db/csv_options.rb', line 9

def initialize(delimiter: nil, header_list: nil)
  @delimiter = delimiter
  Jsii::Type.check_type(@delimiter, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "delimiter") unless @delimiter.nil?
  @header_list = header_list
  Jsii::Type.check_type(@header_list, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7InByaW1pdGl2ZSI6InN0cmluZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "headerList") unless @header_list.nil?
end

Instance Attribute Details

#delimiterString? (readonly)

Note:

Default: - use comma as a delimiter.

The delimiter used for separating items in the CSV file being imported.

Valid delimiters are as follows:

  • comma (,)
  • tab (\t)
  • colon (:)
  • semicolon (;)
  • pipe (|)
  • space ()

Returns:

  • (String, nil)


29
30
31
# File 'dynamo_db/csv_options.rb', line 29

def delimiter
  @delimiter
end

#header_listArray<String>? (readonly)

Note:

Default: - the first line of the CSV file is treated as the header

List of the headers used to specify a common header for all source CSV files being imported.

NOTE: If this field is specified then the first line of each CSV file is treated as data instead of the header. If this field is not specified the first line of each CSV file is treated as the header.

Returns:

  • (Array<String>, nil)


37
38
39
# File 'dynamo_db/csv_options.rb', line 37

def header_list
  @header_list
end

Class Method Details

.jsii_propertiesObject



39
40
41
42
43
44
# File 'dynamo_db/csv_options.rb', line 39

def self.jsii_properties
  {
    :delimiter => "delimiter",
    :header_list => "headerList",
  }
end

Instance Method Details

#to_jsiiObject



46
47
48
49
50
51
52
53
# File 'dynamo_db/csv_options.rb', line 46

def to_jsii
  result = {}
  result.merge!({
    "delimiter" => @delimiter,
    "headerList" => @header_list,
  })
  result.compact
end