aws_sdk_sagemaker/operation/create_image_version/
builders.rs

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