aws_sdk_iotsitewise/operation/create_dataset/
_create_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 CreateDatasetOutput {
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 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>
11    pub dataset_status: ::std::option::Option<crate::types::DatasetStatus>,
12    _request_id: Option<String>,
13}
14impl CreateDatasetOutput {
15    /// <p>The ID of the dataset.</p>
16    pub fn dataset_id(&self) -> &str {
17        use std::ops::Deref;
18        self.dataset_id.deref()
19    }
20    /// <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>
21    pub fn dataset_arn(&self) -> &str {
22        use std::ops::Deref;
23        self.dataset_arn.deref()
24    }
25    /// <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>
26    pub fn dataset_status(&self) -> ::std::option::Option<&crate::types::DatasetStatus> {
27        self.dataset_status.as_ref()
28    }
29}
30impl ::aws_types::request_id::RequestId for CreateDatasetOutput {
31    fn request_id(&self) -> Option<&str> {
32        self._request_id.as_deref()
33    }
34}
35impl CreateDatasetOutput {
36    /// Creates a new builder-style object to manufacture [`CreateDatasetOutput`](crate::operation::create_dataset::CreateDatasetOutput).
37    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetOutputBuilder {
38        crate::operation::create_dataset::builders::CreateDatasetOutputBuilder::default()
39    }
40}
41
42/// A builder for [`CreateDatasetOutput`](crate::operation::create_dataset::CreateDatasetOutput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateDatasetOutputBuilder {
46    pub(crate) dataset_id: ::std::option::Option<::std::string::String>,
47    pub(crate) dataset_arn: ::std::option::Option<::std::string::String>,
48    pub(crate) dataset_status: ::std::option::Option<crate::types::DatasetStatus>,
49    _request_id: Option<String>,
50}
51impl CreateDatasetOutputBuilder {
52    /// <p>The ID of the dataset.</p>
53    /// This field is required.
54    pub fn dataset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
55        self.dataset_id = ::std::option::Option::Some(input.into());
56        self
57    }
58    /// <p>The ID of the dataset.</p>
59    pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
60        self.dataset_id = input;
61        self
62    }
63    /// <p>The ID of the dataset.</p>
64    pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
65        &self.dataset_id
66    }
67    /// <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>
68    /// This field is required.
69    pub fn dataset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
70        self.dataset_arn = ::std::option::Option::Some(input.into());
71        self
72    }
73    /// <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>
74    pub fn set_dataset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
75        self.dataset_arn = input;
76        self
77    }
78    /// <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>
79    pub fn get_dataset_arn(&self) -> &::std::option::Option<::std::string::String> {
80        &self.dataset_arn
81    }
82    /// <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>
83    /// This field is required.
84    pub fn dataset_status(mut self, input: crate::types::DatasetStatus) -> Self {
85        self.dataset_status = ::std::option::Option::Some(input);
86        self
87    }
88    /// <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>
89    pub fn set_dataset_status(mut self, input: ::std::option::Option<crate::types::DatasetStatus>) -> Self {
90        self.dataset_status = input;
91        self
92    }
93    /// <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>
94    pub fn get_dataset_status(&self) -> &::std::option::Option<crate::types::DatasetStatus> {
95        &self.dataset_status
96    }
97    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
98        self._request_id = Some(request_id.into());
99        self
100    }
101
102    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
103        self._request_id = request_id;
104        self
105    }
106    /// Consumes the builder and constructs a [`CreateDatasetOutput`](crate::operation::create_dataset::CreateDatasetOutput).
107    /// This method will fail if any of the following fields are not set:
108    /// - [`dataset_id`](crate::operation::create_dataset::builders::CreateDatasetOutputBuilder::dataset_id)
109    /// - [`dataset_arn`](crate::operation::create_dataset::builders::CreateDatasetOutputBuilder::dataset_arn)
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetOutput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetOutput {
114            dataset_id: self.dataset_id.ok_or_else(|| {
115                ::aws_smithy_types::error::operation::BuildError::missing_field(
116                    "dataset_id",
117                    "dataset_id was not specified but it is required when building CreateDatasetOutput",
118                )
119            })?,
120            dataset_arn: self.dataset_arn.ok_or_else(|| {
121                ::aws_smithy_types::error::operation::BuildError::missing_field(
122                    "dataset_arn",
123                    "dataset_arn was not specified but it is required when building CreateDatasetOutput",
124                )
125            })?,
126            dataset_status: self.dataset_status,
127            _request_id: self._request_id,
128        })
129    }
130}