aws_sdk_iotsitewise/operation/describe_project/
_describe_project_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeProjectOutput {
6 pub project_id: ::std::string::String,
8 pub project_arn: ::std::string::String,
11 pub project_name: ::std::string::String,
13 pub portal_id: ::std::string::String,
15 pub project_description: ::std::option::Option<::std::string::String>,
17 pub project_creation_date: ::aws_smithy_types::DateTime,
19 pub project_last_update_date: ::aws_smithy_types::DateTime,
21 _request_id: Option<String>,
22}
23impl DescribeProjectOutput {
24 pub fn project_id(&self) -> &str {
26 use std::ops::Deref;
27 self.project_id.deref()
28 }
29 pub fn project_arn(&self) -> &str {
32 use std::ops::Deref;
33 self.project_arn.deref()
34 }
35 pub fn project_name(&self) -> &str {
37 use std::ops::Deref;
38 self.project_name.deref()
39 }
40 pub fn portal_id(&self) -> &str {
42 use std::ops::Deref;
43 self.portal_id.deref()
44 }
45 pub fn project_description(&self) -> ::std::option::Option<&str> {
47 self.project_description.as_deref()
48 }
49 pub fn project_creation_date(&self) -> &::aws_smithy_types::DateTime {
51 &self.project_creation_date
52 }
53 pub fn project_last_update_date(&self) -> &::aws_smithy_types::DateTime {
55 &self.project_last_update_date
56 }
57}
58impl ::aws_types::request_id::RequestId for DescribeProjectOutput {
59 fn request_id(&self) -> Option<&str> {
60 self._request_id.as_deref()
61 }
62}
63impl DescribeProjectOutput {
64 pub fn builder() -> crate::operation::describe_project::builders::DescribeProjectOutputBuilder {
66 crate::operation::describe_project::builders::DescribeProjectOutputBuilder::default()
67 }
68}
69
70#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
72#[non_exhaustive]
73pub struct DescribeProjectOutputBuilder {
74 pub(crate) project_id: ::std::option::Option<::std::string::String>,
75 pub(crate) project_arn: ::std::option::Option<::std::string::String>,
76 pub(crate) project_name: ::std::option::Option<::std::string::String>,
77 pub(crate) portal_id: ::std::option::Option<::std::string::String>,
78 pub(crate) project_description: ::std::option::Option<::std::string::String>,
79 pub(crate) project_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
80 pub(crate) project_last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
81 _request_id: Option<String>,
82}
83impl DescribeProjectOutputBuilder {
84 pub fn project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
87 self.project_id = ::std::option::Option::Some(input.into());
88 self
89 }
90 pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92 self.project_id = input;
93 self
94 }
95 pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
97 &self.project_id
98 }
99 pub fn project_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103 self.project_arn = ::std::option::Option::Some(input.into());
104 self
105 }
106 pub fn set_project_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.project_arn = input;
110 self
111 }
112 pub fn get_project_arn(&self) -> &::std::option::Option<::std::string::String> {
115 &self.project_arn
116 }
117 pub fn project_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120 self.project_name = ::std::option::Option::Some(input.into());
121 self
122 }
123 pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125 self.project_name = input;
126 self
127 }
128 pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
130 &self.project_name
131 }
132 pub fn portal_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135 self.portal_id = ::std::option::Option::Some(input.into());
136 self
137 }
138 pub fn set_portal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140 self.portal_id = input;
141 self
142 }
143 pub fn get_portal_id(&self) -> &::std::option::Option<::std::string::String> {
145 &self.portal_id
146 }
147 pub fn project_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
149 self.project_description = ::std::option::Option::Some(input.into());
150 self
151 }
152 pub fn set_project_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.project_description = input;
155 self
156 }
157 pub fn get_project_description(&self) -> &::std::option::Option<::std::string::String> {
159 &self.project_description
160 }
161 pub fn project_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
164 self.project_creation_date = ::std::option::Option::Some(input);
165 self
166 }
167 pub fn set_project_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
169 self.project_creation_date = input;
170 self
171 }
172 pub fn get_project_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
174 &self.project_creation_date
175 }
176 pub fn project_last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
179 self.project_last_update_date = ::std::option::Option::Some(input);
180 self
181 }
182 pub fn set_project_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
184 self.project_last_update_date = input;
185 self
186 }
187 pub fn get_project_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
189 &self.project_last_update_date
190 }
191 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
192 self._request_id = Some(request_id.into());
193 self
194 }
195
196 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
197 self._request_id = request_id;
198 self
199 }
200 pub fn build(
209 self,
210 ) -> ::std::result::Result<crate::operation::describe_project::DescribeProjectOutput, ::aws_smithy_types::error::operation::BuildError> {
211 ::std::result::Result::Ok(crate::operation::describe_project::DescribeProjectOutput {
212 project_id: self.project_id.ok_or_else(|| {
213 ::aws_smithy_types::error::operation::BuildError::missing_field(
214 "project_id",
215 "project_id was not specified but it is required when building DescribeProjectOutput",
216 )
217 })?,
218 project_arn: self.project_arn.ok_or_else(|| {
219 ::aws_smithy_types::error::operation::BuildError::missing_field(
220 "project_arn",
221 "project_arn was not specified but it is required when building DescribeProjectOutput",
222 )
223 })?,
224 project_name: self.project_name.ok_or_else(|| {
225 ::aws_smithy_types::error::operation::BuildError::missing_field(
226 "project_name",
227 "project_name was not specified but it is required when building DescribeProjectOutput",
228 )
229 })?,
230 portal_id: self.portal_id.ok_or_else(|| {
231 ::aws_smithy_types::error::operation::BuildError::missing_field(
232 "portal_id",
233 "portal_id was not specified but it is required when building DescribeProjectOutput",
234 )
235 })?,
236 project_description: self.project_description,
237 project_creation_date: self.project_creation_date.ok_or_else(|| {
238 ::aws_smithy_types::error::operation::BuildError::missing_field(
239 "project_creation_date",
240 "project_creation_date was not specified but it is required when building DescribeProjectOutput",
241 )
242 })?,
243 project_last_update_date: self.project_last_update_date.ok_or_else(|| {
244 ::aws_smithy_types::error::operation::BuildError::missing_field(
245 "project_last_update_date",
246 "project_last_update_date was not specified but it is required when building DescribeProjectOutput",
247 )
248 })?,
249 _request_id: self._request_id,
250 })
251 }
252}