Skip to main content

aws_sdk_continuum/operation/update_environment/
_update_environment_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// Contains the current state of the updated environment. Use GetEnvironment to read its source and environment configuration.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateEnvironmentOutput {
7    /// The unique identifier of the updated environment.
8    pub environment_id: ::std::string::String,
9    /// The ARN of the updated environment.
10    pub environment_arn: ::std::string::String,
11    /// The current customer-visible name of the environment.
12    pub name: ::std::string::String,
13    /// The current operational status of the environment.
14    pub status: crate::types::EnvironmentStatus,
15    /// Human-readable details about the current status.
16    pub status_message: ::std::option::Option<::std::string::String>,
17    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
18    pub status_updated_at: ::aws_smithy_types::DateTime,
19    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
20    pub created_at: ::aws_smithy_types::DateTime,
21    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
22    pub configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
23    _request_id: Option<String>,
24}
25impl UpdateEnvironmentOutput {
26    /// The unique identifier of the updated environment.
27    pub fn environment_id(&self) -> &str {
28        use std::ops::Deref;
29        self.environment_id.deref()
30    }
31    /// The ARN of the updated environment.
32    pub fn environment_arn(&self) -> &str {
33        use std::ops::Deref;
34        self.environment_arn.deref()
35    }
36    /// The current customer-visible name of the environment.
37    pub fn name(&self) -> &str {
38        use std::ops::Deref;
39        self.name.deref()
40    }
41    /// The current operational status of the environment.
42    pub fn status(&self) -> &crate::types::EnvironmentStatus {
43        &self.status
44    }
45    /// Human-readable details about the current status.
46    pub fn status_message(&self) -> ::std::option::Option<&str> {
47        self.status_message.as_deref()
48    }
49    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
50    pub fn status_updated_at(&self) -> &::aws_smithy_types::DateTime {
51        &self.status_updated_at
52    }
53    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
54    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
55        &self.created_at
56    }
57    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
58    pub fn configuration(&self) -> ::std::option::Option<&crate::types::EnvironmentConfigurationDetails> {
59        self.configuration.as_ref()
60    }
61}
62impl ::aws_types::request_id::RequestId for UpdateEnvironmentOutput {
63    fn request_id(&self) -> Option<&str> {
64        self._request_id.as_deref()
65    }
66}
67impl UpdateEnvironmentOutput {
68    /// Creates a new builder-style object to manufacture [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
69    pub fn builder() -> crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder {
70        crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::default()
71    }
72}
73
74/// A builder for [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
75#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
76#[non_exhaustive]
77pub struct UpdateEnvironmentOutputBuilder {
78    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
79    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
80    pub(crate) name: ::std::option::Option<::std::string::String>,
81    pub(crate) status: ::std::option::Option<crate::types::EnvironmentStatus>,
82    pub(crate) status_message: ::std::option::Option<::std::string::String>,
83    pub(crate) status_updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
84    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
85    pub(crate) configuration: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>,
86    _request_id: Option<String>,
87}
88impl UpdateEnvironmentOutputBuilder {
89    /// The unique identifier of the updated environment.
90    /// This field is required.
91    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.environment_id = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// The unique identifier of the updated environment.
96    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.environment_id = input;
98        self
99    }
100    /// The unique identifier of the updated environment.
101    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
102        &self.environment_id
103    }
104    /// The ARN of the updated environment.
105    /// This field is required.
106    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.environment_arn = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// The ARN of the updated environment.
111    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
112        self.environment_arn = input;
113        self
114    }
115    /// The ARN of the updated environment.
116    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
117        &self.environment_arn
118    }
119    /// The current customer-visible name of the environment.
120    /// This field is required.
121    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.name = ::std::option::Option::Some(input.into());
123        self
124    }
125    /// The current customer-visible name of the environment.
126    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.name = input;
128        self
129    }
130    /// The current customer-visible name of the environment.
131    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
132        &self.name
133    }
134    /// The current operational status of the environment.
135    /// This field is required.
136    pub fn status(mut self, input: crate::types::EnvironmentStatus) -> Self {
137        self.status = ::std::option::Option::Some(input);
138        self
139    }
140    /// The current operational status of the environment.
141    pub fn set_status(mut self, input: ::std::option::Option<crate::types::EnvironmentStatus>) -> Self {
142        self.status = input;
143        self
144    }
145    /// The current operational status of the environment.
146    pub fn get_status(&self) -> &::std::option::Option<crate::types::EnvironmentStatus> {
147        &self.status
148    }
149    /// Human-readable details about the current status.
150    pub fn status_message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.status_message = ::std::option::Option::Some(input.into());
152        self
153    }
154    /// Human-readable details about the current status.
155    pub fn set_status_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.status_message = input;
157        self
158    }
159    /// Human-readable details about the current status.
160    pub fn get_status_message(&self) -> &::std::option::Option<::std::string::String> {
161        &self.status_message
162    }
163    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
164    /// This field is required.
165    pub fn status_updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
166        self.status_updated_at = ::std::option::Option::Some(input);
167        self
168    }
169    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
170    pub fn set_status_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
171        self.status_updated_at = input;
172        self
173    }
174    /// The timestamp when the status last transitioned. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
175    pub fn get_status_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
176        &self.status_updated_at
177    }
178    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
179    /// This field is required.
180    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
181        self.created_at = ::std::option::Option::Some(input);
182        self
183    }
184    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
185    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
186        self.created_at = input;
187        self
188    }
189    /// The timestamp when the environment was created. Uses the existing GetEnvironment/ListEnvironments ISO-8601 wire format for this field.
190    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
191        &self.created_at
192    }
193    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
194    /// This field is required.
195    pub fn configuration(mut self, input: crate::types::EnvironmentConfigurationDetails) -> Self {
196        self.configuration = ::std::option::Option::Some(input);
197        self
198    }
199    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
200    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::EnvironmentConfigurationDetails>) -> Self {
201        self.configuration = input;
202        self
203    }
204    /// Type-specific state, including Collector details and the latest scan. Read source and operating-policy settings through GetEnvironment.
205    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::EnvironmentConfigurationDetails> {
206        &self.configuration
207    }
208    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
209        self._request_id = Some(request_id.into());
210        self
211    }
212
213    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
214        self._request_id = request_id;
215        self
216    }
217    /// Consumes the builder and constructs a [`UpdateEnvironmentOutput`](crate::operation::update_environment::UpdateEnvironmentOutput).
218    /// This method will fail if any of the following fields are not set:
219    /// - [`environment_id`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::environment_id)
220    /// - [`environment_arn`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::environment_arn)
221    /// - [`name`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::name)
222    /// - [`status`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::status)
223    /// - [`status_updated_at`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::status_updated_at)
224    /// - [`created_at`](crate::operation::update_environment::builders::UpdateEnvironmentOutputBuilder::created_at)
225    pub fn build(
226        self,
227    ) -> ::std::result::Result<crate::operation::update_environment::UpdateEnvironmentOutput, ::aws_smithy_types::error::operation::BuildError> {
228        ::std::result::Result::Ok(crate::operation::update_environment::UpdateEnvironmentOutput {
229            environment_id: self.environment_id.ok_or_else(|| {
230                ::aws_smithy_types::error::operation::BuildError::missing_field(
231                    "environment_id",
232                    "environment_id was not specified but it is required when building UpdateEnvironmentOutput",
233                )
234            })?,
235            environment_arn: self.environment_arn.ok_or_else(|| {
236                ::aws_smithy_types::error::operation::BuildError::missing_field(
237                    "environment_arn",
238                    "environment_arn was not specified but it is required when building UpdateEnvironmentOutput",
239                )
240            })?,
241            name: self.name.ok_or_else(|| {
242                ::aws_smithy_types::error::operation::BuildError::missing_field(
243                    "name",
244                    "name was not specified but it is required when building UpdateEnvironmentOutput",
245                )
246            })?,
247            status: self.status.ok_or_else(|| {
248                ::aws_smithy_types::error::operation::BuildError::missing_field(
249                    "status",
250                    "status was not specified but it is required when building UpdateEnvironmentOutput",
251                )
252            })?,
253            status_message: self.status_message,
254            status_updated_at: self.status_updated_at.ok_or_else(|| {
255                ::aws_smithy_types::error::operation::BuildError::missing_field(
256                    "status_updated_at",
257                    "status_updated_at was not specified but it is required when building UpdateEnvironmentOutput",
258                )
259            })?,
260            created_at: self.created_at.ok_or_else(|| {
261                ::aws_smithy_types::error::operation::BuildError::missing_field(
262                    "created_at",
263                    "created_at was not specified but it is required when building UpdateEnvironmentOutput",
264                )
265            })?,
266            configuration: self.configuration,
267            _request_id: self._request_id,
268        })
269    }
270}