Skip to main content

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_input::CreateEnvironmentEc2InputBuilder;
3
4pub use crate::operation::create_environment_ec2::_create_environment_ec2_output::CreateEnvironmentEc2OutputBuilder;
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 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
198    /// <li>
199    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
200    /// </ul>
201    /// <p><b>SSM paths</b></p>
202    /// <ul>
203    /// <li>
204    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
205    /// <li>
206    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
207    /// </ul>
208    pub fn image_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
209        self.inner = self.inner.image_id(input.into());
210        self
211    }
212    /// <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>
213    /// <p></p>
214    /// <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p>
215    /// <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>
216    /// <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p>
217    /// <p><b>AMI aliases </b></p>
218    /// <ul>
219    /// <li>
220    /// <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
221    /// <li>
222    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
223    /// </ul>
224    /// <p><b>SSM paths</b></p>
225    /// <ul>
226    /// <li>
227    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
228    /// <li>
229    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
230    /// </ul>
231    pub fn set_image_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
232        self.inner = self.inner.set_image_id(input);
233        self
234    }
235    /// <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>
236    /// <p></p>
237    /// <p>We recommend using Amazon Linux 2023 as the AMI to create your environment as it is fully supported.</p>
238    /// <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>
239    /// <p>Since Ubuntu 18.04 has ended standard support as of May 31, 2023, we recommend you choose Ubuntu 22.04.</p>
240    /// <p><b>AMI aliases </b></p>
241    /// <ul>
242    /// <li>
243    /// <p>Amazon Linux 2023 (recommended): <code>amazonlinux-2023-x86_64</code></p></li>
244    /// <li>
245    /// <p>Ubuntu 22.04: <code>ubuntu-22.04-x86_64</code></p></li>
246    /// </ul>
247    /// <p><b>SSM paths</b></p>
248    /// <ul>
249    /// <li>
250    /// <p>Amazon Linux 2023 (recommended): <code>resolve:ssm:/aws/service/cloud9/amis/amazonlinux-2023-x86_64</code></p></li>
251    /// <li>
252    /// <p>Ubuntu 22.04: <code>resolve:ssm:/aws/service/cloud9/amis/ubuntu-22.04-x86_64</code></p></li>
253    /// </ul>
254    pub fn get_image_id(&self) -> &::std::option::Option<::std::string::String> {
255        self.inner.get_image_id()
256    }
257    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
258    pub fn automatic_stop_time_minutes(mut self, input: i32) -> Self {
259        self.inner = self.inner.automatic_stop_time_minutes(input);
260        self
261    }
262    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
263    pub fn set_automatic_stop_time_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
264        self.inner = self.inner.set_automatic_stop_time_minutes(input);
265        self
266    }
267    /// <p>The number of minutes until the running instance is shut down after the environment has last been used.</p>
268    pub fn get_automatic_stop_time_minutes(&self) -> &::std::option::Option<i32> {
269        self.inner.get_automatic_stop_time_minutes()
270    }
271    /// <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>
272    pub fn owner_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
273        self.inner = self.inner.owner_arn(input.into());
274        self
275    }
276    /// <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>
277    pub fn set_owner_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
278        self.inner = self.inner.set_owner_arn(input);
279        self
280    }
281    /// <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>
282    pub fn get_owner_arn(&self) -> &::std::option::Option<::std::string::String> {
283        self.inner.get_owner_arn()
284    }
285    ///
286    /// Appends an item to `tags`.
287    ///
288    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
289    ///
290    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
291    pub fn tags(mut self, input: crate::types::Tag) -> Self {
292        self.inner = self.inner.tags(input);
293        self
294    }
295    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
296    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
297        self.inner = self.inner.set_tags(input);
298        self
299    }
300    /// <p>An array of key-value pairs that will be associated with the new Cloud9 development environment.</p>
301    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
302        self.inner.get_tags()
303    }
304    /// <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>
305    /// <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>
306    pub fn connection_type(mut self, input: crate::types::ConnectionType) -> Self {
307        self.inner = self.inner.connection_type(input);
308        self
309    }
310    /// <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>
311    /// <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>
312    pub fn set_connection_type(mut self, input: ::std::option::Option<crate::types::ConnectionType>) -> Self {
313        self.inner = self.inner.set_connection_type(input);
314        self
315    }
316    /// <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>
317    /// <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>
318    pub fn get_connection_type(&self) -> &::std::option::Option<crate::types::ConnectionType> {
319        self.inner.get_connection_type()
320    }
321    /// <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>
322    pub fn dry_run(mut self, input: bool) -> Self {
323        self.inner = self.inner.dry_run(input);
324        self
325    }
326    /// <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>
327    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
328        self.inner = self.inner.set_dry_run(input);
329        self
330    }
331    /// <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>
332    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
333        self.inner.get_dry_run()
334    }
335}