aws_sdk_iotsitewise/operation/create_dashboard/
_create_dashboard_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 CreateDashboardOutput {
6    /// <p>The ID of the dashboard.</p>
7    pub dashboard_id: ::std::string::String,
8    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the dashboard, which has the following format.</p>
9    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:dashboard/${DashboardId}</code></p>
10    pub dashboard_arn: ::std::string::String,
11    _request_id: Option<String>,
12}
13impl CreateDashboardOutput {
14    /// <p>The ID of the dashboard.</p>
15    pub fn dashboard_id(&self) -> &str {
16        use std::ops::Deref;
17        self.dashboard_id.deref()
18    }
19    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the dashboard, which has the following format.</p>
20    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:dashboard/${DashboardId}</code></p>
21    pub fn dashboard_arn(&self) -> &str {
22        use std::ops::Deref;
23        self.dashboard_arn.deref()
24    }
25}
26impl ::aws_types::request_id::RequestId for CreateDashboardOutput {
27    fn request_id(&self) -> Option<&str> {
28        self._request_id.as_deref()
29    }
30}
31impl CreateDashboardOutput {
32    /// Creates a new builder-style object to manufacture [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
33    pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder {
34        crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder::default()
35    }
36}
37
38/// A builder for [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
40#[non_exhaustive]
41pub struct CreateDashboardOutputBuilder {
42    pub(crate) dashboard_id: ::std::option::Option<::std::string::String>,
43    pub(crate) dashboard_arn: ::std::option::Option<::std::string::String>,
44    _request_id: Option<String>,
45}
46impl CreateDashboardOutputBuilder {
47    /// <p>The ID of the dashboard.</p>
48    /// This field is required.
49    pub fn dashboard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50        self.dashboard_id = ::std::option::Option::Some(input.into());
51        self
52    }
53    /// <p>The ID of the dashboard.</p>
54    pub fn set_dashboard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55        self.dashboard_id = input;
56        self
57    }
58    /// <p>The ID of the dashboard.</p>
59    pub fn get_dashboard_id(&self) -> &::std::option::Option<::std::string::String> {
60        &self.dashboard_id
61    }
62    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the dashboard, which has the following format.</p>
63    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:dashboard/${DashboardId}</code></p>
64    /// This field is required.
65    pub fn dashboard_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66        self.dashboard_arn = ::std::option::Option::Some(input.into());
67        self
68    }
69    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the dashboard, which has the following format.</p>
70    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:dashboard/${DashboardId}</code></p>
71    pub fn set_dashboard_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.dashboard_arn = input;
73        self
74    }
75    /// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the dashboard, which has the following format.</p>
76    /// <p><code>arn:${Partition}:iotsitewise:${Region}:${Account}:dashboard/${DashboardId}</code></p>
77    pub fn get_dashboard_arn(&self) -> &::std::option::Option<::std::string::String> {
78        &self.dashboard_arn
79    }
80    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81        self._request_id = Some(request_id.into());
82        self
83    }
84
85    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86        self._request_id = request_id;
87        self
88    }
89    /// Consumes the builder and constructs a [`CreateDashboardOutput`](crate::operation::create_dashboard::CreateDashboardOutput).
90    /// This method will fail if any of the following fields are not set:
91    /// - [`dashboard_id`](crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder::dashboard_id)
92    /// - [`dashboard_arn`](crate::operation::create_dashboard::builders::CreateDashboardOutputBuilder::dashboard_arn)
93    pub fn build(
94        self,
95    ) -> ::std::result::Result<crate::operation::create_dashboard::CreateDashboardOutput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::create_dashboard::CreateDashboardOutput {
97            dashboard_id: self.dashboard_id.ok_or_else(|| {
98                ::aws_smithy_types::error::operation::BuildError::missing_field(
99                    "dashboard_id",
100                    "dashboard_id was not specified but it is required when building CreateDashboardOutput",
101                )
102            })?,
103            dashboard_arn: self.dashboard_arn.ok_or_else(|| {
104                ::aws_smithy_types::error::operation::BuildError::missing_field(
105                    "dashboard_arn",
106                    "dashboard_arn was not specified but it is required when building CreateDashboardOutput",
107                )
108            })?,
109            _request_id: self._request_id,
110        })
111    }
112}