aws_sdk_iotsitewise/operation/create_dataset/
_create_dataset_input.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 CreateDatasetInput {
6    /// <p>The ID of the dataset.</p>
7    pub dataset_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the dataset.</p>
9    pub dataset_name: ::std::option::Option<::std::string::String>,
10    /// <p>A description about the dataset, and its functionality.</p>
11    pub dataset_description: ::std::option::Option<::std::string::String>,
12    /// <p>The data source for the dataset.</p>
13    pub dataset_source: ::std::option::Option<crate::types::DatasetSource>,
14    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
15    pub client_token: ::std::option::Option<::std::string::String>,
16    /// <p>A list of key-value pairs that contain metadata for the access policy. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
17    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateDatasetInput {
20    /// <p>The ID of the dataset.</p>
21    pub fn dataset_id(&self) -> ::std::option::Option<&str> {
22        self.dataset_id.as_deref()
23    }
24    /// <p>The name of the dataset.</p>
25    pub fn dataset_name(&self) -> ::std::option::Option<&str> {
26        self.dataset_name.as_deref()
27    }
28    /// <p>A description about the dataset, and its functionality.</p>
29    pub fn dataset_description(&self) -> ::std::option::Option<&str> {
30        self.dataset_description.as_deref()
31    }
32    /// <p>The data source for the dataset.</p>
33    pub fn dataset_source(&self) -> ::std::option::Option<&crate::types::DatasetSource> {
34        self.dataset_source.as_ref()
35    }
36    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
37    pub fn client_token(&self) -> ::std::option::Option<&str> {
38        self.client_token.as_deref()
39    }
40    /// <p>A list of key-value pairs that contain metadata for the access policy. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
41    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
42        self.tags.as_ref()
43    }
44}
45impl CreateDatasetInput {
46    /// Creates a new builder-style object to manufacture [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
47    pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
48        crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateDatasetInputBuilder {
56    pub(crate) dataset_id: ::std::option::Option<::std::string::String>,
57    pub(crate) dataset_name: ::std::option::Option<::std::string::String>,
58    pub(crate) dataset_description: ::std::option::Option<::std::string::String>,
59    pub(crate) dataset_source: ::std::option::Option<crate::types::DatasetSource>,
60    pub(crate) client_token: ::std::option::Option<::std::string::String>,
61    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62}
63impl CreateDatasetInputBuilder {
64    /// <p>The ID of the dataset.</p>
65    pub fn dataset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.dataset_id = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The ID of the dataset.</p>
70    pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71        self.dataset_id = input;
72        self
73    }
74    /// <p>The ID of the dataset.</p>
75    pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
76        &self.dataset_id
77    }
78    /// <p>The name of the dataset.</p>
79    /// This field is required.
80    pub fn dataset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.dataset_name = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The name of the dataset.</p>
85    pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.dataset_name = input;
87        self
88    }
89    /// <p>The name of the dataset.</p>
90    pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
91        &self.dataset_name
92    }
93    /// <p>A description about the dataset, and its functionality.</p>
94    pub fn dataset_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.dataset_description = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <p>A description about the dataset, and its functionality.</p>
99    pub fn set_dataset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.dataset_description = input;
101        self
102    }
103    /// <p>A description about the dataset, and its functionality.</p>
104    pub fn get_dataset_description(&self) -> &::std::option::Option<::std::string::String> {
105        &self.dataset_description
106    }
107    /// <p>The data source for the dataset.</p>
108    /// This field is required.
109    pub fn dataset_source(mut self, input: crate::types::DatasetSource) -> Self {
110        self.dataset_source = ::std::option::Option::Some(input);
111        self
112    }
113    /// <p>The data source for the dataset.</p>
114    pub fn set_dataset_source(mut self, input: ::std::option::Option<crate::types::DatasetSource>) -> Self {
115        self.dataset_source = input;
116        self
117    }
118    /// <p>The data source for the dataset.</p>
119    pub fn get_dataset_source(&self) -> &::std::option::Option<crate::types::DatasetSource> {
120        &self.dataset_source
121    }
122    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
123    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.client_token = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
128    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129        self.client_token = input;
130        self
131    }
132    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
133    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
134        &self.client_token
135    }
136    /// Adds a key-value pair to `tags`.
137    ///
138    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
139    ///
140    /// <p>A list of key-value pairs that contain metadata for the access policy. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
141    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
142        let mut hash_map = self.tags.unwrap_or_default();
143        hash_map.insert(k.into(), v.into());
144        self.tags = ::std::option::Option::Some(hash_map);
145        self
146    }
147    /// <p>A list of key-value pairs that contain metadata for the access policy. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
148    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
149        self.tags = input;
150        self
151    }
152    /// <p>A list of key-value pairs that contain metadata for the access policy. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
153    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
154        &self.tags
155    }
156    /// Consumes the builder and constructs a [`CreateDatasetInput`](crate::operation::create_dataset::CreateDatasetInput).
157    pub fn build(
158        self,
159    ) -> ::std::result::Result<crate::operation::create_dataset::CreateDatasetInput, ::aws_smithy_types::error::operation::BuildError> {
160        ::std::result::Result::Ok(crate::operation::create_dataset::CreateDatasetInput {
161            dataset_id: self.dataset_id,
162            dataset_name: self.dataset_name,
163            dataset_description: self.dataset_description,
164            dataset_source: self.dataset_source,
165            client_token: self.client_token,
166            tags: self.tags,
167        })
168    }
169}