aws_sdk_m2/operation/create_environment/
_create_environment_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateEnvironmentInput {
6    /// <p>The name of the runtime environment. Must be unique within the account.</p>
7    pub name: ::std::option::Option<::std::string::String>,
8    /// <p>The type of instance for the runtime environment.</p>
9    pub instance_type: ::std::option::Option<::std::string::String>,
10    /// <p>The description of the runtime environment.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>The engine type for the runtime environment.</p>
13    pub engine_type: ::std::option::Option<crate::types::EngineType>,
14    /// <p>The version of the engine type for the runtime environment.</p>
15    pub engine_version: ::std::option::Option<::std::string::String>,
16    /// <p>The list of subnets associated with the VPC for this runtime environment.</p>
17    pub subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18    /// <p>The list of security groups for the VPC associated with this runtime environment.</p>
19    pub security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
20    /// <p>Optional. The storage configurations for this runtime environment.</p>
21    pub storage_configurations: ::std::option::Option<::std::vec::Vec<crate::types::StorageConfiguration>>,
22    /// <p>Specifies whether the runtime environment is publicly accessible.</p>
23    pub publicly_accessible: ::std::option::Option<bool>,
24    /// <p>The details of a high availability configuration for this runtime environment.</p>
25    pub high_availability_config: ::std::option::Option<crate::types::HighAvailabilityConfig>,
26    /// <p>The tags for the runtime environment.</p>
27    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
28    /// <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>.</p>
29    /// <p>If you do not provide a value, a random system-generated value will be assigned.</p>
30    pub preferred_maintenance_window: ::std::option::Option<::std::string::String>,
31    /// <p>The network type required for the runtime environment.</p>
32    pub network_type: ::std::option::Option<crate::types::NetworkType>,
33    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
34    pub client_token: ::std::option::Option<::std::string::String>,
35    /// <p>The identifier of a customer managed key.</p>
36    pub kms_key_id: ::std::option::Option<::std::string::String>,
37}
38impl CreateEnvironmentInput {
39    /// <p>The name of the runtime environment. Must be unique within the account.</p>
40    pub fn name(&self) -> ::std::option::Option<&str> {
41        self.name.as_deref()
42    }
43    /// <p>The type of instance for the runtime environment.</p>
44    pub fn instance_type(&self) -> ::std::option::Option<&str> {
45        self.instance_type.as_deref()
46    }
47    /// <p>The description of the runtime environment.</p>
48    pub fn description(&self) -> ::std::option::Option<&str> {
49        self.description.as_deref()
50    }
51    /// <p>The engine type for the runtime environment.</p>
52    pub fn engine_type(&self) -> ::std::option::Option<&crate::types::EngineType> {
53        self.engine_type.as_ref()
54    }
55    /// <p>The version of the engine type for the runtime environment.</p>
56    pub fn engine_version(&self) -> ::std::option::Option<&str> {
57        self.engine_version.as_deref()
58    }
59    /// <p>The list of subnets associated with the VPC for this runtime environment.</p>
60    ///
61    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.subnet_ids.is_none()`.
62    pub fn subnet_ids(&self) -> &[::std::string::String] {
63        self.subnet_ids.as_deref().unwrap_or_default()
64    }
65    /// <p>The list of security groups for the VPC associated with this runtime environment.</p>
66    ///
67    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_group_ids.is_none()`.
68    pub fn security_group_ids(&self) -> &[::std::string::String] {
69        self.security_group_ids.as_deref().unwrap_or_default()
70    }
71    /// <p>Optional. The storage configurations for this runtime environment.</p>
72    ///
73    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.storage_configurations.is_none()`.
74    pub fn storage_configurations(&self) -> &[crate::types::StorageConfiguration] {
75        self.storage_configurations.as_deref().unwrap_or_default()
76    }
77    /// <p>Specifies whether the runtime environment is publicly accessible.</p>
78    pub fn publicly_accessible(&self) -> ::std::option::Option<bool> {
79        self.publicly_accessible
80    }
81    /// <p>The details of a high availability configuration for this runtime environment.</p>
82    pub fn high_availability_config(&self) -> ::std::option::Option<&crate::types::HighAvailabilityConfig> {
83        self.high_availability_config.as_ref()
84    }
85    /// <p>The tags for the runtime environment.</p>
86    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
87        self.tags.as_ref()
88    }
89    /// <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>.</p>
90    /// <p>If you do not provide a value, a random system-generated value will be assigned.</p>
91    pub fn preferred_maintenance_window(&self) -> ::std::option::Option<&str> {
92        self.preferred_maintenance_window.as_deref()
93    }
94    /// <p>The network type required for the runtime environment.</p>
95    pub fn network_type(&self) -> ::std::option::Option<&crate::types::NetworkType> {
96        self.network_type.as_ref()
97    }
98    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
99    pub fn client_token(&self) -> ::std::option::Option<&str> {
100        self.client_token.as_deref()
101    }
102    /// <p>The identifier of a customer managed key.</p>
103    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
104        self.kms_key_id.as_deref()
105    }
106}
107impl CreateEnvironmentInput {
108    /// Creates a new builder-style object to manufacture [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
109    pub fn builder() -> crate::operation::create_environment::builders::CreateEnvironmentInputBuilder {
110        crate::operation::create_environment::builders::CreateEnvironmentInputBuilder::default()
111    }
112}
113
114/// A builder for [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
115#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
116#[non_exhaustive]
117pub struct CreateEnvironmentInputBuilder {
118    pub(crate) name: ::std::option::Option<::std::string::String>,
119    pub(crate) instance_type: ::std::option::Option<::std::string::String>,
120    pub(crate) description: ::std::option::Option<::std::string::String>,
121    pub(crate) engine_type: ::std::option::Option<crate::types::EngineType>,
122    pub(crate) engine_version: ::std::option::Option<::std::string::String>,
123    pub(crate) subnet_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
124    pub(crate) security_group_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
125    pub(crate) storage_configurations: ::std::option::Option<::std::vec::Vec<crate::types::StorageConfiguration>>,
126    pub(crate) publicly_accessible: ::std::option::Option<bool>,
127    pub(crate) high_availability_config: ::std::option::Option<crate::types::HighAvailabilityConfig>,
128    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
129    pub(crate) preferred_maintenance_window: ::std::option::Option<::std::string::String>,
130    pub(crate) network_type: ::std::option::Option<crate::types::NetworkType>,
131    pub(crate) client_token: ::std::option::Option<::std::string::String>,
132    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
133}
134impl CreateEnvironmentInputBuilder {
135    /// <p>The name of the runtime environment. Must be unique within the account.</p>
136    /// This field is required.
137    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
138        self.name = ::std::option::Option::Some(input.into());
139        self
140    }
141    /// <p>The name of the runtime environment. Must be unique within the account.</p>
142    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
143        self.name = input;
144        self
145    }
146    /// <p>The name of the runtime environment. Must be unique within the account.</p>
147    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
148        &self.name
149    }
150    /// <p>The type of instance for the runtime environment.</p>
151    /// This field is required.
152    pub fn instance_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.instance_type = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>The type of instance for the runtime environment.</p>
157    pub fn set_instance_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.instance_type = input;
159        self
160    }
161    /// <p>The type of instance for the runtime environment.</p>
162    pub fn get_instance_type(&self) -> &::std::option::Option<::std::string::String> {
163        &self.instance_type
164    }
165    /// <p>The description of the runtime environment.</p>
166    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.description = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>The description of the runtime environment.</p>
171    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.description = input;
173        self
174    }
175    /// <p>The description of the runtime environment.</p>
176    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
177        &self.description
178    }
179    /// <p>The engine type for the runtime environment.</p>
180    /// This field is required.
181    pub fn engine_type(mut self, input: crate::types::EngineType) -> Self {
182        self.engine_type = ::std::option::Option::Some(input);
183        self
184    }
185    /// <p>The engine type for the runtime environment.</p>
186    pub fn set_engine_type(mut self, input: ::std::option::Option<crate::types::EngineType>) -> Self {
187        self.engine_type = input;
188        self
189    }
190    /// <p>The engine type for the runtime environment.</p>
191    pub fn get_engine_type(&self) -> &::std::option::Option<crate::types::EngineType> {
192        &self.engine_type
193    }
194    /// <p>The version of the engine type for the runtime environment.</p>
195    pub fn engine_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196        self.engine_version = ::std::option::Option::Some(input.into());
197        self
198    }
199    /// <p>The version of the engine type for the runtime environment.</p>
200    pub fn set_engine_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201        self.engine_version = input;
202        self
203    }
204    /// <p>The version of the engine type for the runtime environment.</p>
205    pub fn get_engine_version(&self) -> &::std::option::Option<::std::string::String> {
206        &self.engine_version
207    }
208    /// Appends an item to `subnet_ids`.
209    ///
210    /// To override the contents of this collection use [`set_subnet_ids`](Self::set_subnet_ids).
211    ///
212    /// <p>The list of subnets associated with the VPC for this runtime environment.</p>
213    pub fn subnet_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
214        let mut v = self.subnet_ids.unwrap_or_default();
215        v.push(input.into());
216        self.subnet_ids = ::std::option::Option::Some(v);
217        self
218    }
219    /// <p>The list of subnets associated with the VPC for this runtime environment.</p>
220    pub fn set_subnet_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
221        self.subnet_ids = input;
222        self
223    }
224    /// <p>The list of subnets associated with the VPC for this runtime environment.</p>
225    pub fn get_subnet_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
226        &self.subnet_ids
227    }
228    /// Appends an item to `security_group_ids`.
229    ///
230    /// To override the contents of this collection use [`set_security_group_ids`](Self::set_security_group_ids).
231    ///
232    /// <p>The list of security groups for the VPC associated with this runtime environment.</p>
233    pub fn security_group_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
234        let mut v = self.security_group_ids.unwrap_or_default();
235        v.push(input.into());
236        self.security_group_ids = ::std::option::Option::Some(v);
237        self
238    }
239    /// <p>The list of security groups for the VPC associated with this runtime environment.</p>
240    pub fn set_security_group_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
241        self.security_group_ids = input;
242        self
243    }
244    /// <p>The list of security groups for the VPC associated with this runtime environment.</p>
245    pub fn get_security_group_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
246        &self.security_group_ids
247    }
248    /// Appends an item to `storage_configurations`.
249    ///
250    /// To override the contents of this collection use [`set_storage_configurations`](Self::set_storage_configurations).
251    ///
252    /// <p>Optional. The storage configurations for this runtime environment.</p>
253    pub fn storage_configurations(mut self, input: crate::types::StorageConfiguration) -> Self {
254        let mut v = self.storage_configurations.unwrap_or_default();
255        v.push(input);
256        self.storage_configurations = ::std::option::Option::Some(v);
257        self
258    }
259    /// <p>Optional. The storage configurations for this runtime environment.</p>
260    pub fn set_storage_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StorageConfiguration>>) -> Self {
261        self.storage_configurations = input;
262        self
263    }
264    /// <p>Optional. The storage configurations for this runtime environment.</p>
265    pub fn get_storage_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StorageConfiguration>> {
266        &self.storage_configurations
267    }
268    /// <p>Specifies whether the runtime environment is publicly accessible.</p>
269    pub fn publicly_accessible(mut self, input: bool) -> Self {
270        self.publicly_accessible = ::std::option::Option::Some(input);
271        self
272    }
273    /// <p>Specifies whether the runtime environment is publicly accessible.</p>
274    pub fn set_publicly_accessible(mut self, input: ::std::option::Option<bool>) -> Self {
275        self.publicly_accessible = input;
276        self
277    }
278    /// <p>Specifies whether the runtime environment is publicly accessible.</p>
279    pub fn get_publicly_accessible(&self) -> &::std::option::Option<bool> {
280        &self.publicly_accessible
281    }
282    /// <p>The details of a high availability configuration for this runtime environment.</p>
283    pub fn high_availability_config(mut self, input: crate::types::HighAvailabilityConfig) -> Self {
284        self.high_availability_config = ::std::option::Option::Some(input);
285        self
286    }
287    /// <p>The details of a high availability configuration for this runtime environment.</p>
288    pub fn set_high_availability_config(mut self, input: ::std::option::Option<crate::types::HighAvailabilityConfig>) -> Self {
289        self.high_availability_config = input;
290        self
291    }
292    /// <p>The details of a high availability configuration for this runtime environment.</p>
293    pub fn get_high_availability_config(&self) -> &::std::option::Option<crate::types::HighAvailabilityConfig> {
294        &self.high_availability_config
295    }
296    /// Adds a key-value pair to `tags`.
297    ///
298    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
299    ///
300    /// <p>The tags for the runtime environment.</p>
301    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
302        let mut hash_map = self.tags.unwrap_or_default();
303        hash_map.insert(k.into(), v.into());
304        self.tags = ::std::option::Option::Some(hash_map);
305        self
306    }
307    /// <p>The tags for the runtime environment.</p>
308    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
309        self.tags = input;
310        self
311    }
312    /// <p>The tags for the runtime environment.</p>
313    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
314        &self.tags
315    }
316    /// <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>.</p>
317    /// <p>If you do not provide a value, a random system-generated value will be assigned.</p>
318    pub fn preferred_maintenance_window(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.preferred_maintenance_window = ::std::option::Option::Some(input.into());
320        self
321    }
322    /// <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>.</p>
323    /// <p>If you do not provide a value, a random system-generated value will be assigned.</p>
324    pub fn set_preferred_maintenance_window(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
325        self.preferred_maintenance_window = input;
326        self
327    }
328    /// <p>Configures the maintenance window that you want for the runtime environment. The maintenance window must have the format <code>ddd:hh24:mi-ddd:hh24:mi</code> and must be less than 24 hours. The following two examples are valid maintenance windows: <code>sun:23:45-mon:00:15</code> or <code>sat:01:00-sat:03:00</code>.</p>
329    /// <p>If you do not provide a value, a random system-generated value will be assigned.</p>
330    pub fn get_preferred_maintenance_window(&self) -> &::std::option::Option<::std::string::String> {
331        &self.preferred_maintenance_window
332    }
333    /// <p>The network type required for the runtime environment.</p>
334    pub fn network_type(mut self, input: crate::types::NetworkType) -> Self {
335        self.network_type = ::std::option::Option::Some(input);
336        self
337    }
338    /// <p>The network type required for the runtime environment.</p>
339    pub fn set_network_type(mut self, input: ::std::option::Option<crate::types::NetworkType>) -> Self {
340        self.network_type = input;
341        self
342    }
343    /// <p>The network type required for the runtime environment.</p>
344    pub fn get_network_type(&self) -> &::std::option::Option<crate::types::NetworkType> {
345        &self.network_type
346    }
347    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
348    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
349        self.client_token = ::std::option::Option::Some(input.into());
350        self
351    }
352    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
353    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
354        self.client_token = input;
355        self
356    }
357    /// <p>Unique, case-sensitive identifier you provide to ensure the idempotency of the request to create an environment. The service generates the clientToken when the API call is triggered. The token expires after one hour, so if you retry the API within this timeframe with the same clientToken, you will get the same response. The service also handles deleting the clientToken after it expires.</p>
358    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
359        &self.client_token
360    }
361    /// <p>The identifier of a customer managed key.</p>
362    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
363        self.kms_key_id = ::std::option::Option::Some(input.into());
364        self
365    }
366    /// <p>The identifier of a customer managed key.</p>
367    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
368        self.kms_key_id = input;
369        self
370    }
371    /// <p>The identifier of a customer managed key.</p>
372    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
373        &self.kms_key_id
374    }
375    /// Consumes the builder and constructs a [`CreateEnvironmentInput`](crate::operation::create_environment::CreateEnvironmentInput).
376    pub fn build(
377        self,
378    ) -> ::std::result::Result<crate::operation::create_environment::CreateEnvironmentInput, ::aws_smithy_types::error::operation::BuildError> {
379        ::std::result::Result::Ok(crate::operation::create_environment::CreateEnvironmentInput {
380            name: self.name,
381            instance_type: self.instance_type,
382            description: self.description,
383            engine_type: self.engine_type,
384            engine_version: self.engine_version,
385            subnet_ids: self.subnet_ids,
386            security_group_ids: self.security_group_ids,
387            storage_configurations: self.storage_configurations,
388            publicly_accessible: self.publicly_accessible,
389            high_availability_config: self.high_availability_config,
390            tags: self.tags,
391            preferred_maintenance_window: self.preferred_maintenance_window,
392            network_type: self.network_type,
393            client_token: self.client_token,
394            kms_key_id: self.kms_key_id,
395        })
396    }
397}