aws_sdk_iottwinmaker/operation/create_component_type/
_create_component_type_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateComponentTypeInput {
6 pub workspace_id: ::std::option::Option<::std::string::String>,
8 pub is_singleton: ::std::option::Option<bool>,
10 pub component_type_id: ::std::option::Option<::std::string::String>,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub property_definitions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyDefinitionRequest>>,
16 pub extends_from: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
18 pub functions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FunctionRequest>>,
20 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22 pub property_groups: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyGroupRequest>>,
24 pub component_type_name: ::std::option::Option<::std::string::String>,
26 pub composite_component_types:
28 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentTypeRequest>>,
29}
30impl CreateComponentTypeInput {
31 pub fn workspace_id(&self) -> ::std::option::Option<&str> {
33 self.workspace_id.as_deref()
34 }
35 pub fn is_singleton(&self) -> ::std::option::Option<bool> {
37 self.is_singleton
38 }
39 pub fn component_type_id(&self) -> ::std::option::Option<&str> {
41 self.component_type_id.as_deref()
42 }
43 pub fn description(&self) -> ::std::option::Option<&str> {
45 self.description.as_deref()
46 }
47 pub fn property_definitions(
49 &self,
50 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PropertyDefinitionRequest>> {
51 self.property_definitions.as_ref()
52 }
53 pub fn extends_from(&self) -> &[::std::string::String] {
57 self.extends_from.as_deref().unwrap_or_default()
58 }
59 pub fn functions(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::FunctionRequest>> {
61 self.functions.as_ref()
62 }
63 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
65 self.tags.as_ref()
66 }
67 pub fn property_groups(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::PropertyGroupRequest>> {
69 self.property_groups.as_ref()
70 }
71 pub fn component_type_name(&self) -> ::std::option::Option<&str> {
73 self.component_type_name.as_deref()
74 }
75 pub fn composite_component_types(
77 &self,
78 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentTypeRequest>> {
79 self.composite_component_types.as_ref()
80 }
81}
82impl CreateComponentTypeInput {
83 pub fn builder() -> crate::operation::create_component_type::builders::CreateComponentTypeInputBuilder {
85 crate::operation::create_component_type::builders::CreateComponentTypeInputBuilder::default()
86 }
87}
88
89#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
91#[non_exhaustive]
92pub struct CreateComponentTypeInputBuilder {
93 pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
94 pub(crate) is_singleton: ::std::option::Option<bool>,
95 pub(crate) component_type_id: ::std::option::Option<::std::string::String>,
96 pub(crate) description: ::std::option::Option<::std::string::String>,
97 pub(crate) property_definitions:
98 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyDefinitionRequest>>,
99 pub(crate) extends_from: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
100 pub(crate) functions: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FunctionRequest>>,
101 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
102 pub(crate) property_groups: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyGroupRequest>>,
103 pub(crate) component_type_name: ::std::option::Option<::std::string::String>,
104 pub(crate) composite_component_types:
105 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentTypeRequest>>,
106}
107impl CreateComponentTypeInputBuilder {
108 pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111 self.workspace_id = ::std::option::Option::Some(input.into());
112 self
113 }
114 pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.workspace_id = input;
117 self
118 }
119 pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
121 &self.workspace_id
122 }
123 pub fn is_singleton(mut self, input: bool) -> Self {
125 self.is_singleton = ::std::option::Option::Some(input);
126 self
127 }
128 pub fn set_is_singleton(mut self, input: ::std::option::Option<bool>) -> Self {
130 self.is_singleton = input;
131 self
132 }
133 pub fn get_is_singleton(&self) -> &::std::option::Option<bool> {
135 &self.is_singleton
136 }
137 pub fn component_type_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140 self.component_type_id = ::std::option::Option::Some(input.into());
141 self
142 }
143 pub fn set_component_type_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145 self.component_type_id = input;
146 self
147 }
148 pub fn get_component_type_id(&self) -> &::std::option::Option<::std::string::String> {
150 &self.component_type_id
151 }
152 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.description = ::std::option::Option::Some(input.into());
155 self
156 }
157 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.description = input;
160 self
161 }
162 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
164 &self.description
165 }
166 pub fn property_definitions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PropertyDefinitionRequest) -> Self {
172 let mut hash_map = self.property_definitions.unwrap_or_default();
173 hash_map.insert(k.into(), v);
174 self.property_definitions = ::std::option::Option::Some(hash_map);
175 self
176 }
177 pub fn set_property_definitions(
179 mut self,
180 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyDefinitionRequest>>,
181 ) -> Self {
182 self.property_definitions = input;
183 self
184 }
185 pub fn get_property_definitions(
187 &self,
188 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyDefinitionRequest>> {
189 &self.property_definitions
190 }
191 pub fn extends_from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197 let mut v = self.extends_from.unwrap_or_default();
198 v.push(input.into());
199 self.extends_from = ::std::option::Option::Some(v);
200 self
201 }
202 pub fn set_extends_from(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
204 self.extends_from = input;
205 self
206 }
207 pub fn get_extends_from(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
209 &self.extends_from
210 }
211 pub fn functions(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::FunctionRequest) -> Self {
217 let mut hash_map = self.functions.unwrap_or_default();
218 hash_map.insert(k.into(), v);
219 self.functions = ::std::option::Option::Some(hash_map);
220 self
221 }
222 pub fn set_functions(
224 mut self,
225 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FunctionRequest>>,
226 ) -> Self {
227 self.functions = input;
228 self
229 }
230 pub fn get_functions(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::FunctionRequest>> {
232 &self.functions
233 }
234 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
240 let mut hash_map = self.tags.unwrap_or_default();
241 hash_map.insert(k.into(), v.into());
242 self.tags = ::std::option::Option::Some(hash_map);
243 self
244 }
245 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
247 self.tags = input;
248 self
249 }
250 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
252 &self.tags
253 }
254 pub fn property_groups(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::PropertyGroupRequest) -> Self {
260 let mut hash_map = self.property_groups.unwrap_or_default();
261 hash_map.insert(k.into(), v);
262 self.property_groups = ::std::option::Option::Some(hash_map);
263 self
264 }
265 pub fn set_property_groups(
267 mut self,
268 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyGroupRequest>>,
269 ) -> Self {
270 self.property_groups = input;
271 self
272 }
273 pub fn get_property_groups(
275 &self,
276 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::PropertyGroupRequest>> {
277 &self.property_groups
278 }
279 pub fn component_type_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281 self.component_type_name = ::std::option::Option::Some(input.into());
282 self
283 }
284 pub fn set_component_type_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286 self.component_type_name = input;
287 self
288 }
289 pub fn get_component_type_name(&self) -> &::std::option::Option<::std::string::String> {
291 &self.component_type_name
292 }
293 pub fn composite_component_types(
299 mut self,
300 k: impl ::std::convert::Into<::std::string::String>,
301 v: crate::types::CompositeComponentTypeRequest,
302 ) -> Self {
303 let mut hash_map = self.composite_component_types.unwrap_or_default();
304 hash_map.insert(k.into(), v);
305 self.composite_component_types = ::std::option::Option::Some(hash_map);
306 self
307 }
308 pub fn set_composite_component_types(
310 mut self,
311 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentTypeRequest>>,
312 ) -> Self {
313 self.composite_component_types = input;
314 self
315 }
316 pub fn get_composite_component_types(
318 &self,
319 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentTypeRequest>> {
320 &self.composite_component_types
321 }
322 pub fn build(
324 self,
325 ) -> ::std::result::Result<crate::operation::create_component_type::CreateComponentTypeInput, ::aws_smithy_types::error::operation::BuildError>
326 {
327 ::std::result::Result::Ok(crate::operation::create_component_type::CreateComponentTypeInput {
328 workspace_id: self.workspace_id,
329 is_singleton: self.is_singleton,
330 component_type_id: self.component_type_id,
331 description: self.description,
332 property_definitions: self.property_definitions,
333 extends_from: self.extends_from,
334 functions: self.functions,
335 tags: self.tags,
336 property_groups: self.property_groups,
337 component_type_name: self.component_type_name,
338 composite_component_types: self.composite_component_types,
339 })
340 }
341}