/** * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0. */ #pragma once #include #include #include #include #include #include #include #include #include #include #include namespace Aws { namespace Utils { namespace Json { class JsonValue; class JsonView; } // namespace Json } // namespace Utils namespace kendra { namespace Model { /** *

A single query result.

A query result contains information about a * document returned by the query. This includes the original location of the * document, a list of attributes assigned to the document, and relevant text from * the document that satisfies the query.

See Also:

AWS * API Reference

*/ class QueryResultItem { public: AWS_KENDRA_API QueryResultItem(); AWS_KENDRA_API QueryResultItem(Aws::Utils::Json::JsonView jsonValue); AWS_KENDRA_API QueryResultItem& operator=(Aws::Utils::Json::JsonView jsonValue); AWS_KENDRA_API Aws::Utils::Json::JsonValue Jsonize() const; /** *

The identifier for the query result.

*/ inline const Aws::String& GetId() const{ return m_id; } /** *

The identifier for the query result.

*/ inline bool IdHasBeenSet() const { return m_idHasBeenSet; } /** *

The identifier for the query result.

*/ inline void SetId(const Aws::String& value) { m_idHasBeenSet = true; m_id = value; } /** *

The identifier for the query result.

*/ inline void SetId(Aws::String&& value) { m_idHasBeenSet = true; m_id = std::move(value); } /** *

The identifier for the query result.

*/ inline void SetId(const char* value) { m_idHasBeenSet = true; m_id.assign(value); } /** *

The identifier for the query result.

*/ inline QueryResultItem& WithId(const Aws::String& value) { SetId(value); return *this;} /** *

The identifier for the query result.

*/ inline QueryResultItem& WithId(Aws::String&& value) { SetId(std::move(value)); return *this;} /** *

The identifier for the query result.

*/ inline QueryResultItem& WithId(const char* value) { SetId(value); return *this;} /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline const QueryResultType& GetType() const{ return m_type; } /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline bool TypeHasBeenSet() const { return m_typeHasBeenSet; } /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline void SetType(const QueryResultType& value) { m_typeHasBeenSet = true; m_type = value; } /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline void SetType(QueryResultType&& value) { m_typeHasBeenSet = true; m_type = std::move(value); } /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline QueryResultItem& WithType(const QueryResultType& value) { SetType(value); return *this;} /** *

The type of document within the response. For example, a response could * include a question-answer that's relevant to the query.

*/ inline QueryResultItem& WithType(QueryResultType&& value) { SetType(std::move(value)); return *this;} /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline const QueryResultFormat& GetFormat() const{ return m_format; } /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline bool FormatHasBeenSet() const { return m_formatHasBeenSet; } /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline void SetFormat(const QueryResultFormat& value) { m_formatHasBeenSet = true; m_format = value; } /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline void SetFormat(QueryResultFormat&& value) { m_formatHasBeenSet = true; m_format = std::move(value); } /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline QueryResultItem& WithFormat(const QueryResultFormat& value) { SetFormat(value); return *this;} /** *

If the Type of document within the response is * ANSWER, then it is either a TABLE answer or * TEXT answer. If it's a table answer, a table excerpt is returned in * TableExcerpt. If it's a text answer, a text excerpt is returned in * DocumentExcerpt.

*/ inline QueryResultItem& WithFormat(QueryResultFormat&& value) { SetFormat(std::move(value)); return *this;} /** *

One or more additional fields/attributes associated with the query * result.

*/ inline const Aws::Vector& GetAdditionalAttributes() const{ return m_additionalAttributes; } /** *

One or more additional fields/attributes associated with the query * result.

*/ inline bool AdditionalAttributesHasBeenSet() const { return m_additionalAttributesHasBeenSet; } /** *

One or more additional fields/attributes associated with the query * result.

*/ inline void SetAdditionalAttributes(const Aws::Vector& value) { m_additionalAttributesHasBeenSet = true; m_additionalAttributes = value; } /** *

One or more additional fields/attributes associated with the query * result.

*/ inline void SetAdditionalAttributes(Aws::Vector&& value) { m_additionalAttributesHasBeenSet = true; m_additionalAttributes = std::move(value); } /** *

One or more additional fields/attributes associated with the query * result.

*/ inline QueryResultItem& WithAdditionalAttributes(const Aws::Vector& value) { SetAdditionalAttributes(value); return *this;} /** *

One or more additional fields/attributes associated with the query * result.

*/ inline QueryResultItem& WithAdditionalAttributes(Aws::Vector&& value) { SetAdditionalAttributes(std::move(value)); return *this;} /** *

One or more additional fields/attributes associated with the query * result.

*/ inline QueryResultItem& AddAdditionalAttributes(const AdditionalResultAttribute& value) { m_additionalAttributesHasBeenSet = true; m_additionalAttributes.push_back(value); return *this; } /** *

One or more additional fields/attributes associated with the query * result.

*/ inline QueryResultItem& AddAdditionalAttributes(AdditionalResultAttribute&& value) { m_additionalAttributesHasBeenSet = true; m_additionalAttributes.push_back(std::move(value)); return *this; } /** *

The identifier for the document.

*/ inline const Aws::String& GetDocumentId() const{ return m_documentId; } /** *

The identifier for the document.

*/ inline bool DocumentIdHasBeenSet() const { return m_documentIdHasBeenSet; } /** *

The identifier for the document.

*/ inline void SetDocumentId(const Aws::String& value) { m_documentIdHasBeenSet = true; m_documentId = value; } /** *

The identifier for the document.

*/ inline void SetDocumentId(Aws::String&& value) { m_documentIdHasBeenSet = true; m_documentId = std::move(value); } /** *

The identifier for the document.

*/ inline void SetDocumentId(const char* value) { m_documentIdHasBeenSet = true; m_documentId.assign(value); } /** *

The identifier for the document.

*/ inline QueryResultItem& WithDocumentId(const Aws::String& value) { SetDocumentId(value); return *this;} /** *

The identifier for the document.

*/ inline QueryResultItem& WithDocumentId(Aws::String&& value) { SetDocumentId(std::move(value)); return *this;} /** *

The identifier for the document.

*/ inline QueryResultItem& WithDocumentId(const char* value) { SetDocumentId(value); return *this;} /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline const TextWithHighlights& GetDocumentTitle() const{ return m_documentTitle; } /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline bool DocumentTitleHasBeenSet() const { return m_documentTitleHasBeenSet; } /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline void SetDocumentTitle(const TextWithHighlights& value) { m_documentTitleHasBeenSet = true; m_documentTitle = value; } /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline void SetDocumentTitle(TextWithHighlights&& value) { m_documentTitleHasBeenSet = true; m_documentTitle = std::move(value); } /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline QueryResultItem& WithDocumentTitle(const TextWithHighlights& value) { SetDocumentTitle(value); return *this;} /** *

The title of the document. Contains the text of the title and information for * highlighting the relevant terms in the title.

*/ inline QueryResultItem& WithDocumentTitle(TextWithHighlights&& value) { SetDocumentTitle(std::move(value)); return *this;} /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline const TextWithHighlights& GetDocumentExcerpt() const{ return m_documentExcerpt; } /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline bool DocumentExcerptHasBeenSet() const { return m_documentExcerptHasBeenSet; } /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline void SetDocumentExcerpt(const TextWithHighlights& value) { m_documentExcerptHasBeenSet = true; m_documentExcerpt = value; } /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline void SetDocumentExcerpt(TextWithHighlights&& value) { m_documentExcerptHasBeenSet = true; m_documentExcerpt = std::move(value); } /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline QueryResultItem& WithDocumentExcerpt(const TextWithHighlights& value) { SetDocumentExcerpt(value); return *this;} /** *

An extract of the text in the document. Contains information about * highlighting the relevant terms in the excerpt.

*/ inline QueryResultItem& WithDocumentExcerpt(TextWithHighlights&& value) { SetDocumentExcerpt(std::move(value)); return *this;} /** *

The URI of the original location of the document.

*/ inline const Aws::String& GetDocumentURI() const{ return m_documentURI; } /** *

The URI of the original location of the document.

*/ inline bool DocumentURIHasBeenSet() const { return m_documentURIHasBeenSet; } /** *

The URI of the original location of the document.

*/ inline void SetDocumentURI(const Aws::String& value) { m_documentURIHasBeenSet = true; m_documentURI = value; } /** *

The URI of the original location of the document.

*/ inline void SetDocumentURI(Aws::String&& value) { m_documentURIHasBeenSet = true; m_documentURI = std::move(value); } /** *

The URI of the original location of the document.

*/ inline void SetDocumentURI(const char* value) { m_documentURIHasBeenSet = true; m_documentURI.assign(value); } /** *

The URI of the original location of the document.

*/ inline QueryResultItem& WithDocumentURI(const Aws::String& value) { SetDocumentURI(value); return *this;} /** *

The URI of the original location of the document.

*/ inline QueryResultItem& WithDocumentURI(Aws::String&& value) { SetDocumentURI(std::move(value)); return *this;} /** *

The URI of the original location of the document.

*/ inline QueryResultItem& WithDocumentURI(const char* value) { SetDocumentURI(value); return *this;} /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline const Aws::Vector& GetDocumentAttributes() const{ return m_documentAttributes; } /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline bool DocumentAttributesHasBeenSet() const { return m_documentAttributesHasBeenSet; } /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline void SetDocumentAttributes(const Aws::Vector& value) { m_documentAttributesHasBeenSet = true; m_documentAttributes = value; } /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline void SetDocumentAttributes(Aws::Vector&& value) { m_documentAttributesHasBeenSet = true; m_documentAttributes = std::move(value); } /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline QueryResultItem& WithDocumentAttributes(const Aws::Vector& value) { SetDocumentAttributes(value); return *this;} /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline QueryResultItem& WithDocumentAttributes(Aws::Vector&& value) { SetDocumentAttributes(std::move(value)); return *this;} /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline QueryResultItem& AddDocumentAttributes(const DocumentAttribute& value) { m_documentAttributesHasBeenSet = true; m_documentAttributes.push_back(value); return *this; } /** *

An array of document fields/attributes assigned to a document in the search * results. For example, the document author (_author) or the source * URI (_source_uri) of the document.

*/ inline QueryResultItem& AddDocumentAttributes(DocumentAttribute&& value) { m_documentAttributesHasBeenSet = true; m_documentAttributes.push_back(std::move(value)); return *this; } /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline const ScoreAttributes& GetScoreAttributes() const{ return m_scoreAttributes; } /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline bool ScoreAttributesHasBeenSet() const { return m_scoreAttributesHasBeenSet; } /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline void SetScoreAttributes(const ScoreAttributes& value) { m_scoreAttributesHasBeenSet = true; m_scoreAttributes = value; } /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline void SetScoreAttributes(ScoreAttributes&& value) { m_scoreAttributesHasBeenSet = true; m_scoreAttributes = std::move(value); } /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline QueryResultItem& WithScoreAttributes(const ScoreAttributes& value) { SetScoreAttributes(value); return *this;} /** *

Indicates the confidence level of Amazon Kendra providing a relevant result * for the query. Each result is placed into a bin that indicates the confidence, * VERY_HIGH, HIGH, MEDIUM and * LOW. You can use the score to determine if a response meets the * confidence needed for your application.

The field is only set to * LOW when the Type field is set to * DOCUMENT and Amazon Kendra is not confident that the result is * relevant to the query.

*/ inline QueryResultItem& WithScoreAttributes(ScoreAttributes&& value) { SetScoreAttributes(std::move(value)); return *this;} /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline const Aws::String& GetFeedbackToken() const{ return m_feedbackToken; } /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline bool FeedbackTokenHasBeenSet() const { return m_feedbackTokenHasBeenSet; } /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline void SetFeedbackToken(const Aws::String& value) { m_feedbackTokenHasBeenSet = true; m_feedbackToken = value; } /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline void SetFeedbackToken(Aws::String&& value) { m_feedbackTokenHasBeenSet = true; m_feedbackToken = std::move(value); } /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline void SetFeedbackToken(const char* value) { m_feedbackTokenHasBeenSet = true; m_feedbackToken.assign(value); } /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline QueryResultItem& WithFeedbackToken(const Aws::String& value) { SetFeedbackToken(value); return *this;} /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline QueryResultItem& WithFeedbackToken(Aws::String&& value) { SetFeedbackToken(std::move(value)); return *this;} /** *

A token that identifies a particular result from a particular query. Use this * token to provide click-through feedback for the result. For more information, * see Submitting * feedback.

*/ inline QueryResultItem& WithFeedbackToken(const char* value) { SetFeedbackToken(value); return *this;} /** *

An excerpt from a table within a document.

*/ inline const TableExcerpt& GetTableExcerpt() const{ return m_tableExcerpt; } /** *

An excerpt from a table within a document.

*/ inline bool TableExcerptHasBeenSet() const { return m_tableExcerptHasBeenSet; } /** *

An excerpt from a table within a document.

*/ inline void SetTableExcerpt(const TableExcerpt& value) { m_tableExcerptHasBeenSet = true; m_tableExcerpt = value; } /** *

An excerpt from a table within a document.

*/ inline void SetTableExcerpt(TableExcerpt&& value) { m_tableExcerptHasBeenSet = true; m_tableExcerpt = std::move(value); } /** *

An excerpt from a table within a document.

*/ inline QueryResultItem& WithTableExcerpt(const TableExcerpt& value) { SetTableExcerpt(value); return *this;} /** *

An excerpt from a table within a document.

*/ inline QueryResultItem& WithTableExcerpt(TableExcerpt&& value) { SetTableExcerpt(std::move(value)); return *this;} private: Aws::String m_id; bool m_idHasBeenSet = false; QueryResultType m_type; bool m_typeHasBeenSet = false; QueryResultFormat m_format; bool m_formatHasBeenSet = false; Aws::Vector m_additionalAttributes; bool m_additionalAttributesHasBeenSet = false; Aws::String m_documentId; bool m_documentIdHasBeenSet = false; TextWithHighlights m_documentTitle; bool m_documentTitleHasBeenSet = false; TextWithHighlights m_documentExcerpt; bool m_documentExcerptHasBeenSet = false; Aws::String m_documentURI; bool m_documentURIHasBeenSet = false; Aws::Vector m_documentAttributes; bool m_documentAttributesHasBeenSet = false; ScoreAttributes m_scoreAttributes; bool m_scoreAttributesHasBeenSet = false; Aws::String m_feedbackToken; bool m_feedbackTokenHasBeenSet = false; TableExcerpt m_tableExcerpt; bool m_tableExcerptHasBeenSet = false; }; } // namespace Model } // namespace kendra } // namespace Aws