aws_sdk_personalize/operation/create_solution_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_solution_version::_create_solution_version_output::CreateSolutionVersionOutputBuilder;
3
4pub use crate::operation::create_solution_version::_create_solution_version_input::CreateSolutionVersionInputBuilder;
5
6impl crate::operation::create_solution_version::builders::CreateSolutionVersionInputBuilder {
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_version::CreateSolutionVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_solution_version::CreateSolutionVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_solution_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSolutionVersion`.
24///
25/// <p>Trains or retrains an active solution in a Custom dataset group. A solution is created using the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html">CreateSolution</a> operation and must be in the ACTIVE state before calling <code>CreateSolutionVersion</code>. A new version of the solution is created every time you call this operation.</p>
26/// <p><b>Status</b></p>
27/// <p>A solution version can be in one of the following states:</p>
28/// <ul>
29/// <li>
30/// <p>CREATE PENDING</p></li>
31/// <li>
32/// <p>CREATE IN_PROGRESS</p></li>
33/// <li>
34/// <p>ACTIVE</p></li>
35/// <li>
36/// <p>CREATE FAILED</p></li>
37/// <li>
38/// <p>CREATE STOPPING</p></li>
39/// <li>
40/// <p>CREATE STOPPED</p></li>
41/// </ul>
42/// <p>To get the status of the version, call <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a>. Wait until the status shows as ACTIVE before calling <code>CreateCampaign</code>.</p>
43/// <p>If the status shows as CREATE FAILED, the response includes a <code>failureReason</code> key, which describes why the job failed.</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_ListSolutionVersions.html">ListSolutionVersions</a></p></li>
48/// <li>
49/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolutionVersion.html">DescribeSolutionVersion</a></p></li>
50/// <li>
51/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_ListSolutions.html">ListSolutions</a></p></li>
52/// <li>
53/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateSolution.html">CreateSolution</a></p></li>
54/// <li>
55/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DescribeSolution.html">DescribeSolution</a></p></li>
56/// <li>
57/// <p><a href="https://docs.aws.amazon.com/personalize/latest/dg/API_DeleteSolution.html">DeleteSolution</a></p></li>
58/// </ul>
59#[derive(::std::clone::Clone, ::std::fmt::Debug)]
60pub struct CreateSolutionVersionFluentBuilder {
61    handle: ::std::sync::Arc<crate::client::Handle>,
62    inner: crate::operation::create_solution_version::builders::CreateSolutionVersionInputBuilder,
63    config_override: ::std::option::Option<crate::config::Builder>,
64}
65impl
66    crate::client::customize::internal::CustomizableSend<
67        crate::operation::create_solution_version::CreateSolutionVersionOutput,
68        crate::operation::create_solution_version::CreateSolutionVersionError,
69    > for CreateSolutionVersionFluentBuilder
70{
71    fn send(
72        self,
73        config_override: crate::config::Builder,
74    ) -> crate::client::customize::internal::BoxFuture<
75        crate::client::customize::internal::SendResult<
76            crate::operation::create_solution_version::CreateSolutionVersionOutput,
77            crate::operation::create_solution_version::CreateSolutionVersionError,
78        >,
79    > {
80        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
81    }
82}
83impl CreateSolutionVersionFluentBuilder {
84    /// Creates a new `CreateSolutionVersionFluentBuilder`.
85    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
86        Self {
87            handle,
88            inner: ::std::default::Default::default(),
89            config_override: ::std::option::Option::None,
90        }
91    }
92    /// Access the CreateSolutionVersion as a reference.
93    pub fn as_input(&self) -> &crate::operation::create_solution_version::builders::CreateSolutionVersionInputBuilder {
94        &self.inner
95    }
96    /// Sends the request and returns the response.
97    ///
98    /// If an error occurs, an `SdkError` will be returned with additional details that
99    /// can be matched against.
100    ///
101    /// By default, any retryable failures will be retried twice. Retry behavior
102    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
103    /// set when configuring the client.
104    pub async fn send(
105        self,
106    ) -> ::std::result::Result<
107        crate::operation::create_solution_version::CreateSolutionVersionOutput,
108        ::aws_smithy_runtime_api::client::result::SdkError<
109            crate::operation::create_solution_version::CreateSolutionVersionError,
110            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
111        >,
112    > {
113        let input = self
114            .inner
115            .build()
116            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
117        let runtime_plugins = crate::operation::create_solution_version::CreateSolutionVersion::operation_runtime_plugins(
118            self.handle.runtime_plugins.clone(),
119            &self.handle.conf,
120            self.config_override,
121        );
122        crate::operation::create_solution_version::CreateSolutionVersion::orchestrate(&runtime_plugins, input).await
123    }
124
125    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
126    pub fn customize(
127        self,
128    ) -> crate::client::customize::CustomizableOperation<
129        crate::operation::create_solution_version::CreateSolutionVersionOutput,
130        crate::operation::create_solution_version::CreateSolutionVersionError,
131        Self,
132    > {
133        crate::client::customize::CustomizableOperation::new(self)
134    }
135    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
136        self.set_config_override(::std::option::Option::Some(config_override.into()));
137        self
138    }
139
140    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
141        self.config_override = config_override;
142        self
143    }
144    /// <p>The name of the solution version.</p>
145    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.name(input.into());
147        self
148    }
149    /// <p>The name of the solution version.</p>
150    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_name(input);
152        self
153    }
154    /// <p>The name of the solution version.</p>
155    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_name()
157    }
158    /// <p>The Amazon Resource Name (ARN) of the solution containing the training configuration information.</p>
159    pub fn solution_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.solution_arn(input.into());
161        self
162    }
163    /// <p>The Amazon Resource Name (ARN) of the solution containing the training configuration information.</p>
164    pub fn set_solution_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.inner = self.inner.set_solution_arn(input);
166        self
167    }
168    /// <p>The Amazon Resource Name (ARN) of the solution containing the training configuration information.</p>
169    pub fn get_solution_arn(&self) -> &::std::option::Option<::std::string::String> {
170        self.inner.get_solution_arn()
171    }
172    /// <p>The scope of training to be performed when creating the solution version. The default is <code>FULL</code>. This creates a completely new model based on the entirety of the training data from the datasets in your dataset group.</p>
173    /// <p>If you use <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a>, you can specify a training mode of <code>UPDATE</code>. This updates the model to consider new items for recommendations. It is not a full retraining. You should still complete a full retraining weekly. If you specify <code>UPDATE</code>, Amazon Personalize will stop automatic updates for the solution version. To resume updates, create a new solution with training mode set to <code>FULL</code> and deploy it in a campaign. For more information about automatic updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#maintaining-with-automatic-updates">Automatic updates</a>.</p>
174    /// <p>The <code>UPDATE</code> option can only be used when you already have an active solution version created from the input solution using the <code>FULL</code> option and the input solution was trained with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a> recipe or the legacy <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html">HRNN-Coldstart</a> recipe.</p>
175    pub fn training_mode(mut self, input: crate::types::TrainingMode) -> Self {
176        self.inner = self.inner.training_mode(input);
177        self
178    }
179    /// <p>The scope of training to be performed when creating the solution version. The default is <code>FULL</code>. This creates a completely new model based on the entirety of the training data from the datasets in your dataset group.</p>
180    /// <p>If you use <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a>, you can specify a training mode of <code>UPDATE</code>. This updates the model to consider new items for recommendations. It is not a full retraining. You should still complete a full retraining weekly. If you specify <code>UPDATE</code>, Amazon Personalize will stop automatic updates for the solution version. To resume updates, create a new solution with training mode set to <code>FULL</code> and deploy it in a campaign. For more information about automatic updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#maintaining-with-automatic-updates">Automatic updates</a>.</p>
181    /// <p>The <code>UPDATE</code> option can only be used when you already have an active solution version created from the input solution using the <code>FULL</code> option and the input solution was trained with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a> recipe or the legacy <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html">HRNN-Coldstart</a> recipe.</p>
182    pub fn set_training_mode(mut self, input: ::std::option::Option<crate::types::TrainingMode>) -> Self {
183        self.inner = self.inner.set_training_mode(input);
184        self
185    }
186    /// <p>The scope of training to be performed when creating the solution version. The default is <code>FULL</code>. This creates a completely new model based on the entirety of the training data from the datasets in your dataset group.</p>
187    /// <p>If you use <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a>, you can specify a training mode of <code>UPDATE</code>. This updates the model to consider new items for recommendations. It is not a full retraining. You should still complete a full retraining weekly. If you specify <code>UPDATE</code>, Amazon Personalize will stop automatic updates for the solution version. To resume updates, create a new solution with training mode set to <code>FULL</code> and deploy it in a campaign. For more information about automatic updates, see <a href="https://docs.aws.amazon.com/personalize/latest/dg/use-case-recipe-features.html#maintaining-with-automatic-updates">Automatic updates</a>.</p>
188    /// <p>The <code>UPDATE</code> option can only be used when you already have an active solution version created from the input solution using the <code>FULL</code> option and the input solution was trained with the <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-new-item-USER_PERSONALIZATION.html">User-Personalization</a> recipe or the legacy <a href="https://docs.aws.amazon.com/personalize/latest/dg/native-recipe-hrnn-coldstart.html">HRNN-Coldstart</a> recipe.</p>
189    pub fn get_training_mode(&self) -> &::std::option::Option<crate::types::TrainingMode> {
190        self.inner.get_training_mode()
191    }
192    ///
193    /// Appends an item to `tags`.
194    ///
195    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
196    ///
197    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution version.</p>
198    pub fn tags(mut self, input: crate::types::Tag) -> Self {
199        self.inner = self.inner.tags(input);
200        self
201    }
202    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution version.</p>
203    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
204        self.inner = self.inner.set_tags(input);
205        self
206    }
207    /// <p>A list of <a href="https://docs.aws.amazon.com/personalize/latest/dg/tagging-resources.html">tags</a> to apply to the solution version.</p>
208    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
209        self.inner.get_tags()
210    }
211}