aws_sdk_cloudtrail/operation/update_dashboard/_update_dashboard_input.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 UpdateDashboardInput {
6 /// <p>The name or ARN of the dashboard.</p>
7 pub dashboard_id: ::std::option::Option<::std::string::String>,
8 /// <p>An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.</p>
9 /// <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p>
10 /// <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
11 pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
12 /// <p>The refresh schedule configuration for the dashboard.</p>
13 pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
14 /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
15 pub termination_protection_enabled: ::std::option::Option<bool>,
16}
17impl UpdateDashboardInput {
18 /// <p>The name or ARN of the dashboard.</p>
19 pub fn dashboard_id(&self) -> ::std::option::Option<&str> {
20 self.dashboard_id.as_deref()
21 }
22 /// <p>An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.</p>
23 /// <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p>
24 /// <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
25 ///
26 /// 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()`.
27 pub fn widgets(&self) -> &[crate::types::RequestWidget] {
28 self.widgets.as_deref().unwrap_or_default()
29 }
30 /// <p>The refresh schedule configuration for the dashboard.</p>
31 pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
32 self.refresh_schedule.as_ref()
33 }
34 /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
35 pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
36 self.termination_protection_enabled
37 }
38}
39impl UpdateDashboardInput {
40 /// Creates a new builder-style object to manufacture [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
41 pub fn builder() -> crate::operation::update_dashboard::builders::UpdateDashboardInputBuilder {
42 crate::operation::update_dashboard::builders::UpdateDashboardInputBuilder::default()
43 }
44}
45
46/// A builder for [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateDashboardInputBuilder {
50 pub(crate) dashboard_id: ::std::option::Option<::std::string::String>,
51 pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
52 pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
53 pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
54}
55impl UpdateDashboardInputBuilder {
56 /// <p>The name or ARN of the dashboard.</p>
57 /// This field is required.
58 pub fn dashboard_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.dashboard_id = ::std::option::Option::Some(input.into());
60 self
61 }
62 /// <p>The name or ARN of the dashboard.</p>
63 pub fn set_dashboard_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
64 self.dashboard_id = input;
65 self
66 }
67 /// <p>The name or ARN of the dashboard.</p>
68 pub fn get_dashboard_id(&self) -> &::std::option::Option<::std::string::String> {
69 &self.dashboard_id
70 }
71 /// Appends an item to `widgets`.
72 ///
73 /// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
74 ///
75 /// <p>An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.</p>
76 /// <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p>
77 /// <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
78 pub fn widgets(mut self, input: crate::types::RequestWidget) -> Self {
79 let mut v = self.widgets.unwrap_or_default();
80 v.push(input);
81 self.widgets = ::std::option::Option::Some(v);
82 self
83 }
84 /// <p>An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.</p>
85 /// <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p>
86 /// <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
87 pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>) -> Self {
88 self.widgets = input;
89 self
90 }
91 /// <p>An array of widgets for the dashboard. A custom dashboard can have a maximum of 10 widgets.</p>
92 /// <p>To add new widgets, pass in an array that includes the existing widgets along with any new widgets. Run the <code>GetDashboard</code> operation to get the list of widgets for the dashboard.</p>
93 /// <p>To remove widgets, pass in an array that includes the existing widgets minus the widgets you want removed.</p>
94 pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>> {
95 &self.widgets
96 }
97 /// <p>The refresh schedule configuration for the dashboard.</p>
98 pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
99 self.refresh_schedule = ::std::option::Option::Some(input);
100 self
101 }
102 /// <p>The refresh schedule configuration for the dashboard.</p>
103 pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
104 self.refresh_schedule = input;
105 self
106 }
107 /// <p>The refresh schedule configuration for the dashboard.</p>
108 pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
109 &self.refresh_schedule
110 }
111 /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
112 pub fn termination_protection_enabled(mut self, input: bool) -> Self {
113 self.termination_protection_enabled = ::std::option::Option::Some(input);
114 self
115 }
116 /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
117 pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
118 self.termination_protection_enabled = input;
119 self
120 }
121 /// <p>Specifies whether termination protection is enabled for the dashboard. If termination protection is enabled, you cannot delete the dashboard until termination protection is disabled.</p>
122 pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
123 &self.termination_protection_enabled
124 }
125 /// Consumes the builder and constructs a [`UpdateDashboardInput`](crate::operation::update_dashboard::UpdateDashboardInput).
126 pub fn build(
127 self,
128 ) -> ::std::result::Result<crate::operation::update_dashboard::UpdateDashboardInput, ::aws_smithy_types::error::operation::BuildError> {
129 ::std::result::Result::Ok(crate::operation::update_dashboard::UpdateDashboardInput {
130 dashboard_id: self.dashboard_id,
131 widgets: self.widgets,
132 refresh_schedule: self.refresh_schedule,
133 termination_protection_enabled: self.termination_protection_enabled,
134 })
135 }
136}