aws_sdk_iottwinmaker/operation/create_entity/
_create_entity_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateEntityInput {
6 pub workspace_id: ::std::option::Option<::std::string::String>,
8 pub entity_id: ::std::option::Option<::std::string::String>,
10 pub entity_name: ::std::option::Option<::std::string::String>,
12 pub description: ::std::option::Option<::std::string::String>,
14 pub components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
16 pub composite_components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentRequest>>,
18 pub parent_entity_id: ::std::option::Option<::std::string::String>,
20 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22}
23impl CreateEntityInput {
24 pub fn workspace_id(&self) -> ::std::option::Option<&str> {
26 self.workspace_id.as_deref()
27 }
28 pub fn entity_id(&self) -> ::std::option::Option<&str> {
30 self.entity_id.as_deref()
31 }
32 pub fn entity_name(&self) -> ::std::option::Option<&str> {
34 self.entity_name.as_deref()
35 }
36 pub fn description(&self) -> ::std::option::Option<&str> {
38 self.description.as_deref()
39 }
40 pub fn components(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>> {
42 self.components.as_ref()
43 }
44 pub fn composite_components(
46 &self,
47 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentRequest>> {
48 self.composite_components.as_ref()
49 }
50 pub fn parent_entity_id(&self) -> ::std::option::Option<&str> {
52 self.parent_entity_id.as_deref()
53 }
54 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
56 self.tags.as_ref()
57 }
58}
59impl CreateEntityInput {
60 pub fn builder() -> crate::operation::create_entity::builders::CreateEntityInputBuilder {
62 crate::operation::create_entity::builders::CreateEntityInputBuilder::default()
63 }
64}
65
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
68#[non_exhaustive]
69pub struct CreateEntityInputBuilder {
70 pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
71 pub(crate) entity_id: ::std::option::Option<::std::string::String>,
72 pub(crate) entity_name: ::std::option::Option<::std::string::String>,
73 pub(crate) description: ::std::option::Option<::std::string::String>,
74 pub(crate) components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
75 pub(crate) composite_components:
76 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentRequest>>,
77 pub(crate) parent_entity_id: ::std::option::Option<::std::string::String>,
78 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
79}
80impl CreateEntityInputBuilder {
81 pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84 self.workspace_id = ::std::option::Option::Some(input.into());
85 self
86 }
87 pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.workspace_id = input;
90 self
91 }
92 pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
94 &self.workspace_id
95 }
96 pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
98 self.entity_id = ::std::option::Option::Some(input.into());
99 self
100 }
101 pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.entity_id = input;
104 self
105 }
106 pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
108 &self.entity_id
109 }
110 pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.entity_name = ::std::option::Option::Some(input.into());
114 self
115 }
116 pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.entity_name = input;
119 self
120 }
121 pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
123 &self.entity_name
124 }
125 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.description = ::std::option::Option::Some(input.into());
128 self
129 }
130 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.description = input;
133 self
134 }
135 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
137 &self.description
138 }
139 pub fn components(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ComponentRequest) -> Self {
145 let mut hash_map = self.components.unwrap_or_default();
146 hash_map.insert(k.into(), v);
147 self.components = ::std::option::Option::Some(hash_map);
148 self
149 }
150 pub fn set_components(
152 mut self,
153 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>>,
154 ) -> Self {
155 self.components = input;
156 self
157 }
158 pub fn get_components(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentRequest>> {
160 &self.components
161 }
162 pub fn composite_components(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::CompositeComponentRequest) -> Self {
168 let mut hash_map = self.composite_components.unwrap_or_default();
169 hash_map.insert(k.into(), v);
170 self.composite_components = ::std::option::Option::Some(hash_map);
171 self
172 }
173 pub fn set_composite_components(
175 mut self,
176 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentRequest>>,
177 ) -> Self {
178 self.composite_components = input;
179 self
180 }
181 pub fn get_composite_components(
183 &self,
184 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentRequest>> {
185 &self.composite_components
186 }
187 pub fn parent_entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
189 self.parent_entity_id = ::std::option::Option::Some(input.into());
190 self
191 }
192 pub fn set_parent_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
194 self.parent_entity_id = input;
195 self
196 }
197 pub fn get_parent_entity_id(&self) -> &::std::option::Option<::std::string::String> {
199 &self.parent_entity_id
200 }
201 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
207 let mut hash_map = self.tags.unwrap_or_default();
208 hash_map.insert(k.into(), v.into());
209 self.tags = ::std::option::Option::Some(hash_map);
210 self
211 }
212 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
214 self.tags = input;
215 self
216 }
217 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
219 &self.tags
220 }
221 pub fn build(
223 self,
224 ) -> ::std::result::Result<crate::operation::create_entity::CreateEntityInput, ::aws_smithy_types::error::operation::BuildError> {
225 ::std::result::Result::Ok(crate::operation::create_entity::CreateEntityInput {
226 workspace_id: self.workspace_id,
227 entity_id: self.entity_id,
228 entity_name: self.entity_name,
229 description: self.description,
230 components: self.components,
231 composite_components: self.composite_components,
232 parent_entity_id: self.parent_entity_id,
233 tags: self.tags,
234 })
235 }
236}