aws_sdk_iotsitewise/operation/describe_dataset/
_describe_dataset_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 DescribeDatasetOutput {
6    /// <p>The ID of the dataset.</p>
7    pub dataset_id: ::std::string::String,
8    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARN</a> of the dataset. The format is <code>arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}</code>.</p>
9    pub dataset_arn: ::std::string::String,
10    /// <p>The name of the dataset.</p>
11    pub dataset_name: ::std::string::String,
12    /// <p>A description about the dataset, and its functionality.</p>
13    pub dataset_description: ::std::string::String,
14    /// <p>The data source for the dataset.</p>
15    pub dataset_source: ::std::option::Option<crate::types::DatasetSource>,
16    /// <p>The status of the dataset. This contains the state and any error messages. State is <code>CREATING</code> after a successfull call to this API, and any associated error message. The state is <code>ACTIVE</code> when ready to use.</p>
17    pub dataset_status: ::std::option::Option<crate::types::DatasetStatus>,
18    /// <p>The dataset creation date, in Unix epoch time.</p>
19    pub dataset_creation_date: ::aws_smithy_types::DateTime,
20    /// <p>The date the dataset was last updated, in Unix epoch time.</p>
21    pub dataset_last_update_date: ::aws_smithy_types::DateTime,
22    /// <p>The version of the dataset.</p>
23    pub dataset_version: ::std::option::Option<::std::string::String>,
24    _request_id: Option<String>,
25}
26impl DescribeDatasetOutput {
27    /// <p>The ID of the dataset.</p>
28    pub fn dataset_id(&self) -> &str {
29        use std::ops::Deref;
30        self.dataset_id.deref()
31    }
32    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARN</a> of the dataset. The format is <code>arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}</code>.</p>
33    pub fn dataset_arn(&self) -> &str {
34        use std::ops::Deref;
35        self.dataset_arn.deref()
36    }
37    /// <p>The name of the dataset.</p>
38    pub fn dataset_name(&self) -> &str {
39        use std::ops::Deref;
40        self.dataset_name.deref()
41    }
42    /// <p>A description about the dataset, and its functionality.</p>
43    pub fn dataset_description(&self) -> &str {
44        use std::ops::Deref;
45        self.dataset_description.deref()
46    }
47    /// <p>The data source for the dataset.</p>
48    pub fn dataset_source(&self) -> ::std::option::Option<&crate::types::DatasetSource> {
49        self.dataset_source.as_ref()
50    }
51    /// <p>The status of the dataset. This contains the state and any error messages. State is <code>CREATING</code> after a successfull call to this API, and any associated error message. The state is <code>ACTIVE</code> when ready to use.</p>
52    pub fn dataset_status(&self) -> ::std::option::Option<&crate::types::DatasetStatus> {
53        self.dataset_status.as_ref()
54    }
55    /// <p>The dataset creation date, in Unix epoch time.</p>
56    pub fn dataset_creation_date(&self) -> &::aws_smithy_types::DateTime {
57        &self.dataset_creation_date
58    }
59    /// <p>The date the dataset was last updated, in Unix epoch time.</p>
60    pub fn dataset_last_update_date(&self) -> &::aws_smithy_types::DateTime {
61        &self.dataset_last_update_date
62    }
63    /// <p>The version of the dataset.</p>
64    pub fn dataset_version(&self) -> ::std::option::Option<&str> {
65        self.dataset_version.as_deref()
66    }
67}
68impl ::aws_types::request_id::RequestId for DescribeDatasetOutput {
69    fn request_id(&self) -> Option<&str> {
70        self._request_id.as_deref()
71    }
72}
73impl DescribeDatasetOutput {
74    /// Creates a new builder-style object to manufacture [`DescribeDatasetOutput`](crate::operation::describe_dataset::DescribeDatasetOutput).
75    pub fn builder() -> crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder {
76        crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::default()
77    }
78}
79
80/// A builder for [`DescribeDatasetOutput`](crate::operation::describe_dataset::DescribeDatasetOutput).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct DescribeDatasetOutputBuilder {
84    pub(crate) dataset_id: ::std::option::Option<::std::string::String>,
85    pub(crate) dataset_arn: ::std::option::Option<::std::string::String>,
86    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
87    pub(crate) dataset_description: ::std::option::Option<::std::string::String>,
88    pub(crate) dataset_source: ::std::option::Option<crate::types::DatasetSource>,
89    pub(crate) dataset_status: ::std::option::Option<crate::types::DatasetStatus>,
90    pub(crate) dataset_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
91    pub(crate) dataset_last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
92    pub(crate) dataset_version: ::std::option::Option<::std::string::String>,
93    _request_id: Option<String>,
94}
95impl DescribeDatasetOutputBuilder {
96    /// <p>The ID of the dataset.</p>
97    /// This field is required.
98    pub fn dataset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.dataset_id = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The ID of the dataset.</p>
103    pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.dataset_id = input;
105        self
106    }
107    /// <p>The ID of the dataset.</p>
108    pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
109        &self.dataset_id
110    }
111    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARN</a> of the dataset. The format is <code>arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}</code>.</p>
112    /// This field is required.
113    pub fn dataset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.dataset_arn = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARN</a> of the dataset. The format is <code>arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}</code>.</p>
118    pub fn set_dataset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.dataset_arn = input;
120        self
121    }
122    /// <p>The <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/reference-arns.html">ARN</a> of the dataset. The format is <code>arn:${Partition}:iotsitewise:${Region}:${Account}:dataset/${DatasetId}</code>.</p>
123    pub fn get_dataset_arn(&self) -> &::std::option::Option<::std::string::String> {
124        &self.dataset_arn
125    }
126    /// <p>The name of the dataset.</p>
127    /// This field is required.
128    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
129        self.dataset_name = ::std::option::Option::Some(input.into());
130        self
131    }
132    /// <p>The name of the dataset.</p>
133    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.dataset_name = input;
135        self
136    }
137    /// <p>The name of the dataset.</p>
138    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
139        &self.dataset_name
140    }
141    /// <p>A description about the dataset, and its functionality.</p>
142    /// This field is required.
143    pub fn dataset_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.dataset_description = ::std::option::Option::Some(input.into());
145        self
146    }
147    /// <p>A description about the dataset, and its functionality.</p>
148    pub fn set_dataset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.dataset_description = input;
150        self
151    }
152    /// <p>A description about the dataset, and its functionality.</p>
153    pub fn get_dataset_description(&self) -> &::std::option::Option<::std::string::String> {
154        &self.dataset_description
155    }
156    /// <p>The data source for the dataset.</p>
157    /// This field is required.
158    pub fn dataset_source(mut self, input: crate::types::DatasetSource) -> Self {
159        self.dataset_source = ::std::option::Option::Some(input);
160        self
161    }
162    /// <p>The data source for the dataset.</p>
163    pub fn set_dataset_source(mut self, input: ::std::option::Option<crate::types::DatasetSource>) -> Self {
164        self.dataset_source = input;
165        self
166    }
167    /// <p>The data source for the dataset.</p>
168    pub fn get_dataset_source(&self) -> &::std::option::Option<crate::types::DatasetSource> {
169        &self.dataset_source
170    }
171    /// <p>The status of the dataset. This contains the state and any error messages. State is <code>CREATING</code> after a successfull call to this API, and any associated error message. The state is <code>ACTIVE</code> when ready to use.</p>
172    /// This field is required.
173    pub fn dataset_status(mut self, input: crate::types::DatasetStatus) -> Self {
174        self.dataset_status = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The status of the dataset. This contains the state and any error messages. State is <code>CREATING</code> after a successfull call to this API, and any associated error message. The state is <code>ACTIVE</code> when ready to use.</p>
178    pub fn set_dataset_status(mut self, input: ::std::option::Option<crate::types::DatasetStatus>) -> Self {
179        self.dataset_status = input;
180        self
181    }
182    /// <p>The status of the dataset. This contains the state and any error messages. State is <code>CREATING</code> after a successfull call to this API, and any associated error message. The state is <code>ACTIVE</code> when ready to use.</p>
183    pub fn get_dataset_status(&self) -> &::std::option::Option<crate::types::DatasetStatus> {
184        &self.dataset_status
185    }
186    /// <p>The dataset creation date, in Unix epoch time.</p>
187    /// This field is required.
188    pub fn dataset_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
189        self.dataset_creation_date = ::std::option::Option::Some(input);
190        self
191    }
192    /// <p>The dataset creation date, in Unix epoch time.</p>
193    pub fn set_dataset_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
194        self.dataset_creation_date = input;
195        self
196    }
197    /// <p>The dataset creation date, in Unix epoch time.</p>
198    pub fn get_dataset_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
199        &self.dataset_creation_date
200    }
201    /// <p>The date the dataset was last updated, in Unix epoch time.</p>
202    /// This field is required.
203    pub fn dataset_last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
204        self.dataset_last_update_date = ::std::option::Option::Some(input);
205        self
206    }
207    /// <p>The date the dataset was last updated, in Unix epoch time.</p>
208    pub fn set_dataset_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
209        self.dataset_last_update_date = input;
210        self
211    }
212    /// <p>The date the dataset was last updated, in Unix epoch time.</p>
213    pub fn get_dataset_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
214        &self.dataset_last_update_date
215    }
216    /// <p>The version of the dataset.</p>
217    pub fn dataset_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.dataset_version = ::std::option::Option::Some(input.into());
219        self
220    }
221    /// <p>The version of the dataset.</p>
222    pub fn set_dataset_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.dataset_version = input;
224        self
225    }
226    /// <p>The version of the dataset.</p>
227    pub fn get_dataset_version(&self) -> &::std::option::Option<::std::string::String> {
228        &self.dataset_version
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 [`DescribeDatasetOutput`](crate::operation::describe_dataset::DescribeDatasetOutput).
240    /// This method will fail if any of the following fields are not set:
241    /// - [`dataset_id`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_id)
242    /// - [`dataset_arn`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_arn)
243    /// - [`dataset_name`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_name)
244    /// - [`dataset_description`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_description)
245    /// - [`dataset_creation_date`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_creation_date)
246    /// - [`dataset_last_update_date`](crate::operation::describe_dataset::builders::DescribeDatasetOutputBuilder::dataset_last_update_date)
247    pub fn build(
248        self,
249    ) -> ::std::result::Result<crate::operation::describe_dataset::DescribeDatasetOutput, ::aws_smithy_types::error::operation::BuildError> {
250        ::std::result::Result::Ok(crate::operation::describe_dataset::DescribeDatasetOutput {
251            dataset_id: self.dataset_id.ok_or_else(|| {
252                ::aws_smithy_types::error::operation::BuildError::missing_field(
253                    "dataset_id",
254                    "dataset_id was not specified but it is required when building DescribeDatasetOutput",
255                )
256            })?,
257            dataset_arn: self.dataset_arn.ok_or_else(|| {
258                ::aws_smithy_types::error::operation::BuildError::missing_field(
259                    "dataset_arn",
260                    "dataset_arn was not specified but it is required when building DescribeDatasetOutput",
261                )
262            })?,
263            dataset_name: self.dataset_name.ok_or_else(|| {
264                ::aws_smithy_types::error::operation::BuildError::missing_field(
265                    "dataset_name",
266                    "dataset_name was not specified but it is required when building DescribeDatasetOutput",
267                )
268            })?,
269            dataset_description: self.dataset_description.ok_or_else(|| {
270                ::aws_smithy_types::error::operation::BuildError::missing_field(
271                    "dataset_description",
272                    "dataset_description was not specified but it is required when building DescribeDatasetOutput",
273                )
274            })?,
275            dataset_source: self.dataset_source,
276            dataset_status: self.dataset_status,
277            dataset_creation_date: self.dataset_creation_date.ok_or_else(|| {
278                ::aws_smithy_types::error::operation::BuildError::missing_field(
279                    "dataset_creation_date",
280                    "dataset_creation_date was not specified but it is required when building DescribeDatasetOutput",
281                )
282            })?,
283            dataset_last_update_date: self.dataset_last_update_date.ok_or_else(|| {
284                ::aws_smithy_types::error::operation::BuildError::missing_field(
285                    "dataset_last_update_date",
286                    "dataset_last_update_date was not specified but it is required when building DescribeDatasetOutput",
287                )
288            })?,
289            dataset_version: self.dataset_version,
290            _request_id: self._request_id,
291        })
292    }
293}