aws_sdk_qconnect/operation/query_assistant/
_query_assistant_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct QueryAssistantInput {
6    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
7    pub assistant_id: ::std::option::Option<::std::string::String>,
8    /// <p>The text to search for.</p>
9    pub query_text: ::std::option::Option<::std::string::String>,
10    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
11    pub next_token: ::std::option::Option<::std::string::String>,
12    /// <p>The maximum number of results to return per page.</p>
13    pub max_results: ::std::option::Option<i32>,
14    /// <p>The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
15    pub session_id: ::std::option::Option<::std::string::String>,
16    /// <p>Information about how to query content.</p>
17    pub query_condition: ::std::option::Option<::std::vec::Vec<crate::types::QueryCondition>>,
18    /// <p>Information about the query.</p>
19    pub query_input_data: ::std::option::Option<crate::types::QueryInputData>,
20    /// <p>The search type to be used against the Knowledge Base for this request. The values can be <code>SEMANTIC</code> which uses vector embeddings or <code>HYBRID</code> which use vector embeddings and raw text.</p>
21    pub override_knowledge_base_search_type: ::std::option::Option<crate::types::KnowledgeBaseSearchType>,
22}
23impl QueryAssistantInput {
24    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
25    pub fn assistant_id(&self) -> ::std::option::Option<&str> {
26        self.assistant_id.as_deref()
27    }
28    /// <p>The text to search for.</p>
29    pub fn query_text(&self) -> ::std::option::Option<&str> {
30        self.query_text.as_deref()
31    }
32    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
33    pub fn next_token(&self) -> ::std::option::Option<&str> {
34        self.next_token.as_deref()
35    }
36    /// <p>The maximum number of results to return per page.</p>
37    pub fn max_results(&self) -> ::std::option::Option<i32> {
38        self.max_results
39    }
40    /// <p>The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
41    pub fn session_id(&self) -> ::std::option::Option<&str> {
42        self.session_id.as_deref()
43    }
44    /// <p>Information about how to query content.</p>
45    ///
46    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.query_condition.is_none()`.
47    pub fn query_condition(&self) -> &[crate::types::QueryCondition] {
48        self.query_condition.as_deref().unwrap_or_default()
49    }
50    /// <p>Information about the query.</p>
51    pub fn query_input_data(&self) -> ::std::option::Option<&crate::types::QueryInputData> {
52        self.query_input_data.as_ref()
53    }
54    /// <p>The search type to be used against the Knowledge Base for this request. The values can be <code>SEMANTIC</code> which uses vector embeddings or <code>HYBRID</code> which use vector embeddings and raw text.</p>
55    pub fn override_knowledge_base_search_type(&self) -> ::std::option::Option<&crate::types::KnowledgeBaseSearchType> {
56        self.override_knowledge_base_search_type.as_ref()
57    }
58}
59impl ::std::fmt::Debug for QueryAssistantInput {
60    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
61        let mut formatter = f.debug_struct("QueryAssistantInput");
62        formatter.field("assistant_id", &self.assistant_id);
63        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
64        formatter.field("next_token", &self.next_token);
65        formatter.field("max_results", &self.max_results);
66        formatter.field("session_id", &self.session_id);
67        formatter.field("query_condition", &self.query_condition);
68        formatter.field("query_input_data", &self.query_input_data);
69        formatter.field("override_knowledge_base_search_type", &self.override_knowledge_base_search_type);
70        formatter.finish()
71    }
72}
73impl QueryAssistantInput {
74    /// Creates a new builder-style object to manufacture [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
75    pub fn builder() -> crate::operation::query_assistant::builders::QueryAssistantInputBuilder {
76        crate::operation::query_assistant::builders::QueryAssistantInputBuilder::default()
77    }
78}
79
80/// A builder for [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
82#[non_exhaustive]
83pub struct QueryAssistantInputBuilder {
84    pub(crate) assistant_id: ::std::option::Option<::std::string::String>,
85    pub(crate) query_text: ::std::option::Option<::std::string::String>,
86    pub(crate) next_token: ::std::option::Option<::std::string::String>,
87    pub(crate) max_results: ::std::option::Option<i32>,
88    pub(crate) session_id: ::std::option::Option<::std::string::String>,
89    pub(crate) query_condition: ::std::option::Option<::std::vec::Vec<crate::types::QueryCondition>>,
90    pub(crate) query_input_data: ::std::option::Option<crate::types::QueryInputData>,
91    pub(crate) override_knowledge_base_search_type: ::std::option::Option<crate::types::KnowledgeBaseSearchType>,
92}
93impl QueryAssistantInputBuilder {
94    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
95    /// This field is required.
96    pub fn assistant_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.assistant_id = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
101    pub fn set_assistant_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.assistant_id = input;
103        self
104    }
105    /// <p>The identifier of the Amazon Q in Connect assistant. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
106    pub fn get_assistant_id(&self) -> &::std::option::Option<::std::string::String> {
107        &self.assistant_id
108    }
109    /// <p>The text to search for.</p>
110    pub fn query_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.query_text = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The text to search for.</p>
115    pub fn set_query_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.query_text = input;
117        self
118    }
119    /// <p>The text to search for.</p>
120    pub fn get_query_text(&self) -> &::std::option::Option<::std::string::String> {
121        &self.query_text
122    }
123    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
124    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.next_token = ::std::option::Option::Some(input.into());
126        self
127    }
128    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
129    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.next_token = input;
131        self
132    }
133    /// <p>The token for the next set of results. Use the value returned in the previous response in the next request to retrieve the next set of results.</p>
134    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
135        &self.next_token
136    }
137    /// <p>The maximum number of results to return per page.</p>
138    pub fn max_results(mut self, input: i32) -> Self {
139        self.max_results = ::std::option::Option::Some(input);
140        self
141    }
142    /// <p>The maximum number of results to return per page.</p>
143    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
144        self.max_results = input;
145        self
146    }
147    /// <p>The maximum number of results to return per page.</p>
148    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
149        &self.max_results
150    }
151    /// <p>The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
152    pub fn session_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.session_id = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
157    pub fn set_session_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.session_id = input;
159        self
160    }
161    /// <p>The identifier of the Amazon Q in Connect session. Can be either the ID or the ARN. URLs cannot contain the ARN.</p>
162    pub fn get_session_id(&self) -> &::std::option::Option<::std::string::String> {
163        &self.session_id
164    }
165    /// Appends an item to `query_condition`.
166    ///
167    /// To override the contents of this collection use [`set_query_condition`](Self::set_query_condition).
168    ///
169    /// <p>Information about how to query content.</p>
170    pub fn query_condition(mut self, input: crate::types::QueryCondition) -> Self {
171        let mut v = self.query_condition.unwrap_or_default();
172        v.push(input);
173        self.query_condition = ::std::option::Option::Some(v);
174        self
175    }
176    /// <p>Information about how to query content.</p>
177    pub fn set_query_condition(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::QueryCondition>>) -> Self {
178        self.query_condition = input;
179        self
180    }
181    /// <p>Information about how to query content.</p>
182    pub fn get_query_condition(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::QueryCondition>> {
183        &self.query_condition
184    }
185    /// <p>Information about the query.</p>
186    pub fn query_input_data(mut self, input: crate::types::QueryInputData) -> Self {
187        self.query_input_data = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Information about the query.</p>
191    pub fn set_query_input_data(mut self, input: ::std::option::Option<crate::types::QueryInputData>) -> Self {
192        self.query_input_data = input;
193        self
194    }
195    /// <p>Information about the query.</p>
196    pub fn get_query_input_data(&self) -> &::std::option::Option<crate::types::QueryInputData> {
197        &self.query_input_data
198    }
199    /// <p>The search type to be used against the Knowledge Base for this request. The values can be <code>SEMANTIC</code> which uses vector embeddings or <code>HYBRID</code> which use vector embeddings and raw text.</p>
200    pub fn override_knowledge_base_search_type(mut self, input: crate::types::KnowledgeBaseSearchType) -> Self {
201        self.override_knowledge_base_search_type = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>The search type to be used against the Knowledge Base for this request. The values can be <code>SEMANTIC</code> which uses vector embeddings or <code>HYBRID</code> which use vector embeddings and raw text.</p>
205    pub fn set_override_knowledge_base_search_type(mut self, input: ::std::option::Option<crate::types::KnowledgeBaseSearchType>) -> Self {
206        self.override_knowledge_base_search_type = input;
207        self
208    }
209    /// <p>The search type to be used against the Knowledge Base for this request. The values can be <code>SEMANTIC</code> which uses vector embeddings or <code>HYBRID</code> which use vector embeddings and raw text.</p>
210    pub fn get_override_knowledge_base_search_type(&self) -> &::std::option::Option<crate::types::KnowledgeBaseSearchType> {
211        &self.override_knowledge_base_search_type
212    }
213    /// Consumes the builder and constructs a [`QueryAssistantInput`](crate::operation::query_assistant::QueryAssistantInput).
214    pub fn build(
215        self,
216    ) -> ::std::result::Result<crate::operation::query_assistant::QueryAssistantInput, ::aws_smithy_types::error::operation::BuildError> {
217        ::std::result::Result::Ok(crate::operation::query_assistant::QueryAssistantInput {
218            assistant_id: self.assistant_id,
219            query_text: self.query_text,
220            next_token: self.next_token,
221            max_results: self.max_results,
222            session_id: self.session_id,
223            query_condition: self.query_condition,
224            query_input_data: self.query_input_data,
225            override_knowledge_base_search_type: self.override_knowledge_base_search_type,
226        })
227    }
228}
229impl ::std::fmt::Debug for QueryAssistantInputBuilder {
230    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
231        let mut formatter = f.debug_struct("QueryAssistantInputBuilder");
232        formatter.field("assistant_id", &self.assistant_id);
233        formatter.field("query_text", &"*** Sensitive Data Redacted ***");
234        formatter.field("next_token", &self.next_token);
235        formatter.field("max_results", &self.max_results);
236        formatter.field("session_id", &self.session_id);
237        formatter.field("query_condition", &self.query_condition);
238        formatter.field("query_input_data", &self.query_input_data);
239        formatter.field("override_knowledge_base_search_type", &self.override_knowledge_base_search_type);
240        formatter.finish()
241    }
242}