aws_sdk_sagemaker/operation/create_algorithm/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_algorithm::_create_algorithm_output::CreateAlgorithmOutputBuilder;
3
4pub use crate::operation::create_algorithm::_create_algorithm_input::CreateAlgorithmInputBuilder;
5
6impl crate::operation::create_algorithm::builders::CreateAlgorithmInputBuilder {
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_algorithm::CreateAlgorithmOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_algorithm::CreateAlgorithmError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_algorithm();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAlgorithm`.
24///
25/// <p>Create a machine learning algorithm that you can use in SageMaker and list in the Amazon Web Services Marketplace.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateAlgorithmFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_algorithm::builders::CreateAlgorithmInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_algorithm::CreateAlgorithmOutput,
35        crate::operation::create_algorithm::CreateAlgorithmError,
36    > for CreateAlgorithmFluentBuilder
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_algorithm::CreateAlgorithmOutput,
44            crate::operation::create_algorithm::CreateAlgorithmError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateAlgorithmFluentBuilder {
51    /// Creates a new `CreateAlgorithmFluentBuilder`.
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 CreateAlgorithm as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_algorithm::builders::CreateAlgorithmInputBuilder {
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_algorithm::CreateAlgorithmOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_algorithm::CreateAlgorithmError,
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_algorithm::CreateAlgorithm::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_algorithm::CreateAlgorithm::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_algorithm::CreateAlgorithmOutput,
97        crate::operation::create_algorithm::CreateAlgorithmError,
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 algorithm.</p>
112    pub fn algorithm_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.algorithm_name(input.into());
114        self
115    }
116    /// <p>The name of the algorithm.</p>
117    pub fn set_algorithm_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_algorithm_name(input);
119        self
120    }
121    /// <p>The name of the algorithm.</p>
122    pub fn get_algorithm_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_algorithm_name()
124    }
125    /// <p>A description of the algorithm.</p>
126    pub fn algorithm_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.algorithm_description(input.into());
128        self
129    }
130    /// <p>A description of the algorithm.</p>
131    pub fn set_algorithm_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_algorithm_description(input);
133        self
134    }
135    /// <p>A description of the algorithm.</p>
136    pub fn get_algorithm_description(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_algorithm_description()
138    }
139    /// <p>Specifies details about training jobs run by this algorithm, including the following:</p>
140    /// <ul>
141    /// <li>
142    /// <p>The Amazon ECR path of the container and the version digest of the algorithm.</p></li>
143    /// <li>
144    /// <p>The hyperparameters that the algorithm supports.</p></li>
145    /// <li>
146    /// <p>The instance types that the algorithm supports for training.</p></li>
147    /// <li>
148    /// <p>Whether the algorithm supports distributed training.</p></li>
149    /// <li>
150    /// <p>The metrics that the algorithm emits to Amazon CloudWatch.</p></li>
151    /// <li>
152    /// <p>Which metrics that the algorithm emits can be used as the objective metric for hyperparameter tuning jobs.</p></li>
153    /// <li>
154    /// <p>The input channels that the algorithm supports for training data. For example, an algorithm might support <code>train</code>, <code>validation</code>, and <code>test</code> channels.</p></li>
155    /// </ul>
156    pub fn training_specification(mut self, input: crate::types::TrainingSpecification) -> Self {
157        self.inner = self.inner.training_specification(input);
158        self
159    }
160    /// <p>Specifies details about training jobs run by this algorithm, including the following:</p>
161    /// <ul>
162    /// <li>
163    /// <p>The Amazon ECR path of the container and the version digest of the algorithm.</p></li>
164    /// <li>
165    /// <p>The hyperparameters that the algorithm supports.</p></li>
166    /// <li>
167    /// <p>The instance types that the algorithm supports for training.</p></li>
168    /// <li>
169    /// <p>Whether the algorithm supports distributed training.</p></li>
170    /// <li>
171    /// <p>The metrics that the algorithm emits to Amazon CloudWatch.</p></li>
172    /// <li>
173    /// <p>Which metrics that the algorithm emits can be used as the objective metric for hyperparameter tuning jobs.</p></li>
174    /// <li>
175    /// <p>The input channels that the algorithm supports for training data. For example, an algorithm might support <code>train</code>, <code>validation</code>, and <code>test</code> channels.</p></li>
176    /// </ul>
177    pub fn set_training_specification(mut self, input: ::std::option::Option<crate::types::TrainingSpecification>) -> Self {
178        self.inner = self.inner.set_training_specification(input);
179        self
180    }
181    /// <p>Specifies details about training jobs run by this algorithm, including the following:</p>
182    /// <ul>
183    /// <li>
184    /// <p>The Amazon ECR path of the container and the version digest of the algorithm.</p></li>
185    /// <li>
186    /// <p>The hyperparameters that the algorithm supports.</p></li>
187    /// <li>
188    /// <p>The instance types that the algorithm supports for training.</p></li>
189    /// <li>
190    /// <p>Whether the algorithm supports distributed training.</p></li>
191    /// <li>
192    /// <p>The metrics that the algorithm emits to Amazon CloudWatch.</p></li>
193    /// <li>
194    /// <p>Which metrics that the algorithm emits can be used as the objective metric for hyperparameter tuning jobs.</p></li>
195    /// <li>
196    /// <p>The input channels that the algorithm supports for training data. For example, an algorithm might support <code>train</code>, <code>validation</code>, and <code>test</code> channels.</p></li>
197    /// </ul>
198    pub fn get_training_specification(&self) -> &::std::option::Option<crate::types::TrainingSpecification> {
199        self.inner.get_training_specification()
200    }
201    /// <p>Specifies details about inference jobs that the algorithm runs, including the following:</p>
202    /// <ul>
203    /// <li>
204    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
205    /// <li>
206    /// <p>The instance types that the algorithm supports for transform jobs and real-time endpoints used for inference.</p></li>
207    /// <li>
208    /// <p>The input and output content formats that the algorithm supports for inference.</p></li>
209    /// </ul>
210    pub fn inference_specification(mut self, input: crate::types::InferenceSpecification) -> Self {
211        self.inner = self.inner.inference_specification(input);
212        self
213    }
214    /// <p>Specifies details about inference jobs that the algorithm runs, including the following:</p>
215    /// <ul>
216    /// <li>
217    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
218    /// <li>
219    /// <p>The instance types that the algorithm supports for transform jobs and real-time endpoints used for inference.</p></li>
220    /// <li>
221    /// <p>The input and output content formats that the algorithm supports for inference.</p></li>
222    /// </ul>
223    pub fn set_inference_specification(mut self, input: ::std::option::Option<crate::types::InferenceSpecification>) -> Self {
224        self.inner = self.inner.set_inference_specification(input);
225        self
226    }
227    /// <p>Specifies details about inference jobs that the algorithm runs, including the following:</p>
228    /// <ul>
229    /// <li>
230    /// <p>The Amazon ECR paths of containers that contain the inference code and model artifacts.</p></li>
231    /// <li>
232    /// <p>The instance types that the algorithm supports for transform jobs and real-time endpoints used for inference.</p></li>
233    /// <li>
234    /// <p>The input and output content formats that the algorithm supports for inference.</p></li>
235    /// </ul>
236    pub fn get_inference_specification(&self) -> &::std::option::Option<crate::types::InferenceSpecification> {
237        self.inner.get_inference_specification()
238    }
239    /// <p>Specifies configurations for one or more training jobs and that SageMaker runs to test the algorithm's training code and, optionally, one or more batch transform jobs that SageMaker runs to test the algorithm's inference code.</p>
240    pub fn validation_specification(mut self, input: crate::types::AlgorithmValidationSpecification) -> Self {
241        self.inner = self.inner.validation_specification(input);
242        self
243    }
244    /// <p>Specifies configurations for one or more training jobs and that SageMaker runs to test the algorithm's training code and, optionally, one or more batch transform jobs that SageMaker runs to test the algorithm's inference code.</p>
245    pub fn set_validation_specification(mut self, input: ::std::option::Option<crate::types::AlgorithmValidationSpecification>) -> Self {
246        self.inner = self.inner.set_validation_specification(input);
247        self
248    }
249    /// <p>Specifies configurations for one or more training jobs and that SageMaker runs to test the algorithm's training code and, optionally, one or more batch transform jobs that SageMaker runs to test the algorithm's inference code.</p>
250    pub fn get_validation_specification(&self) -> &::std::option::Option<crate::types::AlgorithmValidationSpecification> {
251        self.inner.get_validation_specification()
252    }
253    /// <p>Whether to certify the algorithm so that it can be listed in Amazon Web Services Marketplace.</p>
254    pub fn certify_for_marketplace(mut self, input: bool) -> Self {
255        self.inner = self.inner.certify_for_marketplace(input);
256        self
257    }
258    /// <p>Whether to certify the algorithm so that it can be listed in Amazon Web Services Marketplace.</p>
259    pub fn set_certify_for_marketplace(mut self, input: ::std::option::Option<bool>) -> Self {
260        self.inner = self.inner.set_certify_for_marketplace(input);
261        self
262    }
263    /// <p>Whether to certify the algorithm so that it can be listed in Amazon Web Services Marketplace.</p>
264    pub fn get_certify_for_marketplace(&self) -> &::std::option::Option<bool> {
265        self.inner.get_certify_for_marketplace()
266    }
267    ///
268    /// Appends an item to `Tags`.
269    ///
270    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
271    ///
272    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
273    pub fn tags(mut self, input: crate::types::Tag) -> Self {
274        self.inner = self.inner.tags(input);
275        self
276    }
277    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
278    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
279        self.inner = self.inner.set_tags(input);
280        self
281    }
282    /// <p>An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways, for example, by purpose, owner, or environment. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html">Tagging Amazon Web Services Resources</a>.</p>
283    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
284        self.inner.get_tags()
285    }
286}