aws_sdk_bcmdashboards/operation/get_dashboard/
_get_dashboard_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetDashboardOutput {
6 pub arn: ::std::string::String,
8 pub name: ::std::string::String,
10 pub description: ::std::option::Option<::std::string::String>,
12 pub r#type: crate::types::DashboardType,
14 pub widgets: ::std::vec::Vec<crate::types::Widget>,
16 pub created_at: ::aws_smithy_types::DateTime,
18 pub updated_at: ::aws_smithy_types::DateTime,
20 _request_id: Option<String>,
21}
22impl GetDashboardOutput {
23 pub fn arn(&self) -> &str {
25 use std::ops::Deref;
26 self.arn.deref()
27 }
28 pub fn name(&self) -> &str {
30 use std::ops::Deref;
31 self.name.deref()
32 }
33 pub fn description(&self) -> ::std::option::Option<&str> {
35 self.description.as_deref()
36 }
37 pub fn r#type(&self) -> &crate::types::DashboardType {
39 &self.r#type
40 }
41 pub fn widgets(&self) -> &[crate::types::Widget] {
43 use std::ops::Deref;
44 self.widgets.deref()
45 }
46 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
48 &self.created_at
49 }
50 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 pub fn builder() -> crate::operation::get_dashboard::builders::GetDashboardOutputBuilder {
63 crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::default()
64 }
65}
66
67#[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 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 pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89 self.arn = input;
90 self
91 }
92 pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
94 &self.arn
95 }
96 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104 self.name = input;
105 self
106 }
107 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
109 &self.name
110 }
111 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.description = input;
119 self
120 }
121 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
123 &self.description
124 }
125 pub fn r#type(mut self, input: crate::types::DashboardType) -> Self {
128 self.r#type = ::std::option::Option::Some(input);
129 self
130 }
131 pub fn set_type(mut self, input: ::std::option::Option<crate::types::DashboardType>) -> Self {
133 self.r#type = input;
134 self
135 }
136 pub fn get_type(&self) -> &::std::option::Option<crate::types::DashboardType> {
138 &self.r#type
139 }
140 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 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 pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
158 &self.widgets
159 }
160 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
173 &self.created_at
174 }
175 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 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 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 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}