aws_sdk_kendra/operation/update_query_suggestions_config/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_query_suggestions_config::_update_query_suggestions_config_output::UpdateQuerySuggestionsConfigOutputBuilder;
3
4pub use crate::operation::update_query_suggestions_config::_update_query_suggestions_config_input::UpdateQuerySuggestionsConfigInputBuilder;
5
6impl crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder {
7 /// Sends a request with this input using the given client.
8 pub async fn send_with(
9 self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_query_suggestions_config();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateQuerySuggestionsConfig`.
24///
25/// <p>Updates the settings of query suggestions for an index.</p>
26/// <p>Amazon Kendra supports partial updates, so you only need to provide the fields you want to update.</p>
27/// <p>If an update is currently processing, you need to wait for the update to finish before making another update.</p>
28/// <p>Updates to query suggestions settings might not take effect right away. The time for your updated settings to take effect depends on the updates made and the number of search queries in your index.</p>
29/// <p>You can still enable/disable query suggestions at any time.</p>
30/// <p><code>UpdateQuerySuggestionsConfig</code> is currently not supported in the Amazon Web Services GovCloud (US-West) region.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct UpdateQuerySuggestionsConfigFluentBuilder {
33 handle: ::std::sync::Arc<crate::client::Handle>,
34 inner: crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder,
35 config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38 crate::client::customize::internal::CustomizableSend<
39 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
40 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
41 > for UpdateQuerySuggestionsConfigFluentBuilder
42{
43 fn send(
44 self,
45 config_override: crate::config::Builder,
46 ) -> crate::client::customize::internal::BoxFuture<
47 crate::client::customize::internal::SendResult<
48 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
49 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
50 >,
51 > {
52 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53 }
54}
55impl UpdateQuerySuggestionsConfigFluentBuilder {
56 /// Creates a new `UpdateQuerySuggestionsConfigFluentBuilder`.
57 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58 Self {
59 handle,
60 inner: ::std::default::Default::default(),
61 config_override: ::std::option::Option::None,
62 }
63 }
64 /// Access the UpdateQuerySuggestionsConfig as a reference.
65 pub fn as_input(&self) -> &crate::operation::update_query_suggestions_config::builders::UpdateQuerySuggestionsConfigInputBuilder {
66 &self.inner
67 }
68 /// Sends the request and returns the response.
69 ///
70 /// If an error occurs, an `SdkError` will be returned with additional details that
71 /// can be matched against.
72 ///
73 /// By default, any retryable failures will be retried twice. Retry behavior
74 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75 /// set when configuring the client.
76 pub async fn send(
77 self,
78 ) -> ::std::result::Result<
79 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
80 ::aws_smithy_runtime_api::client::result::SdkError<
81 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
82 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83 >,
84 > {
85 let input = self
86 .inner
87 .build()
88 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89 let runtime_plugins = crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfig::operation_runtime_plugins(
90 self.handle.runtime_plugins.clone(),
91 &self.handle.conf,
92 self.config_override,
93 );
94 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfig::orchestrate(&runtime_plugins, input).await
95 }
96
97 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98 pub fn customize(
99 self,
100 ) -> crate::client::customize::CustomizableOperation<
101 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigOutput,
102 crate::operation::update_query_suggestions_config::UpdateQuerySuggestionsConfigError,
103 Self,
104 > {
105 crate::client::customize::CustomizableOperation::new(self)
106 }
107 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108 self.set_config_override(::std::option::Option::Some(config_override.into()));
109 self
110 }
111
112 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113 self.config_override = config_override;
114 self
115 }
116 /// <p>The identifier of the index with query suggestions you want to update.</p>
117 pub fn index_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118 self.inner = self.inner.index_id(input.into());
119 self
120 }
121 /// <p>The identifier of the index with query suggestions you want to update.</p>
122 pub fn set_index_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123 self.inner = self.inner.set_index_id(input);
124 self
125 }
126 /// <p>The identifier of the index with query suggestions you want to update.</p>
127 pub fn get_index_id(&self) -> &::std::option::Option<::std::string::String> {
128 self.inner.get_index_id()
129 }
130 /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
131 /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
132 /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
133 pub fn mode(mut self, input: crate::types::Mode) -> Self {
134 self.inner = self.inner.mode(input);
135 self
136 }
137 /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
138 /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
139 /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
140 pub fn set_mode(mut self, input: ::std::option::Option<crate::types::Mode>) -> Self {
141 self.inner = self.inner.set_mode(input);
142 self
143 }
144 /// <p>Set the mode to <code>ENABLED</code> or <code>LEARN_ONLY</code>.</p>
145 /// <p>By default, Amazon Kendra enables query suggestions. <code>LEARN_ONLY</code> mode allows you to turn off query suggestions. You can to update this at any time.</p>
146 /// <p>In <code>LEARN_ONLY</code> mode, Amazon Kendra continues to learn from new queries to keep suggestions up to date for when you are ready to switch to ENABLED mode again.</p>
147 pub fn get_mode(&self) -> &::std::option::Option<crate::types::Mode> {
148 self.inner.get_mode()
149 }
150 /// <p>How recent your queries are in your query log time window.</p>
151 /// <p>The time window is the number of days from current day to past days.</p>
152 /// <p>By default, Amazon Kendra sets this to 180.</p>
153 pub fn query_log_look_back_window_in_days(mut self, input: i32) -> Self {
154 self.inner = self.inner.query_log_look_back_window_in_days(input);
155 self
156 }
157 /// <p>How recent your queries are in your query log time window.</p>
158 /// <p>The time window is the number of days from current day to past days.</p>
159 /// <p>By default, Amazon Kendra sets this to 180.</p>
160 pub fn set_query_log_look_back_window_in_days(mut self, input: ::std::option::Option<i32>) -> Self {
161 self.inner = self.inner.set_query_log_look_back_window_in_days(input);
162 self
163 }
164 /// <p>How recent your queries are in your query log time window.</p>
165 /// <p>The time window is the number of days from current day to past days.</p>
166 /// <p>By default, Amazon Kendra sets this to 180.</p>
167 pub fn get_query_log_look_back_window_in_days(&self) -> &::std::option::Option<i32> {
168 self.inner.get_query_log_look_back_window_in_days()
169 }
170 /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
171 /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
172 /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
173 /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
174 pub fn include_queries_without_user_information(mut self, input: bool) -> Self {
175 self.inner = self.inner.include_queries_without_user_information(input);
176 self
177 }
178 /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
179 /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
180 /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
181 /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
182 pub fn set_include_queries_without_user_information(mut self, input: ::std::option::Option<bool>) -> Self {
183 self.inner = self.inner.set_include_queries_without_user_information(input);
184 self
185 }
186 /// <p><code>TRUE</code> to include queries without user information (i.e. all queries, irrespective of the user), otherwise <code>FALSE</code> to only include queries with user information.</p>
187 /// <p>If you pass user information to Amazon Kendra along with the queries, you can set this flag to <code>FALSE</code> and instruct Amazon Kendra to only consider queries with user information.</p>
188 /// <p>If you set to <code>FALSE</code>, Amazon Kendra only considers queries searched at least <code>MinimumQueryCount</code> times across <code>MinimumNumberOfQueryingUsers</code> unique users for suggestions.</p>
189 /// <p>If you set to <code>TRUE</code>, Amazon Kendra ignores all user information and learns from all queries.</p>
190 pub fn get_include_queries_without_user_information(&self) -> &::std::option::Option<bool> {
191 self.inner.get_include_queries_without_user_information()
192 }
193 /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
194 /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
195 /// <p>How you tune this setting depends on your specific needs.</p>
196 pub fn minimum_number_of_querying_users(mut self, input: i32) -> Self {
197 self.inner = self.inner.minimum_number_of_querying_users(input);
198 self
199 }
200 /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
201 /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
202 /// <p>How you tune this setting depends on your specific needs.</p>
203 pub fn set_minimum_number_of_querying_users(mut self, input: ::std::option::Option<i32>) -> Self {
204 self.inner = self.inner.set_minimum_number_of_querying_users(input);
205 self
206 }
207 /// <p>The minimum number of unique users who must search a query in order for the query to be eligible to suggest to your users.</p>
208 /// <p>Increasing this number might decrease the number of suggestions. However, this ensures a query is searched by many users and is truly popular to suggest to users.</p>
209 /// <p>How you tune this setting depends on your specific needs.</p>
210 pub fn get_minimum_number_of_querying_users(&self) -> &::std::option::Option<i32> {
211 self.inner.get_minimum_number_of_querying_users()
212 }
213 /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
214 /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
215 /// <p>How you tune this setting depends on your specific needs.</p>
216 pub fn minimum_query_count(mut self, input: i32) -> Self {
217 self.inner = self.inner.minimum_query_count(input);
218 self
219 }
220 /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
221 /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
222 /// <p>How you tune this setting depends on your specific needs.</p>
223 pub fn set_minimum_query_count(mut self, input: ::std::option::Option<i32>) -> Self {
224 self.inner = self.inner.set_minimum_query_count(input);
225 self
226 }
227 /// <p>The the minimum number of times a query must be searched in order to be eligible to suggest to your users.</p>
228 /// <p>Decreasing this number increases the number of suggestions. However, this affects the quality of suggestions as it sets a low bar for a query to be considered popular to suggest to users.</p>
229 /// <p>How you tune this setting depends on your specific needs.</p>
230 pub fn get_minimum_query_count(&self) -> &::std::option::Option<i32> {
231 self.inner.get_minimum_query_count()
232 }
233 /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
234 pub fn attribute_suggestions_config(mut self, input: crate::types::AttributeSuggestionsUpdateConfig) -> Self {
235 self.inner = self.inner.attribute_suggestions_config(input);
236 self
237 }
238 /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
239 pub fn set_attribute_suggestions_config(mut self, input: ::std::option::Option<crate::types::AttributeSuggestionsUpdateConfig>) -> Self {
240 self.inner = self.inner.set_attribute_suggestions_config(input);
241 self
242 }
243 /// <p>Configuration information for the document fields/attributes that you want to base query suggestions on.</p>
244 pub fn get_attribute_suggestions_config(&self) -> &::std::option::Option<crate::types::AttributeSuggestionsUpdateConfig> {
245 self.inner.get_attribute_suggestions_config()
246 }
247}