aws_sdk_sagemaker/operation/update_trial_component/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_trial_component::_update_trial_component_output::UpdateTrialComponentOutputBuilder;
3
4pub use crate::operation::update_trial_component::_update_trial_component_input::UpdateTrialComponentInputBuilder;
5
6impl crate::operation::update_trial_component::builders::UpdateTrialComponentInputBuilder {
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_trial_component::UpdateTrialComponentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_trial_component::UpdateTrialComponentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_trial_component();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateTrialComponent`.
24///
25/// <p>Updates one or more properties of a trial component.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateTrialComponentFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_trial_component::builders::UpdateTrialComponentInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_trial_component::UpdateTrialComponentOutput,
35        crate::operation::update_trial_component::UpdateTrialComponentError,
36    > for UpdateTrialComponentFluentBuilder
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::update_trial_component::UpdateTrialComponentOutput,
44            crate::operation::update_trial_component::UpdateTrialComponentError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateTrialComponentFluentBuilder {
51    /// Creates a new `UpdateTrialComponentFluentBuilder`.
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 UpdateTrialComponent as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_trial_component::builders::UpdateTrialComponentInputBuilder {
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::update_trial_component::UpdateTrialComponentOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_trial_component::UpdateTrialComponentError,
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::update_trial_component::UpdateTrialComponent::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_trial_component::UpdateTrialComponent::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::update_trial_component::UpdateTrialComponentOutput,
97        crate::operation::update_trial_component::UpdateTrialComponentError,
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 name of the component to update.</p>
112    pub fn trial_component_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.trial_component_name(input.into());
114        self
115    }
116    /// <p>The name of the component to update.</p>
117    pub fn set_trial_component_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_trial_component_name(input);
119        self
120    }
121    /// <p>The name of the component to update.</p>
122    pub fn get_trial_component_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_trial_component_name()
124    }
125    /// <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>
126    pub fn display_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.display_name(input.into());
128        self
129    }
130    /// <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>
131    pub fn set_display_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_display_name(input);
133        self
134    }
135    /// <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>
136    pub fn get_display_name(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_display_name()
138    }
139    /// <p>The new status of the component.</p>
140    pub fn status(mut self, input: crate::types::TrialComponentStatus) -> Self {
141        self.inner = self.inner.status(input);
142        self
143    }
144    /// <p>The new status of the component.</p>
145    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TrialComponentStatus>) -> Self {
146        self.inner = self.inner.set_status(input);
147        self
148    }
149    /// <p>The new status of the component.</p>
150    pub fn get_status(&self) -> &::std::option::Option<crate::types::TrialComponentStatus> {
151        self.inner.get_status()
152    }
153    /// <p>When the component started.</p>
154    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
155        self.inner = self.inner.start_time(input);
156        self
157    }
158    /// <p>When the component started.</p>
159    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
160        self.inner = self.inner.set_start_time(input);
161        self
162    }
163    /// <p>When the component started.</p>
164    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
165        self.inner.get_start_time()
166    }
167    /// <p>When the component ended.</p>
168    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
169        self.inner = self.inner.end_time(input);
170        self
171    }
172    /// <p>When the component ended.</p>
173    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
174        self.inner = self.inner.set_end_time(input);
175        self
176    }
177    /// <p>When the component ended.</p>
178    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179        self.inner.get_end_time()
180    }
181    ///
182    /// Adds a key-value pair to `Parameters`.
183    ///
184    /// To override the contents of this collection use [`set_parameters`](Self::set_parameters).
185    ///
186    /// <p>Replaces all of the component's hyperparameters with the specified hyperparameters or add new hyperparameters. Existing hyperparameters are replaced if the trial component is updated with an identical hyperparameter key.</p>
187    pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentParameterValue) -> Self {
188        self.inner = self.inner.parameters(k.into(), v);
189        self
190    }
191    /// <p>Replaces all of the component's hyperparameters with the specified hyperparameters or add new hyperparameters. Existing hyperparameters are replaced if the trial component is updated with an identical hyperparameter key.</p>
192    pub fn set_parameters(
193        mut self,
194        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>>,
195    ) -> Self {
196        self.inner = self.inner.set_parameters(input);
197        self
198    }
199    /// <p>Replaces all of the component's hyperparameters with the specified hyperparameters or add new hyperparameters. Existing hyperparameters are replaced if the trial component is updated with an identical hyperparameter key.</p>
200    pub fn get_parameters(
201        &self,
202    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentParameterValue>> {
203        self.inner.get_parameters()
204    }
205    ///
206    /// Appends an item to `ParametersToRemove`.
207    ///
208    /// To override the contents of this collection use [`set_parameters_to_remove`](Self::set_parameters_to_remove).
209    ///
210    /// <p>The hyperparameters to remove from the component.</p>
211    pub fn parameters_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.parameters_to_remove(input.into());
213        self
214    }
215    /// <p>The hyperparameters to remove from the component.</p>
216    pub fn set_parameters_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
217        self.inner = self.inner.set_parameters_to_remove(input);
218        self
219    }
220    /// <p>The hyperparameters to remove from the component.</p>
221    pub fn get_parameters_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
222        self.inner.get_parameters_to_remove()
223    }
224    ///
225    /// Adds a key-value pair to `InputArtifacts`.
226    ///
227    /// To override the contents of this collection use [`set_input_artifacts`](Self::set_input_artifacts).
228    ///
229    /// <p>Replaces all of the component's input artifacts with the specified artifacts or adds new input artifacts. Existing input artifacts are replaced if the trial component is updated with an identical input artifact key.</p>
230    pub fn input_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
231        self.inner = self.inner.input_artifacts(k.into(), v);
232        self
233    }
234    /// <p>Replaces all of the component's input artifacts with the specified artifacts or adds new input artifacts. Existing input artifacts are replaced if the trial component is updated with an identical input artifact key.</p>
235    pub fn set_input_artifacts(
236        mut self,
237        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
238    ) -> Self {
239        self.inner = self.inner.set_input_artifacts(input);
240        self
241    }
242    /// <p>Replaces all of the component's input artifacts with the specified artifacts or adds new input artifacts. Existing input artifacts are replaced if the trial component is updated with an identical input artifact key.</p>
243    pub fn get_input_artifacts(
244        &self,
245    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
246        self.inner.get_input_artifacts()
247    }
248    ///
249    /// Appends an item to `InputArtifactsToRemove`.
250    ///
251    /// To override the contents of this collection use [`set_input_artifacts_to_remove`](Self::set_input_artifacts_to_remove).
252    ///
253    /// <p>The input artifacts to remove from the component.</p>
254    pub fn input_artifacts_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
255        self.inner = self.inner.input_artifacts_to_remove(input.into());
256        self
257    }
258    /// <p>The input artifacts to remove from the component.</p>
259    pub fn set_input_artifacts_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
260        self.inner = self.inner.set_input_artifacts_to_remove(input);
261        self
262    }
263    /// <p>The input artifacts to remove from the component.</p>
264    pub fn get_input_artifacts_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
265        self.inner.get_input_artifacts_to_remove()
266    }
267    ///
268    /// Adds a key-value pair to `OutputArtifacts`.
269    ///
270    /// To override the contents of this collection use [`set_output_artifacts`](Self::set_output_artifacts).
271    ///
272    /// <p>Replaces all of the component's output artifacts with the specified artifacts or adds new output artifacts. Existing output artifacts are replaced if the trial component is updated with an identical output artifact key.</p>
273    pub fn output_artifacts(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::TrialComponentArtifact) -> Self {
274        self.inner = self.inner.output_artifacts(k.into(), v);
275        self
276    }
277    /// <p>Replaces all of the component's output artifacts with the specified artifacts or adds new output artifacts. Existing output artifacts are replaced if the trial component is updated with an identical output artifact key.</p>
278    pub fn set_output_artifacts(
279        mut self,
280        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>>,
281    ) -> Self {
282        self.inner = self.inner.set_output_artifacts(input);
283        self
284    }
285    /// <p>Replaces all of the component's output artifacts with the specified artifacts or adds new output artifacts. Existing output artifacts are replaced if the trial component is updated with an identical output artifact key.</p>
286    pub fn get_output_artifacts(
287        &self,
288    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::TrialComponentArtifact>> {
289        self.inner.get_output_artifacts()
290    }
291    ///
292    /// Appends an item to `OutputArtifactsToRemove`.
293    ///
294    /// To override the contents of this collection use [`set_output_artifacts_to_remove`](Self::set_output_artifacts_to_remove).
295    ///
296    /// <p>The output artifacts to remove from the component.</p>
297    pub fn output_artifacts_to_remove(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
298        self.inner = self.inner.output_artifacts_to_remove(input.into());
299        self
300    }
301    /// <p>The output artifacts to remove from the component.</p>
302    pub fn set_output_artifacts_to_remove(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
303        self.inner = self.inner.set_output_artifacts_to_remove(input);
304        self
305    }
306    /// <p>The output artifacts to remove from the component.</p>
307    pub fn get_output_artifacts_to_remove(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
308        self.inner.get_output_artifacts_to_remove()
309    }
310}