aws_sdk_iot/operation/create_thing/
_create_thing_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The output of the CreateThing operation.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateThingOutput {
7    /// <p>The name of the new thing.</p>
8    pub thing_name: ::std::option::Option<::std::string::String>,
9    /// <p>The ARN of the new thing.</p>
10    pub thing_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The thing ID.</p>
12    pub thing_id: ::std::option::Option<::std::string::String>,
13    _request_id: Option<String>,
14}
15impl CreateThingOutput {
16    /// <p>The name of the new thing.</p>
17    pub fn thing_name(&self) -> ::std::option::Option<&str> {
18        self.thing_name.as_deref()
19    }
20    /// <p>The ARN of the new thing.</p>
21    pub fn thing_arn(&self) -> ::std::option::Option<&str> {
22        self.thing_arn.as_deref()
23    }
24    /// <p>The thing ID.</p>
25    pub fn thing_id(&self) -> ::std::option::Option<&str> {
26        self.thing_id.as_deref()
27    }
28}
29impl ::aws_types::request_id::RequestId for CreateThingOutput {
30    fn request_id(&self) -> Option<&str> {
31        self._request_id.as_deref()
32    }
33}
34impl CreateThingOutput {
35    /// Creates a new builder-style object to manufacture [`CreateThingOutput`](crate::operation::create_thing::CreateThingOutput).
36    pub fn builder() -> crate::operation::create_thing::builders::CreateThingOutputBuilder {
37        crate::operation::create_thing::builders::CreateThingOutputBuilder::default()
38    }
39}
40
41/// A builder for [`CreateThingOutput`](crate::operation::create_thing::CreateThingOutput).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct CreateThingOutputBuilder {
45    pub(crate) thing_name: ::std::option::Option<::std::string::String>,
46    pub(crate) thing_arn: ::std::option::Option<::std::string::String>,
47    pub(crate) thing_id: ::std::option::Option<::std::string::String>,
48    _request_id: Option<String>,
49}
50impl CreateThingOutputBuilder {
51    /// <p>The name of the new thing.</p>
52    pub fn thing_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
53        self.thing_name = ::std::option::Option::Some(input.into());
54        self
55    }
56    /// <p>The name of the new thing.</p>
57    pub fn set_thing_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
58        self.thing_name = input;
59        self
60    }
61    /// <p>The name of the new thing.</p>
62    pub fn get_thing_name(&self) -> &::std::option::Option<::std::string::String> {
63        &self.thing_name
64    }
65    /// <p>The ARN of the new thing.</p>
66    pub fn thing_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.thing_arn = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The ARN of the new thing.</p>
71    pub fn set_thing_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.thing_arn = input;
73        self
74    }
75    /// <p>The ARN of the new thing.</p>
76    pub fn get_thing_arn(&self) -> &::std::option::Option<::std::string::String> {
77        &self.thing_arn
78    }
79    /// <p>The thing ID.</p>
80    pub fn thing_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.thing_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The thing ID.</p>
85    pub fn set_thing_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.thing_id = input;
87        self
88    }
89    /// <p>The thing ID.</p>
90    pub fn get_thing_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.thing_id
92    }
93    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
94        self._request_id = Some(request_id.into());
95        self
96    }
97
98    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
99        self._request_id = request_id;
100        self
101    }
102    /// Consumes the builder and constructs a [`CreateThingOutput`](crate::operation::create_thing::CreateThingOutput).
103    pub fn build(self) -> crate::operation::create_thing::CreateThingOutput {
104        crate::operation::create_thing::CreateThingOutput {
105            thing_name: self.thing_name,
106            thing_arn: self.thing_arn,
107            thing_id: self.thing_id,
108            _request_id: self._request_id,
109        }
110    }
111}