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>.dkr.ecr.<region>.amazonaws.com/<repo-name\[:tag\] or \[@digest\]></code></p>
113 pub fn base_image(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.inner = self.inner.base_image(input.into());
115 self
116 }
117 /// <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>
118 /// <p><code><acct-id>.dkr.ecr.<region>.amazonaws.com/<repo-name\[:tag\] or \[@digest\]></code></p>
119 pub fn set_base_image(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120 self.inner = self.inner.set_base_image(input);
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>.dkr.ecr.<region>.amazonaws.com/<repo-name\[:tag\] or \[@digest\]></code></p>
125 pub fn get_base_image(&self) -> &::std::option::Option<::std::string::String> {
126 self.inner.get_base_image()
127 }
128 /// <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>
129 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.client_token(input.into());
131 self
132 }
133 /// <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>
134 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_client_token(input);
136 self
137 }
138 /// <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>
139 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_client_token()
141 }
142 /// <p>The <code>ImageName</code> of the <code>Image</code> to create a version of.</p>
143 pub fn image_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.image_name(input.into());
145 self
146 }
147 /// <p>The <code>ImageName</code> of the <code>Image</code> to create a version of.</p>
148 pub fn set_image_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_image_name(input);
150 self
151 }
152 /// <p>The <code>ImageName</code> of the <code>Image</code> to create a version of.</p>
153 pub fn get_image_name(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_image_name()
155 }
156 ///
157 /// Appends an item to `Aliases`.
158 ///
159 /// To override the contents of this collection use [`set_aliases`](Self::set_aliases).
160 ///
161 /// <p>A list of aliases created with the image version.</p>
162 pub fn aliases(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163 self.inner = self.inner.aliases(input.into());
164 self
165 }
166 /// <p>A list of aliases created with the image version.</p>
167 pub fn set_aliases(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
168 self.inner = self.inner.set_aliases(input);
169 self
170 }
171 /// <p>A list of aliases created with the image version.</p>
172 pub fn get_aliases(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
173 self.inner.get_aliases()
174 }
175 /// <p>The stability of the image version, specified by the maintainer.</p>
176 /// <ul>
177 /// <li>
178 /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
179 /// <li>
180 /// <p><code>STABLE</code>: The image version is stable.</p></li>
181 /// <li>
182 /// <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>
183 /// <li>
184 /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
185 /// </ul>
186 pub fn vendor_guidance(mut self, input: crate::types::VendorGuidance) -> Self {
187 self.inner = self.inner.vendor_guidance(input);
188 self
189 }
190 /// <p>The stability of the image version, specified by the maintainer.</p>
191 /// <ul>
192 /// <li>
193 /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
194 /// <li>
195 /// <p><code>STABLE</code>: The image version is stable.</p></li>
196 /// <li>
197 /// <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>
198 /// <li>
199 /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
200 /// </ul>
201 pub fn set_vendor_guidance(mut self, input: ::std::option::Option<crate::types::VendorGuidance>) -> Self {
202 self.inner = self.inner.set_vendor_guidance(input);
203 self
204 }
205 /// <p>The stability of the image version, specified by the maintainer.</p>
206 /// <ul>
207 /// <li>
208 /// <p><code>NOT_PROVIDED</code>: The maintainers did not provide a status for image version stability.</p></li>
209 /// <li>
210 /// <p><code>STABLE</code>: The image version is stable.</p></li>
211 /// <li>
212 /// <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>
213 /// <li>
214 /// <p><code>ARCHIVED</code>: The image version is archived. Archived image versions are not searchable and are no longer actively supported.</p></li>
215 /// </ul>
216 pub fn get_vendor_guidance(&self) -> &::std::option::Option<crate::types::VendorGuidance> {
217 self.inner.get_vendor_guidance()
218 }
219 /// <p>Indicates SageMaker AI job type compatibility.</p>
220 /// <ul>
221 /// <li>
222 /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
223 /// <li>
224 /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
225 /// <li>
226 /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
227 /// </ul>
228 pub fn job_type(mut self, input: crate::types::JobType) -> Self {
229 self.inner = self.inner.job_type(input);
230 self
231 }
232 /// <p>Indicates SageMaker AI job type compatibility.</p>
233 /// <ul>
234 /// <li>
235 /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
236 /// <li>
237 /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
238 /// <li>
239 /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
240 /// </ul>
241 pub fn set_job_type(mut self, input: ::std::option::Option<crate::types::JobType>) -> Self {
242 self.inner = self.inner.set_job_type(input);
243 self
244 }
245 /// <p>Indicates SageMaker AI job type compatibility.</p>
246 /// <ul>
247 /// <li>
248 /// <p><code>TRAINING</code>: The image version is compatible with SageMaker AI training jobs.</p></li>
249 /// <li>
250 /// <p><code>INFERENCE</code>: The image version is compatible with SageMaker AI inference jobs.</p></li>
251 /// <li>
252 /// <p><code>NOTEBOOK_KERNEL</code>: The image version is compatible with SageMaker AI notebook kernels.</p></li>
253 /// </ul>
254 pub fn get_job_type(&self) -> &::std::option::Option<crate::types::JobType> {
255 self.inner.get_job_type()
256 }
257 /// <p>The machine learning framework vended in the image version.</p>
258 pub fn ml_framework(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
259 self.inner = self.inner.ml_framework(input.into());
260 self
261 }
262 /// <p>The machine learning framework vended in the image version.</p>
263 pub fn set_ml_framework(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
264 self.inner = self.inner.set_ml_framework(input);
265 self
266 }
267 /// <p>The machine learning framework vended in the image version.</p>
268 pub fn get_ml_framework(&self) -> &::std::option::Option<::std::string::String> {
269 self.inner.get_ml_framework()
270 }
271 /// <p>The supported programming language and its version.</p>
272 pub fn programming_lang(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273 self.inner = self.inner.programming_lang(input.into());
274 self
275 }
276 /// <p>The supported programming language and its version.</p>
277 pub fn set_programming_lang(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278 self.inner = self.inner.set_programming_lang(input);
279 self
280 }
281 /// <p>The supported programming language and its version.</p>
282 pub fn get_programming_lang(&self) -> &::std::option::Option<::std::string::String> {
283 self.inner.get_programming_lang()
284 }
285 /// <p>Indicates CPU or GPU compatibility.</p>
286 /// <ul>
287 /// <li>
288 /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
289 /// <li>
290 /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
291 /// </ul>
292 pub fn processor(mut self, input: crate::types::Processor) -> Self {
293 self.inner = self.inner.processor(input);
294 self
295 }
296 /// <p>Indicates CPU or GPU compatibility.</p>
297 /// <ul>
298 /// <li>
299 /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
300 /// <li>
301 /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
302 /// </ul>
303 pub fn set_processor(mut self, input: ::std::option::Option<crate::types::Processor>) -> Self {
304 self.inner = self.inner.set_processor(input);
305 self
306 }
307 /// <p>Indicates CPU or GPU compatibility.</p>
308 /// <ul>
309 /// <li>
310 /// <p><code>CPU</code>: The image version is compatible with CPU.</p></li>
311 /// <li>
312 /// <p><code>GPU</code>: The image version is compatible with GPU.</p></li>
313 /// </ul>
314 pub fn get_processor(&self) -> &::std::option::Option<crate::types::Processor> {
315 self.inner.get_processor()
316 }
317 /// <p>Indicates Horovod compatibility.</p>
318 pub fn horovod(mut self, input: bool) -> Self {
319 self.inner = self.inner.horovod(input);
320 self
321 }
322 /// <p>Indicates Horovod compatibility.</p>
323 pub fn set_horovod(mut self, input: ::std::option::Option<bool>) -> Self {
324 self.inner = self.inner.set_horovod(input);
325 self
326 }
327 /// <p>Indicates Horovod compatibility.</p>
328 pub fn get_horovod(&self) -> &::std::option::Option<bool> {
329 self.inner.get_horovod()
330 }
331 /// <p>The maintainer description of the image version.</p>
332 pub fn release_notes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
333 self.inner = self.inner.release_notes(input.into());
334 self
335 }
336 /// <p>The maintainer description of the image version.</p>
337 pub fn set_release_notes(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
338 self.inner = self.inner.set_release_notes(input);
339 self
340 }
341 /// <p>The maintainer description of the image version.</p>
342 pub fn get_release_notes(&self) -> &::std::option::Option<::std::string::String> {
343 self.inner.get_release_notes()
344 }
345}