aws_sdk_personalize/operation/create_solution/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_solution::_create_solution_output::CreateSolutionOutputBuilder;
3
4pub use crate::operation::create_solution::_create_solution_input::CreateSolutionInputBuilder;
5
6impl crate::operation::create_solution::builders::CreateSolutionInputBuilder {
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::create_solution::CreateSolutionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_solution::CreateSolutionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_solution();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateSolution`.
24///
25/// <important>
26/// <p>By default, all new solutions use automatic training. With automatic training, you incur training costs while your solution is active. To avoid unnecessary costs, when you are finished you can <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UpdateSolution.html">update the solution</a> to turn off automatic training. For information about training costs, see <a href="https://aws.amazon.com/personalize/pricing/">Amazon Personalize pricing</a>.</p>
27/// </important>
28/// <p>Creates the configuration for training a model (creating a solution version). This configuration includes the recipe to use for model training and optional training configuration, such as columns to use in training and feature transformation parameters. For more information about configuring a solution, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/customizing-solution-config.html">Creating and configuring a solution</a>.</p>
29/// <p>By default, new solutions use automatic training to create solution versions every 7 days. You can change the training frequency. Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
30/// <p>To turn off automatic training, set <code>performAutoTraining</code> to false. If you turn off automatic training, you must manually create a solution version by calling the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolutionVersion.html">CreateSolutionVersion</a> operation.</p>
31/// <p>After training starts, you can get the solution version's Amazon Resource Name (ARN) with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a> API operation. To get its status, use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>.</p>
32/// <p>After training completes you can evaluate model accuracy by calling <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_GetSolutionMetrics.html">GetSolutionMetrics</a>. When you are satisfied with the solution version, you deploy it using <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateCampaign.html">CreateCampaign</a>. The campaign provides recommendations to a client through the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_RS_GetRecommendations.html">GetRecommendations</a> API.</p><note>
33/// <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code> for solution hyperparameter optimization at this time.</p>
34/// </note>
35/// <p><b>Status</b></p>
36/// <p>A solution can be in one of the following states:</p>
37/// <ul>
38/// <li>
39/// <p>CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED</p></li>
40/// <li>
41/// <p>DELETE PENDING > DELETE IN_PROGRESS</p></li>
42/// </ul>
43/// <p>To get the status of the solution, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a>. If you use manual training, the status must be ACTIVE before you call <code>CreateSolutionVersion</code>.</p>
44/// <p class="title"><b>Related APIs</b></p>
45/// <ul>
46/// <li>
47/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_UpdateSolution.html">UpdateSolution</a></p></li>
48/// <li>
49/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutions.html">ListSolutions</a></p></li>
50/// <li>
51/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolutionVersion.html">CreateSolutionVersion</a></p></li>
52/// <li>
53/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a></p></li>
54/// <li>
55/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteSolution.html">DeleteSolution</a></p></li>
56/// </ul>
57/// <ul>
58/// <li>
59/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a></p></li>
60/// <li>
61/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a></p></li>
62/// </ul>
63#[derive(::std::clone::Clone, ::std::fmt::Debug)]
64pub struct CreateSolutionFluentBuilder {
65 handle: ::std::sync::Arc<crate::client::Handle>,
66 inner: crate::operation::create_solution::builders::CreateSolutionInputBuilder,
67 config_override: ::std::option::Option<crate::config::Builder>,
68}
69impl
70 crate::client::customize::internal::CustomizableSend<
71 crate::operation::create_solution::CreateSolutionOutput,
72 crate::operation::create_solution::CreateSolutionError,
73 > for CreateSolutionFluentBuilder
74{
75 fn send(
76 self,
77 config_override: crate::config::Builder,
78 ) -> crate::client::customize::internal::BoxFuture<
79 crate::client::customize::internal::SendResult<
80 crate::operation::create_solution::CreateSolutionOutput,
81 crate::operation::create_solution::CreateSolutionError,
82 >,
83 > {
84 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
85 }
86}
87impl CreateSolutionFluentBuilder {
88 /// Creates a new `CreateSolutionFluentBuilder`.
89 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
90 Self {
91 handle,
92 inner: ::std::default::Default::default(),
93 config_override: ::std::option::Option::None,
94 }
95 }
96 /// Access the CreateSolution as a reference.
97 pub fn as_input(&self) -> &crate::operation::create_solution::builders::CreateSolutionInputBuilder {
98 &self.inner
99 }
100 /// Sends the request and returns the response.
101 ///
102 /// If an error occurs, an `SdkError` will be returned with additional details that
103 /// can be matched against.
104 ///
105 /// By default, any retryable failures will be retried twice. Retry behavior
106 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
107 /// set when configuring the client.
108 pub async fn send(
109 self,
110 ) -> ::std::result::Result<
111 crate::operation::create_solution::CreateSolutionOutput,
112 ::aws_smithy_runtime_api::client::result::SdkError<
113 crate::operation::create_solution::CreateSolutionError,
114 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
115 >,
116 > {
117 let input = self
118 .inner
119 .build()
120 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
121 let runtime_plugins = crate::operation::create_solution::CreateSolution::operation_runtime_plugins(
122 self.handle.runtime_plugins.clone(),
123 &self.handle.conf,
124 self.config_override,
125 );
126 crate::operation::create_solution::CreateSolution::orchestrate(&runtime_plugins, input).await
127 }
128
129 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
130 pub fn customize(
131 self,
132 ) -> crate::client::customize::CustomizableOperation<
133 crate::operation::create_solution::CreateSolutionOutput,
134 crate::operation::create_solution::CreateSolutionError,
135 Self,
136 > {
137 crate::client::customize::CustomizableOperation::new(self)
138 }
139 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
140 self.set_config_override(::std::option::Option::Some(config_override.into()));
141 self
142 }
143
144 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
145 self.config_override = config_override;
146 self
147 }
148 /// <p>The name for the solution.</p>
149 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.name(input.into());
151 self
152 }
153 /// <p>The name for the solution.</p>
154 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_name(input);
156 self
157 }
158 /// <p>The name for the solution.</p>
159 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_name()
161 }
162 /// <p>Whether to perform hyperparameter optimization (HPO) on the specified or selected recipe. The default is <code>false</code>.</p>
163 /// <p>When performing AutoML, this parameter is always <code>true</code> and you should not set it to <code>false</code>.</p>
164 pub fn perform_hpo(mut self, input: bool) -> Self {
165 self.inner = self.inner.perform_hpo(input);
166 self
167 }
168 /// <p>Whether to perform hyperparameter optimization (HPO) on the specified or selected recipe. The default is <code>false</code>.</p>
169 /// <p>When performing AutoML, this parameter is always <code>true</code> and you should not set it to <code>false</code>.</p>
170 pub fn set_perform_hpo(mut self, input: ::std::option::Option<bool>) -> Self {
171 self.inner = self.inner.set_perform_hpo(input);
172 self
173 }
174 /// <p>Whether to perform hyperparameter optimization (HPO) on the specified or selected recipe. The default is <code>false</code>.</p>
175 /// <p>When performing AutoML, this parameter is always <code>true</code> and you should not set it to <code>false</code>.</p>
176 pub fn get_perform_hpo(&self) -> &::std::option::Option<bool> {
177 self.inner.get_perform_hpo()
178 }
179 /// <important>
180 /// <p>We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
181 /// </important>
182 /// <p>Whether to perform automated machine learning (AutoML). The default is <code>false</code>. For this case, you must specify <code>recipeArn</code>.</p>
183 /// <p>When set to <code>true</code>, Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omit <code>recipeArn</code>. Amazon Personalize determines the optimal recipe by running tests with different values for the hyperparameters. AutoML lengthens the training process as compared to selecting a specific recipe.</p>
184 pub fn perform_auto_ml(mut self, input: bool) -> Self {
185 self.inner = self.inner.perform_auto_ml(input);
186 self
187 }
188 /// <important>
189 /// <p>We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
190 /// </important>
191 /// <p>Whether to perform automated machine learning (AutoML). The default is <code>false</code>. For this case, you must specify <code>recipeArn</code>.</p>
192 /// <p>When set to <code>true</code>, Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omit <code>recipeArn</code>. Amazon Personalize determines the optimal recipe by running tests with different values for the hyperparameters. AutoML lengthens the training process as compared to selecting a specific recipe.</p>
193 pub fn set_perform_auto_ml(mut self, input: ::std::option::Option<bool>) -> Self {
194 self.inner = self.inner.set_perform_auto_ml(input);
195 self
196 }
197 /// <important>
198 /// <p>We don't recommend enabling automated machine learning. Instead, match your use case to the available Amazon Personalize recipes. For more information, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
199 /// </important>
200 /// <p>Whether to perform automated machine learning (AutoML). The default is <code>false</code>. For this case, you must specify <code>recipeArn</code>.</p>
201 /// <p>When set to <code>true</code>, Amazon Personalize analyzes your training data and selects the optimal USER_PERSONALIZATION recipe and hyperparameters. In this case, you must omit <code>recipeArn</code>. Amazon Personalize determines the optimal recipe by running tests with different values for the hyperparameters. AutoML lengthens the training process as compared to selecting a specific recipe.</p>
202 pub fn get_perform_auto_ml(&self) -> &::std::option::Option<bool> {
203 self.inner.get_perform_auto_ml()
204 }
205 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). The default is <code>True</code> and the solution automatically creates new solution versions every 7 days. You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration. For more information about automatic training, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
206 /// <p>Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training.</p>
207 /// <p>After training starts, you can get the solution version's Amazon Resource Name (ARN) with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a> API operation. To get its status, use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>.</p>
208 pub fn perform_auto_training(mut self, input: bool) -> Self {
209 self.inner = self.inner.perform_auto_training(input);
210 self
211 }
212 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). The default is <code>True</code> and the solution automatically creates new solution versions every 7 days. You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration. For more information about automatic training, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
213 /// <p>Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training.</p>
214 /// <p>After training starts, you can get the solution version's Amazon Resource Name (ARN) with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a> API operation. To get its status, use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>.</p>
215 pub fn set_perform_auto_training(mut self, input: ::std::option::Option<bool>) -> Self {
216 self.inner = self.inner.set_perform_auto_training(input);
217 self
218 }
219 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). The default is <code>True</code> and the solution automatically creates new solution versions every 7 days. You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration. For more information about automatic training, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/solution-config-auto-training.html">Configuring automatic training</a>.</p>
220 /// <p>Automatic solution version creation starts within one hour after the solution is ACTIVE. If you manually create a solution version within the hour, the solution skips the first automatic training.</p>
221 /// <p>After training starts, you can get the solution version's Amazon Resource Name (ARN) with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutionVersions.html">ListSolutionVersions</a> API operation. To get its status, use the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>.</p>
222 pub fn get_perform_auto_training(&self) -> &::std::option::Option<bool> {
223 self.inner.get_perform_auto_training()
224 }
225 /// <p>The Amazon Resource Name (ARN) of the recipe to use for model training. This is required when <code>performAutoML</code> is false. For information about different Amazon Personalize recipes and their ARNs, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
226 pub fn recipe_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227 self.inner = self.inner.recipe_arn(input.into());
228 self
229 }
230 /// <p>The Amazon Resource Name (ARN) of the recipe to use for model training. This is required when <code>performAutoML</code> is false. For information about different Amazon Personalize recipes and their ARNs, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
231 pub fn set_recipe_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232 self.inner = self.inner.set_recipe_arn(input);
233 self
234 }
235 /// <p>The Amazon Resource Name (ARN) of the recipe to use for model training. This is required when <code>performAutoML</code> is false. For information about different Amazon Personalize recipes and their ARNs, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/working-with-predefined-recipes.html">Choosing a recipe</a>.</p>
236 pub fn get_recipe_arn(&self) -> &::std::option::Option<::std::string::String> {
237 self.inner.get_recipe_arn()
238 }
239 /// <p>The Amazon Resource Name (ARN) of the dataset group that provides the training data.</p>
240 pub fn dataset_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241 self.inner = self.inner.dataset_group_arn(input.into());
242 self
243 }
244 /// <p>The Amazon Resource Name (ARN) of the dataset group that provides the training data.</p>
245 pub fn set_dataset_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
246 self.inner = self.inner.set_dataset_group_arn(input);
247 self
248 }
249 /// <p>The Amazon Resource Name (ARN) of the dataset group that provides the training data.</p>
250 pub fn get_dataset_group_arn(&self) -> &::std::option::Option<::std::string::String> {
251 self.inner.get_dataset_group_arn()
252 }
253 /// <p>When your have multiple event types (using an <code>EVENT_TYPE</code> schema field), this parameter specifies which event type (for example, 'click' or 'like') is used for training the model.</p>
254 /// <p>If you do not provide an <code>eventType</code>, Amazon Personalize will use all interactions for training with equal weight regardless of type.</p>
255 pub fn event_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
256 self.inner = self.inner.event_type(input.into());
257 self
258 }
259 /// <p>When your have multiple event types (using an <code>EVENT_TYPE</code> schema field), this parameter specifies which event type (for example, 'click' or 'like') is used for training the model.</p>
260 /// <p>If you do not provide an <code>eventType</code>, Amazon Personalize will use all interactions for training with equal weight regardless of type.</p>
261 pub fn set_event_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262 self.inner = self.inner.set_event_type(input);
263 self
264 }
265 /// <p>When your have multiple event types (using an <code>EVENT_TYPE</code> schema field), this parameter specifies which event type (for example, 'click' or 'like') is used for training the model.</p>
266 /// <p>If you do not provide an <code>eventType</code>, Amazon Personalize will use all interactions for training with equal weight regardless of type.</p>
267 pub fn get_event_type(&self) -> &::std::option::Option<::std::string::String> {
268 self.inner.get_event_type()
269 }
270 /// <p>The configuration properties for the solution. When <code>performAutoML</code> is set to true, Amazon Personalize only evaluates the <code>autoMLConfig</code> section of the solution configuration.</p><note>
271 /// <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code> at this time.</p>
272 /// </note>
273 pub fn solution_config(mut self, input: crate::types::SolutionConfig) -> Self {
274 self.inner = self.inner.solution_config(input);
275 self
276 }
277 /// <p>The configuration properties for the solution. When <code>performAutoML</code> is set to true, Amazon Personalize only evaluates the <code>autoMLConfig</code> section of the solution configuration.</p><note>
278 /// <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code> at this time.</p>
279 /// </note>
280 pub fn set_solution_config(mut self, input: ::std::option::Option<crate::types::SolutionConfig>) -> Self {
281 self.inner = self.inner.set_solution_config(input);
282 self
283 }
284 /// <p>The configuration properties for the solution. When <code>performAutoML</code> is set to true, Amazon Personalize only evaluates the <code>autoMLConfig</code> section of the solution configuration.</p><note>
285 /// <p>Amazon Personalize doesn't support configuring the <code>hpoObjective</code> at this time.</p>
286 /// </note>
287 pub fn get_solution_config(&self) -> &::std::option::Option<crate::types::SolutionConfig> {
288 self.inner.get_solution_config()
289 }
290 ///
291 /// Appends an item to `tags`.
292 ///
293 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
294 ///
295 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution.</p>
296 pub fn tags(mut self, input: crate::types::Tag) -> Self {
297 self.inner = self.inner.tags(input);
298 self
299 }
300 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution.</p>
301 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
302 self.inner = self.inner.set_tags(input);
303 self
304 }
305 /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution.</p>
306 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
307 self.inner.get_tags()
308 }
309}