Class: AWSCDK::Kendra::CfnDataSource::DataSourceToIndexFieldMappingProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
kendra/cfn_data_source.rb

Overview

Maps a column or attribute in the data source to an index field.

You must first create the fields in the index using the UpdateIndex operation.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data_source_field_name:, index_field_name:, date_field_format: nil) ⇒ DataSourceToIndexFieldMappingProperty

Returns a new instance of DataSourceToIndexFieldMappingProperty.

Parameters:

  • data_source_field_name (String)

    The name of the field in the data source.

  • index_field_name (String)

    The name of the index field to map to the data source field.

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

    The format for date fields in the data source.



1669
1670
1671
1672
1673
1674
1675
1676
# File 'kendra/cfn_data_source.rb', line 1669

def initialize(data_source_field_name:, index_field_name:, date_field_format: nil)
  @data_source_field_name = data_source_field_name
  Jsii::Type.check_type(@data_source_field_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dataSourceFieldName")
  @index_field_name = index_field_name
  Jsii::Type.check_type(@index_field_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "indexFieldName")
  @date_field_format = date_field_format
  Jsii::Type.check_type(@date_field_format, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "dateFieldFormat") unless @date_field_format.nil?
end

Instance Attribute Details

#data_source_field_nameString (readonly)

The name of the field in the data source.

You must first create the index field using the UpdateIndex API.



1684
1685
1686
# File 'kendra/cfn_data_source.rb', line 1684

def data_source_field_name
  @data_source_field_name
end

#date_field_formatString? (readonly)

The format for date fields in the data source.

If the field specified in DataSourceFieldName is a date field, you must specify the date format. If the field is not a date field, an exception is thrown.



1698
1699
1700
# File 'kendra/cfn_data_source.rb', line 1698

def date_field_format
  @date_field_format
end

#index_field_nameString (readonly)

The name of the index field to map to the data source field.

The index field type must match the data source field type.



1691
1692
1693
# File 'kendra/cfn_data_source.rb', line 1691

def index_field_name
  @index_field_name
end

Class Method Details

.jsii_propertiesObject



1700
1701
1702
1703
1704
1705
1706
# File 'kendra/cfn_data_source.rb', line 1700

def self.jsii_properties
  {
    :data_source_field_name => "dataSourceFieldName",
    :index_field_name => "indexFieldName",
    :date_field_format => "dateFieldFormat",
  }
end

Instance Method Details

#to_jsiiObject



1708
1709
1710
1711
1712
1713
1714
1715
1716
# File 'kendra/cfn_data_source.rb', line 1708

def to_jsii
  result = {}
  result.merge!({
    "dataSourceFieldName" => @data_source_field_name,
    "indexFieldName" => @index_field_name,
    "dateFieldFormat" => @date_field_format,
  })
  result.compact
end