1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateDashboardInput {
/// <p>The name of the dashboard. The name must be unique to your account.</p>
/// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The refresh schedule configuration for the dashboard.</p>
/// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
pub refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
/// <p>A list of tags.</p>
pub tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
/// <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>
pub termination_protection_enabled: ::std::option::Option<bool>,
/// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
/// <p>You do not need to specify widgets for the Highlights dashboard.</p>
pub widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
}
impl CreateDashboardInput {
/// <p>The name of the dashboard. The name must be unique to your account.</p>
/// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The refresh schedule configuration for the dashboard.</p>
/// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
pub fn refresh_schedule(&self) -> ::std::option::Option<&crate::types::RefreshSchedule> {
self.refresh_schedule.as_ref()
}
/// <p>A list of tags.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags_list.is_none()`.
pub fn tags_list(&self) -> &[crate::types::Tag] {
self.tags_list.as_deref().unwrap_or_default()
}
/// <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>
pub fn termination_protection_enabled(&self) -> ::std::option::Option<bool> {
self.termination_protection_enabled
}
/// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
/// <p>You do not need to specify widgets for the Highlights dashboard.</p>
///
/// 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()`.
pub fn widgets(&self) -> &[crate::types::RequestWidget] {
self.widgets.as_deref().unwrap_or_default()
}
}
impl CreateDashboardInput {
/// Creates a new builder-style object to manufacture [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
pub fn builder() -> crate::operation::create_dashboard::builders::CreateDashboardInputBuilder {
crate::operation::create_dashboard::builders::CreateDashboardInputBuilder::default()
}
}
/// A builder for [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDashboardInputBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) refresh_schedule: ::std::option::Option<crate::types::RefreshSchedule>,
pub(crate) tags_list: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
pub(crate) termination_protection_enabled: ::std::option::Option<bool>,
pub(crate) widgets: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>,
}
impl CreateDashboardInputBuilder {
/// <p>The name of the dashboard. The name must be unique to your account.</p>
/// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
/// This field is required.
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the dashboard. The name must be unique to your account.</p>
/// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name of the dashboard. The name must be unique to your account.</p>
/// <p>To create the Highlights dashboard, the name must be <code>AWSCloudTrail-Highlights</code>.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The refresh schedule configuration for the dashboard.</p>
/// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
pub fn refresh_schedule(mut self, input: crate::types::RefreshSchedule) -> Self {
self.refresh_schedule = ::std::option::Option::Some(input);
self
}
/// <p>The refresh schedule configuration for the dashboard.</p>
/// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
pub fn set_refresh_schedule(mut self, input: ::std::option::Option<crate::types::RefreshSchedule>) -> Self {
self.refresh_schedule = input;
self
}
/// <p>The refresh schedule configuration for the dashboard.</p>
/// <p>To create the Highlights dashboard, you must set a refresh schedule and set the <code>Status</code> to <code>ENABLED</code>. The <code>Unit</code> for the refresh schedule must be <code>HOURS</code> and the <code>Value</code> must be <code>6</code>.</p>
pub fn get_refresh_schedule(&self) -> &::std::option::Option<crate::types::RefreshSchedule> {
&self.refresh_schedule
}
/// Appends an item to `tags_list`.
///
/// To override the contents of this collection use [`set_tags_list`](Self::set_tags_list).
///
/// <p>A list of tags.</p>
pub fn tags_list(mut self, input: crate::types::Tag) -> Self {
let mut v = self.tags_list.unwrap_or_default();
v.push(input);
self.tags_list = ::std::option::Option::Some(v);
self
}
/// <p>A list of tags.</p>
pub fn set_tags_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
self.tags_list = input;
self
}
/// <p>A list of tags.</p>
pub fn get_tags_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
&self.tags_list
}
/// <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>
pub fn termination_protection_enabled(mut self, input: bool) -> Self {
self.termination_protection_enabled = ::std::option::Option::Some(input);
self
}
/// <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>
pub fn set_termination_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.termination_protection_enabled = input;
self
}
/// <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>
pub fn get_termination_protection_enabled(&self) -> &::std::option::Option<bool> {
&self.termination_protection_enabled
}
/// Appends an item to `widgets`.
///
/// To override the contents of this collection use [`set_widgets`](Self::set_widgets).
///
/// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
/// <p>You do not need to specify widgets for the Highlights dashboard.</p>
pub fn widgets(mut self, input: crate::types::RequestWidget) -> Self {
let mut v = self.widgets.unwrap_or_default();
v.push(input);
self.widgets = ::std::option::Option::Some(v);
self
}
/// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
/// <p>You do not need to specify widgets for the Highlights dashboard.</p>
pub fn set_widgets(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>>) -> Self {
self.widgets = input;
self
}
/// <p>An array of widgets for a custom dashboard. A custom dashboard can have a maximum of ten widgets.</p>
/// <p>You do not need to specify widgets for the Highlights dashboard.</p>
pub fn get_widgets(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequestWidget>> {
&self.widgets
}
/// Consumes the builder and constructs a [`CreateDashboardInput`](crate::operation::create_dashboard::CreateDashboardInput).
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_dashboard::CreateDashboardInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_dashboard::CreateDashboardInput {
name: self.name,
refresh_schedule: self.refresh_schedule,
tags_list: self.tags_list,
termination_protection_enabled: self.termination_protection_enabled,
widgets: self.widgets,
})
}
}