aws_sdk_cloud9/operation/create_environment_ec2/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_environment_ec2::_create_environment_ec2_output::CreateEnvironmentEc2OutputBuilder;
3
4pub use crate::operation::create_environment_ec2::_create_environment_ec2_input::CreateEnvironmentEc2InputBuilder;
5
6impl crate::operation::create_environment_ec2::builders::CreateEnvironmentEc2InputBuilder {
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_environment_ec2::CreateEnvironmentEc2Output,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_environment_ec2::CreateEnvironmentEC2Error,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_environment_ec2();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateEnvironmentEC2`.
24///
25/// <p>Creates an Cloud9 development environment, launches an Amazon Elastic Compute Cloud (Amazon EC2) instance, and then connects from the instance to the environment.</p><important>
26/// <p>Cloud9 is no longer available to new customers. Existing customers of Cloud9 can continue to use the service as normal. <a href="http://aws.amazon.com/blogs/devops/how-to-migrate-from-aws-cloud9-to-aws-ide-toolkits-or-aws-cloudshell/">Learn more"</a></p>
27/// </important>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateEnvironmentEC2FluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_environment_ec2::builders::CreateEnvironmentEc2InputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_environment_ec2::CreateEnvironmentEc2Output,
37        crate::operation::create_environment_ec2::CreateEnvironmentEC2Error,
38    > for CreateEnvironmentEC2FluentBuilder
39{
40    fn send(
41        self,
42        config_override: crate::config::Builder,
43    ) -> crate::client::customize::internal::BoxFuture<
44        crate::client::customize::internal::SendResult<
45            crate::operation::create_environment_ec2::CreateEnvironmentEc2Output,
46            crate::operation::create_environment_ec2::CreateEnvironmentEC2Error,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateEnvironmentEC2FluentBuilder {
53    /// Creates a new `CreateEnvironmentEC2FluentBuilder`.
54    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
55        Self {
56            handle,
57            inner: ::std::default::Default::default(),
58            config_override: ::std::option::Option::None,
59        }
60    }
61    /// Access the CreateEnvironmentEC2 as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_environment_ec2::builders::CreateEnvironmentEc2InputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::create_environment_ec2::CreateEnvironmentEc2Output,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_environment_ec2::CreateEnvironmentEC2Error,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins = crate::operation::create_environment_ec2::CreateEnvironmentEC2::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_environment_ec2::CreateEnvironmentEC2::orchestrate(&runtime_plugins, input).await
92    }
93
94    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
95    pub fn customize(
96        self,
97    ) -> crate::client::customize::CustomizableOperation<
98        crate::operation::create_environment_ec2::CreateEnvironmentEc2Output,
99        crate::operation::create_environment_ec2::CreateEnvironmentEC2Error,
100        Self,
101    > {
102        crate::client::customize::CustomizableOperation::new(self)
103    }
104    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
105        self.set_config_override(::std::option::Option::Some(config_override.into()));
106        self
107    }
108
109    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
110        self.config_override = config_override;
111        self
112    }
113    /// <p>The name of the environment to create.</p>
114    /// <p>This name is visible to other IAM users in the same Amazon Web Services account.</p>
115    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.name(input.into());
117        self
118    }
119    /// <p>The name of the environment to create.</p>
120    /// <p>This name is visible to other IAM users in the same Amazon Web Services account.</p>
121    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_name(input);
123        self
124    }
125    /// <p>The name of the environment to create.</p>
126    /// <p>This name is visible to other IAM users in the same Amazon Web Services account.</p>
127    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_name()
129    }
130    /// <p>The description of the environment to create.</p>
131    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.description(input.into());
133        self
134    }
135    /// <p>The description of the environment to create.</p>
136    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_description(input);
138        self
139    }
140    /// <p>The description of the environment to create.</p>
141    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_description()
143    }
144    /// <p>A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time.</p>
145    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p>
146    pub fn client_request_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.client_request_token(input.into());
148        self
149    }
150    /// <p>A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time.</p>
151    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p>
152    pub fn set_client_request_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_client_request_token(input);
154        self
155    }
156    /// <p>A unique, case-sensitive string that helps Cloud9 to ensure this operation completes no more than one time.</p>
157    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html">Client Tokens</a> in the <i>Amazon EC2 API Reference</i>.</p>
158    pub fn get_client_request_token(&self) -> &::std::option::Option<::std::string::String> {
159        self.inner.get_client_request_token()
160    }
161    /// <p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p>
162    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.instance_type(input.into());
164        self
165    }
166    /// <p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p>
167    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_instance_type(input);
169        self
170    }
171    /// <p>The type of instance to connect to the environment (for example, <code>t2.micro</code>).</p>
172    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_instance_type()
174    }
175    /// <p>The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance.</p>
176    pub fn subnet_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.inner = self.inner.subnet_id(input.into());
178        self
179    }
180    /// <p>The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance.</p>
181    pub fn set_subnet_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.inner = self.inner.set_subnet_id(input);
183        self
184    }
185    /// <p>The ID of the subnet in Amazon VPC that Cloud9 will use to communicate with the Amazon EC2 instance.</p>
186    pub fn get_subnet_id(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_subnet_id()
188    }
189    /// <p>The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.</p>
190    /// <p></p>
191    /// <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p>
192    /// <p>From December 16, 2024, Ubuntu 18.04 will be removed from the list of available <code>imageIds</code> for Cloud9. This change is necessary as Ubuntu 18.04 has ended standard support on May 31, 2023. This change will only affect direct API consumers, and not Cloud9 console users.</p>
193    /// <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p>
194    /// <p><b>AMI aliases </b></p>
195    /// <ul>
196    /// <li>
197    /// <p>Amazon Linux 2: <code>amazonlinux-2-x86_64</code></p></li>
198    /// <li>
199    /// <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
200    /// <li>
201    /// <p>Ubuntu 18.04: <code>ubuntu-18.04-x86_64</code></p></li>
202    /// <li>
203    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
204    /// </ul>
205    /// <p><b>SSM paths</b></p>
206    /// <ul>
207    /// <li>
208    /// <p>Amazon Linux 2: <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64</code></p></li>
209    /// <li>
210    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
211    /// <li>
212    /// <p>Ubuntu 18.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64</code></p></li>
213    /// <li>
214    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
215    /// </ul>
216    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
217        self.inner = self.inner.image_id(input.into());
218        self
219    }
220    /// <p>The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.</p>
221    /// <p></p>
222    /// <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p>
223    /// <p>From December 16, 2024, Ubuntu 18.04 will be removed from the list of available <code>imageIds</code> for Cloud9. This change is necessary as Ubuntu 18.04 has ended standard support on May 31, 2023. This change will only affect direct API consumers, and not Cloud9 console users.</p>
224    /// <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p>
225    /// <p><b>AMI aliases </b></p>
226    /// <ul>
227    /// <li>
228    /// <p>Amazon Linux 2: <code>amazonlinux-2-x86_64</code></p></li>
229    /// <li>
230    /// <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
231    /// <li>
232    /// <p>Ubuntu 18.04: <code>ubuntu-18.04-x86_64</code></p></li>
233    /// <li>
234    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
235    /// </ul>
236    /// <p><b>SSM paths</b></p>
237    /// <ul>
238    /// <li>
239    /// <p>Amazon Linux 2: <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64</code></p></li>
240    /// <li>
241    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
242    /// <li>
243    /// <p>Ubuntu 18.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64</code></p></li>
244    /// <li>
245    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
246    /// </ul>
247    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
248        self.inner = self.inner.set_image_id(input);
249        self
250    }
251    /// <p>The identifier for the Amazon Machine Image (AMI) that's used to create the EC2 instance. To choose an AMI for the instance, you must specify a valid AMI alias or a valid Amazon EC2 Systems Manager (SSM) path.</p>
252    /// <p></p>
253    /// <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p>
254    /// <p>From December 16, 2024, Ubuntu 18.04 will be removed from the list of available <code>imageIds</code> for Cloud9. This change is necessary as Ubuntu 18.04 has ended standard support on May 31, 2023. This change will only affect direct API consumers, and not Cloud9 console users.</p>
255    /// <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p>
256    /// <p><b>AMI aliases </b></p>
257    /// <ul>
258    /// <li>
259    /// <p>Amazon Linux 2: <code>amazonlinux-2-x86_64</code></p></li>
260    /// <li>
261    /// <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
262    /// <li>
263    /// <p>Ubuntu 18.04: <code>ubuntu-18.04-x86_64</code></p></li>
264    /// <li>
265    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
266    /// </ul>
267    /// <p><b>SSM paths</b></p>
268    /// <ul>
269    /// <li>
270    /// <p>Amazon Linux 2: <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2-x86_64</code></p></li>
271    /// <li>
272    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
273    /// <li>
274    /// <p>Ubuntu 18.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-18.04-x86_64</code></p></li>
275    /// <li>
276    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
277    /// </ul>
278    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
279        self.inner.get_image_id()
280    }
281    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
282    pub fn automatic_stop_time_minutes(mut self, input: i32) -> Self {
283        self.inner = self.inner.automatic_stop_time_minutes(input);
284        self
285    }
286    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
287    pub fn set_automatic_stop_time_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
288        self.inner = self.inner.set_automatic_stop_time_minutes(input);
289        self
290    }
291    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
292    pub fn get_automatic_stop_time_minutes(&self) -> &::std::option::Option<i32> {
293        self.inner.get_automatic_stop_time_minutes()
294    }
295    /// <p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this value is not specified, the ARN defaults to this environment's creator.</p>
296    pub fn owner_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
297        self.inner = self.inner.owner_arn(input.into());
298        self
299    }
300    /// <p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this value is not specified, the ARN defaults to this environment's creator.</p>
301    pub fn set_owner_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
302        self.inner = self.inner.set_owner_arn(input);
303        self
304    }
305    /// <p>The Amazon Resource Name (ARN) of the environment owner. This ARN can be the ARN of any IAM principal. If this value is not specified, the ARN defaults to this environment's creator.</p>
306    pub fn get_owner_arn(&self) -> &::std::option::Option<::std::string::String> {
307        self.inner.get_owner_arn()
308    }
309    ///
310    /// Appends an item to `tags`.
311    ///
312    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
313    ///
314    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
315    pub fn tags(mut self, input: crate::types::Tag) -> Self {
316        self.inner = self.inner.tags(input);
317        self
318    }
319    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
320    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
321        self.inner = self.inner.set_tags(input);
322        self
323    }
324    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
325    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
326        self.inner.get_tags()
327    }
328    /// <p>The connection type used for connecting to an Amazon EC2 environment. Valid values are <code>CONNECT_SSH</code> (default) and <code>CONNECT_SSM</code> (connected through Amazon EC2 Systems Manager).</p>
329    /// <p>For more information, see <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html">Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager</a> in the <i>Cloud9 User Guide</i>.</p>
330    pub fn connection_type(mut self, input: crate::types::ConnectionType) -> Self {
331        self.inner = self.inner.connection_type(input);
332        self
333    }
334    /// <p>The connection type used for connecting to an Amazon EC2 environment. Valid values are <code>CONNECT_SSH</code> (default) and <code>CONNECT_SSM</code> (connected through Amazon EC2 Systems Manager).</p>
335    /// <p>For more information, see <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html">Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager</a> in the <i>Cloud9 User Guide</i>.</p>
336    pub fn set_connection_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
337        self.inner = self.inner.set_connection_type(input);
338        self
339    }
340    /// <p>The connection type used for connecting to an Amazon EC2 environment. Valid values are <code>CONNECT_SSH</code> (default) and <code>CONNECT_SSM</code> (connected through Amazon EC2 Systems Manager).</p>
341    /// <p>For more information, see <a href="https://docs.aws.amazon.com/cloud9/latest/user-guide/ec2-ssm.html">Accessing no-ingress EC2 instances with Amazon EC2 Systems Manager</a> in the <i>Cloud9 User Guide</i>.</p>
342    pub fn get_connection_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
343        self.inner.get_connection_type()
344    }
345    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
346    pub fn dry_run(mut self, input: bool) -> Self {
347        self.inner = self.inner.dry_run(input);
348        self
349    }
350    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
351    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
352        self.inner = self.inner.set_dry_run(input);
353        self
354    }
355    /// <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
356    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
357        self.inner.get_dry_run()
358    }
359}