aws_sdk_cloudtrail/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 for the dashboard.</p>
7    pub dashboard_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The type of dashboard.</p>
9    pub r#type: ::std::option::Option<crate::types::DashboardType>,
10    /// <p>The status of the dashboard.</p>
11    pub status: ::std::option::Option<crate::types::DashboardStatus>,
12    /// <p>An array of widgets for the dashboard.</p>
13    pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
14    /// <p>The refresh schedule for the dashboard, if configured.</p>
15    pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
16    /// <p>The timestamp that shows when the dashboard was created.</p>
17    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
18    /// <p>The timestamp that shows when the dashboard was last updated.</p>
19    pub updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>The ID of the last dashboard refresh.</p>
21    pub last_refresh_id: ::std::option::Option<::std::string::String>,
22    /// <p>Provides information about failures for the last scheduled refresh.</p>
23    pub last_refresh_failure_reason: ::std::option::Option<::std::string::String>,
24    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
25    pub termination_protection_enabled: ::std::option::Option<bool>,
26    _request_id: Option<String>,
27}
28impl GetDashboardOutput {
29    /// <p>The ARN for the dashboard.</p>
30    pub fn dashboard_arn(&self) -> ::std::option::Option<&str> {
31        self.dashboard_arn.as_deref()
32    }
33    /// <p>The type of dashboard.</p>
34    pub fn r#type(&self) -> ::std::option::Option<&crate::types::DashboardType> {
35        self.r#type.as_ref()
36    }
37    /// <p>The status of the dashboard.</p>
38    pub fn status(&self) -> ::std::option::Option<&crate::types::DashboardStatus> {
39        self.status.as_ref()
40    }
41    /// <p>An array of widgets for the dashboard.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.widgets.is_none()`.
44    pub fn widgets(&self) -> &[crate::types::Widget] {
45        self.widgets.as_deref().unwrap_or_default()
46    }
47    /// <p>The refresh schedule for the dashboard, if configured.</p>
48    pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
49        self.refresh_schedule.as_ref()
50    }
51    /// <p>The timestamp that shows when the dashboard was created.</p>
52    pub fn created_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
53        self.created_timestamp.as_ref()
54    }
55    /// <p>The timestamp that shows when the dashboard was last updated.</p>
56    pub fn updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.updated_timestamp.as_ref()
58    }
59    /// <p>The ID of the last dashboard refresh.</p>
60    pub fn last_refresh_id(&self) -> ::std::option::Option<&str> {
61        self.last_refresh_id.as_deref()
62    }
63    /// <p>Provides information about failures for the last scheduled refresh.</p>
64    pub fn last_refresh_failure_reason(&self) -> ::std::option::Option<&str> {
65        self.last_refresh_failure_reason.as_deref()
66    }
67    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
68    pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
69        self.termination_protection_enabled
70    }
71}
72impl ::aws_types::request_id::RequestId for GetDashboardOutput {
73    fn request_id(&self) -> Option<&str> {
74        self._request_id.as_deref()
75    }
76}
77impl GetDashboardOutput {
78    /// Creates a new builder-style object to manufacture [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
79    pub fn builder() -> crate::operation::get_dashboard::builders::GetDashboardOutputBuilder {
80        crate::operation::get_dashboard::builders::GetDashboardOutputBuilder::default()
81    }
82}
83
84/// A builder for [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
85#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
86#[non_exhaustive]
87pub struct GetDashboardOutputBuilder {
88    pub(crate) dashboard_arn: ::std::option::Option<::std::string::String>,
89    pub(crate) r#type: ::std::option::Option<crate::types::DashboardType>,
90    pub(crate) status: ::std::option::Option<crate::types::DashboardStatus>,
91    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
92    pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
93    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
94    pub(crate) updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
95    pub(crate) last_refresh_id: ::std::option::Option<::std::string::String>,
96    pub(crate) last_refresh_failure_reason: ::std::option::Option<::std::string::String>,
97    pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
98    _request_id: Option<String>,
99}
100impl GetDashboardOutputBuilder {
101    /// <p>The ARN for the dashboard.</p>
102    pub fn dashboard_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.dashboard_arn = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The ARN for the dashboard.</p>
107    pub fn set_dashboard_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.dashboard_arn = input;
109        self
110    }
111    /// <p>The ARN for the dashboard.</p>
112    pub fn get_dashboard_arn(&self) -> &::std::option::Option<::std::string::String> {
113        &self.dashboard_arn
114    }
115    /// <p>The type of dashboard.</p>
116    pub fn r#type(mut self, input: crate::types::DashboardType) -> Self {
117        self.r#type = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>The type of dashboard.</p>
121    pub fn set_type(mut self, input: ::std::option::Option<crate::types::DashboardType>) -> Self {
122        self.r#type = input;
123        self
124    }
125    /// <p>The type of dashboard.</p>
126    pub fn get_type(&self) -> &::std::option::Option<crate::types::DashboardType> {
127        &self.r#type
128    }
129    /// <p>The status of the dashboard.</p>
130    pub fn status(mut self, input: crate::types::DashboardStatus) -> Self {
131        self.status = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p>The status of the dashboard.</p>
135    pub fn set_status(mut self, input: ::std::option::Option<crate::types::DashboardStatus>) -> Self {
136        self.status = input;
137        self
138    }
139    /// <p>The status of the dashboard.</p>
140    pub fn get_status(&self) -> &::std::option::Option<crate::types::DashboardStatus> {
141        &self.status
142    }
143    /// Appends an item to `widgets`.
144    ///
145    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
146    ///
147    /// <p>An array of widgets for the dashboard.</p>
148    pub fn widgets(mut self, input: crate::types::Widget) -> Self {
149        let mut v = self.widgets.unwrap_or_default();
150        v.push(input);
151        self.widgets = ::std::option::Option::Some(v);
152        self
153    }
154    /// <p>An array of widgets for the dashboard.</p>
155    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
156        self.widgets = input;
157        self
158    }
159    /// <p>An array of widgets for the dashboard.</p>
160    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
161        &self.widgets
162    }
163    /// <p>The refresh schedule for the dashboard, if configured.</p>
164    pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
165        self.refresh_schedule = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>The refresh schedule for the dashboard, if configured.</p>
169    pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
170        self.refresh_schedule = input;
171        self
172    }
173    /// <p>The refresh schedule for the dashboard, if configured.</p>
174    pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
175        &self.refresh_schedule
176    }
177    /// <p>The timestamp that shows when the dashboard was created.</p>
178    pub fn created_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
179        self.created_timestamp = ::std::option::Option::Some(input);
180        self
181    }
182    /// <p>The timestamp that shows when the dashboard was created.</p>
183    pub fn set_created_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
184        self.created_timestamp = input;
185        self
186    }
187    /// <p>The timestamp that shows when the dashboard was created.</p>
188    pub fn get_created_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
189        &self.created_timestamp
190    }
191    /// <p>The timestamp that shows when the dashboard was last updated.</p>
192    pub fn updated_timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
193        self.updated_timestamp = ::std::option::Option::Some(input);
194        self
195    }
196    /// <p>The timestamp that shows when the dashboard was last updated.</p>
197    pub fn set_updated_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
198        self.updated_timestamp = input;
199        self
200    }
201    /// <p>The timestamp that shows when the dashboard was last updated.</p>
202    pub fn get_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
203        &self.updated_timestamp
204    }
205    /// <p>The ID of the last dashboard refresh.</p>
206    pub fn last_refresh_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.last_refresh_id = ::std::option::Option::Some(input.into());
208        self
209    }
210    /// <p>The ID of the last dashboard refresh.</p>
211    pub fn set_last_refresh_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.last_refresh_id = input;
213        self
214    }
215    /// <p>The ID of the last dashboard refresh.</p>
216    pub fn get_last_refresh_id(&self) -> &::std::option::Option<::std::string::String> {
217        &self.last_refresh_id
218    }
219    /// <p>Provides information about failures for the last scheduled refresh.</p>
220    pub fn last_refresh_failure_reason(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.last_refresh_failure_reason = ::std::option::Option::Some(input.into());
222        self
223    }
224    /// <p>Provides information about failures for the last scheduled refresh.</p>
225    pub fn set_last_refresh_failure_reason(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.last_refresh_failure_reason = input;
227        self
228    }
229    /// <p>Provides information about failures for the last scheduled refresh.</p>
230    pub fn get_last_refresh_failure_reason(&self) -> &::std::option::Option<::std::string::String> {
231        &self.last_refresh_failure_reason
232    }
233    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
234    pub fn termination_protection_enabled(mut self, input: bool) -> Self {
235        self.termination_protection_enabled = ::std::option::Option::Some(input);
236        self
237    }
238    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
239    pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
240        self.termination_protection_enabled = input;
241        self
242    }
243    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
244    pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
245        &self.termination_protection_enabled
246    }
247    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
248        self._request_id = Some(request_id.into());
249        self
250    }
251
252    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
253        self._request_id = request_id;
254        self
255    }
256    /// Consumes the builder and constructs a [`GetDashboardOutput`](crate::operation::get_dashboard::GetDashboardOutput).
257    pub fn build(self) -> crate::operation::get_dashboard::GetDashboardOutput {
258        crate::operation::get_dashboard::GetDashboardOutput {
259            dashboard_arn: self.dashboard_arn,
260            r#type: self.r#type,
261            status: self.status,
262            widgets: self.widgets,
263            refresh_schedule: self.refresh_schedule,
264            created_timestamp: self.created_timestamp,
265            updated_timestamp: self.updated_timestamp,
266            last_refresh_id: self.last_refresh_id,
267            last_refresh_failure_reason: self.last_refresh_failure_reason,
268            termination_protection_enabled: self.termination_protection_enabled,
269            _request_id: self._request_id,
270        }
271    }
272}