Class: AWSCDK::QBusiness::CfnDataSource::DocumentAttributeConditionProperty

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

Overview

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

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 Q Business can't 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 Q Business 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(key:, operator:, value: nil) ⇒ DocumentAttributeConditionProperty

Returns a new instance of DocumentAttributeConditionProperty.

Parameters:



780
781
782
783
784
785
786
787
# File 'q_business/cfn_data_source.rb', line 780

def initialize(key:, operator:, value: nil)
  @key = key
  Jsii::Type.check_type(@key, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "key")
  @operator = operator
  Jsii::Type.check_type(@operator, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "operator")
  @value = value.is_a?(Hash) ? ::AWSCDK::QBusiness::CfnDataSource::DocumentAttributeValueProperty.new(**value.transform_keys(&:to_sym)) : value
  Jsii::Type.check_type(@value, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19xYnVzaW5lc3MuQ2ZuRGF0YVNvdXJjZS5Eb2N1bWVudEF0dHJpYnV0ZVZhbHVlUHJvcGVydHkifV19fQ==")), "value") unless @value.nil?
end

Instance Attribute Details

#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 Q Business currently doesn't support _document_body as an attribute key used for the condition.



797
798
799
# File 'q_business/cfn_data_source.rb', line 797

def key
  @key
end

#operatorString (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 Q Business currently does not support _document_body as an attribute key used for the condition.



806
807
808
# File 'q_business/cfn_data_source.rb', line 806

def operator
  @operator
end

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

The value of a document attribute.

You can only provide one value for a document attribute.



813
814
815
# File 'q_business/cfn_data_source.rb', line 813

def value
  @value
end

Class Method Details

.jsii_propertiesObject



815
816
817
818
819
820
821
# File 'q_business/cfn_data_source.rb', line 815

def self.jsii_properties
  {
    :key => "key",
    :operator => "operator",
    :value => "value",
  }
end

Instance Method Details

#to_jsiiObject



823
824
825
826
827
828
829
830
831
# File 'q_business/cfn_data_source.rb', line 823

def to_jsii
  result = {}
  result.merge!({
    "key" => @key,
    "operator" => @operator,
    "value" => @value,
  })
  result.compact
end