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