aws_sdk_codecatalyst/operation/create_dev_environment/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_dev_environment::_create_dev_environment_output::CreateDevEnvironmentOutputBuilder;
3
4pub use crate::operation::create_dev_environment::_create_dev_environment_input::CreateDevEnvironmentInputBuilder;
5
6impl crate::operation::create_dev_environment::builders::CreateDevEnvironmentInputBuilder {
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_dev_environment::CreateDevEnvironmentOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_dev_environment::CreateDevEnvironmentError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_dev_environment();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateDevEnvironment`.
24///
25/// <p>Creates a Dev Environment in Amazon CodeCatalyst, a cloud-based development environment that you can use to quickly work on the code stored in the source repositories of your project.</p><note>
26/// <p>When created in the Amazon CodeCatalyst console, by default a Dev Environment is configured to have a 2 core processor, 4GB of RAM, and 16GB of persistent storage. None of these defaults apply to a Dev Environment created programmatically.</p>
27/// </note>
28#[derive(::std::clone::Clone, ::std::fmt::Debug)]
29pub struct CreateDevEnvironmentFluentBuilder {
30    handle: ::std::sync::Arc<crate::client::Handle>,
31    inner: crate::operation::create_dev_environment::builders::CreateDevEnvironmentInputBuilder,
32    config_override: ::std::option::Option<crate::config::Builder>,
33}
34impl
35    crate::client::customize::internal::CustomizableSend<
36        crate::operation::create_dev_environment::CreateDevEnvironmentOutput,
37        crate::operation::create_dev_environment::CreateDevEnvironmentError,
38    > for CreateDevEnvironmentFluentBuilder
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_dev_environment::CreateDevEnvironmentOutput,
46            crate::operation::create_dev_environment::CreateDevEnvironmentError,
47        >,
48    > {
49        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
50    }
51}
52impl CreateDevEnvironmentFluentBuilder {
53    /// Creates a new `CreateDevEnvironmentFluentBuilder`.
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 CreateDevEnvironment as a reference.
62    pub fn as_input(&self) -> &crate::operation::create_dev_environment::builders::CreateDevEnvironmentInputBuilder {
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_dev_environment::CreateDevEnvironmentOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::create_dev_environment::CreateDevEnvironmentError,
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_dev_environment::CreateDevEnvironment::operation_runtime_plugins(
87            self.handle.runtime_plugins.clone(),
88            &self.handle.conf,
89            self.config_override,
90        );
91        crate::operation::create_dev_environment::CreateDevEnvironment::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_dev_environment::CreateDevEnvironmentOutput,
99        crate::operation::create_dev_environment::CreateDevEnvironmentError,
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 space.</p>
114    pub fn space_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.inner = self.inner.space_name(input.into());
116        self
117    }
118    /// <p>The name of the space.</p>
119    pub fn set_space_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
120        self.inner = self.inner.set_space_name(input);
121        self
122    }
123    /// <p>The name of the space.</p>
124    pub fn get_space_name(&self) -> &::std::option::Option<::std::string::String> {
125        self.inner.get_space_name()
126    }
127    /// <p>The name of the project in the space.</p>
128    pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.inner = self.inner.project_name(input.into());
130        self
131    }
132    /// <p>The name of the project in the space.</p>
133    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_project_name(input);
135        self
136    }
137    /// <p>The name of the project in the space.</p>
138    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
139        self.inner.get_project_name()
140    }
141    ///
142    /// Appends an item to `repositories`.
143    ///
144    /// To override the contents of this collection use [`set_repositories`](Self::set_repositories).
145    ///
146    /// <p>The source repository that contains the branch to clone into the Dev Environment.</p>
147    pub fn repositories(mut self, input: crate::types::RepositoryInput) -> Self {
148        self.inner = self.inner.repositories(input);
149        self
150    }
151    /// <p>The source repository that contains the branch to clone into the Dev Environment.</p>
152    pub fn set_repositories(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RepositoryInput>>) -> Self {
153        self.inner = self.inner.set_repositories(input);
154        self
155    }
156    /// <p>The source repository that contains the branch to clone into the Dev Environment.</p>
157    pub fn get_repositories(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RepositoryInput>> {
158        self.inner.get_repositories()
159    }
160    /// <p>A user-specified idempotency token. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.</p>
161    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.client_token(input.into());
163        self
164    }
165    /// <p>A user-specified idempotency token. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.</p>
166    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_client_token(input);
168        self
169    }
170    /// <p>A user-specified idempotency token. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries return the result from the original successful request and have no additional effect.</p>
171    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_client_token()
173    }
174    /// <p>The user-defined alias for a Dev Environment.</p>
175    pub fn alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.alias(input.into());
177        self
178    }
179    /// <p>The user-defined alias for a Dev Environment.</p>
180    pub fn set_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_alias(input);
182        self
183    }
184    /// <p>The user-defined alias for a Dev Environment.</p>
185    pub fn get_alias(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_alias()
187    }
188    ///
189    /// Appends an item to `ides`.
190    ///
191    /// To override the contents of this collection use [`set_ides`](Self::set_ides).
192    ///
193    /// <p>Information about the integrated development environment (IDE) configured for a Dev Environment.</p><note>
194    /// <p>An IDE is required to create a Dev Environment. For Dev Environment creation, this field contains configuration information and must be provided.</p>
195    /// </note>
196    pub fn ides(mut self, input: crate::types::IdeConfiguration) -> Self {
197        self.inner = self.inner.ides(input);
198        self
199    }
200    /// <p>Information about the integrated development environment (IDE) configured for a Dev Environment.</p><note>
201    /// <p>An IDE is required to create a Dev Environment. For Dev Environment creation, this field contains configuration information and must be provided.</p>
202    /// </note>
203    pub fn set_ides(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::IdeConfiguration>>) -> Self {
204        self.inner = self.inner.set_ides(input);
205        self
206    }
207    /// <p>Information about the integrated development environment (IDE) configured for a Dev Environment.</p><note>
208    /// <p>An IDE is required to create a Dev Environment. For Dev Environment creation, this field contains configuration information and must be provided.</p>
209    /// </note>
210    pub fn get_ides(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::IdeConfiguration>> {
211        self.inner.get_ides()
212    }
213    /// <p>The Amazon EC2 instace type to use for the Dev Environment.</p>
214    pub fn instance_type(mut self, input: crate::types::InstanceType) -> Self {
215        self.inner = self.inner.instance_type(input);
216        self
217    }
218    /// <p>The Amazon EC2 instace type to use for the Dev Environment.</p>
219    pub fn set_instance_type(mut self, input: ::std::option::Option<crate::types::InstanceType>) -> Self {
220        self.inner = self.inner.set_instance_type(input);
221        self
222    }
223    /// <p>The Amazon EC2 instace type to use for the Dev Environment.</p>
224    pub fn get_instance_type(&self) -> &::std::option::Option<crate::types::InstanceType> {
225        self.inner.get_instance_type()
226    }
227    /// <p>The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.</p>
228    pub fn inactivity_timeout_minutes(mut self, input: i32) -> Self {
229        self.inner = self.inner.inactivity_timeout_minutes(input);
230        self
231    }
232    /// <p>The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.</p>
233    pub fn set_inactivity_timeout_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
234        self.inner = self.inner.set_inactivity_timeout_minutes(input);
235        self
236    }
237    /// <p>The amount of time the Dev Environment will run without any activity detected before stopping, in minutes. Only whole integers are allowed. Dev Environments consume compute minutes when running.</p>
238    pub fn get_inactivity_timeout_minutes(&self) -> &::std::option::Option<i32> {
239        self.inner.get_inactivity_timeout_minutes()
240    }
241    /// <p>Information about the amount of storage allocated to the Dev Environment.</p><note>
242    /// <p>By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically creating a Dev Environment. Valid values for persistent storage are based on memory sizes in 16GB increments. Valid values are 16, 32, and 64.</p>
243    /// </note>
244    pub fn persistent_storage(mut self, input: crate::types::PersistentStorageConfiguration) -> Self {
245        self.inner = self.inner.persistent_storage(input);
246        self
247    }
248    /// <p>Information about the amount of storage allocated to the Dev Environment.</p><note>
249    /// <p>By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically creating a Dev Environment. Valid values for persistent storage are based on memory sizes in 16GB increments. Valid values are 16, 32, and 64.</p>
250    /// </note>
251    pub fn set_persistent_storage(mut self, input: ::std::option::Option<crate::types::PersistentStorageConfiguration>) -> Self {
252        self.inner = self.inner.set_persistent_storage(input);
253        self
254    }
255    /// <p>Information about the amount of storage allocated to the Dev Environment.</p><note>
256    /// <p>By default, a Dev Environment is configured to have 16GB of persistent storage when created from the Amazon CodeCatalyst console, but there is no default when programmatically creating a Dev Environment. Valid values for persistent storage are based on memory sizes in 16GB increments. Valid values are 16, 32, and 64.</p>
257    /// </note>
258    pub fn get_persistent_storage(&self) -> &::std::option::Option<crate::types::PersistentStorageConfiguration> {
259        self.inner.get_persistent_storage()
260    }
261    /// <p>The name of the connection that will be used to connect to Amazon VPC, if any.</p>
262    pub fn vpc_connection_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.inner = self.inner.vpc_connection_name(input.into());
264        self
265    }
266    /// <p>The name of the connection that will be used to connect to Amazon VPC, if any.</p>
267    pub fn set_vpc_connection_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.inner = self.inner.set_vpc_connection_name(input);
269        self
270    }
271    /// <p>The name of the connection that will be used to connect to Amazon VPC, if any.</p>
272    pub fn get_vpc_connection_name(&self) -> &::std::option::Option<::std::string::String> {
273        self.inner.get_vpc_connection_name()
274    }
275}