aws_sdk_appconfig/operation/create_environment/
_create_environment_output.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 CreateEnvironmentOutput {
6    /// <p>The application ID.</p>
7    pub application_id: ::std::option::Option<::std::string::String>,
8    /// <p>The environment ID.</p>
9    pub id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the environment.</p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the environment.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
15    pub state: ::std::option::Option<crate::types::EnvironmentState>,
16    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
17    pub monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
18    _request_id: Option<String>,
19}
20impl CreateEnvironmentOutput {
21    /// <p>The application ID.</p>
22    pub fn application_id(&self) -> ::std::option::Option<&str> {
23        self.application_id.as_deref()
24    }
25    /// <p>The environment ID.</p>
26    pub fn id(&self) -> ::std::option::Option<&str> {
27        self.id.as_deref()
28    }
29    /// <p>The name of the environment.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// <p>The description of the environment.</p>
34    pub fn description(&self) -> ::std::option::Option<&str> {
35        self.description.as_deref()
36    }
37    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
38    pub fn state(&self) -> ::std::option::Option<&crate::types::EnvironmentState> {
39        self.state.as_ref()
40    }
41    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.monitors.is_none()`.
44    pub fn monitors(&self) -> &[crate::types::Monitor] {
45        self.monitors.as_deref().unwrap_or_default()
46    }
47}
48impl ::aws_types::request_id::RequestId for CreateEnvironmentOutput {
49    fn request_id(&self) -> Option<&str> {
50        self._request_id.as_deref()
51    }
52}
53impl CreateEnvironmentOutput {
54    /// Creates a new builder-style object to manufacture [`CreateEnvironmentOutput`](crate::operation::create_environment::CreateEnvironmentOutput).
55    pub fn builder() -> crate::operation::create_environment::builders::CreateEnvironmentOutputBuilder {
56        crate::operation::create_environment::builders::CreateEnvironmentOutputBuilder::default()
57    }
58}
59
60/// A builder for [`CreateEnvironmentOutput`](crate::operation::create_environment::CreateEnvironmentOutput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateEnvironmentOutputBuilder {
64    pub(crate) application_id: ::std::option::Option<::std::string::String>,
65    pub(crate) id: ::std::option::Option<::std::string::String>,
66    pub(crate) name: ::std::option::Option<::std::string::String>,
67    pub(crate) description: ::std::option::Option<::std::string::String>,
68    pub(crate) state: ::std::option::Option<crate::types::EnvironmentState>,
69    pub(crate) monitors: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>,
70    _request_id: Option<String>,
71}
72impl CreateEnvironmentOutputBuilder {
73    /// <p>The application ID.</p>
74    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.application_id = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The application ID.</p>
79    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.application_id = input;
81        self
82    }
83    /// <p>The application ID.</p>
84    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
85        &self.application_id
86    }
87    /// <p>The environment ID.</p>
88    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The environment ID.</p>
93    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.id = input;
95        self
96    }
97    /// <p>The environment ID.</p>
98    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.id
100    }
101    /// <p>The name of the environment.</p>
102    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.name = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The name of the environment.</p>
107    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.name = input;
109        self
110    }
111    /// <p>The name of the environment.</p>
112    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
113        &self.name
114    }
115    /// <p>The description of the environment.</p>
116    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.description = ::std::option::Option::Some(input.into());
118        self
119    }
120    /// <p>The description of the environment.</p>
121    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.description = input;
123        self
124    }
125    /// <p>The description of the environment.</p>
126    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
127        &self.description
128    }
129    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
130    pub fn state(mut self, input: crate::types::EnvironmentState) -> Self {
131        self.state = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
135    pub fn set_state(mut self, input: ::std::option::Option<crate::types::EnvironmentState>) -> Self {
136        self.state = input;
137        self
138    }
139    /// <p>The state of the environment. An environment can be in one of the following states: <code>READY_FOR_DEPLOYMENT</code>, <code>DEPLOYING</code>, <code>ROLLING_BACK</code>, or <code>ROLLED_BACK</code></p>
140    pub fn get_state(&self) -> &::std::option::Option<crate::types::EnvironmentState> {
141        &self.state
142    }
143    /// Appends an item to `monitors`.
144    ///
145    /// To override the contents of this collection use [`set_monitors`](Self::set_monitors).
146    ///
147    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
148    pub fn monitors(mut self, input: crate::types::Monitor) -> Self {
149        let mut v = self.monitors.unwrap_or_default();
150        v.push(input);
151        self.monitors = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
155    pub fn set_monitors(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Monitor>>) -> Self {
156        self.monitors = input;
157        self
158    }
159    /// <p>Amazon CloudWatch alarms monitored during the deployment.</p>
160    pub fn get_monitors(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Monitor>> {
161        &self.monitors
162    }
163    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
164        self._request_id = Some(request_id.into());
165        self
166    }
167
168    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
169        self._request_id = request_id;
170        self
171    }
172    /// Consumes the builder and constructs a [`CreateEnvironmentOutput`](crate::operation::create_environment::CreateEnvironmentOutput).
173    pub fn build(self) -> crate::operation::create_environment::CreateEnvironmentOutput {
174        crate::operation::create_environment::CreateEnvironmentOutput {
175            application_id: self.application_id,
176            id: self.id,
177            name: self.name,
178            description: self.description,
179            state: self.state,
180            monitors: self.monitors,
181            _request_id: self._request_id,
182        }
183    }
184}