aws_sdk_personalize/operation/update_solution/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_solution::_update_solution_output::UpdateSolutionOutputBuilder;
3
4pub use crate::operation::update_solution::_update_solution_input::UpdateSolutionInputBuilder;
5
6impl crate::operation::update_solution::builders::UpdateSolutionInputBuilder {
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_solution::UpdateSolutionOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_solution::UpdateSolutionError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_solution();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateSolution`.
24///
25/// <p>Updates an Amazon Personalize solution to use a different automatic training configuration. When you update a solution, you can change whether the solution uses automatic training, and you can change the training frequency. For more information about updating a solution, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/updating-solution.html">Updating a solution</a>.</p>
26/// <p>A solution update can be in one of the following states:</p>
27/// <p>CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED</p>
28/// <p>To get the status of a solution update, call the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a> API operation and find the status in the <code>latestSolutionUpdate</code>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct UpdateSolutionFluentBuilder {
31 handle: ::std::sync::Arc<crate::client::Handle>,
32 inner: crate::operation::update_solution::builders::UpdateSolutionInputBuilder,
33 config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36 crate::client::customize::internal::CustomizableSend<
37 crate::operation::update_solution::UpdateSolutionOutput,
38 crate::operation::update_solution::UpdateSolutionError,
39 > for UpdateSolutionFluentBuilder
40{
41 fn send(
42 self,
43 config_override: crate::config::Builder,
44 ) -> crate::client::customize::internal::BoxFuture<
45 crate::client::customize::internal::SendResult<
46 crate::operation::update_solution::UpdateSolutionOutput,
47 crate::operation::update_solution::UpdateSolutionError,
48 >,
49 > {
50 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51 }
52}
53impl UpdateSolutionFluentBuilder {
54 /// Creates a new `UpdateSolutionFluentBuilder`.
55 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56 Self {
57 handle,
58 inner: ::std::default::Default::default(),
59 config_override: ::std::option::Option::None,
60 }
61 }
62 /// Access the UpdateSolution as a reference.
63 pub fn as_input(&self) -> &crate::operation::update_solution::builders::UpdateSolutionInputBuilder {
64 &self.inner
65 }
66 /// Sends the request and returns the response.
67 ///
68 /// If an error occurs, an `SdkError` will be returned with additional details that
69 /// can be matched against.
70 ///
71 /// By default, any retryable failures will be retried twice. Retry behavior
72 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73 /// set when configuring the client.
74 pub async fn send(
75 self,
76 ) -> ::std::result::Result<
77 crate::operation::update_solution::UpdateSolutionOutput,
78 ::aws_smithy_runtime_api::client::result::SdkError<
79 crate::operation::update_solution::UpdateSolutionError,
80 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81 >,
82 > {
83 let input = self
84 .inner
85 .build()
86 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87 let runtime_plugins = crate::operation::update_solution::UpdateSolution::operation_runtime_plugins(
88 self.handle.runtime_plugins.clone(),
89 &self.handle.conf,
90 self.config_override,
91 );
92 crate::operation::update_solution::UpdateSolution::orchestrate(&runtime_plugins, input).await
93 }
94
95 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96 pub fn customize(
97 self,
98 ) -> crate::client::customize::CustomizableOperation<
99 crate::operation::update_solution::UpdateSolutionOutput,
100 crate::operation::update_solution::UpdateSolutionError,
101 Self,
102 > {
103 crate::client::customize::CustomizableOperation::new(self)
104 }
105 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106 self.set_config_override(::std::option::Option::Some(config_override.into()));
107 self
108 }
109
110 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111 self.config_override = config_override;
112 self
113 }
114 /// <p>The Amazon Resource Name (ARN) of the solution to update.</p>
115 pub fn solution_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116 self.inner = self.inner.solution_arn(input.into());
117 self
118 }
119 /// <p>The Amazon Resource Name (ARN) of the solution to update.</p>
120 pub fn set_solution_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.inner = self.inner.set_solution_arn(input);
122 self
123 }
124 /// <p>The Amazon Resource Name (ARN) of the solution to update.</p>
125 pub fn get_solution_arn(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_solution_arn()
127 }
128 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration.</p>
129 /// <p>If you turn on automatic training, the first automatic training starts within one hour after the solution update completes. If you manually create a solution version within the hour, the solution skips the first automatic training. 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>
130 /// <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>
131 pub fn perform_auto_training(mut self, input: bool) -> Self {
132 self.inner = self.inner.perform_auto_training(input);
133 self
134 }
135 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration.</p>
136 /// <p>If you turn on automatic training, the first automatic training starts within one hour after the solution update completes. If you manually create a solution version within the hour, the solution skips the first automatic training. 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>
137 /// <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>
138 pub fn set_perform_auto_training(mut self, input: ::std::option::Option<bool>) -> Self {
139 self.inner = self.inner.set_perform_auto_training(input);
140 self
141 }
142 /// <p>Whether the solution uses automatic training to create new solution versions (trained models). You can change the training frequency by specifying a <code>schedulingExpression</code> in the <code>AutoTrainingConfig</code> as part of solution configuration.</p>
143 /// <p>If you turn on automatic training, the first automatic training starts within one hour after the solution update completes. If you manually create a solution version within the hour, the solution skips the first automatic training. 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>
144 /// <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>
145 pub fn get_perform_auto_training(&self) -> &::std::option::Option<bool> {
146 self.inner.get_perform_auto_training()
147 }
148 /// <p>The new configuration details of the solution.</p>
149 pub fn solution_update_config(mut self, input: crate::types::SolutionUpdateConfig) -> Self {
150 self.inner = self.inner.solution_update_config(input);
151 self
152 }
153 /// <p>The new configuration details of the solution.</p>
154 pub fn set_solution_update_config(mut self, input: ::std::option::Option<crate::types::SolutionUpdateConfig>) -> Self {
155 self.inner = self.inner.set_solution_update_config(input);
156 self
157 }
158 /// <p>The new configuration details of the solution.</p>
159 pub fn get_solution_update_config(&self) -> &::std::option::Option<crate::types::SolutionUpdateConfig> {
160 self.inner.get_solution_update_config()
161 }
162}