aws_sdk_iottwinmaker/operation/update_entity/
_update_entity_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 UpdateEntityInput {
6    /// <p>The ID of the workspace that contains the entity.</p>
7    pub workspace_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID of the entity.</p>
9    pub entity_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the entity.</p>
11    pub entity_name: ::std::option::Option<::std::string::String>,
12    /// <p>The description of the entity.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
15    pub component_updates: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentUpdateRequest>>,
16    /// <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
17    pub composite_component_updates:
18        ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::CompositeComponentUpdateRequest>>,
19    /// <p>An object that describes the update request for a parent entity.</p>
20    pub parent_entity_update: ::std::option::Option<crate::types::ParentEntityUpdateRequest>,
21}
22impl UpdateEntityInput {
23    /// <p>The ID of the workspace that contains the entity.</p>
24    pub fn workspace_id(&self) -> ::std::option::Option<&str> {
25        self.workspace_id.as_deref()
26    }
27    /// <p>The ID of the entity.</p>
28    pub fn entity_id(&self) -> ::std::option::Option<&str> {
29        self.entity_id.as_deref()
30    }
31    /// <p>The name of the entity.</p>
32    pub fn entity_name(&self) -> ::std::option::Option<&str> {
33        self.entity_name.as_deref()
34    }
35    /// <p>The description of the entity.</p>
36    pub fn description(&self) -> ::std::option::Option<&str> {
37        self.description.as_deref()
38    }
39    /// <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
40    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    /// <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
46    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    /// <p>An object that describes the update request for a parent entity.</p>
52    pub fn parent_entity_update(&self) -> ::std::option::Option<&crate::types::ParentEntityUpdateRequest> {
53        self.parent_entity_update.as_ref()
54    }
55}
56impl UpdateEntityInput {
57    /// Creates a new builder-style object to manufacture [`UpdateEntityInput`](crate::operation::update_entity::UpdateEntityInput).
58    pub fn builder() -> crate::operation::update_entity::builders::UpdateEntityInputBuilder {
59        crate::operation::update_entity::builders::UpdateEntityInputBuilder::default()
60    }
61}
62
63/// A builder for [`UpdateEntityInput`](crate::operation::update_entity::UpdateEntityInput).
64#[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    /// <p>The ID of the workspace that contains the entity.</p>
78    /// This field is required.
79    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    /// <p>The ID of the workspace that contains the entity.</p>
84    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.workspace_id = input;
86        self
87    }
88    /// <p>The ID of the workspace that contains the entity.</p>
89    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
90        &self.workspace_id
91    }
92    /// <p>The ID of the entity.</p>
93    /// This field is required.
94    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    /// <p>The ID of the entity.</p>
99    pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.entity_id = input;
101        self
102    }
103    /// <p>The ID of the entity.</p>
104    pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
105        &self.entity_id
106    }
107    /// <p>The name of the entity.</p>
108    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    /// <p>The name of the entity.</p>
113    pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.entity_name = input;
115        self
116    }
117    /// <p>The name of the entity.</p>
118    pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
119        &self.entity_name
120    }
121    /// <p>The description of the entity.</p>
122    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    /// <p>The description of the entity.</p>
127    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.description = input;
129        self
130    }
131    /// <p>The description of the entity.</p>
132    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
133        &self.description
134    }
135    /// Adds a key-value pair to `component_updates`.
136    ///
137    /// To override the contents of this collection use [`set_component_updates`](Self::set_component_updates).
138    ///
139    /// <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
140    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    /// <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
147    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    /// <p>An object that maps strings to the component updates in the request. Each string in the mapping must be unique to this object.</p>
155    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    /// Adds a key-value pair to `composite_component_updates`.
161    ///
162    /// To override the contents of this collection use [`set_composite_component_updates`](Self::set_composite_component_updates).
163    ///
164    /// <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
165    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    /// <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
176    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    /// <p>This is an object that maps strings to <code>compositeComponent</code> updates in the request. Each key of the map represents the <code>componentPath</code> of the <code>compositeComponent</code>.</p>
184    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    /// <p>An object that describes the update request for a parent entity.</p>
190    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    /// <p>An object that describes the update request for a parent entity.</p>
195    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    /// <p>An object that describes the update request for a parent entity.</p>
200    pub fn get_parent_entity_update(&self) -> &::std::option::Option<crate::types::ParentEntityUpdateRequest> {
201        &self.parent_entity_update
202    }
203    /// Consumes the builder and constructs a [`UpdateEntityInput`](crate::operation::update_entity::UpdateEntityInput).
204    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}