aws_sdk_iotsitewise/operation/describe_project/
_describe_project_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 DescribeProjectOutput {
6    /// <p>The ID of the project.</p>
7    pub project_id: ::std::string::String,
8    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the project, which has the following format.</p>
9    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}</code></p>
10    pub project_arn: ::std::string::String,
11    /// <p>The name of the project.</p>
12    pub project_name: ::std::string::String,
13    /// <p>The ID of the portal that the project is in.</p>
14    pub portal_id: ::std::string::String,
15    /// <p>The project's description.</p>
16    pub project_description: ::std::option::Option<::std::string::String>,
17    /// <p>The date the project was created, in Unix epoch time.</p>
18    pub project_creation_date: ::aws_smithy_types::DateTime,
19    /// <p>The date the project was last updated, in Unix epoch time.</p>
20    pub project_last_update_date: ::aws_smithy_types::DateTime,
21    _request_id: Option<String>,
22}
23impl DescribeProjectOutput {
24    /// <p>The ID of the project.</p>
25    pub fn project_id(&self) -> &str {
26        use std::ops::Deref;
27        self.project_id.deref()
28    }
29    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the project, which has the following format.</p>
30    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}</code></p>
31    pub fn project_arn(&self) -> &str {
32        use std::ops::Deref;
33        self.project_arn.deref()
34    }
35    /// <p>The name of the project.</p>
36    pub fn project_name(&self) -> &str {
37        use std::ops::Deref;
38        self.project_name.deref()
39    }
40    /// <p>The ID of the portal that the project is in.</p>
41    pub fn portal_id(&self) -> &str {
42        use std::ops::Deref;
43        self.portal_id.deref()
44    }
45    /// <p>The project's description.</p>
46    pub fn project_description(&self) -> ::std::option::Option<&str> {
47        self.project_description.as_deref()
48    }
49    /// <p>The date the project was created, in Unix epoch time.</p>
50    pub fn project_creation_date(&self) -> &::aws_smithy_types::DateTime {
51        &self.project_creation_date
52    }
53    /// <p>The date the project was last updated, in Unix epoch time.</p>
54    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    /// Creates a new builder-style object to manufacture [`DescribeProjectOutput`](crate::operation::describe_project::DescribeProjectOutput).
65    pub fn builder() -> crate::operation::describe_project::builders::DescribeProjectOutputBuilder {
66        crate::operation::describe_project::builders::DescribeProjectOutputBuilder::default()
67    }
68}
69
70/// A builder for [`DescribeProjectOutput`](crate::operation::describe_project::DescribeProjectOutput).
71#[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    /// <p>The ID of the project.</p>
85    /// This field is required.
86    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    /// <p>The ID of the project.</p>
91    pub fn set_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
92        self.project_id = input;
93        self
94    }
95    /// <p>The ID of the project.</p>
96    pub fn get_project_id(&self) -> &::std::option::Option<::std::string::String> {
97        &self.project_id
98    }
99    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the project, which has the following format.</p>
100    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}</code></p>
101    /// This field is required.
102    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    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the project, which has the following format.</p>
107    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}</code></p>
108    pub fn set_project_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.project_arn = input;
110        self
111    }
112    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the project, which has the following format.</p>
113    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:project/${ProjectId}</code></p>
114    pub fn get_project_arn(&self) -> &::std::option::Option<::std::string::String> {
115        &self.project_arn
116    }
117    /// <p>The name of the project.</p>
118    /// This field is required.
119    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    /// <p>The name of the project.</p>
124    pub fn set_project_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.project_name = input;
126        self
127    }
128    /// <p>The name of the project.</p>
129    pub fn get_project_name(&self) -> &::std::option::Option<::std::string::String> {
130        &self.project_name
131    }
132    /// <p>The ID of the portal that the project is in.</p>
133    /// This field is required.
134    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    /// <p>The ID of the portal that the project is in.</p>
139    pub fn set_portal_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140        self.portal_id = input;
141        self
142    }
143    /// <p>The ID of the portal that the project is in.</p>
144    pub fn get_portal_id(&self) -> &::std::option::Option<::std::string::String> {
145        &self.portal_id
146    }
147    /// <p>The project's description.</p>
148    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    /// <p>The project's description.</p>
153    pub fn set_project_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154        self.project_description = input;
155        self
156    }
157    /// <p>The project's description.</p>
158    pub fn get_project_description(&self) -> &::std::option::Option<::std::string::String> {
159        &self.project_description
160    }
161    /// <p>The date the project was created, in Unix epoch time.</p>
162    /// This field is required.
163    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    /// <p>The date the project was created, in Unix epoch time.</p>
168    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    /// <p>The date the project was created, in Unix epoch time.</p>
173    pub fn get_project_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
174        &self.project_creation_date
175    }
176    /// <p>The date the project was last updated, in Unix epoch time.</p>
177    /// This field is required.
178    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    /// <p>The date the project was last updated, in Unix epoch time.</p>
183    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    /// <p>The date the project was last updated, in Unix epoch time.</p>
188    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    /// Consumes the builder and constructs a [`DescribeProjectOutput`](crate::operation::describe_project::DescribeProjectOutput).
201    /// This method will fail if any of the following fields are not set:
202    /// - [`project_id`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::project_id)
203    /// - [`project_arn`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::project_arn)
204    /// - [`project_name`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::project_name)
205    /// - [`portal_id`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::portal_id)
206    /// - [`project_creation_date`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::project_creation_date)
207    /// - [`project_last_update_date`](crate::operation::describe_project::builders::DescribeProjectOutputBuilder::project_last_update_date)
208    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}