aws_sdk_iottwinmaker/operation/get_entity/
_get_entity_output.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 GetEntityOutput {
6    /// <p>The ID of the entity.</p>
7    pub entity_id: ::std::string::String,
8    /// <p>The name of the entity.</p>
9    pub entity_name: ::std::string::String,
10    /// <p>The ARN of the entity.</p>
11    pub arn: ::std::string::String,
12    /// <p>The current status of the entity.</p>
13    pub status: ::std::option::Option<crate::types::Status>,
14    /// <p>The ID of the workspace.</p>
15    pub workspace_id: ::std::string::String,
16    /// <p>The description of the entity.</p>
17    pub description: ::std::option::Option<::std::string::String>,
18    /// <p>An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.</p>
19    pub components: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>>,
20    /// <p>The ID of the parent entity for this entity.</p>
21    pub parent_entity_id: ::std::string::String,
22    /// <p>A Boolean value that specifies whether the entity has associated child entities.</p>
23    pub has_child_entities: bool,
24    /// <p>The date and time when the entity was created.</p>
25    pub creation_date_time: ::aws_smithy_types::DateTime,
26    /// <p>The date and time when the entity was last updated.</p>
27    pub update_date_time: ::aws_smithy_types::DateTime,
28    /// <p>The syncSource of the sync job, if this entity was created by a sync job.</p>
29    pub sync_source: ::std::option::Option<::std::string::String>,
30    /// <p>This flag notes whether all components are returned in the API response. The maximum number of components returned is 30.</p>
31    pub are_all_components_returned: ::std::option::Option<bool>,
32    _request_id: Option<String>,
33}
34impl GetEntityOutput {
35    /// <p>The ID of the entity.</p>
36    pub fn entity_id(&self) -> &str {
37        use std::ops::Deref;
38        self.entity_id.deref()
39    }
40    /// <p>The name of the entity.</p>
41    pub fn entity_name(&self) -> &str {
42        use std::ops::Deref;
43        self.entity_name.deref()
44    }
45    /// <p>The ARN of the entity.</p>
46    pub fn arn(&self) -> &str {
47        use std::ops::Deref;
48        self.arn.deref()
49    }
50    /// <p>The current status of the entity.</p>
51    pub fn status(&self) -> ::std::option::Option<&crate::types::Status> {
52        self.status.as_ref()
53    }
54    /// <p>The ID of the workspace.</p>
55    pub fn workspace_id(&self) -> &str {
56        use std::ops::Deref;
57        self.workspace_id.deref()
58    }
59    /// <p>The description of the entity.</p>
60    pub fn description(&self) -> ::std::option::Option<&str> {
61        self.description.as_deref()
62    }
63    /// <p>An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.</p>
64    pub fn components(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>> {
65        self.components.as_ref()
66    }
67    /// <p>The ID of the parent entity for this entity.</p>
68    pub fn parent_entity_id(&self) -> &str {
69        use std::ops::Deref;
70        self.parent_entity_id.deref()
71    }
72    /// <p>A Boolean value that specifies whether the entity has associated child entities.</p>
73    pub fn has_child_entities(&self) -> bool {
74        self.has_child_entities
75    }
76    /// <p>The date and time when the entity was created.</p>
77    pub fn creation_date_time(&self) -> &::aws_smithy_types::DateTime {
78        &self.creation_date_time
79    }
80    /// <p>The date and time when the entity was last updated.</p>
81    pub fn update_date_time(&self) -> &::aws_smithy_types::DateTime {
82        &self.update_date_time
83    }
84    /// <p>The syncSource of the sync job, if this entity was created by a sync job.</p>
85    pub fn sync_source(&self) -> ::std::option::Option<&str> {
86        self.sync_source.as_deref()
87    }
88    /// <p>This flag notes whether all components are returned in the API response. The maximum number of components returned is 30.</p>
89    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    /// Creates a new builder-style object to manufacture [`GetEntityOutput`](crate::operation::get_entity::GetEntityOutput).
100    pub fn builder() -> crate::operation::get_entity::builders::GetEntityOutputBuilder {
101        crate::operation::get_entity::builders::GetEntityOutputBuilder::default()
102    }
103}
104
105/// A builder for [`GetEntityOutput`](crate::operation::get_entity::GetEntityOutput).
106#[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    /// <p>The ID of the entity.</p>
126    /// This field is required.
127    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    /// <p>The ID of the entity.</p>
132    pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.entity_id = input;
134        self
135    }
136    /// <p>The ID of the entity.</p>
137    pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
138        &self.entity_id
139    }
140    /// <p>The name of the entity.</p>
141    /// This field is required.
142    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    /// <p>The name of the entity.</p>
147    pub fn set_entity_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.entity_name = input;
149        self
150    }
151    /// <p>The name of the entity.</p>
152    pub fn get_entity_name(&self) -> &::std::option::Option<::std::string::String> {
153        &self.entity_name
154    }
155    /// <p>The ARN of the entity.</p>
156    /// This field is required.
157    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    /// <p>The ARN of the entity.</p>
162    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.arn = input;
164        self
165    }
166    /// <p>The ARN of the entity.</p>
167    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
168        &self.arn
169    }
170    /// <p>The current status of the entity.</p>
171    /// This field is required.
172    pub fn status(mut self, input: crate::types::Status) -> Self {
173        self.status = ::std::option::Option::Some(input);
174        self
175    }
176    /// <p>The current status of the entity.</p>
177    pub fn set_status(mut self, input: ::std::option::Option<crate::types::Status>) -> Self {
178        self.status = input;
179        self
180    }
181    /// <p>The current status of the entity.</p>
182    pub fn get_status(&self) -> &::std::option::Option<crate::types::Status> {
183        &self.status
184    }
185    /// <p>The ID of the workspace.</p>
186    /// This field is required.
187    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    /// <p>The ID of the workspace.</p>
192    pub fn set_workspace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.workspace_id = input;
194        self
195    }
196    /// <p>The ID of the workspace.</p>
197    pub fn get_workspace_id(&self) -> &::std::option::Option<::std::string::String> {
198        &self.workspace_id
199    }
200    /// <p>The description of the entity.</p>
201    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    /// <p>The description of the entity.</p>
206    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.description = input;
208        self
209    }
210    /// <p>The description of the entity.</p>
211    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
212        &self.description
213    }
214    /// Adds a key-value pair to `components`.
215    ///
216    /// To override the contents of this collection use [`set_components`](Self::set_components).
217    ///
218    /// <p>An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.</p>
219    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    /// <p>An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.</p>
226    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    /// <p>An object that maps strings to the components in the entity. Each string in the mapping must be unique to this object.</p>
234    pub fn get_components(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ComponentResponse>> {
235        &self.components
236    }
237    /// <p>The ID of the parent entity for this entity.</p>
238    /// This field is required.
239    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    /// <p>The ID of the parent entity for this entity.</p>
244    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    /// <p>The ID of the parent entity for this entity.</p>
249    pub fn get_parent_entity_id(&self) -> &::std::option::Option<::std::string::String> {
250        &self.parent_entity_id
251    }
252    /// <p>A Boolean value that specifies whether the entity has associated child entities.</p>
253    /// This field is required.
254    pub fn has_child_entities(mut self, input: bool) -> Self {
255        self.has_child_entities = ::std::option::Option::Some(input);
256        self
257    }
258    /// <p>A Boolean value that specifies whether the entity has associated child entities.</p>
259    pub fn set_has_child_entities(mut self, input: ::std::option::Option<bool>) -> Self {
260        self.has_child_entities = input;
261        self
262    }
263    /// <p>A Boolean value that specifies whether the entity has associated child entities.</p>
264    pub fn get_has_child_entities(&self) -> &::std::option::Option<bool> {
265        &self.has_child_entities
266    }
267    /// <p>The date and time when the entity was created.</p>
268    /// This field is required.
269    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    /// <p>The date and time when the entity was created.</p>
274    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    /// <p>The date and time when the entity was created.</p>
279    pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
280        &self.creation_date_time
281    }
282    /// <p>The date and time when the entity was last updated.</p>
283    /// This field is required.
284    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    /// <p>The date and time when the entity was last updated.</p>
289    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    /// <p>The date and time when the entity was last updated.</p>
294    pub fn get_update_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
295        &self.update_date_time
296    }
297    /// <p>The syncSource of the sync job, if this entity was created by a sync job.</p>
298    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    /// <p>The syncSource of the sync job, if this entity was created by a sync job.</p>
303    pub fn set_sync_source(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304        self.sync_source = input;
305        self
306    }
307    /// <p>The syncSource of the sync job, if this entity was created by a sync job.</p>
308    pub fn get_sync_source(&self) -> &::std::option::Option<::std::string::String> {
309        &self.sync_source
310    }
311    /// <p>This flag notes whether all components are returned in the API response. The maximum number of components returned is 30.</p>
312    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    /// <p>This flag notes whether all components are returned in the API response. The maximum number of components returned is 30.</p>
317    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    /// <p>This flag notes whether all components are returned in the API response. The maximum number of components returned is 30.</p>
322    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    /// Consumes the builder and constructs a [`GetEntityOutput`](crate::operation::get_entity::GetEntityOutput).
335    /// This method will fail if any of the following fields are not set:
336    /// - [`entity_id`](crate::operation::get_entity::builders::GetEntityOutputBuilder::entity_id)
337    /// - [`entity_name`](crate::operation::get_entity::builders::GetEntityOutputBuilder::entity_name)
338    /// - [`arn`](crate::operation::get_entity::builders::GetEntityOutputBuilder::arn)
339    /// - [`workspace_id`](crate::operation::get_entity::builders::GetEntityOutputBuilder::workspace_id)
340    /// - [`parent_entity_id`](crate::operation::get_entity::builders::GetEntityOutputBuilder::parent_entity_id)
341    /// - [`has_child_entities`](crate::operation::get_entity::builders::GetEntityOutputBuilder::has_child_entities)
342    /// - [`creation_date_time`](crate::operation::get_entity::builders::GetEntityOutputBuilder::creation_date_time)
343    /// - [`update_date_time`](crate::operation::get_entity::builders::GetEntityOutputBuilder::update_date_time)
344    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}