aws_sdk_bcmdashboards/operation/get_dashboard/
_get_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 GetDashboardOutput {
6    /// <p>The ARN of the retrieved dashboard.</p>
7    pub arn: ::std::string::String,
8    /// <p>The name of the retrieved dashboard.</p>
9    pub name: ::std::string::String,
10    /// <p>The description of the retrieved dashboard.</p>
11    pub description: ::std::option::Option<::std::string::String>,
12    /// <p>Indicates the dashboard type.</p>
13    pub r#type: crate::types::DashboardType,
14    /// <p>An array of widget configurations that make up the dashboard.</p>
15    pub widgets: ::std::vec::Vec<crate::types::Widget>,
16    /// <p>The timestamp when the dashboard was created.</p>
17    pub created_at: ::aws_smithy_types::DateTime,
18    /// <p>The timestamp when the dashboard was last modified.</p>
19    pub updated_at: ::aws_smithy_types::DateTime,
20    _request_id: Option<String>,
21}
22impl GetDashboardOutput {
23    /// <p>The ARN of the retrieved dashboard.</p>
24    pub fn arn(&self) -> &str {
25        use std::ops::Deref;
26        self.arn.deref()
27    }
28    /// <p>The name of the retrieved dashboard.</p>
29    pub fn name(&self) -> &str {
30        use std::ops::Deref;
31        self.name.deref()
32    }
33    /// <p>The description of the retrieved dashboard.</p>
34    pub fn description(&self) -> ::std::option::Option<&str> {
35        self.description.as_deref()
36    }
37    /// <p>Indicates the dashboard type.</p>
38    pub fn r#type(&self) -> &crate::types::DashboardType {
39        &self.r#type
40    }
41    /// <p>An array of widget configurations that make up the dashboard.</p>
42    pub fn widgets(&self) -> &[crate::types::Widget] {
43        use std::ops::Deref;
44        self.widgets.deref()
45    }
46    /// <p>The timestamp when the dashboard was created.</p>
47    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
48        &self.created_at
49    }
50    /// <p>The timestamp when the dashboard was last modified.</p>
51    pub fn updated_at(&self) -> &::aws_smithy_types::DateTime {
52        &self.updated_at
53    }
54}
55impl ::aws_types::request_id::RequestId for GetDashboardOutput {
56    fn request_id(&self) -> Option<&str> {
57        self._request_id.as_deref()
58    }
59}
60impl GetDashboardOutput {
61    /// Creates a new builder-style object to manufacture [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
62    pub fn builder() -> crate::operation::get_dashboard::builders::GetDashboardOutputBuilder {
63        crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::default()
64    }
65}
66
67/// A builder for [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
68#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
69#[non_exhaustive]
70pub struct GetDashboardOutputBuilder {
71    pub(crate) arn: ::std::option::Option<::std::string::String>,
72    pub(crate) name: ::std::option::Option<::std::string::String>,
73    pub(crate) description: ::std::option::Option<::std::string::String>,
74    pub(crate) r#type: ::std::option::Option<crate::types::DashboardType>,
75    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
76    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
77    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
78    _request_id: Option<String>,
79}
80impl GetDashboardOutputBuilder {
81    /// <p>The ARN of the retrieved dashboard.</p>
82    /// This field is required.
83    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.arn = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The ARN of the retrieved dashboard.</p>
88    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.arn = input;
90        self
91    }
92    /// <p>The ARN of the retrieved dashboard.</p>
93    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
94        &self.arn
95    }
96    /// <p>The name of the retrieved dashboard.</p>
97    /// This field is required.
98    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.name = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The name of the retrieved dashboard.</p>
103    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.name = input;
105        self
106    }
107    /// <p>The name of the retrieved dashboard.</p>
108    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
109        &self.name
110    }
111    /// <p>The description of the retrieved dashboard.</p>
112    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.description = ::std::option::Option::Some(input.into());
114        self
115    }
116    /// <p>The description of the retrieved dashboard.</p>
117    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.description = input;
119        self
120    }
121    /// <p>The description of the retrieved dashboard.</p>
122    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
123        &self.description
124    }
125    /// <p>Indicates the dashboard type.</p>
126    /// This field is required.
127    pub fn r#type(mut self, input: crate::types::DashboardType) -> Self {
128        self.r#type = ::std::option::Option::Some(input);
129        self
130    }
131    /// <p>Indicates the dashboard type.</p>
132    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DashboardType>) -> Self {
133        self.r#type = input;
134        self
135    }
136    /// <p>Indicates the dashboard type.</p>
137    pub fn get_type(&self) -> &::std::option::Option<crate::types::DashboardType> {
138        &self.r#type
139    }
140    /// Appends an item to `widgets`.
141    ///
142    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
143    ///
144    /// <p>An array of widget configurations that make up the dashboard.</p>
145    pub fn widgets(mut self, input: crate::types::Widget) -> Self {
146        let mut v = self.widgets.unwrap_or_default();
147        v.push(input);
148        self.widgets = ::std::option::Option::Some(v);
149        self
150    }
151    /// <p>An array of widget configurations that make up the dashboard.</p>
152    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
153        self.widgets = input;
154        self
155    }
156    /// <p>An array of widget configurations that make up the dashboard.</p>
157    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
158        &self.widgets
159    }
160    /// <p>The timestamp when the dashboard was created.</p>
161    /// This field is required.
162    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
163        self.created_at = ::std::option::Option::Some(input);
164        self
165    }
166    /// <p>The timestamp when the dashboard was created.</p>
167    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
168        self.created_at = input;
169        self
170    }
171    /// <p>The timestamp when the dashboard was created.</p>
172    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173        &self.created_at
174    }
175    /// <p>The timestamp when the dashboard was last modified.</p>
176    /// This field is required.
177    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
178        self.updated_at = ::std::option::Option::Some(input);
179        self
180    }
181    /// <p>The timestamp when the dashboard was last modified.</p>
182    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
183        self.updated_at = input;
184        self
185    }
186    /// <p>The timestamp when the dashboard was last modified.</p>
187    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
188        &self.updated_at
189    }
190    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
191        self._request_id = Some(request_id.into());
192        self
193    }
194
195    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
196        self._request_id = request_id;
197        self
198    }
199    /// Consumes the builder and constructs a [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
200    /// This method will fail if any of the following fields are not set:
201    /// - [`arn`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::arn)
202    /// - [`name`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::name)
203    /// - [`r#type`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::type)
204    /// - [`widgets`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::widgets)
205    /// - [`created_at`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::created_at)
206    /// - [`updated_at`](crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::updated_at)
207    pub fn build(
208        self,
209    ) -> ::std::result::Result<crate::operation::get_dashboard::GetDashboardOutput, ::aws_smithy_types::error::operation::BuildError> {
210        ::std::result::Result::Ok(crate::operation::get_dashboard::GetDashboardOutput {
211            arn: self.arn.ok_or_else(|| {
212                ::aws_smithy_types::error::operation::BuildError::missing_field(
213                    "arn",
214                    "arn was not specified but it is required when building GetDashboardOutput",
215                )
216            })?,
217            name: self.name.ok_or_else(|| {
218                ::aws_smithy_types::error::operation::BuildError::missing_field(
219                    "name",
220                    "name was not specified but it is required when building GetDashboardOutput",
221                )
222            })?,
223            description: self.description,
224            r#type: self.r#type.ok_or_else(|| {
225                ::aws_smithy_types::error::operation::BuildError::missing_field(
226                    "r#type",
227                    "r#type was not specified but it is required when building GetDashboardOutput",
228                )
229            })?,
230            widgets: self.widgets.ok_or_else(|| {
231                ::aws_smithy_types::error::operation::BuildError::missing_field(
232                    "widgets",
233                    "widgets was not specified but it is required when building GetDashboardOutput",
234                )
235            })?,
236            created_at: self.created_at.ok_or_else(|| {
237                ::aws_smithy_types::error::operation::BuildError::missing_field(
238                    "created_at",
239                    "created_at was not specified but it is required when building GetDashboardOutput",
240                )
241            })?,
242            updated_at: self.updated_at.ok_or_else(|| {
243                ::aws_smithy_types::error::operation::BuildError::missing_field(
244                    "updated_at",
245                    "updated_at was not specified but it is required when building GetDashboardOutput",
246                )
247            })?,
248            _request_id: self._request_id,
249        })
250    }
251}