aws_sdk_iottwinmaker/operation/get_entity/
_get_entity_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetEntityOutput {
6 pub entity_id: ::std::string::String,
8 pub entity_name: ::std::string::String,
10 pub arn: ::std::string::String,
12 pub status: ::std::option::Option<crate::types::Status>,
14 pub workspace_id: ::std::string::String,
16 pub description: ::std::option::Option<::std::string::String>,
18 pub components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>>,
20 pub parent_entity_id: ::std::string::String,
22 pub has_child_entities: bool,
24 pub creation_date_time: ::aws_smithy_types::DateTime,
26 pub update_date_time: ::aws_smithy_types::DateTime,
28 pub sync_source: ::std::option::Option<::std::string::String>,
30 pub are_all_components_returned: ::std::option::Option<bool>,
32 _request_id: Option<String>,
33}
34impl GetEntityOutput {
35 pub fn entity_id(&self) -> &str {
37 use std::ops::Deref;
38 self.entity_id.deref()
39 }
40 pub fn entity_name(&self) -> &str {
42 use std::ops::Deref;
43 self.entity_name.deref()
44 }
45 pub fn arn(&self) -> &str {
47 use std::ops::Deref;
48 self.arn.deref()
49 }
50 pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
52 self.status.as_ref()
53 }
54 pub fn workspace_id(&self) -> &str {
56 use std::ops::Deref;
57 self.workspace_id.deref()
58 }
59 pub fn description(&self) -> ::std::option::Option<&str> {
61 self.description.as_deref()
62 }
63 pub fn components(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>> {
65 self.components.as_ref()
66 }
67 pub fn parent_entity_id(&self) -> &str {
69 use std::ops::Deref;
70 self.parent_entity_id.deref()
71 }
72 pub fn has_child_entities(&self) -> bool {
74 self.has_child_entities
75 }
76 pub fn creation_date_time(&self) -> &::aws_smithy_types::DateTime {
78 &self.creation_date_time
79 }
80 pub fn update_date_time(&self) -> &::aws_smithy_types::DateTime {
82 &self.update_date_time
83 }
84 pub fn sync_source(&self) -> ::std::option::Option<&str> {
86 self.sync_source.as_deref()
87 }
88 pub fn are_all_components_returned(&self) -> ::std::option::Option<bool> {
90 self.are_all_components_returned
91 }
92}
93impl ::aws_types::request_id::RequestId for GetEntityOutput {
94 fn request_id(&self) -> Option<&str> {
95 self._request_id.as_deref()
96 }
97}
98impl GetEntityOutput {
99 pub fn builder() -> crate::operation::get_entity::builders::GetEntityOutputBuilder {
101 crate::operation::get_entity::builders::GetEntityOutputBuilder::default()
102 }
103}
104
105#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
107#[non_exhaustive]
108pub struct GetEntityOutputBuilder {
109 pub(crate) entity_id: ::std::option::Option<::std::string::String>,
110 pub(crate) entity_name: ::std::option::Option<::std::string::String>,
111 pub(crate) arn: ::std::option::Option<::std::string::String>,
112 pub(crate) status: ::std::option::Option<crate::types::Status>,
113 pub(crate) workspace_id: ::std::option::Option<::std::string::String>,
114 pub(crate) description: ::std::option::Option<::std::string::String>,
115 pub(crate) components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>>,
116 pub(crate) parent_entity_id: ::std::option::Option<::std::string::String>,
117 pub(crate) has_child_entities: ::std::option::Option<bool>,
118 pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
119 pub(crate) update_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
120 pub(crate) sync_source: ::std::option::Option<::std::string::String>,
121 pub(crate) are_all_components_returned: ::std::option::Option<bool>,
122 _request_id: Option<String>,
123}
124impl GetEntityOutputBuilder {
125 pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.entity_id = ::std::option::Option::Some(input.into());
129 self
130 }
131 pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133 self.entity_id = input;
134 self
135 }
136 pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
138 &self.entity_id
139 }
140 pub fn entity_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143 self.entity_name = ::std::option::Option::Some(input.into());
144 self
145 }
146 pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148 self.entity_name = input;
149 self
150 }
151 pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
153 &self.entity_name
154 }
155 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 self.arn = ::std::option::Option::Some(input.into());
159 self
160 }
161 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163 self.arn = input;
164 self
165 }
166 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
168 &self.arn
169 }
170 pub fn status(mut self, input: crate::types::Status) -> Self {
173 self.status = ::std::option::Option::Some(input);
174 self
175 }
176 pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
178 self.status = input;
179 self
180 }
181 pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
183 &self.status
184 }
185 pub fn workspace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.workspace_id = ::std::option::Option::Some(input.into());
189 self
190 }
191 pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.workspace_id = input;
194 self
195 }
196 pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
198 &self.workspace_id
199 }
200 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.description = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.description = input;
208 self
209 }
210 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
212 &self.description
213 }
214 pub fn components(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ComponentResponse) -> Self {
220 let mut hash_map = self.components.unwrap_or_default();
221 hash_map.insert(k.into(), v);
222 self.components = ::std::option::Option::Some(hash_map);
223 self
224 }
225 pub fn set_components(
227 mut self,
228 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>>,
229 ) -> Self {
230 self.components = input;
231 self
232 }
233 pub fn get_components(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>> {
235 &self.components
236 }
237 pub fn parent_entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
240 self.parent_entity_id = ::std::option::Option::Some(input.into());
241 self
242 }
243 pub fn set_parent_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
245 self.parent_entity_id = input;
246 self
247 }
248 pub fn get_parent_entity_id(&self) -> &::std::option::Option<::std::string::String> {
250 &self.parent_entity_id
251 }
252 pub fn has_child_entities(mut self, input: bool) -> Self {
255 self.has_child_entities = ::std::option::Option::Some(input);
256 self
257 }
258 pub fn set_has_child_entities(mut self, input: ::std::option::Option<bool>) -> Self {
260 self.has_child_entities = input;
261 self
262 }
263 pub fn get_has_child_entities(&self) -> &::std::option::Option<bool> {
265 &self.has_child_entities
266 }
267 pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
270 self.creation_date_time = ::std::option::Option::Some(input);
271 self
272 }
273 pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
275 self.creation_date_time = input;
276 self
277 }
278 pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
280 &self.creation_date_time
281 }
282 pub fn update_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
285 self.update_date_time = ::std::option::Option::Some(input);
286 self
287 }
288 pub fn set_update_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
290 self.update_date_time = input;
291 self
292 }
293 pub fn get_update_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
295 &self.update_date_time
296 }
297 pub fn sync_source(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299 self.sync_source = ::std::option::Option::Some(input.into());
300 self
301 }
302 pub fn set_sync_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304 self.sync_source = input;
305 self
306 }
307 pub fn get_sync_source(&self) -> &::std::option::Option<::std::string::String> {
309 &self.sync_source
310 }
311 pub fn are_all_components_returned(mut self, input: bool) -> Self {
313 self.are_all_components_returned = ::std::option::Option::Some(input);
314 self
315 }
316 pub fn set_are_all_components_returned(mut self, input: ::std::option::Option<bool>) -> Self {
318 self.are_all_components_returned = input;
319 self
320 }
321 pub fn get_are_all_components_returned(&self) -> &::std::option::Option<bool> {
323 &self.are_all_components_returned
324 }
325 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
326 self._request_id = Some(request_id.into());
327 self
328 }
329
330 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
331 self._request_id = request_id;
332 self
333 }
334 pub fn build(self) -> ::std::result::Result<crate::operation::get_entity::GetEntityOutput, ::aws_smithy_types::error::operation::BuildError> {
345 ::std::result::Result::Ok(crate::operation::get_entity::GetEntityOutput {
346 entity_id: self.entity_id.ok_or_else(|| {
347 ::aws_smithy_types::error::operation::BuildError::missing_field(
348 "entity_id",
349 "entity_id was not specified but it is required when building GetEntityOutput",
350 )
351 })?,
352 entity_name: self.entity_name.ok_or_else(|| {
353 ::aws_smithy_types::error::operation::BuildError::missing_field(
354 "entity_name",
355 "entity_name was not specified but it is required when building GetEntityOutput",
356 )
357 })?,
358 arn: self.arn.ok_or_else(|| {
359 ::aws_smithy_types::error::operation::BuildError::missing_field(
360 "arn",
361 "arn was not specified but it is required when building GetEntityOutput",
362 )
363 })?,
364 status: self.status,
365 workspace_id: self.workspace_id.ok_or_else(|| {
366 ::aws_smithy_types::error::operation::BuildError::missing_field(
367 "workspace_id",
368 "workspace_id was not specified but it is required when building GetEntityOutput",
369 )
370 })?,
371 description: self.description,
372 components: self.components,
373 parent_entity_id: self.parent_entity_id.ok_or_else(|| {
374 ::aws_smithy_types::error::operation::BuildError::missing_field(
375 "parent_entity_id",
376 "parent_entity_id was not specified but it is required when building GetEntityOutput",
377 )
378 })?,
379 has_child_entities: self.has_child_entities.ok_or_else(|| {
380 ::aws_smithy_types::error::operation::BuildError::missing_field(
381 "has_child_entities",
382 "has_child_entities was not specified but it is required when building GetEntityOutput",
383 )
384 })?,
385 creation_date_time: self.creation_date_time.ok_or_else(|| {
386 ::aws_smithy_types::error::operation::BuildError::missing_field(
387 "creation_date_time",
388 "creation_date_time was not specified but it is required when building GetEntityOutput",
389 )
390 })?,
391 update_date_time: self.update_date_time.ok_or_else(|| {
392 ::aws_smithy_types::error::operation::BuildError::missing_field(
393 "update_date_time",
394 "update_date_time was not specified but it is required when building GetEntityOutput",
395 )
396 })?,
397 sync_source: self.sync_source,
398 are_all_components_returned: self.are_all_components_returned,
399 _request_id: self._request_id,
400 })
401 }
402}