aws_sdk_emrserverless/operation/create_application/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_application::_create_application_output::CreateApplicationOutputBuilder;
3
4pub use crate::operation::create_application::_create_application_input::CreateApplicationInputBuilder;
5
6impl crate::operation::create_application::builders::CreateApplicationInputBuilder {
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_application::CreateApplicationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_application::CreateApplicationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_application();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateApplication`.
24///
25/// <p>Creates an application.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateApplicationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_application::builders::CreateApplicationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_application::CreateApplicationOutput,
35        crate::operation::create_application::CreateApplicationError,
36    > for CreateApplicationFluentBuilder
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_application::CreateApplicationOutput,
44            crate::operation::create_application::CreateApplicationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateApplicationFluentBuilder {
51    /// Creates a new `CreateApplicationFluentBuilder`.
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 CreateApplication as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_application::builders::CreateApplicationInputBuilder {
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_application::CreateApplicationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_application::CreateApplicationError,
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_application::CreateApplication::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_application::CreateApplication::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_application::CreateApplicationOutput,
97        crate::operation::create_application::CreateApplicationError,
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 application.</p>
112    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.name(input.into());
114        self
115    }
116    /// <p>The name of the application.</p>
117    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_name(input);
119        self
120    }
121    /// <p>The name of the application.</p>
122    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_name()
124    }
125    /// <p>The Amazon EMR release associated with the application.</p>
126    pub fn release_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.release_label(input.into());
128        self
129    }
130    /// <p>The Amazon EMR release associated with the application.</p>
131    pub fn set_release_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_release_label(input);
133        self
134    }
135    /// <p>The Amazon EMR release associated with the application.</p>
136    pub fn get_release_label(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_release_label()
138    }
139    /// <p>The type of application you want to start, such as Spark or Hive.</p>
140    pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.r#type(input.into());
142        self
143    }
144    /// <p>The type of application you want to start, such as Spark or Hive.</p>
145    pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_type(input);
147        self
148    }
149    /// <p>The type of application you want to start, such as Spark or Hive.</p>
150    pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_type()
152    }
153    /// <p>The client idempotency token of the application to create. Its value must be unique for each request.</p>
154    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.client_token(input.into());
156        self
157    }
158    /// <p>The client idempotency token of the application to create. Its value must be unique for each request.</p>
159    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_client_token(input);
161        self
162    }
163    /// <p>The client idempotency token of the application to create. Its value must be unique for each request.</p>
164    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_client_token()
166    }
167    ///
168    /// Adds a key-value pair to `initialCapacity`.
169    ///
170    /// To override the contents of this collection use [`set_initial_capacity`](Self::set_initial_capacity).
171    ///
172    /// <p>The capacity to initialize when the application is created.</p>
173    pub fn initial_capacity(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::InitialCapacityConfig) -> Self {
174        self.inner = self.inner.initial_capacity(k.into(), v);
175        self
176    }
177    /// <p>The capacity to initialize when the application is created.</p>
178    pub fn set_initial_capacity(
179        mut self,
180        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InitialCapacityConfig>>,
181    ) -> Self {
182        self.inner = self.inner.set_initial_capacity(input);
183        self
184    }
185    /// <p>The capacity to initialize when the application is created.</p>
186    pub fn get_initial_capacity(
187        &self,
188    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::InitialCapacityConfig>> {
189        self.inner.get_initial_capacity()
190    }
191    /// <p>The maximum capacity to allocate when the application is created. This is cumulative across all workers at any given point in time, not just when an application is created. No new resources will be created once any one of the defined limits is hit.</p>
192    pub fn maximum_capacity(mut self, input: crate::types::MaximumAllowedResources) -> Self {
193        self.inner = self.inner.maximum_capacity(input);
194        self
195    }
196    /// <p>The maximum capacity to allocate when the application is created. This is cumulative across all workers at any given point in time, not just when an application is created. No new resources will be created once any one of the defined limits is hit.</p>
197    pub fn set_maximum_capacity(mut self, input: ::std::option::Option<crate::types::MaximumAllowedResources>) -> Self {
198        self.inner = self.inner.set_maximum_capacity(input);
199        self
200    }
201    /// <p>The maximum capacity to allocate when the application is created. This is cumulative across all workers at any given point in time, not just when an application is created. No new resources will be created once any one of the defined limits is hit.</p>
202    pub fn get_maximum_capacity(&self) -> &::std::option::Option<crate::types::MaximumAllowedResources> {
203        self.inner.get_maximum_capacity()
204    }
205    ///
206    /// Adds a key-value pair to `tags`.
207    ///
208    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
209    ///
210    /// <p>The tags assigned to the application.</p>
211    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
212        self.inner = self.inner.tags(k.into(), v.into());
213        self
214    }
215    /// <p>The tags assigned to the application.</p>
216    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
217        self.inner = self.inner.set_tags(input);
218        self
219    }
220    /// <p>The tags assigned to the application.</p>
221    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
222        self.inner.get_tags()
223    }
224    /// <p>The configuration for an application to automatically start on job submission.</p>
225    pub fn auto_start_configuration(mut self, input: crate::types::AutoStartConfig) -> Self {
226        self.inner = self.inner.auto_start_configuration(input);
227        self
228    }
229    /// <p>The configuration for an application to automatically start on job submission.</p>
230    pub fn set_auto_start_configuration(mut self, input: ::std::option::Option<crate::types::AutoStartConfig>) -> Self {
231        self.inner = self.inner.set_auto_start_configuration(input);
232        self
233    }
234    /// <p>The configuration for an application to automatically start on job submission.</p>
235    pub fn get_auto_start_configuration(&self) -> &::std::option::Option<crate::types::AutoStartConfig> {
236        self.inner.get_auto_start_configuration()
237    }
238    /// <p>The configuration for an application to automatically stop after a certain amount of time being idle.</p>
239    pub fn auto_stop_configuration(mut self, input: crate::types::AutoStopConfig) -> Self {
240        self.inner = self.inner.auto_stop_configuration(input);
241        self
242    }
243    /// <p>The configuration for an application to automatically stop after a certain amount of time being idle.</p>
244    pub fn set_auto_stop_configuration(mut self, input: ::std::option::Option<crate::types::AutoStopConfig>) -> Self {
245        self.inner = self.inner.set_auto_stop_configuration(input);
246        self
247    }
248    /// <p>The configuration for an application to automatically stop after a certain amount of time being idle.</p>
249    pub fn get_auto_stop_configuration(&self) -> &::std::option::Option<crate::types::AutoStopConfig> {
250        self.inner.get_auto_stop_configuration()
251    }
252    /// <p>The network configuration for customer VPC connectivity.</p>
253    pub fn network_configuration(mut self, input: crate::types::NetworkConfiguration) -> Self {
254        self.inner = self.inner.network_configuration(input);
255        self
256    }
257    /// <p>The network configuration for customer VPC connectivity.</p>
258    pub fn set_network_configuration(mut self, input: ::std::option::Option<crate::types::NetworkConfiguration>) -> Self {
259        self.inner = self.inner.set_network_configuration(input);
260        self
261    }
262    /// <p>The network configuration for customer VPC connectivity.</p>
263    pub fn get_network_configuration(&self) -> &::std::option::Option<crate::types::NetworkConfiguration> {
264        self.inner.get_network_configuration()
265    }
266    /// <p>The CPU architecture of an application.</p>
267    pub fn architecture(mut self, input: crate::types::Architecture) -> Self {
268        self.inner = self.inner.architecture(input);
269        self
270    }
271    /// <p>The CPU architecture of an application.</p>
272    pub fn set_architecture(mut self, input: ::std::option::Option<crate::types::Architecture>) -> Self {
273        self.inner = self.inner.set_architecture(input);
274        self
275    }
276    /// <p>The CPU architecture of an application.</p>
277    pub fn get_architecture(&self) -> &::std::option::Option<crate::types::Architecture> {
278        self.inner.get_architecture()
279    }
280    /// <p>The image configuration for all worker types. You can either set this parameter or <code>imageConfiguration</code> for each worker type in <code>workerTypeSpecifications</code>.</p>
281    pub fn image_configuration(mut self, input: crate::types::ImageConfigurationInput) -> Self {
282        self.inner = self.inner.image_configuration(input);
283        self
284    }
285    /// <p>The image configuration for all worker types. You can either set this parameter or <code>imageConfiguration</code> for each worker type in <code>workerTypeSpecifications</code>.</p>
286    pub fn set_image_configuration(mut self, input: ::std::option::Option<crate::types::ImageConfigurationInput>) -> Self {
287        self.inner = self.inner.set_image_configuration(input);
288        self
289    }
290    /// <p>The image configuration for all worker types. You can either set this parameter or <code>imageConfiguration</code> for each worker type in <code>workerTypeSpecifications</code>.</p>
291    pub fn get_image_configuration(&self) -> &::std::option::Option<crate::types::ImageConfigurationInput> {
292        self.inner.get_image_configuration()
293    }
294    ///
295    /// Adds a key-value pair to `workerTypeSpecifications`.
296    ///
297    /// To override the contents of this collection use [`set_worker_type_specifications`](Self::set_worker_type_specifications).
298    ///
299    /// <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
300    pub fn worker_type_specifications(
301        mut self,
302        k: impl ::std::convert::Into<::std::string::String>,
303        v: crate::types::WorkerTypeSpecificationInput,
304    ) -> Self {
305        self.inner = self.inner.worker_type_specifications(k.into(), v);
306        self
307    }
308    /// <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
309    pub fn set_worker_type_specifications(
310        mut self,
311        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::WorkerTypeSpecificationInput>>,
312    ) -> Self {
313        self.inner = self.inner.set_worker_type_specifications(input);
314        self
315    }
316    /// <p>The key-value pairs that specify worker type to <code>WorkerTypeSpecificationInput</code>. This parameter must contain all valid worker types for a Spark or Hive application. Valid worker types include <code>Driver</code> and <code>Executor</code> for Spark applications and <code>HiveDriver</code> and <code>TezTask</code> for Hive applications. You can either set image details in this parameter for each worker type, or in <code>imageConfiguration</code> for all worker types.</p>
317    pub fn get_worker_type_specifications(
318        &self,
319    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::WorkerTypeSpecificationInput>> {
320        self.inner.get_worker_type_specifications()
321    }
322    ///
323    /// Appends an item to `runtimeConfiguration`.
324    ///
325    /// To override the contents of this collection use [`set_runtime_configuration`](Self::set_runtime_configuration).
326    ///
327    /// <p>The <a href="https://docs.aws.amazon.com/emr-serverless/latest/APIReference/API_Configuration.html">Configuration</a> specifications to use when creating an application. Each configuration consists of a classification and properties. This configuration is applied to all the job runs submitted under the application.</p>
328    pub fn runtime_configuration(mut self, input: crate::types::Configuration) -> Self {
329        self.inner = self.inner.runtime_configuration(input);
330        self
331    }
332    /// <p>The <a href="https://docs.aws.amazon.com/emr-serverless/latest/APIReference/API_Configuration.html">Configuration</a> specifications to use when creating an application. Each configuration consists of a classification and properties. This configuration is applied to all the job runs submitted under the application.</p>
333    pub fn set_runtime_configuration(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Configuration>>) -> Self {
334        self.inner = self.inner.set_runtime_configuration(input);
335        self
336    }
337    /// <p>The <a href="https://docs.aws.amazon.com/emr-serverless/latest/APIReference/API_Configuration.html">Configuration</a> specifications to use when creating an application. Each configuration consists of a classification and properties. This configuration is applied to all the job runs submitted under the application.</p>
338    pub fn get_runtime_configuration(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Configuration>> {
339        self.inner.get_runtime_configuration()
340    }
341    /// <p>The configuration setting for monitoring.</p>
342    pub fn monitoring_configuration(mut self, input: crate::types::MonitoringConfiguration) -> Self {
343        self.inner = self.inner.monitoring_configuration(input);
344        self
345    }
346    /// <p>The configuration setting for monitoring.</p>
347    pub fn set_monitoring_configuration(mut self, input: ::std::option::Option<crate::types::MonitoringConfiguration>) -> Self {
348        self.inner = self.inner.set_monitoring_configuration(input);
349        self
350    }
351    /// <p>The configuration setting for monitoring.</p>
352    pub fn get_monitoring_configuration(&self) -> &::std::option::Option<crate::types::MonitoringConfiguration> {
353        self.inner.get_monitoring_configuration()
354    }
355    /// <p>The interactive configuration object that enables the interactive use cases to use when running an application.</p>
356    pub fn interactive_configuration(mut self, input: crate::types::InteractiveConfiguration) -> Self {
357        self.inner = self.inner.interactive_configuration(input);
358        self
359    }
360    /// <p>The interactive configuration object that enables the interactive use cases to use when running an application.</p>
361    pub fn set_interactive_configuration(mut self, input: ::std::option::Option<crate::types::InteractiveConfiguration>) -> Self {
362        self.inner = self.inner.set_interactive_configuration(input);
363        self
364    }
365    /// <p>The interactive configuration object that enables the interactive use cases to use when running an application.</p>
366    pub fn get_interactive_configuration(&self) -> &::std::option::Option<crate::types::InteractiveConfiguration> {
367        self.inner.get_interactive_configuration()
368    }
369    /// <p>The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.</p>
370    pub fn scheduler_configuration(mut self, input: crate::types::SchedulerConfiguration) -> Self {
371        self.inner = self.inner.scheduler_configuration(input);
372        self
373    }
374    /// <p>The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.</p>
375    pub fn set_scheduler_configuration(mut self, input: ::std::option::Option<crate::types::SchedulerConfiguration>) -> Self {
376        self.inner = self.inner.set_scheduler_configuration(input);
377        self
378    }
379    /// <p>The scheduler configuration for batch and streaming jobs running on this application. Supported with release labels emr-7.0.0 and above.</p>
380    pub fn get_scheduler_configuration(&self) -> &::std::option::Option<crate::types::SchedulerConfiguration> {
381        self.inner.get_scheduler_configuration()
382    }
383    /// <p>The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.</p>
384    pub fn identity_center_configuration(mut self, input: crate::types::IdentityCenterConfigurationInput) -> Self {
385        self.inner = self.inner.identity_center_configuration(input);
386        self
387    }
388    /// <p>The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.</p>
389    pub fn set_identity_center_configuration(mut self, input: ::std::option::Option<crate::types::IdentityCenterConfigurationInput>) -> Self {
390        self.inner = self.inner.set_identity_center_configuration(input);
391        self
392    }
393    /// <p>The IAM Identity Center Configuration accepts the Identity Center instance parameter required to enable trusted identity propagation. This configuration allows identity propagation between integrated services and the Identity Center instance.</p>
394    pub fn get_identity_center_configuration(&self) -> &::std::option::Option<crate::types::IdentityCenterConfigurationInput> {
395        self.inner.get_identity_center_configuration()
396    }
397}