Class: AWSCDK::Kendra::CfnDataSource::DocumentAttributeConditionProperty

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

Overview

The condition used for the target document attribute or metadata field when ingesting documents into Amazon Kendra.

You use this with DocumentAttributeTarget to apply the condition .

For example, you can create the 'Department' target field and have it prefill department names associated with the documents based on information in the 'Source_URI' field. Set the condition that if the 'Source_URI' field contains 'financial' in its URI value, then prefill the target field 'Department' with the target value 'Finance' for the document.

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.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(condition_document_attribute_key:, operator:, condition_on_value: nil) ⇒ DocumentAttributeConditionProperty

Returns a new instance of DocumentAttributeConditionProperty.

Parameters:



1864
1865
1866
1867
1868
1869
1870
1871
# File 'kendra/cfn_data_source.rb', line 1864

def initialize(condition_document_attribute_key:, operator:, condition_on_value: nil)
  @condition_document_attribute_key = condition_document_attribute_key
  Jsii::Type.check_type(@condition_document_attribute_key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "conditionDocumentAttributeKey")
  @operator = operator
  Jsii::Type.check_type(@operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operator")
  @condition_on_value = condition_on_value.is_a?(Hash) ? ::AWSCDK::Kendra::CfnDataSource::DocumentAttributeValueProperty.new(**condition_on_value.transform_keys(&:to_sym)) : condition_on_value
  Jsii::Type.check_type(@condition_on_value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19rZW5kcmEuQ2ZuRGF0YVNvdXJjZS5Eb2N1bWVudEF0dHJpYnV0ZVZhbHVlUHJvcGVydHkifV19fQ==")), "conditionOnValue") unless @condition_on_value.nil?
end

Instance Attribute Details

#condition_document_attribute_keyString (readonly)

The identifier of the document attribute used for the condition.

For example, 'Source_URI' could be an identifier for the attribute or metadata field that contains source URIs associated with the documents.

Amazon Kendra currently does not support _document_body as an attribute key used for the condition.



1881
1882
1883
# File 'kendra/cfn_data_source.rb', line 1881

def condition_document_attribute_key
  @condition_document_attribute_key
end

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

The value used by the operator.

For example, you can specify the value 'financial' for strings in the 'Source_URI' field that partially match or contain this value.



1895
1896
1897
# File 'kendra/cfn_data_source.rb', line 1895

def condition_on_value
  @condition_on_value
end

#operatorString (readonly)

The condition operator.

For example, you can use 'Contains' to partially match a string.



1888
1889
1890
# File 'kendra/cfn_data_source.rb', line 1888

def operator
  @operator
end

Class Method Details

.jsii_propertiesObject



1897
1898
1899
1900
1901
1902
1903
# File 'kendra/cfn_data_source.rb', line 1897

def self.jsii_properties
  {
    :condition_document_attribute_key => "conditionDocumentAttributeKey",
    :operator => "operator",
    :condition_on_value => "conditionOnValue",
  }
end

Instance Method Details

#to_jsiiObject



1905
1906
1907
1908
1909
1910
1911
1912
1913
# File 'kendra/cfn_data_source.rb', line 1905

def to_jsii
  result = {}
  result.merge!({
    "conditionDocumentAttributeKey" => @condition_document_attribute_key,
    "operator" => @operator,
    "conditionOnValue" => @condition_on_value,
  })
  result.compact
end