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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A widget on a CloudTrail Lake dashboard.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Widget {
/// <p>The query alias used to identify the query for the widget.</p>
pub query_alias: ::std::option::Option<::std::string::String>,
/// <p>The SQL query statement for the widget.</p>
pub query_statement: ::std::option::Option<::std::string::String>,
/// <p>The query parameters for the widget.</p>
pub query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
/// <p>The view properties for the widget. For more information about view properties, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html"> View properties for widgets </a> in the <i>CloudTrail User Guide</i>..</p>
pub view_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Widget {
/// <p>The query alias used to identify the query for the widget.</p>
pub fn query_alias(&self) -> ::std::option::Option<&str> {
self.query_alias.as_deref()
}
/// <p>The SQL query statement for the widget.</p>
pub fn query_statement(&self) -> ::std::option::Option<&str> {
self.query_statement.as_deref()
}
/// <p>The query parameters for the widget.</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 `.query_parameters.is_none()`.
pub fn query_parameters(&self) -> &[::std::string::String] {
self.query_parameters.as_deref().unwrap_or_default()
}
/// <p>The view properties for the widget. For more information about view properties, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html"> View properties for widgets </a> in the <i>CloudTrail User Guide</i>..</p>
pub fn view_properties(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.view_properties.as_ref()
}
}
impl Widget {
/// Creates a new builder-style object to manufacture [`Widget`](crate::types::Widget).
pub fn builder() -> crate::types::builders::WidgetBuilder {
crate::types::builders::WidgetBuilder::default()
}
}
/// A builder for [`Widget`](crate::types::Widget).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct WidgetBuilder {
pub(crate) query_alias: ::std::option::Option<::std::string::String>,
pub(crate) query_statement: ::std::option::Option<::std::string::String>,
pub(crate) query_parameters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
pub(crate) view_properties: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl WidgetBuilder {
/// <p>The query alias used to identify the query for the widget.</p>
pub fn query_alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.query_alias = ::std::option::Option::Some(input.into());
self
}
/// <p>The query alias used to identify the query for the widget.</p>
pub fn set_query_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.query_alias = input;
self
}
/// <p>The query alias used to identify the query for the widget.</p>
pub fn get_query_alias(&self) -> &::std::option::Option<::std::string::String> {
&self.query_alias
}
/// <p>The SQL query statement for the widget.</p>
pub fn query_statement(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.query_statement = ::std::option::Option::Some(input.into());
self
}
/// <p>The SQL query statement for the widget.</p>
pub fn set_query_statement(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.query_statement = input;
self
}
/// <p>The SQL query statement for the widget.</p>
pub fn get_query_statement(&self) -> &::std::option::Option<::std::string::String> {
&self.query_statement
}
/// Appends an item to `query_parameters`.
///
/// To override the contents of this collection use [`set_query_parameters`](Self::set_query_parameters).
///
/// <p>The query parameters for the widget.</p>
pub fn query_parameters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.query_parameters.unwrap_or_default();
v.push(input.into());
self.query_parameters = ::std::option::Option::Some(v);
self
}
/// <p>The query parameters for the widget.</p>
pub fn set_query_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.query_parameters = input;
self
}
/// <p>The query parameters for the widget.</p>
pub fn get_query_parameters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.query_parameters
}
/// Adds a key-value pair to `view_properties`.
///
/// To override the contents of this collection use [`set_view_properties`](Self::set_view_properties).
///
/// <p>The view properties for the widget. For more information about view properties, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html"> View properties for widgets </a> in the <i>CloudTrail User Guide</i>..</p>
pub fn view_properties(
mut self,
k: impl ::std::convert::Into<::std::string::String>,
v: impl ::std::convert::Into<::std::string::String>,
) -> Self {
let mut hash_map = self.view_properties.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.view_properties = ::std::option::Option::Some(hash_map);
self
}
/// <p>The view properties for the widget. For more information about view properties, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html"> View properties for widgets </a> in the <i>CloudTrail User Guide</i>..</p>
pub fn set_view_properties(
mut self,
input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
) -> Self {
self.view_properties = input;
self
}
/// <p>The view properties for the widget. For more information about view properties, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html"> View properties for widgets </a> in the <i>CloudTrail User Guide</i>..</p>
pub fn get_view_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.view_properties
}
/// Consumes the builder and constructs a [`Widget`](crate::types::Widget).
pub fn build(self) -> crate::types::Widget {
crate::types::Widget {
query_alias: self.query_alias,
query_statement: self.query_statement,
query_parameters: self.query_parameters,
view_properties: self.view_properties,
}
}
}