aws_sdk_m2/operation/get_deployment/
_get_deployment_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 GetDeploymentOutput {
6    /// <p>The unique identifier of the deployment.</p>
7    pub deployment_id: ::std::string::String,
8    /// <p>The unique identifier of the application.</p>
9    pub application_id: ::std::string::String,
10    /// <p>The unique identifier of the runtime environment.</p>
11    pub environment_id: ::std::string::String,
12    /// <p>The application version.</p>
13    pub application_version: i32,
14    /// <p>The status of the deployment.</p>
15    pub status: crate::types::DeploymentLifecycle,
16    /// <p>The timestamp when the deployment was created.</p>
17    pub creation_time: ::aws_smithy_types::DateTime,
18    /// <p>The reason for the reported status.</p>
19    pub status_reason: ::std::option::Option<::std::string::String>,
20    _request_id: Option<String>,
21}
22impl GetDeploymentOutput {
23    /// <p>The unique identifier of the deployment.</p>
24    pub fn deployment_id(&self) -> &str {
25        use std::ops::Deref;
26        self.deployment_id.deref()
27    }
28    /// <p>The unique identifier of the application.</p>
29    pub fn application_id(&self) -> &str {
30        use std::ops::Deref;
31        self.application_id.deref()
32    }
33    /// <p>The unique identifier of the runtime environment.</p>
34    pub fn environment_id(&self) -> &str {
35        use std::ops::Deref;
36        self.environment_id.deref()
37    }
38    /// <p>The application version.</p>
39    pub fn application_version(&self) -> i32 {
40        self.application_version
41    }
42    /// <p>The status of the deployment.</p>
43    pub fn status(&self) -> &crate::types::DeploymentLifecycle {
44        &self.status
45    }
46    /// <p>The timestamp when the deployment was created.</p>
47    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
48        &self.creation_time
49    }
50    /// <p>The reason for the reported status.</p>
51    pub fn status_reason(&self) -> ::std::option::Option<&str> {
52        self.status_reason.as_deref()
53    }
54}
55impl ::aws_types::request_id::RequestId for GetDeploymentOutput {
56    fn request_id(&self) -> Option<&str> {
57        self._request_id.as_deref()
58    }
59}
60impl GetDeploymentOutput {
61    /// Creates a new builder-style object to manufacture [`GetDeploymentOutput`](crate::operation::get_deployment::GetDeploymentOutput).
62    pub fn builder() -> crate::operation::get_deployment::builders::GetDeploymentOutputBuilder {
63        crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::default()
64    }
65}
66
67/// A builder for [`GetDeploymentOutput`](crate::operation::get_deployment::GetDeploymentOutput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct GetDeploymentOutputBuilder {
71    pub(crate) deployment_id: ::std::option::Option<::std::string::String>,
72    pub(crate) application_id: ::std::option::Option<::std::string::String>,
73    pub(crate) environment_id: ::std::option::Option<::std::string::String>,
74    pub(crate) application_version: ::std::option::Option<i32>,
75    pub(crate) status: ::std::option::Option<crate::types::DeploymentLifecycle>,
76    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
77    pub(crate) status_reason: ::std::option::Option<::std::string::String>,
78    _request_id: Option<String>,
79}
80impl GetDeploymentOutputBuilder {
81    /// <p>The unique identifier of the deployment.</p>
82    /// This field is required.
83    pub fn deployment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.deployment_id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The unique identifier of the deployment.</p>
88    pub fn set_deployment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.deployment_id = input;
90        self
91    }
92    /// <p>The unique identifier of the deployment.</p>
93    pub fn get_deployment_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.deployment_id
95    }
96    /// <p>The unique identifier of the application.</p>
97    /// This field is required.
98    pub fn application_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.application_id = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The unique identifier of the application.</p>
103    pub fn set_application_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.application_id = input;
105        self
106    }
107    /// <p>The unique identifier of the application.</p>
108    pub fn get_application_id(&self) -> &::std::option::Option<::std::string::String> {
109        &self.application_id
110    }
111    /// <p>The unique identifier of the runtime environment.</p>
112    /// This field is required.
113    pub fn environment_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.environment_id = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The unique identifier of the runtime environment.</p>
118    pub fn set_environment_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.environment_id = input;
120        self
121    }
122    /// <p>The unique identifier of the runtime environment.</p>
123    pub fn get_environment_id(&self) -> &::std::option::Option<::std::string::String> {
124        &self.environment_id
125    }
126    /// <p>The application version.</p>
127    /// This field is required.
128    pub fn application_version(mut self, input: i32) -> Self {
129        self.application_version = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The application version.</p>
133    pub fn set_application_version(mut self, input: ::std::option::Option<i32>) -> Self {
134        self.application_version = input;
135        self
136    }
137    /// <p>The application version.</p>
138    pub fn get_application_version(&self) -> &::std::option::Option<i32> {
139        &self.application_version
140    }
141    /// <p>The status of the deployment.</p>
142    /// This field is required.
143    pub fn status(mut self, input: crate::types::DeploymentLifecycle) -> Self {
144        self.status = ::std::option::Option::Some(input);
145        self
146    }
147    /// <p>The status of the deployment.</p>
148    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DeploymentLifecycle>) -> Self {
149        self.status = input;
150        self
151    }
152    /// <p>The status of the deployment.</p>
153    pub fn get_status(&self) -> &::std::option::Option<crate::types::DeploymentLifecycle> {
154        &self.status
155    }
156    /// <p>The timestamp when the deployment was created.</p>
157    /// This field is required.
158    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
159        self.creation_time = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The timestamp when the deployment was created.</p>
163    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
164        self.creation_time = input;
165        self
166    }
167    /// <p>The timestamp when the deployment was created.</p>
168    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
169        &self.creation_time
170    }
171    /// <p>The reason for the reported status.</p>
172    pub fn status_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.status_reason = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The reason for the reported status.</p>
177    pub fn set_status_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.status_reason = input;
179        self
180    }
181    /// <p>The reason for the reported status.</p>
182    pub fn get_status_reason(&self) -> &::std::option::Option<::std::string::String> {
183        &self.status_reason
184    }
185    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
186        self._request_id = Some(request_id.into());
187        self
188    }
189
190    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
191        self._request_id = request_id;
192        self
193    }
194    /// Consumes the builder and constructs a [`GetDeploymentOutput`](crate::operation::get_deployment::GetDeploymentOutput).
195    /// This method will fail if any of the following fields are not set:
196    /// - [`deployment_id`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::deployment_id)
197    /// - [`application_id`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::application_id)
198    /// - [`environment_id`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::environment_id)
199    /// - [`application_version`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::application_version)
200    /// - [`status`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::status)
201    /// - [`creation_time`](crate::operation::get_deployment::builders::GetDeploymentOutputBuilder::creation_time)
202    pub fn build(
203        self,
204    ) -> ::std::result::Result<crate::operation::get_deployment::GetDeploymentOutput, ::aws_smithy_types::error::operation::BuildError> {
205        ::std::result::Result::Ok(crate::operation::get_deployment::GetDeploymentOutput {
206            deployment_id: self.deployment_id.ok_or_else(|| {
207                ::aws_smithy_types::error::operation::BuildError::missing_field(
208                    "deployment_id",
209                    "deployment_id was not specified but it is required when building GetDeploymentOutput",
210                )
211            })?,
212            application_id: self.application_id.ok_or_else(|| {
213                ::aws_smithy_types::error::operation::BuildError::missing_field(
214                    "application_id",
215                    "application_id was not specified but it is required when building GetDeploymentOutput",
216                )
217            })?,
218            environment_id: self.environment_id.ok_or_else(|| {
219                ::aws_smithy_types::error::operation::BuildError::missing_field(
220                    "environment_id",
221                    "environment_id was not specified but it is required when building GetDeploymentOutput",
222                )
223            })?,
224            application_version: self.application_version.ok_or_else(|| {
225                ::aws_smithy_types::error::operation::BuildError::missing_field(
226                    "application_version",
227                    "application_version was not specified but it is required when building GetDeploymentOutput",
228                )
229            })?,
230            status: self.status.ok_or_else(|| {
231                ::aws_smithy_types::error::operation::BuildError::missing_field(
232                    "status",
233                    "status was not specified but it is required when building GetDeploymentOutput",
234                )
235            })?,
236            creation_time: self.creation_time.ok_or_else(|| {
237                ::aws_smithy_types::error::operation::BuildError::missing_field(
238                    "creation_time",
239                    "creation_time was not specified but it is required when building GetDeploymentOutput",
240                )
241            })?,
242            status_reason: self.status_reason,
243            _request_id: self._request_id,
244        })
245    }
246}