aws_sdk_sagemaker/operation/create_trial_component/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_trial_component::_create_trial_component_output::CreateTrialComponentOutputBuilder;
3
4pub use crate::operation::create_trial_component::_create_trial_component_input::CreateTrialComponentInputBuilder;
5
6impl crate::operation::create_trial_component::builders::CreateTrialComponentInputBuilder {
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_trial_component::CreateTrialComponentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_trial_component::CreateTrialComponentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_trial_component();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateTrialComponent`.
24///
25/// <p>Creates a <i>trial component</i>, which is a stage of a machine learning <i>trial</i>. A trial is composed of one or more trial components. A trial component can be used in multiple trials.</p>
26/// <p>Trial components include pre-processing jobs, training jobs, and batch transform jobs.</p>
27/// <p>When you use SageMaker Studio or the SageMaker Python SDK, all experiments, trials, and trial components are automatically tracked, logged, and indexed. When you use the Amazon Web Services SDK for Python (Boto), you must use the logging APIs provided by the SDK.</p>
28/// <p>You can add tags to a trial component and then use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search for the tags.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct CreateTrialComponentFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::create_trial_component::builders::CreateTrialComponentInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::create_trial_component::CreateTrialComponentOutput,
38        crate::operation::create_trial_component::CreateTrialComponentError,
39    > for CreateTrialComponentFluentBuilder
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::create_trial_component::CreateTrialComponentOutput,
47            crate::operation::create_trial_component::CreateTrialComponentError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl CreateTrialComponentFluentBuilder {
54    /// Creates a new `CreateTrialComponentFluentBuilder`.
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 CreateTrialComponent as a reference.
63    pub fn as_input(&self) -> &crate::operation::create_trial_component::builders::CreateTrialComponentInputBuilder {
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::create_trial_component::CreateTrialComponentOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::create_trial_component::CreateTrialComponentError,
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::create_trial_component::CreateTrialComponent::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::create_trial_component::CreateTrialComponent::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::create_trial_component::CreateTrialComponentOutput,
100        crate::operation::create_trial_component::CreateTrialComponentError,
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 name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
115    pub fn trial_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.trial_component_name(input.into());
117        self
118    }
119    /// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
120    pub fn set_trial_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_trial_component_name(input);
122        self
123    }
124    /// <p>The name of the component. The name must be unique in your Amazon Web Services account and is not case-sensitive.</p>
125    pub fn get_trial_component_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_trial_component_name()
127    }
128    /// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
129    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.display_name(input.into());
131        self
132    }
133    /// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
134    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_display_name(input);
136        self
137    }
138    /// <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
139    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_display_name()
141    }
142    /// <p>The status of the component. States include:</p>
143    /// <ul>
144    /// <li>
145    /// <p>InProgress</p></li>
146    /// <li>
147    /// <p>Completed</p></li>
148    /// <li>
149    /// <p>Failed</p></li>
150    /// </ul>
151    pub fn status(mut self, input: crate::types::TrialComponentStatus) -> Self {
152        self.inner = self.inner.status(input);
153        self
154    }
155    /// <p>The status of the component. States include:</p>
156    /// <ul>
157    /// <li>
158    /// <p>InProgress</p></li>
159    /// <li>
160    /// <p>Completed</p></li>
161    /// <li>
162    /// <p>Failed</p></li>
163    /// </ul>
164    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TrialComponentStatus>) -> Self {
165        self.inner = self.inner.set_status(input);
166        self
167    }
168    /// <p>The status of the component. States include:</p>
169    /// <ul>
170    /// <li>
171    /// <p>InProgress</p></li>
172    /// <li>
173    /// <p>Completed</p></li>
174    /// <li>
175    /// <p>Failed</p></li>
176    /// </ul>
177    pub fn get_status(&self) -> &::std::option::Option<crate::types::TrialComponentStatus> {
178        self.inner.get_status()
179    }
180    /// <p>When the component started.</p>
181    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
182        self.inner = self.inner.start_time(input);
183        self
184    }
185    /// <p>When the component started.</p>
186    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
187        self.inner = self.inner.set_start_time(input);
188        self
189    }
190    /// <p>When the component started.</p>
191    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
192        self.inner.get_start_time()
193    }
194    /// <p>When the component ended.</p>
195    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
196        self.inner = self.inner.end_time(input);
197        self
198    }
199    /// <p>When the component ended.</p>
200    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
201        self.inner = self.inner.set_end_time(input);
202        self
203    }
204    /// <p>When the component ended.</p>
205    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
206        self.inner.get_end_time()
207    }
208    ///
209    /// Adds a key-value pair to `Parameters`.
210    ///
211    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
212    ///
213    /// <p>The hyperparameters for the component.</p>
214    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentParameterValue) -> Self {
215        self.inner = self.inner.parameters(k.into(), v);
216        self
217    }
218    /// <p>The hyperparameters for the component.</p>
219    pub fn set_parameters(
220        mut self,
221        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>>,
222    ) -> Self {
223        self.inner = self.inner.set_parameters(input);
224        self
225    }
226    /// <p>The hyperparameters for the component.</p>
227    pub fn get_parameters(
228        &self,
229    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>> {
230        self.inner.get_parameters()
231    }
232    ///
233    /// Adds a key-value pair to `InputArtifacts`.
234    ///
235    /// To override the contents of this collection use [`set_input_artifacts`](Self::set_input_artifacts).
236    ///
237    /// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
238    pub fn input_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
239        self.inner = self.inner.input_artifacts(k.into(), v);
240        self
241    }
242    /// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
243    pub fn set_input_artifacts(
244        mut self,
245        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
246    ) -> Self {
247        self.inner = self.inner.set_input_artifacts(input);
248        self
249    }
250    /// <p>The input artifacts for the component. Examples of input artifacts are datasets, algorithms, hyperparameters, source code, and instance types.</p>
251    pub fn get_input_artifacts(
252        &self,
253    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
254        self.inner.get_input_artifacts()
255    }
256    ///
257    /// Adds a key-value pair to `OutputArtifacts`.
258    ///
259    /// To override the contents of this collection use [`set_output_artifacts`](Self::set_output_artifacts).
260    ///
261    /// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
262    pub fn output_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
263        self.inner = self.inner.output_artifacts(k.into(), v);
264        self
265    }
266    /// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
267    pub fn set_output_artifacts(
268        mut self,
269        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
270    ) -> Self {
271        self.inner = self.inner.set_output_artifacts(input);
272        self
273    }
274    /// <p>The output artifacts for the component. Examples of output artifacts are metrics, snapshots, logs, and images.</p>
275    pub fn get_output_artifacts(
276        &self,
277    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
278        self.inner.get_output_artifacts()
279    }
280    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
281    pub fn metadata_properties(mut self, input: crate::types::MetadataProperties) -> Self {
282        self.inner = self.inner.metadata_properties(input);
283        self
284    }
285    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
286    pub fn set_metadata_properties(mut self, input: ::std::option::Option<crate::types::MetadataProperties>) -> Self {
287        self.inner = self.inner.set_metadata_properties(input);
288        self
289    }
290    /// <p>Metadata properties of the tracking entity, trial, or trial component.</p>
291    pub fn get_metadata_properties(&self) -> &::std::option::Option<crate::types::MetadataProperties> {
292        self.inner.get_metadata_properties()
293    }
294    ///
295    /// Appends an item to `Tags`.
296    ///
297    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
298    ///
299    /// <p>A list of tags to associate with the component. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
300    pub fn tags(mut self, input: crate::types::Tag) -> Self {
301        self.inner = self.inner.tags(input);
302        self
303    }
304    /// <p>A list of tags to associate with the component. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
305    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
306        self.inner = self.inner.set_tags(input);
307        self
308    }
309    /// <p>A list of tags to associate with the component. You can use <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API to search on the tags.</p>
310    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
311        self.inner.get_tags()
312    }
313}