aws_sdk_iotsitewise/operation/create_dataset/
_create_dataset_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateDatasetInput {
6 pub dataset_id: ::std::option::Option<::std::string::String>,
8 pub dataset_name: ::std::option::Option<::std::string::String>,
10 pub dataset_description: ::std::option::Option<::std::string::String>,
12 pub dataset_source: ::std::option::Option<crate::types::DatasetSource>,
14 pub client_token: ::std::option::Option<::std::string::String>,
16 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
18}
19impl CreateDatasetInput {
20 pub fn dataset_id(&self) -> ::std::option::Option<&str> {
22 self.dataset_id.as_deref()
23 }
24 pub fn dataset_name(&self) -> ::std::option::Option<&str> {
26 self.dataset_name.as_deref()
27 }
28 pub fn dataset_description(&self) -> ::std::option::Option<&str> {
30 self.dataset_description.as_deref()
31 }
32 pub fn dataset_source(&self) -> ::std::option::Option<&crate::types::DatasetSource> {
34 self.dataset_source.as_ref()
35 }
36 pub fn client_token(&self) -> ::std::option::Option<&str> {
38 self.client_token.as_deref()
39 }
40 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 pub fn builder() -> crate::operation::create_dataset::builders::CreateDatasetInputBuilder {
48 crate::operation::create_dataset::builders::CreateDatasetInputBuilder::default()
49 }
50}
51
52#[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 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 pub fn set_dataset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.dataset_id = input;
72 self
73 }
74 pub fn get_dataset_id(&self) -> &::std::option::Option<::std::string::String> {
76 &self.dataset_id
77 }
78 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 pub fn set_dataset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.dataset_name = input;
87 self
88 }
89 pub fn get_dataset_name(&self) -> &::std::option::Option<::std::string::String> {
91 &self.dataset_name
92 }
93 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 pub fn set_dataset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.dataset_description = input;
101 self
102 }
103 pub fn get_dataset_description(&self) -> &::std::option::Option<::std::string::String> {
105 &self.dataset_description
106 }
107 pub fn dataset_source(mut self, input: crate::types::DatasetSource) -> Self {
110 self.dataset_source = ::std::option::Option::Some(input);
111 self
112 }
113 pub fn set_dataset_source(mut self, input: ::std::option::Option<crate::types::DatasetSource>) -> Self {
115 self.dataset_source = input;
116 self
117 }
118 pub fn get_dataset_source(&self) -> &::std::option::Option<crate::types::DatasetSource> {
120 &self.dataset_source
121 }
122 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 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
129 self.client_token = input;
130 self
131 }
132 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
134 &self.client_token
135 }
136 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
154 &self.tags
155 }
156 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}