aws_sdk_iottwinmaker/operation/update_entity/
_update_entity_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateEntityInput {
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 component_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>>,
16 pub composite_component_updates:
18 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>>,
19 pub parent_entity_update: ::std::option::Option<crate::types::ParentEntityUpdateRequest>,
21}
22impl UpdateEntityInput {
23 pub fn workspace_id(&self) -> ::std::option::Option<&str> {
25 self.workspace_id.as_deref()
26 }
27 pub fn entity_id(&self) -> ::std::option::Option<&str> {
29 self.entity_id.as_deref()
30 }
31 pub fn entity_name(&self) -> ::std::option::Option<&str> {
33 self.entity_name.as_deref()
34 }
35 pub fn description(&self) -> ::std::option::Option<&str> {
37 self.description.as_deref()
38 }
39 pub fn component_updates(
41 &self,
42 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>> {
43 self.component_updates.as_ref()
44 }
45 pub fn composite_component_updates(
47 &self,
48 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>> {
49 self.composite_component_updates.as_ref()
50 }
51 pub fn parent_entity_update(&self) -> ::std::option::Option<&crate::types::ParentEntityUpdateRequest> {
53 self.parent_entity_update.as_ref()
54 }
55}
56impl UpdateEntityInput {
57 pub fn builder() -> crate::operation::update_entity::builders::UpdateEntityInputBuilder {
59 crate::operation::update_entity::builders::UpdateEntityInputBuilder::default()
60 }
61}
62
63#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
65#[non_exhaustive]
66pub struct UpdateEntityInputBuilder {
67 pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
68 pub(crate) entity_id: ::std::option::Option<::std::string::String>,
69 pub(crate) entity_name: ::std::option::Option<::std::string::String>,
70 pub(crate) description: ::std::option::Option<::std::string::String>,
71 pub(crate) component_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>>,
72 pub(crate) composite_component_updates:
73 ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>>,
74 pub(crate) parent_entity_update: ::std::option::Option<crate::types::ParentEntityUpdateRequest>,
75}
76impl UpdateEntityInputBuilder {
77 pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 self.workspace_id = ::std::option::Option::Some(input.into());
81 self
82 }
83 pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.workspace_id = input;
86 self
87 }
88 pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
90 &self.workspace_id
91 }
92 pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95 self.entity_id = ::std::option::Option::Some(input.into());
96 self
97 }
98 pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100 self.entity_id = input;
101 self
102 }
103 pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
105 &self.entity_id
106 }
107 pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.entity_name = ::std::option::Option::Some(input.into());
110 self
111 }
112 pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.entity_name = input;
115 self
116 }
117 pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
119 &self.entity_name
120 }
121 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123 self.description = ::std::option::Option::Some(input.into());
124 self
125 }
126 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128 self.description = input;
129 self
130 }
131 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
133 &self.description
134 }
135 pub fn component_updates(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ComponentUpdateRequest) -> Self {
141 let mut hash_map = self.component_updates.unwrap_or_default();
142 hash_map.insert(k.into(), v);
143 self.component_updates = ::std::option::Option::Some(hash_map);
144 self
145 }
146 pub fn set_component_updates(
148 mut self,
149 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>>,
150 ) -> Self {
151 self.component_updates = input;
152 self
153 }
154 pub fn get_component_updates(
156 &self,
157 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>> {
158 &self.component_updates
159 }
160 pub fn composite_component_updates(
166 mut self,
167 k: impl ::std::convert::Into<::std::string::String>,
168 v: crate::types::CompositeComponentUpdateRequest,
169 ) -> Self {
170 let mut hash_map = self.composite_component_updates.unwrap_or_default();
171 hash_map.insert(k.into(), v);
172 self.composite_component_updates = ::std::option::Option::Some(hash_map);
173 self
174 }
175 pub fn set_composite_component_updates(
177 mut self,
178 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>>,
179 ) -> Self {
180 self.composite_component_updates = input;
181 self
182 }
183 pub fn get_composite_component_updates(
185 &self,
186 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>> {
187 &self.composite_component_updates
188 }
189 pub fn parent_entity_update(mut self, input: crate::types::ParentEntityUpdateRequest) -> Self {
191 self.parent_entity_update = ::std::option::Option::Some(input);
192 self
193 }
194 pub fn set_parent_entity_update(mut self, input: ::std::option::Option<crate::types::ParentEntityUpdateRequest>) -> Self {
196 self.parent_entity_update = input;
197 self
198 }
199 pub fn get_parent_entity_update(&self) -> &::std::option::Option<crate::types::ParentEntityUpdateRequest> {
201 &self.parent_entity_update
202 }
203 pub fn build(
205 self,
206 ) -> ::std::result::Result<crate::operation::update_entity::UpdateEntityInput, ::aws_smithy_types::error::operation::BuildError> {
207 ::std::result::Result::Ok(crate::operation::update_entity::UpdateEntityInput {
208 workspace_id: self.workspace_id,
209 entity_id: self.entity_id,
210 entity_name: self.entity_name,
211 description: self.description,
212 component_updates: self.component_updates,
213 composite_component_updates: self.composite_component_updates,
214 parent_entity_update: self.parent_entity_update,
215 })
216 }
217}