aws_sdk_cloudtrail/operation/update_dashboard/
_update_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 UpdateDashboardOutput {
6    /// <p>The ARN for the dashboard.</p>
7    pub dashboard_arn: ::std::option::Option<::std::string::String>,
8    /// <p>The name for the dashboard.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The type of dashboard.</p>
11    pub r#type: ::std::option::Option<crate::types::DashboardType>,
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>Indicates whether termination protection is enabled for the dashboard.</p>
17    pub termination_protection_enabled: ::std::option::Option<bool>,
18    /// <p>The timestamp that shows when the dashboard was created.</p>
19    pub created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>The timestamp that shows when the dashboard was updated.</p>
21    pub updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
22    _request_id: Option<String>,
23}
24impl UpdateDashboardOutput {
25    /// <p>The ARN for the dashboard.</p>
26    pub fn dashboard_arn(&self) -> ::std::option::Option<&str> {
27        self.dashboard_arn.as_deref()
28    }
29    /// <p>The name for the dashboard.</p>
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.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>An array of widgets for the dashboard.</p>
38    ///
39    /// 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()`.
40    pub fn widgets(&self) -> &[crate::types::Widget] {
41        self.widgets.as_deref().unwrap_or_default()
42    }
43    /// <p>The refresh schedule for the dashboard, if configured.</p>
44    pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
45        self.refresh_schedule.as_ref()
46    }
47    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
48    pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
49        self.termination_protection_enabled
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 updated.</p>
56    pub fn updated_timestamp(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
57        self.updated_timestamp.as_ref()
58    }
59}
60impl ::aws_types::request_id::RequestId for UpdateDashboardOutput {
61    fn request_id(&self) -> Option<&str> {
62        self._request_id.as_deref()
63    }
64}
65impl UpdateDashboardOutput {
66    /// Creates a new builder-style object to manufacture [`UpdateDashboardOutput`](crate::operation::update_dashboard::UpdateDashboardOutput).
67    pub fn builder() -> crate::operation::update_dashboard::builders::UpdateDashboardOutputBuilder {
68        crate::operation::update_dashboard::builders::UpdateDashboardOutputBuilder::default()
69    }
70}
71
72/// A builder for [`UpdateDashboardOutput`](crate::operation::update_dashboard::UpdateDashboardOutput).
73#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
74#[non_exhaustive]
75pub struct UpdateDashboardOutputBuilder {
76    pub(crate) dashboard_arn: ::std::option::Option<::std::string::String>,
77    pub(crate) name: ::std::option::Option<::std::string::String>,
78    pub(crate) r#type: ::std::option::Option<crate::types::DashboardType>,
79    pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>,
80    pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
81    pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
82    pub(crate) created_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
83    pub(crate) updated_timestamp: ::std::option::Option<::aws_smithy_types::DateTime>,
84    _request_id: Option<String>,
85}
86impl UpdateDashboardOutputBuilder {
87    /// <p>The ARN for the dashboard.</p>
88    pub fn dashboard_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.dashboard_arn = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The ARN for the dashboard.</p>
93    pub fn set_dashboard_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.dashboard_arn = input;
95        self
96    }
97    /// <p>The ARN for the dashboard.</p>
98    pub fn get_dashboard_arn(&self) -> &::std::option::Option<::std::string::String> {
99        &self.dashboard_arn
100    }
101    /// <p>The name for the dashboard.</p>
102    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.name = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>The name for the dashboard.</p>
107    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.name = input;
109        self
110    }
111    /// <p>The name for the dashboard.</p>
112    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
113        &self.name
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    /// Appends an item to `widgets`.
130    ///
131    /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
132    ///
133    /// <p>An array of widgets for the dashboard.</p>
134    pub fn widgets(mut self, input: crate::types::Widget) -> Self {
135        let mut v = self.widgets.unwrap_or_default();
136        v.push(input);
137        self.widgets = ::std::option::Option::Some(v);
138        self
139    }
140    /// <p>An array of widgets for the dashboard.</p>
141    pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Widget>>) -> Self {
142        self.widgets = input;
143        self
144    }
145    /// <p>An array of widgets for the dashboard.</p>
146    pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Widget>> {
147        &self.widgets
148    }
149    /// <p>The refresh schedule for the dashboard, if configured.</p>
150    pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
151        self.refresh_schedule = ::std::option::Option::Some(input);
152        self
153    }
154    /// <p>The refresh schedule for the dashboard, if configured.</p>
155    pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
156        self.refresh_schedule = input;
157        self
158    }
159    /// <p>The refresh schedule for the dashboard, if configured.</p>
160    pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
161        &self.refresh_schedule
162    }
163    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
164    pub fn termination_protection_enabled(mut self, input: bool) -> Self {
165        self.termination_protection_enabled = ::std::option::Option::Some(input);
166        self
167    }
168    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
169    pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
170        self.termination_protection_enabled = input;
171        self
172    }
173    /// <p>Indicates whether termination protection is enabled for the dashboard.</p>
174    pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
175        &self.termination_protection_enabled
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 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 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 updated.</p>
202    pub fn get_updated_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
203        &self.updated_timestamp
204    }
205    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
206        self._request_id = Some(request_id.into());
207        self
208    }
209
210    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
211        self._request_id = request_id;
212        self
213    }
214    /// Consumes the builder and constructs a [`UpdateDashboardOutput`](crate::operation::update_dashboard::UpdateDashboardOutput).
215    pub fn build(self) -> crate::operation::update_dashboard::UpdateDashboardOutput {
216        crate::operation::update_dashboard::UpdateDashboardOutput {
217            dashboard_arn: self.dashboard_arn,
218            name: self.name,
219            r#type: self.r#type,
220            widgets: self.widgets,
221            refresh_schedule: self.refresh_schedule,
222            termination_protection_enabled: self.termination_protection_enabled,
223            created_timestamp: self.created_timestamp,
224            updated_timestamp: self.updated_timestamp,
225            _request_id: self._request_id,
226        }
227    }
228}