Skip to main content

aws_sdk_continuum/operation/get_environment/
_get_environment_output.rs

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