aws_sdk_sagemaker/operation/create_processing_job/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_processing_job::_create_processing_job_output::CreateProcessingJobOutputBuilder;
3
4pub use crate::operation::create_processing_job::_create_processing_job_input::CreateProcessingJobInputBuilder;
5
6impl crate::operation::create_processing_job::builders::CreateProcessingJobInputBuilder {
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_processing_job::CreateProcessingJobOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_processing_job::CreateProcessingJobError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_processing_job();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateProcessingJob`.
24///
25/// <p>Creates a processing job.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateProcessingJobFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_processing_job::builders::CreateProcessingJobInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_processing_job::CreateProcessingJobOutput,
35        crate::operation::create_processing_job::CreateProcessingJobError,
36    > for CreateProcessingJobFluentBuilder
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_processing_job::CreateProcessingJobOutput,
44            crate::operation::create_processing_job::CreateProcessingJobError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateProcessingJobFluentBuilder {
51    /// Creates a new `CreateProcessingJobFluentBuilder`.
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 CreateProcessingJob as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_processing_job::builders::CreateProcessingJobInputBuilder {
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_processing_job::CreateProcessingJobOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_processing_job::CreateProcessingJobError,
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_processing_job::CreateProcessingJob::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_processing_job::CreateProcessingJob::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_processing_job::CreateProcessingJobOutput,
97        crate::operation::create_processing_job::CreateProcessingJobError,
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    ///
112    /// Appends an item to `ProcessingInputs`.
113    ///
114    /// To override the contents of this collection use [`set_processing_inputs`](Self::set_processing_inputs).
115    ///
116    /// <p>An array of inputs configuring the data to download into the processing container.</p>
117    pub fn processing_inputs(mut self, input: crate::types::ProcessingInput) -> Self {
118        self.inner = self.inner.processing_inputs(input);
119        self
120    }
121    /// <p>An array of inputs configuring the data to download into the processing container.</p>
122    pub fn set_processing_inputs(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ProcessingInput>>) -> Self {
123        self.inner = self.inner.set_processing_inputs(input);
124        self
125    }
126    /// <p>An array of inputs configuring the data to download into the processing container.</p>
127    pub fn get_processing_inputs(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ProcessingInput>> {
128        self.inner.get_processing_inputs()
129    }
130    /// <p>Output configuration for the processing job.</p>
131    pub fn processing_output_config(mut self, input: crate::types::ProcessingOutputConfig) -> Self {
132        self.inner = self.inner.processing_output_config(input);
133        self
134    }
135    /// <p>Output configuration for the processing job.</p>
136    pub fn set_processing_output_config(mut self, input: ::std::option::Option<crate::types::ProcessingOutputConfig>) -> Self {
137        self.inner = self.inner.set_processing_output_config(input);
138        self
139    }
140    /// <p>Output configuration for the processing job.</p>
141    pub fn get_processing_output_config(&self) -> &::std::option::Option<crate::types::ProcessingOutputConfig> {
142        self.inner.get_processing_output_config()
143    }
144    /// <p>The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.</p>
145    pub fn processing_job_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.processing_job_name(input.into());
147        self
148    }
149    /// <p>The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.</p>
150    pub fn set_processing_job_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_processing_job_name(input);
152        self
153    }
154    /// <p>The name of the processing job. The name must be unique within an Amazon Web Services Region in the Amazon Web Services account.</p>
155    pub fn get_processing_job_name(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_processing_job_name()
157    }
158    /// <p>Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job. In distributed training, you specify more than one instance.</p>
159    pub fn processing_resources(mut self, input: crate::types::ProcessingResources) -> Self {
160        self.inner = self.inner.processing_resources(input);
161        self
162    }
163    /// <p>Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job. In distributed training, you specify more than one instance.</p>
164    pub fn set_processing_resources(mut self, input: ::std::option::Option<crate::types::ProcessingResources>) -> Self {
165        self.inner = self.inner.set_processing_resources(input);
166        self
167    }
168    /// <p>Identifies the resources, ML compute instances, and ML storage volumes to deploy for a processing job. In distributed training, you specify more than one instance.</p>
169    pub fn get_processing_resources(&self) -> &::std::option::Option<crate::types::ProcessingResources> {
170        self.inner.get_processing_resources()
171    }
172    /// <p>The time limit for how long the processing job is allowed to run.</p>
173    pub fn stopping_condition(mut self, input: crate::types::ProcessingStoppingCondition) -> Self {
174        self.inner = self.inner.stopping_condition(input);
175        self
176    }
177    /// <p>The time limit for how long the processing job is allowed to run.</p>
178    pub fn set_stopping_condition(mut self, input: ::std::option::Option<crate::types::ProcessingStoppingCondition>) -> Self {
179        self.inner = self.inner.set_stopping_condition(input);
180        self
181    }
182    /// <p>The time limit for how long the processing job is allowed to run.</p>
183    pub fn get_stopping_condition(&self) -> &::std::option::Option<crate::types::ProcessingStoppingCondition> {
184        self.inner.get_stopping_condition()
185    }
186    /// <p>Configures the processing job to run a specified Docker container image.</p>
187    pub fn app_specification(mut self, input: crate::types::AppSpecification) -> Self {
188        self.inner = self.inner.app_specification(input);
189        self
190    }
191    /// <p>Configures the processing job to run a specified Docker container image.</p>
192    pub fn set_app_specification(mut self, input: ::std::option::Option<crate::types::AppSpecification>) -> Self {
193        self.inner = self.inner.set_app_specification(input);
194        self
195    }
196    /// <p>Configures the processing job to run a specified Docker container image.</p>
197    pub fn get_app_specification(&self) -> &::std::option::Option<crate::types::AppSpecification> {
198        self.inner.get_app_specification()
199    }
200    ///
201    /// Adds a key-value pair to `Environment`.
202    ///
203    /// To override the contents of this collection use [`set_environment`](Self::set_environment).
204    ///
205    /// <p>The environment variables to set in the Docker container. Up to 100 key and values entries in the map are supported.</p>
206    pub fn environment(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.environment(k.into(), v.into());
208        self
209    }
210    /// <p>The environment variables to set in the Docker container. Up to 100 key and values entries in the map are supported.</p>
211    pub fn set_environment(
212        mut self,
213        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
214    ) -> Self {
215        self.inner = self.inner.set_environment(input);
216        self
217    }
218    /// <p>The environment variables to set in the Docker container. Up to 100 key and values entries in the map are supported.</p>
219    pub fn get_environment(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
220        self.inner.get_environment()
221    }
222    /// <p>Networking options for a processing job, such as whether to allow inbound and outbound network calls to and from processing containers, and the VPC subnets and security groups to use for VPC-enabled processing jobs.</p>
223    pub fn network_config(mut self, input: crate::types::NetworkConfig) -> Self {
224        self.inner = self.inner.network_config(input);
225        self
226    }
227    /// <p>Networking options for a processing job, such as whether to allow inbound and outbound network calls to and from processing containers, and the VPC subnets and security groups to use for VPC-enabled processing jobs.</p>
228    pub fn set_network_config(mut self, input: ::std::option::Option<crate::types::NetworkConfig>) -> Self {
229        self.inner = self.inner.set_network_config(input);
230        self
231    }
232    /// <p>Networking options for a processing job, such as whether to allow inbound and outbound network calls to and from processing containers, and the VPC subnets and security groups to use for VPC-enabled processing jobs.</p>
233    pub fn get_network_config(&self) -> &::std::option::Option<crate::types::NetworkConfig> {
234        self.inner.get_network_config()
235    }
236    /// <p>The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.</p>
237    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
238        self.inner = self.inner.role_arn(input.into());
239        self
240    }
241    /// <p>The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.</p>
242    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
243        self.inner = self.inner.set_role_arn(input);
244        self
245    }
246    /// <p>The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.</p>
247    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
248        self.inner.get_role_arn()
249    }
250    ///
251    /// Appends an item to `Tags`.
252    ///
253    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
254    ///
255    /// <p>(Optional) An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
256    pub fn tags(mut self, input: crate::types::Tag) -> Self {
257        self.inner = self.inner.tags(input);
258        self
259    }
260    /// <p>(Optional) An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
261    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
262        self.inner = self.inner.set_tags(input);
263        self
264    }
265    /// <p>(Optional) An array of key-value pairs. For more information, see <a href="https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html#allocation-whatURL">Using Cost Allocation Tags</a> in the <i>Amazon Web Services Billing and Cost Management User Guide</i>.</p>
266    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
267        self.inner.get_tags()
268    }
269    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
270    /// <ul>
271    /// <li>
272    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
273    /// <li>
274    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
275    /// <li>
276    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
277    /// </ul>
278    pub fn experiment_config(mut self, input: crate::types::ExperimentConfig) -> Self {
279        self.inner = self.inner.experiment_config(input);
280        self
281    }
282    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
283    /// <ul>
284    /// <li>
285    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
286    /// <li>
287    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
288    /// <li>
289    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
290    /// </ul>
291    pub fn set_experiment_config(mut self, input: ::std::option::Option<crate::types::ExperimentConfig>) -> Self {
292        self.inner = self.inner.set_experiment_config(input);
293        self
294    }
295    /// <p>Associates a SageMaker job as a trial component with an experiment and trial. Specified when you call the following APIs:</p>
296    /// <ul>
297    /// <li>
298    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateProcessingJob.html">CreateProcessingJob</a></p></li>
299    /// <li>
300    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTrainingJob.html">CreateTrainingJob</a></p></li>
301    /// <li>
302    /// <p><a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateTransformJob.html">CreateTransformJob</a></p></li>
303    /// </ul>
304    pub fn get_experiment_config(&self) -> &::std::option::Option<crate::types::ExperimentConfig> {
305        self.inner.get_experiment_config()
306    }
307}