aws_sdk_cleanroomsml/operation/create_trained_model/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_trained_model::_create_trained_model_output::CreateTrainedModelOutputBuilder;
3
4pub use crate::operation::create_trained_model::_create_trained_model_input::CreateTrainedModelInputBuilder;
5
6impl crate::operation::create_trained_model::builders::CreateTrainedModelInputBuilder {
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_trained_model::CreateTrainedModelOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_trained_model::CreateTrainedModelError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_trained_model();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTrainedModel`.
24///
25/// <p>Creates a trained model from an associated configured model algorithm using data from any member of the collaboration.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateTrainedModelFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_trained_model::builders::CreateTrainedModelInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_trained_model::CreateTrainedModelOutput,
35        crate::operation::create_trained_model::CreateTrainedModelError,
36    > for CreateTrainedModelFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_trained_model::CreateTrainedModelOutput,
44            crate::operation::create_trained_model::CreateTrainedModelError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateTrainedModelFluentBuilder {
51    /// Creates a new `CreateTrainedModelFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateTrainedModel as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_trained_model::builders::CreateTrainedModelInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_trained_model::CreateTrainedModelOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_trained_model::CreateTrainedModelError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_trained_model::CreateTrainedModel::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_trained_model::CreateTrainedModel::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_trained_model::CreateTrainedModelOutput,
97        crate::operation::create_trained_model::CreateTrainedModelError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The membership ID of the member that is creating the trained model.</p>
112    pub fn membership_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.membership_identifier(input.into());
114        self
115    }
116    /// <p>The membership ID of the member that is creating the trained model.</p>
117    pub fn set_membership_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_membership_identifier(input);
119        self
120    }
121    /// <p>The membership ID of the member that is creating the trained model.</p>
122    pub fn get_membership_identifier(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_membership_identifier()
124    }
125    /// <p>The name of the trained model.</p>
126    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.name(input.into());
128        self
129    }
130    /// <p>The name of the trained model.</p>
131    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_name(input);
133        self
134    }
135    /// <p>The name of the trained model.</p>
136    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_name()
138    }
139    /// <p>The associated configured model algorithm used to train this model.</p>
140    pub fn configured_model_algorithm_association_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.configured_model_algorithm_association_arn(input.into());
142        self
143    }
144    /// <p>The associated configured model algorithm used to train this model.</p>
145    pub fn set_configured_model_algorithm_association_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_configured_model_algorithm_association_arn(input);
147        self
148    }
149    /// <p>The associated configured model algorithm used to train this model.</p>
150    pub fn get_configured_model_algorithm_association_arn(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_configured_model_algorithm_association_arn()
152    }
153    ///
154    /// Adds a key-value pair to `hyperparameters`.
155    ///
156    /// To override the contents of this collection use [`set_hyperparameters`](Self::set_hyperparameters).
157    ///
158    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process.</p>
159    pub fn hyperparameters(
160        mut self,
161        k: impl ::std::convert::Into<::std::string::String>,
162        v: impl ::std::convert::Into<::std::string::String>,
163    ) -> Self {
164        self.inner = self.inner.hyperparameters(k.into(), v.into());
165        self
166    }
167    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process.</p>
168    pub fn set_hyperparameters(
169        mut self,
170        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
171    ) -> Self {
172        self.inner = self.inner.set_hyperparameters(input);
173        self
174    }
175    /// <p>Algorithm-specific parameters that influence the quality of the model. You set hyperparameters before you start the learning process.</p>
176    pub fn get_hyperparameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
177        self.inner.get_hyperparameters()
178    }
179    ///
180    /// Adds a key-value pair to `environment`.
181    ///
182    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
183    ///
184    /// <p>The environment variables to set in the Docker container.</p>
185    pub fn environment(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
186        self.inner = self.inner.environment(k.into(), v.into());
187        self
188    }
189    /// <p>The environment variables to set in the Docker container.</p>
190    pub fn set_environment(
191        mut self,
192        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
193    ) -> Self {
194        self.inner = self.inner.set_environment(input);
195        self
196    }
197    /// <p>The environment variables to set in the Docker container.</p>
198    pub fn get_environment(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
199        self.inner.get_environment()
200    }
201    /// <p>Information about the EC2 resources that are used to train this model.</p>
202    pub fn resource_config(mut self, input: crate::types::ResourceConfig) -> Self {
203        self.inner = self.inner.resource_config(input);
204        self
205    }
206    /// <p>Information about the EC2 resources that are used to train this model.</p>
207    pub fn set_resource_config(mut self, input: ::std::option::Option<crate::types::ResourceConfig>) -> Self {
208        self.inner = self.inner.set_resource_config(input);
209        self
210    }
211    /// <p>Information about the EC2 resources that are used to train this model.</p>
212    pub fn get_resource_config(&self) -> &::std::option::Option<crate::types::ResourceConfig> {
213        self.inner.get_resource_config()
214    }
215    /// <p>The criteria that is used to stop model training.</p>
216    pub fn stopping_condition(mut self, input: crate::types::StoppingCondition) -> Self {
217        self.inner = self.inner.stopping_condition(input);
218        self
219    }
220    /// <p>The criteria that is used to stop model training.</p>
221    pub fn set_stopping_condition(mut self, input: ::std::option::Option<crate::types::StoppingCondition>) -> Self {
222        self.inner = self.inner.set_stopping_condition(input);
223        self
224    }
225    /// <p>The criteria that is used to stop model training.</p>
226    pub fn get_stopping_condition(&self) -> &::std::option::Option<crate::types::StoppingCondition> {
227        self.inner.get_stopping_condition()
228    }
229    ///
230    /// Appends an item to `incrementalTrainingDataChannels`.
231    ///
232    /// To override the contents of this collection use [`set_incremental_training_data_channels`](Self::set_incremental_training_data_channels).
233    ///
234    /// <p>Specifies the incremental training data channels for the trained model.</p>
235    /// <p>Incremental training allows you to create a new trained model with updates without retraining from scratch. You can specify up to one incremental training data channel that references a previously trained model and its version.</p>
236    /// <p>Limit: Maximum of 20 channels total (including both <code>incrementalTrainingDataChannels</code> and <code>dataChannels</code>).</p>
237    pub fn incremental_training_data_channels(mut self, input: crate::types::IncrementalTrainingDataChannel) -> Self {
238        self.inner = self.inner.incremental_training_data_channels(input);
239        self
240    }
241    /// <p>Specifies the incremental training data channels for the trained model.</p>
242    /// <p>Incremental training allows you to create a new trained model with updates without retraining from scratch. You can specify up to one incremental training data channel that references a previously trained model and its version.</p>
243    /// <p>Limit: Maximum of 20 channels total (including both <code>incrementalTrainingDataChannels</code> and <code>dataChannels</code>).</p>
244    pub fn set_incremental_training_data_channels(
245        mut self,
246        input: ::std::option::Option<::std::vec::Vec<crate::types::IncrementalTrainingDataChannel>>,
247    ) -> Self {
248        self.inner = self.inner.set_incremental_training_data_channels(input);
249        self
250    }
251    /// <p>Specifies the incremental training data channels for the trained model.</p>
252    /// <p>Incremental training allows you to create a new trained model with updates without retraining from scratch. You can specify up to one incremental training data channel that references a previously trained model and its version.</p>
253    /// <p>Limit: Maximum of 20 channels total (including both <code>incrementalTrainingDataChannels</code> and <code>dataChannels</code>).</p>
254    pub fn get_incremental_training_data_channels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IncrementalTrainingDataChannel>> {
255        self.inner.get_incremental_training_data_channels()
256    }
257    ///
258    /// Appends an item to `dataChannels`.
259    ///
260    /// To override the contents of this collection use [`set_data_channels`](Self::set_data_channels).
261    ///
262    /// <p>Defines the data channels that are used as input for the trained model request.</p>
263    /// <p>Limit: Maximum of 20 channels total (including both <code>dataChannels</code> and <code>incrementalTrainingDataChannels</code>).</p>
264    pub fn data_channels(mut self, input: crate::types::ModelTrainingDataChannel) -> Self {
265        self.inner = self.inner.data_channels(input);
266        self
267    }
268    /// <p>Defines the data channels that are used as input for the trained model request.</p>
269    /// <p>Limit: Maximum of 20 channels total (including both <code>dataChannels</code> and <code>incrementalTrainingDataChannels</code>).</p>
270    pub fn set_data_channels(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ModelTrainingDataChannel>>) -> Self {
271        self.inner = self.inner.set_data_channels(input);
272        self
273    }
274    /// <p>Defines the data channels that are used as input for the trained model request.</p>
275    /// <p>Limit: Maximum of 20 channels total (including both <code>dataChannels</code> and <code>incrementalTrainingDataChannels</code>).</p>
276    pub fn get_data_channels(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ModelTrainingDataChannel>> {
277        self.inner.get_data_channels()
278    }
279    /// <p>The input mode for accessing the training data. This parameter determines how the training data is made available to the training algorithm. Valid values are:</p>
280    /// <ul>
281    /// <li>
282    /// <p><code>File</code> - The training data is downloaded to the training instance and made available as files.</p></li>
283    /// <li>
284    /// <p><code>FastFile</code> - The training data is streamed directly from Amazon S3 to the training algorithm, providing faster access for large datasets.</p></li>
285    /// <li>
286    /// <p><code>Pipe</code> - The training data is streamed to the training algorithm using named pipes, which can improve performance for certain algorithms.</p></li>
287    /// </ul>
288    pub fn training_input_mode(mut self, input: crate::types::TrainingInputMode) -> Self {
289        self.inner = self.inner.training_input_mode(input);
290        self
291    }
292    /// <p>The input mode for accessing the training data. This parameter determines how the training data is made available to the training algorithm. Valid values are:</p>
293    /// <ul>
294    /// <li>
295    /// <p><code>File</code> - The training data is downloaded to the training instance and made available as files.</p></li>
296    /// <li>
297    /// <p><code>FastFile</code> - The training data is streamed directly from Amazon S3 to the training algorithm, providing faster access for large datasets.</p></li>
298    /// <li>
299    /// <p><code>Pipe</code> - The training data is streamed to the training algorithm using named pipes, which can improve performance for certain algorithms.</p></li>
300    /// </ul>
301    pub fn set_training_input_mode(mut self, input: ::std::option::Option<crate::types::TrainingInputMode>) -> Self {
302        self.inner = self.inner.set_training_input_mode(input);
303        self
304    }
305    /// <p>The input mode for accessing the training data. This parameter determines how the training data is made available to the training algorithm. Valid values are:</p>
306    /// <ul>
307    /// <li>
308    /// <p><code>File</code> - The training data is downloaded to the training instance and made available as files.</p></li>
309    /// <li>
310    /// <p><code>FastFile</code> - The training data is streamed directly from Amazon S3 to the training algorithm, providing faster access for large datasets.</p></li>
311    /// <li>
312    /// <p><code>Pipe</code> - The training data is streamed to the training algorithm using named pipes, which can improve performance for certain algorithms.</p></li>
313    /// </ul>
314    pub fn get_training_input_mode(&self) -> &::std::option::Option<crate::types::TrainingInputMode> {
315        self.inner.get_training_input_mode()
316    }
317    /// <p>The description of the trained model.</p>
318    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.inner = self.inner.description(input.into());
320        self
321    }
322    /// <p>The description of the trained model.</p>
323    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
324        self.inner = self.inner.set_description(input);
325        self
326    }
327    /// <p>The description of the trained model.</p>
328    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
329        self.inner.get_description()
330    }
331    /// <p>The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt and decrypt customer-owned data in the trained ML model and the associated data.</p>
332    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333        self.inner = self.inner.kms_key_arn(input.into());
334        self
335    }
336    /// <p>The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt and decrypt customer-owned data in the trained ML model and the associated data.</p>
337    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338        self.inner = self.inner.set_kms_key_arn(input);
339        self
340    }
341    /// <p>The Amazon Resource Name (ARN) of the KMS key. This key is used to encrypt and decrypt customer-owned data in the trained ML model and the associated data.</p>
342    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
343        self.inner.get_kms_key_arn()
344    }
345    ///
346    /// Adds a key-value pair to `tags`.
347    ///
348    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
349    ///
350    /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
351    /// <p>The following basic restrictions apply to tags:</p>
352    /// <ul>
353    /// <li>
354    /// <p>Maximum number of tags per resource - 50.</p></li>
355    /// <li>
356    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
357    /// <li>
358    /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
359    /// <li>
360    /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
361    /// <li>
362    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
363    /// <li>
364    /// <p>Tag keys and values are case sensitive.</p></li>
365    /// <li>
366    /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
367    /// </ul>
368    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
369        self.inner = self.inner.tags(k.into(), v.into());
370        self
371    }
372    /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
373    /// <p>The following basic restrictions apply to tags:</p>
374    /// <ul>
375    /// <li>
376    /// <p>Maximum number of tags per resource - 50.</p></li>
377    /// <li>
378    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
379    /// <li>
380    /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
381    /// <li>
382    /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
383    /// <li>
384    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
385    /// <li>
386    /// <p>Tag keys and values are case sensitive.</p></li>
387    /// <li>
388    /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
389    /// </ul>
390    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
391        self.inner = self.inner.set_tags(input);
392        self
393    }
394    /// <p>The optional metadata that you apply to the resource to help you categorize and organize them. Each tag consists of a key and an optional value, both of which you define.</p>
395    /// <p>The following basic restrictions apply to tags:</p>
396    /// <ul>
397    /// <li>
398    /// <p>Maximum number of tags per resource - 50.</p></li>
399    /// <li>
400    /// <p>For each resource, each tag key must be unique, and each tag key can have only one value.</p></li>
401    /// <li>
402    /// <p>Maximum key length - 128 Unicode characters in UTF-8.</p></li>
403    /// <li>
404    /// <p>Maximum value length - 256 Unicode characters in UTF-8.</p></li>
405    /// <li>
406    /// <p>If your tagging schema is used across multiple services and resources, remember that other services may have restrictions on allowed characters. Generally allowed characters are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.</p></li>
407    /// <li>
408    /// <p>Tag keys and values are case sensitive.</p></li>
409    /// <li>
410    /// <p>Do not use aws:, AWS:, or any upper or lowercase combination of such as a prefix for keys as it is reserved for AWS use. You cannot edit or delete tag keys with this prefix. Values can have this prefix. If a tag value has aws as its prefix but the key does not, then Clean Rooms ML considers it to be a user tag and will count against the limit of 50 tags. Tags with only the key prefix of aws do not count against your tags per resource limit.</p></li>
411    /// </ul>
412    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
413        self.inner.get_tags()
414    }
415}