aws_sdk_emr/operation/add_job_flow_steps/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_job_flow_steps::_add_job_flow_steps_output::AddJobFlowStepsOutputBuilder;
3
4pub use crate::operation::add_job_flow_steps::_add_job_flow_steps_input::AddJobFlowStepsInputBuilder;
5
6impl crate::operation::add_job_flow_steps::builders::AddJobFlowStepsInputBuilder {
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::add_job_flow_steps::AddJobFlowStepsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::add_job_flow_steps::AddJobFlowStepsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.add_job_flow_steps();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AddJobFlowSteps`.
24///
25/// <p>AddJobFlowSteps adds new steps to a running cluster. A maximum of 256 steps are allowed in each job flow.</p>
26/// <p>If your cluster is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data. You can bypass the 256-step limitation in various ways, including using SSH to connect to the master node and submitting queries directly to the software running on the master node, such as Hive and Hadoop.</p>
27/// <p>A step specifies the location of a JAR file stored either on the master node of the cluster or in Amazon S3. Each step is performed by the main function of the main class of the JAR file. The main class can be specified either in the manifest of the JAR or by using the MainFunction parameter of the step.</p>
28/// <p>Amazon EMR executes each step in the order listed. For a step to be considered complete, the main function must exit with a zero exit code and all Hadoop jobs started while the step was running must have completed and run successfully.</p>
29/// <p>You can only add steps to a cluster that is in one of the following states: STARTING, BOOTSTRAPPING, RUNNING, or WAITING.</p><note>
30/// <p>The string values passed into <code>HadoopJarStep</code> object cannot exceed a total of 10240 characters.</p>
31/// </note>
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct AddJobFlowStepsFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::add_job_flow_steps::builders::AddJobFlowStepsInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::add_job_flow_steps::AddJobFlowStepsOutput,
41        crate::operation::add_job_flow_steps::AddJobFlowStepsError,
42    > for AddJobFlowStepsFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::add_job_flow_steps::AddJobFlowStepsOutput,
50            crate::operation::add_job_flow_steps::AddJobFlowStepsError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl AddJobFlowStepsFluentBuilder {
57    /// Creates a new `AddJobFlowStepsFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the AddJobFlowSteps as a reference.
66    pub fn as_input(&self) -> &crate::operation::add_job_flow_steps::builders::AddJobFlowStepsInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::add_job_flow_steps::AddJobFlowStepsOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::add_job_flow_steps::AddJobFlowStepsError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::add_job_flow_steps::AddJobFlowSteps::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        crate::operation::add_job_flow_steps::AddJobFlowSteps::orchestrate(&runtime_plugins, input).await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::add_job_flow_steps::AddJobFlowStepsOutput,
103        crate::operation::add_job_flow_steps::AddJobFlowStepsError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>A string that uniquely identifies the job flow. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>ListClusters</code>.</p>
118    pub fn job_flow_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.inner = self.inner.job_flow_id(input.into());
120        self
121    }
122    /// <p>A string that uniquely identifies the job flow. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>ListClusters</code>.</p>
123    pub fn set_job_flow_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.inner = self.inner.set_job_flow_id(input);
125        self
126    }
127    /// <p>A string that uniquely identifies the job flow. This identifier is returned by <code>RunJobFlow</code> and can also be obtained from <code>ListClusters</code>.</p>
128    pub fn get_job_flow_id(&self) -> &::std::option::Option<::std::string::String> {
129        self.inner.get_job_flow_id()
130    }
131    ///
132    /// Appends an item to `Steps`.
133    ///
134    /// To override the contents of this collection use [`set_steps`](Self::set_steps).
135    ///
136    /// <p>A list of <code>StepConfig</code> to be executed by the job flow.</p>
137    pub fn steps(mut self, input: crate::types::StepConfig) -> Self {
138        self.inner = self.inner.steps(input);
139        self
140    }
141    /// <p>A list of <code>StepConfig</code> to be executed by the job flow.</p>
142    pub fn set_steps(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StepConfig>>) -> Self {
143        self.inner = self.inner.set_steps(input);
144        self
145    }
146    /// <p>A list of <code>StepConfig</code> to be executed by the job flow.</p>
147    pub fn get_steps(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StepConfig>> {
148        self.inner.get_steps()
149    }
150    /// <p>The Amazon Resource Name (ARN) of the runtime role for a step on the cluster. The runtime role can be a cross-account IAM role. The runtime role ARN is a combination of account ID, role name, and role type using the following format: <code>arn:partition:service:region:account:resource</code>.</p>
151    /// <p>For example, <code>arn:aws:IAM::1234567890:role/ReadOnly</code> is a correctly formatted runtime role ARN.</p>
152    pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.execution_role_arn(input.into());
154        self
155    }
156    /// <p>The Amazon Resource Name (ARN) of the runtime role for a step on the cluster. The runtime role can be a cross-account IAM role. The runtime role ARN is a combination of account ID, role name, and role type using the following format: <code>arn:partition:service:region:account:resource</code>.</p>
157    /// <p>For example, <code>arn:aws:IAM::1234567890:role/ReadOnly</code> is a correctly formatted runtime role ARN.</p>
158    pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_execution_role_arn(input);
160        self
161    }
162    /// <p>The Amazon Resource Name (ARN) of the runtime role for a step on the cluster. The runtime role can be a cross-account IAM role. The runtime role ARN is a combination of account ID, role name, and role type using the following format: <code>arn:partition:service:region:account:resource</code>.</p>
163    /// <p>For example, <code>arn:aws:IAM::1234567890:role/ReadOnly</code> is a correctly formatted runtime role ARN.</p>
164    pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_execution_role_arn()
166    }
167}