aws_sdk_sagemaker/operation/update_image_version/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_image_version::_update_image_version_output::UpdateImageVersionOutputBuilder;
3
4pub use crate::operation::update_image_version::_update_image_version_input::UpdateImageVersionInputBuilder;
5
6impl crate::operation::update_image_version::builders::UpdateImageVersionInputBuilder {
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_image_version::UpdateImageVersionOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_image_version::UpdateImageVersionError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_image_version();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateImageVersion`.
24///
25/// <p>Updates the properties of a SageMaker AI image version.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateImageVersionFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::update_image_version::builders::UpdateImageVersionInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::update_image_version::UpdateImageVersionOutput,
35        crate::operation::update_image_version::UpdateImageVersionError,
36    > for UpdateImageVersionFluentBuilder
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_image_version::UpdateImageVersionOutput,
44            crate::operation::update_image_version::UpdateImageVersionError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl UpdateImageVersionFluentBuilder {
51    /// Creates a new `UpdateImageVersionFluentBuilder`.
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 UpdateImageVersion as a reference.
60    pub fn as_input(&self) -> &crate::operation::update_image_version::builders::UpdateImageVersionInputBuilder {
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_image_version::UpdateImageVersionOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::update_image_version::UpdateImageVersionError,
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_image_version::UpdateImageVersion::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::update_image_version::UpdateImageVersion::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_image_version::UpdateImageVersionOutput,
97        crate::operation::update_image_version::UpdateImageVersionError,
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 image.</p>
112    pub fn image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.image_name(input.into());
114        self
115    }
116    /// <p>The name of the image.</p>
117    pub fn set_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_image_name(input);
119        self
120    }
121    /// <p>The name of the image.</p>
122    pub fn get_image_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_image_name()
124    }
125    /// <p>The alias of the image version.</p>
126    pub fn alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.alias(input.into());
128        self
129    }
130    /// <p>The alias of the image version.</p>
131    pub fn set_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_alias(input);
133        self
134    }
135    /// <p>The alias of the image version.</p>
136    pub fn get_alias(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_alias()
138    }
139    /// <p>The version of the image.</p>
140    pub fn version(mut self, input: i32) -> Self {
141        self.inner = self.inner.version(input);
142        self
143    }
144    /// <p>The version of the image.</p>
145    pub fn set_version(mut self, input: ::std::option::Option<i32>) -> Self {
146        self.inner = self.inner.set_version(input);
147        self
148    }
149    /// <p>The version of the image.</p>
150    pub fn get_version(&self) -> &::std::option::Option<i32> {
151        self.inner.get_version()
152    }
153    ///
154    /// Appends an item to `AliasesToAdd`.
155    ///
156    /// To override the contents of this collection use [`set_aliases_to_add`](Self::set_aliases_to_add).
157    ///
158    /// <p>A list of aliases to add.</p>
159    pub fn aliases_to_add(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.inner = self.inner.aliases_to_add(input.into());
161        self
162    }
163    /// <p>A list of aliases to add.</p>
164    pub fn set_aliases_to_add(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
165        self.inner = self.inner.set_aliases_to_add(input);
166        self
167    }
168    /// <p>A list of aliases to add.</p>
169    pub fn get_aliases_to_add(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170        self.inner.get_aliases_to_add()
171    }
172    ///
173    /// Appends an item to `AliasesToDelete`.
174    ///
175    /// To override the contents of this collection use [`set_aliases_to_delete`](Self::set_aliases_to_delete).
176    ///
177    /// <p>A list of aliases to delete.</p>
178    pub fn aliases_to_delete(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
179        self.inner = self.inner.aliases_to_delete(input.into());
180        self
181    }
182    /// <p>A list of aliases to delete.</p>
183    pub fn set_aliases_to_delete(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
184        self.inner = self.inner.set_aliases_to_delete(input);
185        self
186    }
187    /// <p>A list of aliases to delete.</p>
188    pub fn get_aliases_to_delete(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
189        self.inner.get_aliases_to_delete()
190    }
191    /// <p>The availability of the image version specified by the maintainer.</p>
192    /// <ul>
193    /// <li>
194    /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
195    /// <li>
196    /// <p><code>STABLE</code>: The image version is stable.</p></li>
197    /// <li>
198    /// <p><code>TO_BE_ARCHIVED</code>: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months.</p></li>
199    /// <li>
200    /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
201    /// </ul>
202    pub fn vendor_guidance(mut self, input: crate::types::VendorGuidance) -> Self {
203        self.inner = self.inner.vendor_guidance(input);
204        self
205    }
206    /// <p>The availability of the image version specified by the maintainer.</p>
207    /// <ul>
208    /// <li>
209    /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
210    /// <li>
211    /// <p><code>STABLE</code>: The image version is stable.</p></li>
212    /// <li>
213    /// <p><code>TO_BE_ARCHIVED</code>: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months.</p></li>
214    /// <li>
215    /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
216    /// </ul>
217    pub fn set_vendor_guidance(mut self, input: ::std::option::Option<crate::types::VendorGuidance>) -> Self {
218        self.inner = self.inner.set_vendor_guidance(input);
219        self
220    }
221    /// <p>The availability of the image version specified by the maintainer.</p>
222    /// <ul>
223    /// <li>
224    /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
225    /// <li>
226    /// <p><code>STABLE</code>: The image version is stable.</p></li>
227    /// <li>
228    /// <p><code>TO_BE_ARCHIVED</code>: The image version is set to be archived. Custom image versions that are set to be archived are automatically archived after three months.</p></li>
229    /// <li>
230    /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
231    /// </ul>
232    pub fn get_vendor_guidance(&self) -> &::std::option::Option<crate::types::VendorGuidance> {
233        self.inner.get_vendor_guidance()
234    }
235    /// <p>Indicates SageMaker AI job type compatibility.</p>
236    /// <ul>
237    /// <li>
238    /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
239    /// <li>
240    /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
241    /// <li>
242    /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
243    /// </ul>
244    pub fn job_type(mut self, input: crate::types::JobType) -> Self {
245        self.inner = self.inner.job_type(input);
246        self
247    }
248    /// <p>Indicates SageMaker AI job type compatibility.</p>
249    /// <ul>
250    /// <li>
251    /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
252    /// <li>
253    /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
254    /// <li>
255    /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
256    /// </ul>
257    pub fn set_job_type(mut self, input: ::std::option::Option<crate::types::JobType>) -> Self {
258        self.inner = self.inner.set_job_type(input);
259        self
260    }
261    /// <p>Indicates SageMaker AI job type compatibility.</p>
262    /// <ul>
263    /// <li>
264    /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
265    /// <li>
266    /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
267    /// <li>
268    /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
269    /// </ul>
270    pub fn get_job_type(&self) -> &::std::option::Option<crate::types::JobType> {
271        self.inner.get_job_type()
272    }
273    /// <p>The machine learning framework vended in the image version.</p>
274    pub fn ml_framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275        self.inner = self.inner.ml_framework(input.into());
276        self
277    }
278    /// <p>The machine learning framework vended in the image version.</p>
279    pub fn set_ml_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280        self.inner = self.inner.set_ml_framework(input);
281        self
282    }
283    /// <p>The machine learning framework vended in the image version.</p>
284    pub fn get_ml_framework(&self) -> &::std::option::Option<::std::string::String> {
285        self.inner.get_ml_framework()
286    }
287    /// <p>The supported programming language and its version.</p>
288    pub fn programming_lang(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
289        self.inner = self.inner.programming_lang(input.into());
290        self
291    }
292    /// <p>The supported programming language and its version.</p>
293    pub fn set_programming_lang(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
294        self.inner = self.inner.set_programming_lang(input);
295        self
296    }
297    /// <p>The supported programming language and its version.</p>
298    pub fn get_programming_lang(&self) -> &::std::option::Option<::std::string::String> {
299        self.inner.get_programming_lang()
300    }
301    /// <p>Indicates CPU or GPU compatibility.</p>
302    /// <ul>
303    /// <li>
304    /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
305    /// <li>
306    /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
307    /// </ul>
308    pub fn processor(mut self, input: crate::types::Processor) -> Self {
309        self.inner = self.inner.processor(input);
310        self
311    }
312    /// <p>Indicates CPU or GPU compatibility.</p>
313    /// <ul>
314    /// <li>
315    /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
316    /// <li>
317    /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
318    /// </ul>
319    pub fn set_processor(mut self, input: ::std::option::Option<crate::types::Processor>) -> Self {
320        self.inner = self.inner.set_processor(input);
321        self
322    }
323    /// <p>Indicates CPU or GPU compatibility.</p>
324    /// <ul>
325    /// <li>
326    /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
327    /// <li>
328    /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
329    /// </ul>
330    pub fn get_processor(&self) -> &::std::option::Option<crate::types::Processor> {
331        self.inner.get_processor()
332    }
333    /// <p>Indicates Horovod compatibility.</p>
334    pub fn horovod(mut self, input: bool) -> Self {
335        self.inner = self.inner.horovod(input);
336        self
337    }
338    /// <p>Indicates Horovod compatibility.</p>
339    pub fn set_horovod(mut self, input: ::std::option::Option<bool>) -> Self {
340        self.inner = self.inner.set_horovod(input);
341        self
342    }
343    /// <p>Indicates Horovod compatibility.</p>
344    pub fn get_horovod(&self) -> &::std::option::Option<bool> {
345        self.inner.get_horovod()
346    }
347    /// <p>The maintainer description of the image version.</p>
348    pub fn release_notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
349        self.inner = self.inner.release_notes(input.into());
350        self
351    }
352    /// <p>The maintainer description of the image version.</p>
353    pub fn set_release_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
354        self.inner = self.inner.set_release_notes(input);
355        self
356    }
357    /// <p>The maintainer description of the image version.</p>
358    pub fn get_release_notes(&self) -> &::std::option::Option<::std::string::String> {
359        self.inner.get_release_notes()
360    }
361}