aws_sdk_iottwinmaker/operation/create_entity/
_create_entity_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateEntityOutput {
6 pub entity_id: ::std::string::String,
8 pub arn: ::std::string::String,
10 pub creation_date_time: ::aws_smithy_types::DateTime,
12 pub state: crate::types::State,
14 _request_id: Option<String>,
15}
16impl CreateEntityOutput {
17 pub fn entity_id(&self) -> &str {
19 use std::ops::Deref;
20 self.entity_id.deref()
21 }
22 pub fn arn(&self) -> &str {
24 use std::ops::Deref;
25 self.arn.deref()
26 }
27 pub fn creation_date_time(&self) -> &::aws_smithy_types::DateTime {
29 &self.creation_date_time
30 }
31 pub fn state(&self) -> &crate::types::State {
33 &self.state
34 }
35}
36impl ::aws_types::request_id::RequestId for CreateEntityOutput {
37 fn request_id(&self) -> Option<&str> {
38 self._request_id.as_deref()
39 }
40}
41impl CreateEntityOutput {
42 pub fn builder() -> crate::operation::create_entity::builders::CreateEntityOutputBuilder {
44 crate::operation::create_entity::builders::CreateEntityOutputBuilder::default()
45 }
46}
47
48#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateEntityOutputBuilder {
52 pub(crate) entity_id: ::std::option::Option<::std::string::String>,
53 pub(crate) arn: ::std::option::Option<::std::string::String>,
54 pub(crate) creation_date_time: ::std::option::Option<::aws_smithy_types::DateTime>,
55 pub(crate) state: ::std::option::Option<crate::types::State>,
56 _request_id: Option<String>,
57}
58impl CreateEntityOutputBuilder {
59 pub fn entity_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.entity_id = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_entity_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.entity_id = input;
68 self
69 }
70 pub fn get_entity_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.entity_id
73 }
74 pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
77 self.arn = ::std::option::Option::Some(input.into());
78 self
79 }
80 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
82 self.arn = input;
83 self
84 }
85 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
87 &self.arn
88 }
89 pub fn creation_date_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
92 self.creation_date_time = ::std::option::Option::Some(input);
93 self
94 }
95 pub fn set_creation_date_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
97 self.creation_date_time = input;
98 self
99 }
100 pub fn get_creation_date_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
102 &self.creation_date_time
103 }
104 pub fn state(mut self, input: crate::types::State) -> Self {
107 self.state = ::std::option::Option::Some(input);
108 self
109 }
110 pub fn set_state(mut self, input: ::std::option::Option<crate::types::State>) -> Self {
112 self.state = input;
113 self
114 }
115 pub fn get_state(&self) -> &::std::option::Option<crate::types::State> {
117 &self.state
118 }
119 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
120 self._request_id = Some(request_id.into());
121 self
122 }
123
124 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
125 self._request_id = request_id;
126 self
127 }
128 pub fn build(
135 self,
136 ) -> ::std::result::Result<crate::operation::create_entity::CreateEntityOutput, ::aws_smithy_types::error::operation::BuildError> {
137 ::std::result::Result::Ok(crate::operation::create_entity::CreateEntityOutput {
138 entity_id: self.entity_id.ok_or_else(|| {
139 ::aws_smithy_types::error::operation::BuildError::missing_field(
140 "entity_id",
141 "entity_id was not specified but it is required when building CreateEntityOutput",
142 )
143 })?,
144 arn: self.arn.ok_or_else(|| {
145 ::aws_smithy_types::error::operation::BuildError::missing_field(
146 "arn",
147 "arn was not specified but it is required when building CreateEntityOutput",
148 )
149 })?,
150 creation_date_time: self.creation_date_time.ok_or_else(|| {
151 ::aws_smithy_types::error::operation::BuildError::missing_field(
152 "creation_date_time",
153 "creation_date_time was not specified but it is required when building CreateEntityOutput",
154 )
155 })?,
156 state: self.state.ok_or_else(|| {
157 ::aws_smithy_types::error::operation::BuildError::missing_field(
158 "state",
159 "state was not specified but it is required when building CreateEntityOutput",
160 )
161 })?,
162 _request_id: self._request_id,
163 })
164 }
165}