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

Specifies the document attribute to use to sort the response to a Amazon * Kendra query. You can specify a single attribute for sorting. The attribute must * have the Sortable flag set to true, otherwise Amazon * Kendra returns an exception.

You can sort attributes of the following * types.

  • Date value

  • Long value

  • *

    String value

You can't sort attributes of the following * type.

  • String list value

See Also:

* AWS * API Reference

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

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline const Aws::String& GetDocumentAttributeKey() const{ return m_documentAttributeKey; } /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline bool DocumentAttributeKeyHasBeenSet() const { return m_documentAttributeKeyHasBeenSet; } /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline void SetDocumentAttributeKey(const Aws::String& value) { m_documentAttributeKeyHasBeenSet = true; m_documentAttributeKey = value; } /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline void SetDocumentAttributeKey(Aws::String&& value) { m_documentAttributeKeyHasBeenSet = true; m_documentAttributeKey = std::move(value); } /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline void SetDocumentAttributeKey(const char* value) { m_documentAttributeKeyHasBeenSet = true; m_documentAttributeKey.assign(value); } /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline SortingConfiguration& WithDocumentAttributeKey(const Aws::String& value) { SetDocumentAttributeKey(value); return *this;} /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline SortingConfiguration& WithDocumentAttributeKey(Aws::String&& value) { SetDocumentAttributeKey(std::move(value)); return *this;} /** *

The name of the document attribute used to sort the response. You can use any * field that has the Sortable flag set to true.

You can also * sort by any of the following built-in attributes:

  • _category

    *
  • _created_at

  • _last_updated_at

  • *

    _version

  • _view_count

*/ inline SortingConfiguration& WithDocumentAttributeKey(const char* value) { SetDocumentAttributeKey(value); return *this;} /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline const SortOrder& GetSortOrder() const{ return m_sortOrder; } /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline bool SortOrderHasBeenSet() const { return m_sortOrderHasBeenSet; } /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline void SetSortOrder(const SortOrder& value) { m_sortOrderHasBeenSet = true; m_sortOrder = value; } /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline void SetSortOrder(SortOrder&& value) { m_sortOrderHasBeenSet = true; m_sortOrder = std::move(value); } /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline SortingConfiguration& WithSortOrder(const SortOrder& value) { SetSortOrder(value); return *this;} /** *

The order that the results should be returned in. In case of ties, the * relevance assigned to the result by Amazon Kendra is used as the * tie-breaker.

*/ inline SortingConfiguration& WithSortOrder(SortOrder&& value) { SetSortOrder(std::move(value)); return *this;} private: Aws::String m_documentAttributeKey; bool m_documentAttributeKeyHasBeenSet = false; SortOrder m_sortOrder; bool m_sortOrderHasBeenSet = false; }; } // namespace Model } // namespace kendra } // namespace Aws