/** * 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 namespace Aws { namespace kendra { namespace Model { /** */ class AWS_KENDRA_API QueryRequest : public KendraRequest { public: QueryRequest(); // Service request name is the Operation name which will send this request out, // each operation should has unique request name, so that we can get operation's name from this request. // Note: this is not true for response, multiple operations may have the same response name, // so we can not get operation's name from response. inline virtual const char* GetServiceRequestName() const override { return "Query"; } Aws::String SerializePayload() const override; Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override; /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline const Aws::String& GetIndexId() const{ return m_indexId; } /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline bool IndexIdHasBeenSet() const { return m_indexIdHasBeenSet; } /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline void SetIndexId(const Aws::String& value) { m_indexIdHasBeenSet = true; m_indexId = value; } /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline void SetIndexId(Aws::String&& value) { m_indexIdHasBeenSet = true; m_indexId = std::move(value); } /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline void SetIndexId(const char* value) { m_indexIdHasBeenSet = true; m_indexId.assign(value); } /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline QueryRequest& WithIndexId(const Aws::String& value) { SetIndexId(value); return *this;} /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline QueryRequest& WithIndexId(Aws::String&& value) { SetIndexId(std::move(value)); return *this;} /** *

The unique identifier of the index to search. The identifier is returned in * the response from the operation.

*/ inline QueryRequest& WithIndexId(const char* value) { SetIndexId(value); return *this;} /** *

The text to search for.

*/ inline const Aws::String& GetQueryText() const{ return m_queryText; } /** *

The text to search for.

*/ inline bool QueryTextHasBeenSet() const { return m_queryTextHasBeenSet; } /** *

The text to search for.

*/ inline void SetQueryText(const Aws::String& value) { m_queryTextHasBeenSet = true; m_queryText = value; } /** *

The text to search for.

*/ inline void SetQueryText(Aws::String&& value) { m_queryTextHasBeenSet = true; m_queryText = std::move(value); } /** *

The text to search for.

*/ inline void SetQueryText(const char* value) { m_queryTextHasBeenSet = true; m_queryText.assign(value); } /** *

The text to search for.

*/ inline QueryRequest& WithQueryText(const Aws::String& value) { SetQueryText(value); return *this;} /** *

The text to search for.

*/ inline QueryRequest& WithQueryText(Aws::String&& value) { SetQueryText(std::move(value)); return *this;} /** *

The text to search for.

*/ inline QueryRequest& WithQueryText(const char* value) { SetQueryText(value); return *this;} /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline const AttributeFilter& GetAttributeFilter() const{ return m_attributeFilter; } /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline bool AttributeFilterHasBeenSet() const { return m_attributeFilterHasBeenSet; } /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline void SetAttributeFilter(const AttributeFilter& value) { m_attributeFilterHasBeenSet = true; m_attributeFilter = value; } /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline void SetAttributeFilter(AttributeFilter&& value) { m_attributeFilterHasBeenSet = true; m_attributeFilter = std::move(value); } /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline QueryRequest& WithAttributeFilter(const AttributeFilter& value) { SetAttributeFilter(value); return *this;} /** *

Enables filtered searches based on document attributes. You can only provide * one attribute filter; however, the AndAllFilters, * NotFilter, and OrAllFilters parameters contain a list * of other filters.

The AttributeFilter parameter enables you * to create a set of filtering rules that a document must satisfy to be included * in the query results.

*/ inline QueryRequest& WithAttributeFilter(AttributeFilter&& value) { SetAttributeFilter(std::move(value)); return *this;} /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline const Aws::Vector& GetFacets() const{ return m_facets; } /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline bool FacetsHasBeenSet() const { return m_facetsHasBeenSet; } /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline void SetFacets(const Aws::Vector& value) { m_facetsHasBeenSet = true; m_facets = value; } /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline void SetFacets(Aws::Vector&& value) { m_facetsHasBeenSet = true; m_facets = std::move(value); } /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline QueryRequest& WithFacets(const Aws::Vector& value) { SetFacets(value); return *this;} /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline QueryRequest& WithFacets(Aws::Vector&& value) { SetFacets(std::move(value)); return *this;} /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline QueryRequest& AddFacets(const Facet& value) { m_facetsHasBeenSet = true; m_facets.push_back(value); return *this; } /** *

An array of documents attributes. Amazon Kendra returns a count for each * attribute key specified. You can use this information to help narrow the search * for your user.

*/ inline QueryRequest& AddFacets(Facet&& value) { m_facetsHasBeenSet = true; m_facets.push_back(std::move(value)); return *this; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline const Aws::Vector& GetRequestedDocumentAttributes() const{ return m_requestedDocumentAttributes; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline bool RequestedDocumentAttributesHasBeenSet() const { return m_requestedDocumentAttributesHasBeenSet; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline void SetRequestedDocumentAttributes(const Aws::Vector& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes = value; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline void SetRequestedDocumentAttributes(Aws::Vector&& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes = std::move(value); } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline QueryRequest& WithRequestedDocumentAttributes(const Aws::Vector& value) { SetRequestedDocumentAttributes(value); return *this;} /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline QueryRequest& WithRequestedDocumentAttributes(Aws::Vector&& value) { SetRequestedDocumentAttributes(std::move(value)); return *this;} /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline QueryRequest& AddRequestedDocumentAttributes(const Aws::String& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(value); return *this; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline QueryRequest& AddRequestedDocumentAttributes(Aws::String&& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(std::move(value)); return *this; } /** *

An array of document attributes to include in the response. No other document * attributes are included in the response. By default all document attributes are * included in the response.

*/ inline QueryRequest& AddRequestedDocumentAttributes(const char* value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(value); return *this; } /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline const QueryResultType& GetQueryResultTypeFilter() const{ return m_queryResultTypeFilter; } /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline bool QueryResultTypeFilterHasBeenSet() const { return m_queryResultTypeFilterHasBeenSet; } /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline void SetQueryResultTypeFilter(const QueryResultType& value) { m_queryResultTypeFilterHasBeenSet = true; m_queryResultTypeFilter = value; } /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline void SetQueryResultTypeFilter(QueryResultType&& value) { m_queryResultTypeFilterHasBeenSet = true; m_queryResultTypeFilter = std::move(value); } /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline QueryRequest& WithQueryResultTypeFilter(const QueryResultType& value) { SetQueryResultTypeFilter(value); return *this;} /** *

Sets the type of query. Only results for the specified query type are * returned.

*/ inline QueryRequest& WithQueryResultTypeFilter(QueryResultType&& value) { SetQueryResultTypeFilter(std::move(value)); return *this;} /** *

Query results are returned in pages the size of the PageSize * parameter. By default, Amazon Kendra returns the first page of results. Use this * parameter to get result pages after the first one.

*/ inline int GetPageNumber() const{ return m_pageNumber; } /** *

Query results are returned in pages the size of the PageSize * parameter. By default, Amazon Kendra returns the first page of results. Use this * parameter to get result pages after the first one.

*/ inline bool PageNumberHasBeenSet() const { return m_pageNumberHasBeenSet; } /** *

Query results are returned in pages the size of the PageSize * parameter. By default, Amazon Kendra returns the first page of results. Use this * parameter to get result pages after the first one.

*/ inline void SetPageNumber(int value) { m_pageNumberHasBeenSet = true; m_pageNumber = value; } /** *

Query results are returned in pages the size of the PageSize * parameter. By default, Amazon Kendra returns the first page of results. Use this * parameter to get result pages after the first one.

*/ inline QueryRequest& WithPageNumber(int value) { SetPageNumber(value); return *this;} /** *

Sets the number of results that are returned in each page of results. The * default page size is 10. The maximum number of results returned is 100. If you * ask for more than 100 results, only 100 are returned.

*/ inline int GetPageSize() const{ return m_pageSize; } /** *

Sets the number of results that are returned in each page of results. The * default page size is 10. The maximum number of results returned is 100. If you * ask for more than 100 results, only 100 are returned.

*/ inline bool PageSizeHasBeenSet() const { return m_pageSizeHasBeenSet; } /** *

Sets the number of results that are returned in each page of results. The * default page size is 10. The maximum number of results returned is 100. If you * ask for more than 100 results, only 100 are returned.

*/ inline void SetPageSize(int value) { m_pageSizeHasBeenSet = true; m_pageSize = value; } /** *

Sets the number of results that are returned in each page of results. The * default page size is 10. The maximum number of results returned is 100. If you * ask for more than 100 results, only 100 are returned.

*/ inline QueryRequest& WithPageSize(int value) { SetPageSize(value); return *this;} /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline const SortingConfiguration& GetSortingConfiguration() const{ return m_sortingConfiguration; } /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline bool SortingConfigurationHasBeenSet() const { return m_sortingConfigurationHasBeenSet; } /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline void SetSortingConfiguration(const SortingConfiguration& value) { m_sortingConfigurationHasBeenSet = true; m_sortingConfiguration = value; } /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline void SetSortingConfiguration(SortingConfiguration&& value) { m_sortingConfigurationHasBeenSet = true; m_sortingConfiguration = std::move(value); } /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline QueryRequest& WithSortingConfiguration(const SortingConfiguration& value) { SetSortingConfiguration(value); return *this;} /** *

Provides information that determines how the results of the query are sorted. * You can set the field that Amazon Kendra should sort the results on, and specify * whether the results should be sorted in ascending or descending order. In the * case of ties in sorting the results, the results are sorted by relevance.

*

If you don't provide sorting configuration, the results are sorted by the * relevance that Amazon Kendra determines for the result.

*/ inline QueryRequest& WithSortingConfiguration(SortingConfiguration&& value) { SetSortingConfiguration(std::move(value)); return *this;} private: Aws::String m_indexId; bool m_indexIdHasBeenSet; Aws::String m_queryText; bool m_queryTextHasBeenSet; AttributeFilter m_attributeFilter; bool m_attributeFilterHasBeenSet; Aws::Vector m_facets; bool m_facetsHasBeenSet; Aws::Vector m_requestedDocumentAttributes; bool m_requestedDocumentAttributesHasBeenSet; QueryResultType m_queryResultTypeFilter; bool m_queryResultTypeFilterHasBeenSet; int m_pageNumber; bool m_pageNumberHasBeenSet; int m_pageSize; bool m_pageSizeHasBeenSet; SortingConfiguration m_sortingConfiguration; bool m_sortingConfigurationHasBeenSet; }; } // namespace Model } // namespace kendra } // namespace Aws