aws_sdk_iottwinmaker/operation/update_entity/
_update_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 UpdateEntityOutput {
6    /// <p>The date and time when the entity was last updated.</p>
7    pub update_date_time: ::aws_smithy_types::DateTime,
8    /// <p>The current state of the entity update.</p>
9    pub state: crate::types::State,
10    _request_id: Option<String>,
11}
12impl UpdateEntityOutput {
13    /// <p>The date and time when the entity was last updated.</p>
14    pub fn update_date_time(&self) -> &::aws_smithy_types::DateTime {
15        &self.update_date_time
16    }
17    /// <p>The current state of the entity update.</p>
18    pub fn state(&self) -> &crate::types::State {
19        &self.state
20    }
21}
22impl ::aws_types::request_id::RequestId for UpdateEntityOutput {
23    fn request_id(&self) -> Option<&str> {
24        self._request_id.as_deref()
25    }
26}
27impl UpdateEntityOutput {
28    /// Creates a new builder-style object to manufacture [`UpdateEntityOutput`](crate::operation::update_entity::UpdateEntityOutput).
29    pub fn builder() -> crate::operation::update_entity::builders::UpdateEntityOutputBuilder {
30        crate::operation::update_entity::builders::UpdateEntityOutputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateEntityOutput`](crate::operation::update_entity::UpdateEntityOutput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateEntityOutputBuilder {
38    pub(crate) update_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
39    pub(crate) state: ::std::option::Option<crate::types::State>,
40    _request_id: Option<String>,
41}
42impl UpdateEntityOutputBuilder {
43    /// <p>The date and time when the entity was last updated.</p>
44    /// This field is required.
45    pub fn update_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
46        self.update_date_time = ::std::option::Option::Some(input);
47        self
48    }
49    /// <p>The date and time when the entity was last updated.</p>
50    pub fn set_update_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
51        self.update_date_time = input;
52        self
53    }
54    /// <p>The date and time when the entity was last updated.</p>
55    pub fn get_update_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
56        &self.update_date_time
57    }
58    /// <p>The current state of the entity update.</p>
59    /// This field is required.
60    pub fn state(mut self, input: crate::types::State) -> Self {
61        self.state = ::std::option::Option::Some(input);
62        self
63    }
64    /// <p>The current state of the entity update.</p>
65    pub fn set_state(mut self, input: ::std::option::Option<crate::types::State>) -> Self {
66        self.state = input;
67        self
68    }
69    /// <p>The current state of the entity update.</p>
70    pub fn get_state(&self) -> &::std::option::Option<crate::types::State> {
71        &self.state
72    }
73    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
74        self._request_id = Some(request_id.into());
75        self
76    }
77
78    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
79        self._request_id = request_id;
80        self
81    }
82    /// Consumes the builder and constructs a [`UpdateEntityOutput`](crate::operation::update_entity::UpdateEntityOutput).
83    /// This method will fail if any of the following fields are not set:
84    /// - [`update_date_time`](crate::operation::update_entity::builders::UpdateEntityOutputBuilder::update_date_time)
85    /// - [`state`](crate::operation::update_entity::builders::UpdateEntityOutputBuilder::state)
86    pub fn build(
87        self,
88    ) -> ::std::result::Result<crate::operation::update_entity::UpdateEntityOutput, ::aws_smithy_types::error::operation::BuildError> {
89        ::std::result::Result::Ok(crate::operation::update_entity::UpdateEntityOutput {
90            update_date_time: self.update_date_time.ok_or_else(|| {
91                ::aws_smithy_types::error::operation::BuildError::missing_field(
92                    "update_date_time",
93                    "update_date_time was not specified but it is required when building UpdateEntityOutput",
94                )
95            })?,
96            state: self.state.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "state",
99                    "state was not specified but it is required when building UpdateEntityOutput",
100                )
101            })?,
102            _request_id: self._request_id,
103        })
104    }
105}