AWS SDK for C++  1.8.95
AWS SDK for C++
QueryRequest.h
Go to the documentation of this file.
1 
6 #pragma once
15 #include <aws/kendra/model/Facet.h>
16 #include <utility>
17 
18 namespace Aws
19 {
20 namespace kendra
21 {
22 namespace Model
23 {
24 
28  {
29  public:
30  QueryRequest();
31 
32  // Service request name is the Operation name which will send this request out,
33  // each operation should has unique request name, so that we can get operation's name from this request.
34  // Note: this is not true for response, multiple operations may have the same response name,
35  // so we can not get operation's name from response.
36  inline virtual const char* GetServiceRequestName() const override { return "Query"; }
37 
38  Aws::String SerializePayload() const override;
39 
40  Aws::Http::HeaderValueCollection GetRequestSpecificHeaders() const override;
41 
42 
47  inline const Aws::String& GetIndexId() const{ return m_indexId; }
48 
53  inline bool IndexIdHasBeenSet() const { return m_indexIdHasBeenSet; }
54 
59  inline void SetIndexId(const Aws::String& value) { m_indexIdHasBeenSet = true; m_indexId = value; }
60 
65  inline void SetIndexId(Aws::String&& value) { m_indexIdHasBeenSet = true; m_indexId = std::move(value); }
66 
71  inline void SetIndexId(const char* value) { m_indexIdHasBeenSet = true; m_indexId.assign(value); }
72 
77  inline QueryRequest& WithIndexId(const Aws::String& value) { SetIndexId(value); return *this;}
78 
83  inline QueryRequest& WithIndexId(Aws::String&& value) { SetIndexId(std::move(value)); return *this;}
84 
89  inline QueryRequest& WithIndexId(const char* value) { SetIndexId(value); return *this;}
90 
91 
95  inline const Aws::String& GetQueryText() const{ return m_queryText; }
96 
100  inline bool QueryTextHasBeenSet() const { return m_queryTextHasBeenSet; }
101 
105  inline void SetQueryText(const Aws::String& value) { m_queryTextHasBeenSet = true; m_queryText = value; }
106 
110  inline void SetQueryText(Aws::String&& value) { m_queryTextHasBeenSet = true; m_queryText = std::move(value); }
111 
115  inline void SetQueryText(const char* value) { m_queryTextHasBeenSet = true; m_queryText.assign(value); }
116 
120  inline QueryRequest& WithQueryText(const Aws::String& value) { SetQueryText(value); return *this;}
121 
125  inline QueryRequest& WithQueryText(Aws::String&& value) { SetQueryText(std::move(value)); return *this;}
126 
130  inline QueryRequest& WithQueryText(const char* value) { SetQueryText(value); return *this;}
131 
132 
141  inline const AttributeFilter& GetAttributeFilter() const{ return m_attributeFilter; }
142 
151  inline bool AttributeFilterHasBeenSet() const { return m_attributeFilterHasBeenSet; }
152 
161  inline void SetAttributeFilter(const AttributeFilter& value) { m_attributeFilterHasBeenSet = true; m_attributeFilter = value; }
162 
171  inline void SetAttributeFilter(AttributeFilter&& value) { m_attributeFilterHasBeenSet = true; m_attributeFilter = std::move(value); }
172 
181  inline QueryRequest& WithAttributeFilter(const AttributeFilter& value) { SetAttributeFilter(value); return *this;}
182 
191  inline QueryRequest& WithAttributeFilter(AttributeFilter&& value) { SetAttributeFilter(std::move(value)); return *this;}
192 
193 
199  inline const Aws::Vector<Facet>& GetFacets() const{ return m_facets; }
200 
206  inline bool FacetsHasBeenSet() const { return m_facetsHasBeenSet; }
207 
213  inline void SetFacets(const Aws::Vector<Facet>& value) { m_facetsHasBeenSet = true; m_facets = value; }
214 
220  inline void SetFacets(Aws::Vector<Facet>&& value) { m_facetsHasBeenSet = true; m_facets = std::move(value); }
221 
227  inline QueryRequest& WithFacets(const Aws::Vector<Facet>& value) { SetFacets(value); return *this;}
228 
234  inline QueryRequest& WithFacets(Aws::Vector<Facet>&& value) { SetFacets(std::move(value)); return *this;}
235 
241  inline QueryRequest& AddFacets(const Facet& value) { m_facetsHasBeenSet = true; m_facets.push_back(value); return *this; }
242 
248  inline QueryRequest& AddFacets(Facet&& value) { m_facetsHasBeenSet = true; m_facets.push_back(std::move(value)); return *this; }
249 
250 
256  inline const Aws::Vector<Aws::String>& GetRequestedDocumentAttributes() const{ return m_requestedDocumentAttributes; }
257 
263  inline bool RequestedDocumentAttributesHasBeenSet() const { return m_requestedDocumentAttributesHasBeenSet; }
264 
270  inline void SetRequestedDocumentAttributes(const Aws::Vector<Aws::String>& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes = value; }
271 
277  inline void SetRequestedDocumentAttributes(Aws::Vector<Aws::String>&& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes = std::move(value); }
278 
284  inline QueryRequest& WithRequestedDocumentAttributes(const Aws::Vector<Aws::String>& value) { SetRequestedDocumentAttributes(value); return *this;}
285 
291  inline QueryRequest& WithRequestedDocumentAttributes(Aws::Vector<Aws::String>&& value) { SetRequestedDocumentAttributes(std::move(value)); return *this;}
292 
298  inline QueryRequest& AddRequestedDocumentAttributes(const Aws::String& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(value); return *this; }
299 
305  inline QueryRequest& AddRequestedDocumentAttributes(Aws::String&& value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(std::move(value)); return *this; }
306 
312  inline QueryRequest& AddRequestedDocumentAttributes(const char* value) { m_requestedDocumentAttributesHasBeenSet = true; m_requestedDocumentAttributes.push_back(value); return *this; }
313 
314 
319  inline const QueryResultType& GetQueryResultTypeFilter() const{ return m_queryResultTypeFilter; }
320 
325  inline bool QueryResultTypeFilterHasBeenSet() const { return m_queryResultTypeFilterHasBeenSet; }
326 
331  inline void SetQueryResultTypeFilter(const QueryResultType& value) { m_queryResultTypeFilterHasBeenSet = true; m_queryResultTypeFilter = value; }
332 
337  inline void SetQueryResultTypeFilter(QueryResultType&& value) { m_queryResultTypeFilterHasBeenSet = true; m_queryResultTypeFilter = std::move(value); }
338 
343  inline QueryRequest& WithQueryResultTypeFilter(const QueryResultType& value) { SetQueryResultTypeFilter(value); return *this;}
344 
349  inline QueryRequest& WithQueryResultTypeFilter(QueryResultType&& value) { SetQueryResultTypeFilter(std::move(value)); return *this;}
350 
351 
357  inline int GetPageNumber() const{ return m_pageNumber; }
358 
364  inline bool PageNumberHasBeenSet() const { return m_pageNumberHasBeenSet; }
365 
371  inline void SetPageNumber(int value) { m_pageNumberHasBeenSet = true; m_pageNumber = value; }
372 
378  inline QueryRequest& WithPageNumber(int value) { SetPageNumber(value); return *this;}
379 
380 
386  inline int GetPageSize() const{ return m_pageSize; }
387 
393  inline bool PageSizeHasBeenSet() const { return m_pageSizeHasBeenSet; }
394 
400  inline void SetPageSize(int value) { m_pageSizeHasBeenSet = true; m_pageSize = value; }
401 
407  inline QueryRequest& WithPageSize(int value) { SetPageSize(value); return *this;}
408 
409 
418  inline const SortingConfiguration& GetSortingConfiguration() const{ return m_sortingConfiguration; }
419 
428  inline bool SortingConfigurationHasBeenSet() const { return m_sortingConfigurationHasBeenSet; }
429 
438  inline void SetSortingConfiguration(const SortingConfiguration& value) { m_sortingConfigurationHasBeenSet = true; m_sortingConfiguration = value; }
439 
448  inline void SetSortingConfiguration(SortingConfiguration&& value) { m_sortingConfigurationHasBeenSet = true; m_sortingConfiguration = std::move(value); }
449 
458  inline QueryRequest& WithSortingConfiguration(const SortingConfiguration& value) { SetSortingConfiguration(value); return *this;}
459 
468  inline QueryRequest& WithSortingConfiguration(SortingConfiguration&& value) { SetSortingConfiguration(std::move(value)); return *this;}
469 
470 
474  inline const UserContext& GetUserContext() const{ return m_userContext; }
475 
479  inline bool UserContextHasBeenSet() const { return m_userContextHasBeenSet; }
480 
484  inline void SetUserContext(const UserContext& value) { m_userContextHasBeenSet = true; m_userContext = value; }
485 
489  inline void SetUserContext(UserContext&& value) { m_userContextHasBeenSet = true; m_userContext = std::move(value); }
490 
494  inline QueryRequest& WithUserContext(const UserContext& value) { SetUserContext(value); return *this;}
495 
499  inline QueryRequest& WithUserContext(UserContext&& value) { SetUserContext(std::move(value)); return *this;}
500 
501  private:
502 
503  Aws::String m_indexId;
504  bool m_indexIdHasBeenSet;
505 
506  Aws::String m_queryText;
507  bool m_queryTextHasBeenSet;
508 
509  AttributeFilter m_attributeFilter;
510  bool m_attributeFilterHasBeenSet;
511 
512  Aws::Vector<Facet> m_facets;
513  bool m_facetsHasBeenSet;
514 
515  Aws::Vector<Aws::String> m_requestedDocumentAttributes;
516  bool m_requestedDocumentAttributesHasBeenSet;
517 
518  QueryResultType m_queryResultTypeFilter;
519  bool m_queryResultTypeFilterHasBeenSet;
520 
521  int m_pageNumber;
522  bool m_pageNumberHasBeenSet;
523 
524  int m_pageSize;
525  bool m_pageSizeHasBeenSet;
526 
527  SortingConfiguration m_sortingConfiguration;
528  bool m_sortingConfigurationHasBeenSet;
529 
530  UserContext m_userContext;
531  bool m_userContextHasBeenSet;
532  };
533 
534 } // namespace Model
535 } // namespace kendra
536 } // namespace Aws
const Aws::Vector< Facet > & GetFacets() const
Definition: QueryRequest.h:199
#define AWS_KENDRA_API
QueryRequest & AddRequestedDocumentAttributes(const Aws::String &value)
Definition: QueryRequest.h:298
QueryRequest & WithRequestedDocumentAttributes(Aws::Vector< Aws::String > &&value)
Definition: QueryRequest.h:291
void SetIndexId(Aws::String &&value)
Definition: QueryRequest.h:65
const Aws::String & GetQueryText() const
Definition: QueryRequest.h:95
QueryRequest & AddRequestedDocumentAttributes(const char *value)
Definition: QueryRequest.h:312
QueryRequest & WithQueryText(const char *value)
Definition: QueryRequest.h:130
QueryRequest & WithQueryText(Aws::String &&value)
Definition: QueryRequest.h:125
QueryRequest & WithSortingConfiguration(const SortingConfiguration &value)
Definition: QueryRequest.h:458
QueryRequest & WithFacets(const Aws::Vector< Facet > &value)
Definition: QueryRequest.h:227
void SetUserContext(const UserContext &value)
Definition: QueryRequest.h:484
std::vector< T, Aws::Allocator< T > > Vector
Definition: AWSVector.h:17
const UserContext & GetUserContext() const
Definition: QueryRequest.h:474
Aws::Map< Aws::String, Aws::String > HeaderValueCollection
Definition: HttpTypes.h:53
QueryRequest & AddFacets(Facet &&value)
Definition: QueryRequest.h:248
void SetIndexId(const Aws::String &value)
Definition: QueryRequest.h:59
const Aws::Vector< Aws::String > & GetRequestedDocumentAttributes() const
Definition: QueryRequest.h:256
void SetSortingConfiguration(const SortingConfiguration &value)
Definition: QueryRequest.h:438
QueryRequest & WithPageSize(int value)
Definition: QueryRequest.h:407
void SetQueryText(Aws::String &&value)
Definition: QueryRequest.h:110
bool RequestedDocumentAttributesHasBeenSet() const
Definition: QueryRequest.h:263
void SetQueryResultTypeFilter(QueryResultType &&value)
Definition: QueryRequest.h:337
void SetSortingConfiguration(SortingConfiguration &&value)
Definition: QueryRequest.h:448
QueryRequest & AddFacets(const Facet &value)
Definition: QueryRequest.h:241
void SetQueryResultTypeFilter(const QueryResultType &value)
Definition: QueryRequest.h:331
bool SortingConfigurationHasBeenSet() const
Definition: QueryRequest.h:428
void SetFacets(Aws::Vector< Facet > &&value)
Definition: QueryRequest.h:220
void SetAttributeFilter(const AttributeFilter &value)
Definition: QueryRequest.h:161
bool QueryResultTypeFilterHasBeenSet() const
Definition: QueryRequest.h:325
QueryRequest & WithPageNumber(int value)
Definition: QueryRequest.h:378
QueryRequest & WithRequestedDocumentAttributes(const Aws::Vector< Aws::String > &value)
Definition: QueryRequest.h:284
void SetQueryText(const char *value)
Definition: QueryRequest.h:115
QueryRequest & WithIndexId(Aws::String &&value)
Definition: QueryRequest.h:83
QueryRequest & WithSortingConfiguration(SortingConfiguration &&value)
Definition: QueryRequest.h:468
virtual const char * GetServiceRequestName() const override
Definition: QueryRequest.h:36
void SetAttributeFilter(AttributeFilter &&value)
Definition: QueryRequest.h:171
void SetUserContext(UserContext &&value)
Definition: QueryRequest.h:489
QueryRequest & WithFacets(Aws::Vector< Facet > &&value)
Definition: QueryRequest.h:234
QueryRequest & WithIndexId(const char *value)
Definition: QueryRequest.h:89
void SetFacets(const Aws::Vector< Facet > &value)
Definition: QueryRequest.h:213
void SetRequestedDocumentAttributes(Aws::Vector< Aws::String > &&value)
Definition: QueryRequest.h:277
QueryRequest & WithQueryResultTypeFilter(const QueryResultType &value)
Definition: QueryRequest.h:343
void SetRequestedDocumentAttributes(const Aws::Vector< Aws::String > &value)
Definition: QueryRequest.h:270
const Aws::String & GetIndexId() const
Definition: QueryRequest.h:47
QueryRequest & WithUserContext(const UserContext &value)
Definition: QueryRequest.h:494
QueryRequest & WithAttributeFilter(AttributeFilter &&value)
Definition: QueryRequest.h:191
const AttributeFilter & GetAttributeFilter() const
Definition: QueryRequest.h:141
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition: AWSString.h:97
QueryRequest & WithIndexId(const Aws::String &value)
Definition: QueryRequest.h:77
QueryRequest & WithQueryText(const Aws::String &value)
Definition: QueryRequest.h:120
QueryRequest & AddRequestedDocumentAttributes(Aws::String &&value)
Definition: QueryRequest.h:305
QueryRequest & WithUserContext(UserContext &&value)
Definition: QueryRequest.h:499
const QueryResultType & GetQueryResultTypeFilter() const
Definition: QueryRequest.h:319
const SortingConfiguration & GetSortingConfiguration() const
Definition: QueryRequest.h:418
void SetIndexId(const char *value)
Definition: QueryRequest.h:71
QueryRequest & WithQueryResultTypeFilter(QueryResultType &&value)
Definition: QueryRequest.h:349
void SetQueryText(const Aws::String &value)
Definition: QueryRequest.h:105
QueryRequest & WithAttributeFilter(const AttributeFilter &value)
Definition: QueryRequest.h:181