aws_sdk_iottwinmaker/operation/delete_entity/
_delete_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 DeleteEntityOutput {
6    /// <p>The current state of the deleted entity.</p>
7    pub state: crate::types::State,
8    _request_id: Option<String>,
9}
10impl DeleteEntityOutput {
11    /// <p>The current state of the deleted entity.</p>
12    pub fn state(&self) -> &crate::types::State {
13        &self.state
14    }
15}
16impl ::aws_types::request_id::RequestId for DeleteEntityOutput {
17    fn request_id(&self) -> Option<&str> {
18        self._request_id.as_deref()
19    }
20}
21impl DeleteEntityOutput {
22    /// Creates a new builder-style object to manufacture [`DeleteEntityOutput`](crate::operation::delete_entity::DeleteEntityOutput).
23    pub fn builder() -> crate::operation::delete_entity::builders::DeleteEntityOutputBuilder {
24        crate::operation::delete_entity::builders::DeleteEntityOutputBuilder::default()
25    }
26}
27
28/// A builder for [`DeleteEntityOutput`](crate::operation::delete_entity::DeleteEntityOutput).
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
30#[non_exhaustive]
31pub struct DeleteEntityOutputBuilder {
32    pub(crate) state: ::std::option::Option<crate::types::State>,
33    _request_id: Option<String>,
34}
35impl DeleteEntityOutputBuilder {
36    /// <p>The current state of the deleted entity.</p>
37    /// This field is required.
38    pub fn state(mut self, input: crate::types::State) -> Self {
39        self.state = ::std::option::Option::Some(input);
40        self
41    }
42    /// <p>The current state of the deleted entity.</p>
43    pub fn set_state(mut self, input: ::std::option::Option<crate::types::State>) -> Self {
44        self.state = input;
45        self
46    }
47    /// <p>The current state of the deleted entity.</p>
48    pub fn get_state(&self) -> &::std::option::Option<crate::types::State> {
49        &self.state
50    }
51    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
52        self._request_id = Some(request_id.into());
53        self
54    }
55
56    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
57        self._request_id = request_id;
58        self
59    }
60    /// Consumes the builder and constructs a [`DeleteEntityOutput`](crate::operation::delete_entity::DeleteEntityOutput).
61    /// This method will fail if any of the following fields are not set:
62    /// - [`state`](crate::operation::delete_entity::builders::DeleteEntityOutputBuilder::state)
63    pub fn build(
64        self,
65    ) -> ::std::result::Result<crate::operation::delete_entity::DeleteEntityOutput, ::aws_smithy_types::error::operation::BuildError> {
66        ::std::result::Result::Ok(crate::operation::delete_entity::DeleteEntityOutput {
67            state: self.state.ok_or_else(|| {
68                ::aws_smithy_types::error::operation::BuildError::missing_field(
69                    "state",
70                    "state was not specified but it is required when building DeleteEntityOutput",
71                )
72            })?,
73            _request_id: self._request_id,
74        })
75    }
76}