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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A set of rules used to make a recommendation during an analysis.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Pattern {
/// <p>The universally unique identifier (UUID) of this pattern.</p>
pub id: ::std::option::Option<::std::string::String>,
/// <p>The name for this pattern.</p>
pub name: ::std::option::Option<::std::string::String>,
/// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
pub description: ::std::option::Option<::std::string::String>,
/// <p>A string that contains the steps recommended to address the potential inefficiency.</p>
pub resolution_steps: ::std::option::Option<::std::string::String>,
/// <p>A list of frame names that were searched during the analysis that generated a recommendation.</p>
pub target_frames: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
/// <p>The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis.</p>
pub threshold_percent: f64,
/// <p>A list of the different counters used to determine if there is a match.</p>
pub counters_to_aggregate: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl Pattern {
/// <p>The universally unique identifier (UUID) of this pattern.</p>
pub fn id(&self) -> ::std::option::Option<&str> {
self.id.as_deref()
}
/// <p>The name for this pattern.</p>
pub fn name(&self) -> ::std::option::Option<&str> {
self.name.as_deref()
}
/// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
pub fn description(&self) -> ::std::option::Option<&str> {
self.description.as_deref()
}
/// <p>A string that contains the steps recommended to address the potential inefficiency.</p>
pub fn resolution_steps(&self) -> ::std::option::Option<&str> {
self.resolution_steps.as_deref()
}
/// <p>A list of frame names that were searched during the analysis that generated a recommendation.</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 `.target_frames.is_none()`.
pub fn target_frames(&self) -> &[::std::vec::Vec<::std::string::String>] {
self.target_frames.as_deref().unwrap_or_default()
}
/// <p>The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis.</p>
pub fn threshold_percent(&self) -> f64 {
self.threshold_percent
}
/// <p>A list of the different counters used to determine if there is a match.</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 `.counters_to_aggregate.is_none()`.
pub fn counters_to_aggregate(&self) -> &[::std::string::String] {
self.counters_to_aggregate.as_deref().unwrap_or_default()
}
}
impl Pattern {
/// Creates a new builder-style object to manufacture [`Pattern`](crate::types::Pattern).
pub fn builder() -> crate::types::builders::PatternBuilder {
crate::types::builders::PatternBuilder::default()
}
}
/// A builder for [`Pattern`](crate::types::Pattern).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct PatternBuilder {
pub(crate) id: ::std::option::Option<::std::string::String>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) description: ::std::option::Option<::std::string::String>,
pub(crate) resolution_steps: ::std::option::Option<::std::string::String>,
pub(crate) target_frames: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>,
pub(crate) threshold_percent: ::std::option::Option<f64>,
pub(crate) counters_to_aggregate: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl PatternBuilder {
/// <p>The universally unique identifier (UUID) of this pattern.</p>
pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.id = ::std::option::Option::Some(input.into());
self
}
/// <p>The universally unique identifier (UUID) of this pattern.</p>
pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.id = input;
self
}
/// <p>The universally unique identifier (UUID) of this pattern.</p>
pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
&self.id
}
/// <p>The name for this pattern.</p>
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 for this pattern.</p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
/// <p>The name for this pattern.</p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
/// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.description = ::std::option::Option::Some(input.into());
self
}
/// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.description = input;
self
}
/// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
&self.description
}
/// <p>A string that contains the steps recommended to address the potential inefficiency.</p>
pub fn resolution_steps(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.resolution_steps = ::std::option::Option::Some(input.into());
self
}
/// <p>A string that contains the steps recommended to address the potential inefficiency.</p>
pub fn set_resolution_steps(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.resolution_steps = input;
self
}
/// <p>A string that contains the steps recommended to address the potential inefficiency.</p>
pub fn get_resolution_steps(&self) -> &::std::option::Option<::std::string::String> {
&self.resolution_steps
}
/// Appends an item to `target_frames`.
///
/// To override the contents of this collection use [`set_target_frames`](Self::set_target_frames).
///
/// <p>A list of frame names that were searched during the analysis that generated a recommendation.</p>
pub fn target_frames(mut self, input: ::std::vec::Vec<::std::string::String>) -> Self {
let mut v = self.target_frames.unwrap_or_default();
v.push(input);
self.target_frames = ::std::option::Option::Some(v);
self
}
/// <p>A list of frame names that were searched during the analysis that generated a recommendation.</p>
pub fn set_target_frames(mut self, input: ::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>>) -> Self {
self.target_frames = input;
self
}
/// <p>A list of frame names that were searched during the analysis that generated a recommendation.</p>
pub fn get_target_frames(&self) -> &::std::option::Option<::std::vec::Vec<::std::vec::Vec<::std::string::String>>> {
&self.target_frames
}
/// <p>The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis.</p>
pub fn threshold_percent(mut self, input: f64) -> Self {
self.threshold_percent = ::std::option::Option::Some(input);
self
}
/// <p>The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis.</p>
pub fn set_threshold_percent(mut self, input: ::std::option::Option<f64>) -> Self {
self.threshold_percent = input;
self
}
/// <p>The percentage of time an application spends in one method that triggers a recommendation. The percentage of time is the same as the percentage of the total gathered sample counts during analysis.</p>
pub fn get_threshold_percent(&self) -> &::std::option::Option<f64> {
&self.threshold_percent
}
/// Appends an item to `counters_to_aggregate`.
///
/// To override the contents of this collection use [`set_counters_to_aggregate`](Self::set_counters_to_aggregate).
///
/// <p>A list of the different counters used to determine if there is a match.</p>
pub fn counters_to_aggregate(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut v = self.counters_to_aggregate.unwrap_or_default();
v.push(input.into());
self.counters_to_aggregate = ::std::option::Option::Some(v);
self
}
/// <p>A list of the different counters used to determine if there is a match.</p>
pub fn set_counters_to_aggregate(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.counters_to_aggregate = input;
self
}
/// <p>A list of the different counters used to determine if there is a match.</p>
pub fn get_counters_to_aggregate(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
&self.counters_to_aggregate
}
/// Consumes the builder and constructs a [`Pattern`](crate::types::Pattern).
pub fn build(self) -> crate::types::Pattern {
crate::types::Pattern {
id: self.id,
name: self.name,
description: self.description,
resolution_steps: self.resolution_steps,
target_frames: self.target_frames,
threshold_percent: self.threshold_percent.unwrap_or_default(),
counters_to_aggregate: self.counters_to_aggregate,
}
}
}