Class: AWSCDK::Kendra::CfnDataSource::DocumentAttributeTargetProperty

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

Overview

The target document attribute or metadata field you want to alter when ingesting documents into Amazon Kendra.

For example, you can delete customer identification numbers associated with the documents, stored in the document metadata field called 'Customer_ID'. You set the target key as 'Customer_ID' and the deletion flag to TRUE . This removes all customer ID values in the field 'Customer_ID'. This would scrub personally identifiable information from each document's metadata.

Amazon Kendra cannot create a target field if it has not already been created as an index field. After you create your index field, you can create a document metadata field using DocumentAttributeTarget . Amazon Kendra then will map your newly created metadata field to your index field.

You can also use this with DocumentAttributeCondition .

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_document_attribute_key:, target_document_attribute_value: nil, target_document_attribute_value_deletion: nil) ⇒ DocumentAttributeTargetProperty

Returns a new instance of DocumentAttributeTargetProperty.

Parameters:

  • target_document_attribute_key (String)

    The identifier of the target document attribute or metadata field.

  • target_document_attribute_value (AWSCDK::IResolvable, AWSCDK::Kendra::CfnDataSource::DocumentAttributeValueProperty, nil) (defaults to: nil)

    The target value you want to create for the target attribute.

  • target_document_attribute_value_deletion (Boolean, AWSCDK::IResolvable, nil) (defaults to: nil)

    TRUE to delete the existing target value for your specified target attribute key.



1931
1932
1933
1934
1935
1936
1937
1938
# File 'kendra/cfn_data_source.rb', line 1931

def initialize(target_document_attribute_key:, target_document_attribute_value: nil, target_document_attribute_value_deletion: nil)
  @target_document_attribute_key = target_document_attribute_key
  Jsii::Type.check_type(@target_document_attribute_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "targetDocumentAttributeKey")
  @target_document_attribute_value = target_document_attribute_value.is_a?(Hash) ? ::AWSCDK::Kendra::CfnDataSource::DocumentAttributeValueProperty.new(**target_document_attribute_value.transform_keys(&:to_sym)) : target_document_attribute_value
  Jsii::Type.check_type(@target_document_attribute_value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19rZW5kcmEuQ2ZuRGF0YVNvdXJjZS5Eb2N1bWVudEF0dHJpYnV0ZVZhbHVlUHJvcGVydHkifV19fQ==")), "targetDocumentAttributeValue") unless @target_document_attribute_value.nil?
  @target_document_attribute_value_deletion = target_document_attribute_value_deletion
  Jsii::Type.check_type(@target_document_attribute_value_deletion, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3sicHJpbWl0aXZlIjoiYm9vbGVhbiJ9LHsiZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifV19fQ==")), "targetDocumentAttributeValueDeletion") unless @target_document_attribute_value_deletion.nil?
end

Instance Attribute Details

#target_document_attribute_keyString (readonly)

The identifier of the target document attribute or metadata field.

For example, 'Department' could be an identifier for the target attribute or metadata field that includes the department names associated with the documents.



1946
1947
1948
# File 'kendra/cfn_data_source.rb', line 1946

def target_document_attribute_key
  @target_document_attribute_key
end

#target_document_attribute_valueAWSCDK::IResolvable, ... (readonly)

The target value you want to create for the target attribute.

For example, 'Finance' could be the target value for the target attribute key 'Department'.



1953
1954
1955
# File 'kendra/cfn_data_source.rb', line 1953

def target_document_attribute_value
  @target_document_attribute_value
end

#target_document_attribute_value_deletionBoolean, ... (readonly)

TRUE to delete the existing target value for your specified target attribute key.

You cannot create a target value and set this to TRUE . To create a target value ( TargetDocumentAttributeValue ), set this to FALSE .



1960
1961
1962
# File 'kendra/cfn_data_source.rb', line 1960

def target_document_attribute_value_deletion
  @target_document_attribute_value_deletion
end

Class Method Details

.jsii_propertiesObject



1962
1963
1964
1965
1966
1967
1968
# File 'kendra/cfn_data_source.rb', line 1962

def self.jsii_properties
  {
    :target_document_attribute_key => "targetDocumentAttributeKey",
    :target_document_attribute_value => "targetDocumentAttributeValue",
    :target_document_attribute_value_deletion => "targetDocumentAttributeValueDeletion",
  }
end

Instance Method Details

#to_jsiiObject



1970
1971
1972
1973
1974
1975
1976
1977
1978
# File 'kendra/cfn_data_source.rb', line 1970

def to_jsii
  result = {}
  result.merge!({
    "targetDocumentAttributeKey" => @target_document_attribute_key,
    "targetDocumentAttributeValue" => @target_document_attribute_value,
    "targetDocumentAttributeValueDeletion" => @target_document_attribute_value_deletion,
  })
  result.compact
end