rusoto_codeguruprofiler/
generated.rs

1// =================================================================
2//
3//                           * WARNING *
4//
5//                    This file is generated!
6//
7//  Changes made to this file will be overwritten. If changes are
8//  required to the generated code, the service_crategen project
9//  must be updated to generate the changes.
10//
11// =================================================================
12
13use std::error::Error;
14use std::fmt;
15
16use async_trait::async_trait;
17use rusoto_core::credential::ProvideAwsCredentials;
18use rusoto_core::region;
19use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
20use rusoto_core::{Client, RusotoError};
21
22use rusoto_core::param::{Params, ServiceParams};
23use rusoto_core::proto;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27use serde_json;
28/// <p>The structure representing the AddNotificationChannelsRequest.</p>
29#[derive(Clone, Debug, Default, PartialEq, Serialize)]
30#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
31pub struct AddNotificationChannelsRequest {
32    /// <p>One or 2 channels to report to when anomalies are detected.</p>
33    #[serde(rename = "channels")]
34    pub channels: Vec<Channel>,
35    /// <p>The name of the profiling group that we are setting up notifications for.</p>
36    #[serde(rename = "profilingGroupName")]
37    pub profiling_group_name: String,
38}
39
40/// <p>The structure representing the AddNotificationChannelsResponse.</p>
41#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
42#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
43pub struct AddNotificationChannelsResponse {
44    /// <p>The new notification configuration for this profiling group.</p>
45    #[serde(rename = "notificationConfiguration")]
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub notification_configuration: Option<NotificationConfiguration>,
48}
49
50/// <p> The response of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a> that specifies if an agent profiles or not and for how long to return profiling data. </p>
51#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
52#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
53pub struct AgentConfiguration {
54    /// <p><p> Parameters used by the profiler. The valid parameters are: </p> <ul> <li> <p> <code>MaxStackDepth</code> - The maximum depth of the stacks in the code that is represented in the profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the profiler evaluates <code>A</code> and <code>B</code>. </p> </li> <li> <p> <code>MemoryUsageLimitPercent</code> - The percentage of memory that is used by the profiler.</p> </li> <li> <p> <code>MinimumTimeForReportingInMilliseconds</code> - The minimum time in milliseconds between sending reports. </p> </li> <li> <p> <code>ReportingIntervalInMilliseconds</code> - The reporting interval in milliseconds used to report profiles. </p> </li> <li> <p> <code>SamplingIntervalInMilliseconds</code> - The sampling interval in milliseconds that is used to profile samples. </p> </li> </ul></p>
55    #[serde(rename = "agentParameters")]
56    #[serde(skip_serializing_if = "Option::is_none")]
57    pub agent_parameters: Option<::std::collections::HashMap<String, String>>,
58    /// <p> How long a profiling agent should send profiling data using <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a>. For example, if this is set to 300, the profiling agent calls <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a> every 5 minutes to submit the profiled data collected during that period. </p>
59    #[serde(rename = "periodInSeconds")]
60    pub period_in_seconds: i64,
61    /// <p> A <code>Boolean</code> that specifies whether the profiling agent collects profiling data or not. Set to <code>true</code> to enable profiling. </p>
62    #[serde(rename = "shouldProfile")]
63    pub should_profile: bool,
64}
65
66/// <p> Specifies whether profiling is enabled or disabled for a profiling group. It is used by <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a> to enable or disable profiling for a profiling group. </p>
67#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
68pub struct AgentOrchestrationConfig {
69    /// <p> A <code>Boolean</code> that specifies whether the profiling agent collects profiling data or not. Set to <code>true</code> to enable profiling. </p>
70    #[serde(rename = "profilingEnabled")]
71    pub profiling_enabled: bool,
72}
73
74/// <p> Specifies the aggregation period and aggregation start time for an aggregated profile. An aggregated profile is used to collect posted agent profiles during an aggregation period. There are three possible aggregation periods (1 day, 1 hour, or 5 minutes). </p>
75#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
76#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
77pub struct AggregatedProfileTime {
78    /// <p><p> The aggregation period. This indicates the period during which an aggregation profile collects posted agent profiles for a profiling group. Use one of three valid durations that are specified using the ISO 8601 format. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul></p>
79    #[serde(rename = "period")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub period: Option<String>,
82    /// <p> The time that aggregation of posted agent profiles for a profiling group starts. The aggregation profile contains profiles posted by the agent starting at this time for an aggregation period specified by the <code>period</code> property of the <code>AggregatedProfileTime</code> object. </p> <p> Specify <code>start</code> using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
83    #[serde(rename = "start")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub start: Option<f64>,
86}
87
88/// <p> Details about an anomaly in a specific metric of application profile. The anomaly is detected using analysis of the metric data over a period of time. </p>
89#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
90#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
91pub struct Anomaly {
92    /// <p> A list of the instances of the detected anomalies during the requested period. </p>
93    #[serde(rename = "instances")]
94    pub instances: Vec<AnomalyInstance>,
95    /// <p> Details about the metric that the analysis used when it detected the anomaly. The metric includes the name of the frame that was analyzed with the type and thread states used to derive the metric value for that frame. </p>
96    #[serde(rename = "metric")]
97    pub metric: Metric,
98    /// <p>The reason for which metric was flagged as anomalous.</p>
99    #[serde(rename = "reason")]
100    pub reason: String,
101}
102
103/// <p>The specific duration in which the metric is flagged as anomalous.</p>
104#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
105#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
106pub struct AnomalyInstance {
107    /// <p> The end time of the period during which the metric is flagged as anomalous. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
108    #[serde(rename = "endTime")]
109    #[serde(skip_serializing_if = "Option::is_none")]
110    pub end_time: Option<f64>,
111    /// <p> The universally unique identifier (UUID) of an instance of an anomaly in a metric. </p>
112    #[serde(rename = "id")]
113    pub id: String,
114    /// <p> The start time of the period during which the metric is flagged as anomalous. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
115    #[serde(rename = "startTime")]
116    pub start_time: f64,
117    /// <p>Feedback type on a specific instance of anomaly submitted by the user.</p>
118    #[serde(rename = "userFeedback")]
119    #[serde(skip_serializing_if = "Option::is_none")]
120    pub user_feedback: Option<UserFeedback>,
121}
122
123/// <p>The structure representing the BatchGetFrameMetricDataRequest.</p>
124#[derive(Clone, Debug, Default, PartialEq, Serialize)]
125#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
126pub struct BatchGetFrameMetricDataRequest {
127    /// <p> The end time of the time period for the returned time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
128    #[serde(rename = "endTime")]
129    #[serde(skip_serializing_if = "Option::is_none")]
130    pub end_time: Option<f64>,
131    /// <p> The details of the metrics that are used to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
132    #[serde(rename = "frameMetrics")]
133    #[serde(skip_serializing_if = "Option::is_none")]
134    pub frame_metrics: Option<Vec<FrameMetric>>,
135    /// <p> The duration of the frame metrics used to return the time series values. Specify using the ISO 8601 format. The maximum period duration is one day (<code>PT24H</code> or <code>P1D</code>). </p>
136    #[serde(rename = "period")]
137    #[serde(skip_serializing_if = "Option::is_none")]
138    pub period: Option<String>,
139    /// <p> The name of the profiling group associated with the the frame metrics used to return the time series values. </p>
140    #[serde(rename = "profilingGroupName")]
141    pub profiling_group_name: String,
142    /// <p> The start time of the time period for the frame metrics used to return the time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
143    #[serde(rename = "startTime")]
144    #[serde(skip_serializing_if = "Option::is_none")]
145    pub start_time: Option<f64>,
146    /// <p><p>The requested resolution of time steps for the returned time series of values. If the requested target resolution is not available due to data not being retained we provide a best effort result by falling back to the most granular available resolution after the target resolution. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul></p>
147    #[serde(rename = "targetResolution")]
148    #[serde(skip_serializing_if = "Option::is_none")]
149    pub target_resolution: Option<String>,
150}
151
152/// <p>The structure representing the BatchGetFrameMetricDataResponse.</p>
153#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
154#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
155pub struct BatchGetFrameMetricDataResponse {
156    /// <p> The end time of the time period for the returned time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
157    #[serde(rename = "endTime")]
158    pub end_time: f64,
159    /// <p> List of instances, or time steps, in the time series. For example, if the <code>period</code> is one day (<code>PT24H)</code>), and the <code>resolution</code> is five minutes (<code>PT5M</code>), then there are 288 <code>endTimes</code> in the list that are each five minutes appart. </p>
160    #[serde(rename = "endTimes")]
161    pub end_times: Vec<TimestampStructure>,
162    /// <p>Details of the metrics to request a time series of values. The metric includes the name of the frame, the aggregation type to calculate the metric value for the frame, and the thread states to use to get the count for the metric value of the frame.</p>
163    #[serde(rename = "frameMetricData")]
164    pub frame_metric_data: Vec<FrameMetricDatum>,
165    /// <p><p>Resolution or granularity of the profile data used to generate the time series. This is the value used to jump through time steps in a time series. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul></p>
166    #[serde(rename = "resolution")]
167    pub resolution: String,
168    /// <p> The start time of the time period for the returned time series values. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
169    #[serde(rename = "startTime")]
170    pub start_time: f64,
171    /// <p>List of instances which remained unprocessed. This will create a missing time step in the list of end times.</p>
172    #[serde(rename = "unprocessedEndTimes")]
173    pub unprocessed_end_times: ::std::collections::HashMap<String, Vec<TimestampStructure>>,
174}
175
176/// <p>Notification medium for users to get alerted for events that occur in application profile. We support SNS topic as a notification channel.</p>
177#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
178pub struct Channel {
179    /// <p>List of publishers for different type of events that may be detected in an application from the profile. Anomaly detection is the only event publisher in Profiler.</p>
180    #[serde(rename = "eventPublishers")]
181    pub event_publishers: Vec<String>,
182    /// <p>Unique identifier for each <code>Channel</code> in the notification configuration of a Profiling Group. A random UUID for channelId is used when adding a channel to the notification configuration if not specified in the request.</p>
183    #[serde(rename = "id")]
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub id: Option<String>,
186    /// <p>Unique arn of the resource to be used for notifications. We support a valid SNS topic arn as a channel uri.</p>
187    #[serde(rename = "uri")]
188    pub uri: String,
189}
190
191/// <p>The structure representing the configureAgentRequest.</p>
192#[derive(Clone, Debug, Default, PartialEq, Serialize)]
193#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
194pub struct ConfigureAgentRequest {
195    /// <p> A universally unique identifier (UUID) for a profiling instance. For example, if the profiling instance is an Amazon EC2 instance, it is the instance ID. If it is an AWS Fargate container, it is the container's task ID. </p>
196    #[serde(rename = "fleetInstanceId")]
197    #[serde(skip_serializing_if = "Option::is_none")]
198    pub fleet_instance_id: Option<String>,
199    /// <p><p> Metadata captured about the compute platform the agent is running on. It includes information about sampling and reporting. The valid fields are:</p> <ul> <li> <p> <code>COMPUTE<em>PLATFORM</code> - The compute platform on which the agent is running </p> </li> <li> <p> <code>AGENT</em>ID</code> - The ID for an agent instance. </p> </li> <li> <p> <code>AWS<em>REQUEST</em>ID</code> - The AWS request ID of a Lambda invocation. </p> </li> <li> <p> <code>EXECUTION<em>ENVIRONMENT</code> - The execution environment a Lambda function is running on. </p> </li> <li> <p> <code>LAMBDA</em>FUNCTION<em>ARN</code> - The Amazon Resource Name (ARN) that is used to invoke a Lambda function. </p> </li> <li> <p> <code>LAMBDA</em>MEMORY<em>LIMIT</em>IN<em>MB</code> - The memory allocated to a Lambda function. </p> </li> <li> <p> <code>LAMBDA</em>REMAINING<em>TIME</em>IN<em>MILLISECONDS</code> - The time in milliseconds before execution of a Lambda function times out. </p> </li> <li> <p> <code>LAMBDA</em>TIME<em>GAP</em>BETWEEN<em>INVOKES</em>IN<em>MILLISECONDS</code> - The time in milliseconds between two invocations of a Lambda function. </p> </li> <li> <p> <code>LAMBDA</em>PREVIOUS<em>EXECUTION</em>TIME<em>IN</em>MILLISECONDS</code> - The time in milliseconds for the previous Lambda invocation. </p> </li> </ul></p>
200    #[serde(rename = "metadata")]
201    #[serde(skip_serializing_if = "Option::is_none")]
202    pub metadata: Option<::std::collections::HashMap<String, String>>,
203    /// <p> The name of the profiling group for which the configured agent is collecting profiling data. </p>
204    #[serde(rename = "profilingGroupName")]
205    pub profiling_group_name: String,
206}
207
208/// <p>The structure representing the configureAgentResponse.</p>
209#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
210#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
211pub struct ConfigureAgentResponse {
212    /// <p> An <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentConfiguration.html"> <code>AgentConfiguration</code> </a> object that specifies if an agent profiles or not and for how long to return profiling data. </p>
213    #[serde(rename = "configuration")]
214    pub configuration: AgentConfiguration,
215}
216
217/// <p>The structure representing the createProfiliingGroupRequest.</p>
218#[derive(Clone, Debug, Default, PartialEq, Serialize)]
219#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
220pub struct CreateProfilingGroupRequest {
221    /// <p> Specifies whether profiling is enabled or disabled for the created profiling group. </p>
222    #[serde(rename = "agentOrchestrationConfig")]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub agent_orchestration_config: Option<AgentOrchestrationConfig>,
225    /// <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental creation of duplicate profiling groups if there are failures and retries. </p>
226    #[serde(rename = "clientToken")]
227    pub client_token: String,
228    /// <p> The compute platform of the profiling group. Use <code>AWSLambda</code> if your application runs on AWS Lambda. Use <code>Default</code> if your application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. If not specified, <code>Default</code> is used. </p>
229    #[serde(rename = "computePlatform")]
230    #[serde(skip_serializing_if = "Option::is_none")]
231    pub compute_platform: Option<String>,
232    /// <p>The name of the profiling group to create.</p>
233    #[serde(rename = "profilingGroupName")]
234    pub profiling_group_name: String,
235}
236
237/// <p>The structure representing the createProfilingGroupResponse.</p>
238#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
239#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
240pub struct CreateProfilingGroupResponse {
241    /// <p> The returned <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> object that contains information about the created profiling group. </p>
242    #[serde(rename = "profilingGroup")]
243    pub profiling_group: ProfilingGroupDescription,
244}
245
246/// <p>The structure representing the deleteProfilingGroupRequest.</p>
247#[derive(Clone, Debug, Default, PartialEq, Serialize)]
248#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
249pub struct DeleteProfilingGroupRequest {
250    /// <p>The name of the profiling group to delete.</p>
251    #[serde(rename = "profilingGroupName")]
252    pub profiling_group_name: String,
253}
254
255/// <p>The structure representing the deleteProfilingGroupResponse.</p>
256#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
257#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
258pub struct DeleteProfilingGroupResponse {}
259
260/// <p>The structure representing the describeProfilingGroupRequest.</p>
261#[derive(Clone, Debug, Default, PartialEq, Serialize)]
262#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
263pub struct DescribeProfilingGroupRequest {
264    /// <p> The name of the profiling group to get information about. </p>
265    #[serde(rename = "profilingGroupName")]
266    pub profiling_group_name: String,
267}
268
269/// <p>The structure representing the describeProfilingGroupResponse.</p>
270#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
271#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
272pub struct DescribeProfilingGroupResponse {
273    /// <p> The returned <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> object that contains information about the requested profiling group. </p>
274    #[serde(rename = "profilingGroup")]
275    pub profiling_group: ProfilingGroupDescription,
276}
277
278/// <p> Information about potential recommendations that might be created from the analysis of profiling data. </p>
279#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
280#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
281pub struct FindingsReportSummary {
282    /// <p>The universally unique identifier (UUID) of the recommendation report.</p>
283    #[serde(rename = "id")]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub id: Option<String>,
286    /// <p> The end time of the period during which the metric is flagged as anomalous. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
287    #[serde(rename = "profileEndTime")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub profile_end_time: Option<f64>,
290    /// <p>The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
291    #[serde(rename = "profileStartTime")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub profile_start_time: Option<f64>,
294    /// <p>The name of the profiling group that is associated with the analysis data.</p>
295    #[serde(rename = "profilingGroupName")]
296    #[serde(skip_serializing_if = "Option::is_none")]
297    pub profiling_group_name: Option<String>,
298    /// <p>The total number of different recommendations that were found by the analysis.</p>
299    #[serde(rename = "totalNumberOfFindings")]
300    #[serde(skip_serializing_if = "Option::is_none")]
301    pub total_number_of_findings: Option<i64>,
302}
303
304/// <p> The frame name, metric type, and thread states. These are used to derive the value of the metric for the frame.</p>
305#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
306pub struct FrameMetric {
307    /// <p> Name of the method common across the multiple occurrences of a frame in an application profile.</p>
308    #[serde(rename = "frameName")]
309    pub frame_name: String,
310    /// <p>List of application runtime thread states used to get the counts for a frame a derive a metric value.</p>
311    #[serde(rename = "threadStates")]
312    pub thread_states: Vec<String>,
313    /// <p> A type of aggregation that specifies how a metric for a frame is analyzed. The supported value <code>AggregatedRelativeTotalTime</code> is an aggregation of the metric value for one frame that is calculated across the occurrences of all frames in a profile. </p>
314    #[serde(rename = "type")]
315    pub type_: String,
316}
317
318/// <p> Information about a frame metric and its values. </p>
319#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
320#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
321pub struct FrameMetricDatum {
322    #[serde(rename = "frameMetric")]
323    pub frame_metric: FrameMetric,
324    /// <p> A list of values that are associated with a frame metric. </p>
325    #[serde(rename = "values")]
326    pub values: Vec<f64>,
327}
328
329/// <p>The structure representing the GetFindingsReportAccountSummaryRequest.</p>
330#[derive(Clone, Debug, Default, PartialEq, Serialize)]
331#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
332pub struct GetFindingsReportAccountSummaryRequest {
333    /// <p>A <code>Boolean</code> value indicating whether to only return reports from daily profiles. If set to <code>True</code>, only analysis data from daily profiles is returned. If set to <code>False</code>, analysis data is returned from smaller time windows (for example, one hour).</p>
334    #[serde(rename = "dailyReportsOnly")]
335    #[serde(skip_serializing_if = "Option::is_none")]
336    pub daily_reports_only: Option<bool>,
337    /// <p>The maximum number of results returned by <code> GetFindingsReportAccountSummary</code> in paginated output. When this parameter is used, <code>GetFindingsReportAccountSummary</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>GetFindingsReportAccountSummary</code> request with the returned <code>nextToken</code> value.</p>
338    #[serde(rename = "maxResults")]
339    #[serde(skip_serializing_if = "Option::is_none")]
340    pub max_results: Option<i64>,
341    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>GetFindingsReportAccountSummary</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
342    #[serde(rename = "nextToken")]
343    #[serde(skip_serializing_if = "Option::is_none")]
344    pub next_token: Option<String>,
345}
346
347/// <p>The structure representing the GetFindingsReportAccountSummaryResponse.</p>
348#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
349#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
350pub struct GetFindingsReportAccountSummaryResponse {
351    /// <p>The <code>nextToken</code> value to include in a future <code>GetFindingsReportAccountSummary</code> request. When the results of a <code>GetFindingsReportAccountSummary</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
352    #[serde(rename = "nextToken")]
353    #[serde(skip_serializing_if = "Option::is_none")]
354    pub next_token: Option<String>,
355    /// <p>The return list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_FindingsReportSummary.html"> <code>FindingsReportSummary</code> </a> objects taht contain summaries of analysis results for all profiling groups in your AWS account.</p>
356    #[serde(rename = "reportSummaries")]
357    pub report_summaries: Vec<FindingsReportSummary>,
358}
359
360/// <p>The structure representing the GetNotificationConfigurationRequest.</p>
361#[derive(Clone, Debug, Default, PartialEq, Serialize)]
362#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
363pub struct GetNotificationConfigurationRequest {
364    /// <p>The name of the profiling group we want to get the notification configuration for.</p>
365    #[serde(rename = "profilingGroupName")]
366    pub profiling_group_name: String,
367}
368
369/// <p>The structure representing the GetNotificationConfigurationResponse.</p>
370#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
371#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
372pub struct GetNotificationConfigurationResponse {
373    /// <p>The current notification configuration for this profiling group.</p>
374    #[serde(rename = "notificationConfiguration")]
375    pub notification_configuration: NotificationConfiguration,
376}
377
378/// <p> The structure representing the <code>getPolicyRequest</code>. </p>
379#[derive(Clone, Debug, Default, PartialEq, Serialize)]
380#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
381pub struct GetPolicyRequest {
382    /// <p>The name of the profiling group.</p>
383    #[serde(rename = "profilingGroupName")]
384    pub profiling_group_name: String,
385}
386
387/// <p>The structure representing the <code>getPolicyResponse</code>.</p>
388#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
389#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
390pub struct GetPolicyResponse {
391    /// <p>The JSON-formatted resource-based policy attached to the <code>ProfilingGroup</code>.</p>
392    #[serde(rename = "policy")]
393    pub policy: String,
394    /// <p>A unique identifier for the current revision of the returned policy.</p>
395    #[serde(rename = "revisionId")]
396    pub revision_id: String,
397}
398
399/// <p>The structure representing the getProfileRequest.</p>
400#[derive(Clone, Debug, Default, PartialEq, Serialize)]
401#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
402pub struct GetProfileRequest {
403    /// <p><p> The format of the returned profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <pre><code> &lt;ul&gt; &lt;li&gt; &lt;p&gt; &lt;code&gt;application/json&lt;/code&gt; — standard JSON format &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; &lt;code&gt;application/x-amzn-ion&lt;/code&gt; — the Amazon Ion data format. For more information, see &lt;a href=&quot;http://amzn.github.io/ion-docs/&quot;&gt;Amazon Ion&lt;/a&gt;. &lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre></p>
404    #[serde(rename = "accept")]
405    #[serde(skip_serializing_if = "Option::is_none")]
406    pub accept: Option<String>,
407    /// <p> The end time of the requested profile. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p> <p> If you specify <code>endTime</code>, then you must also specify <code>period</code> or <code>startTime</code>, but not both. </p>
408    #[serde(rename = "endTime")]
409    #[serde(skip_serializing_if = "Option::is_none")]
410    pub end_time: Option<f64>,
411    /// <p> The maximum depth of the stacks in the code that is represented in the aggregated profile. For example, if CodeGuru Profiler finds a method <code>A</code>, which calls method <code>B</code>, which calls method <code>C</code>, which calls method <code>D</code>, then the depth is 4. If the <code>maxDepth</code> is set to 2, then the aggregated profile contains representations of methods <code>A</code> and <code>B</code>. </p>
412    #[serde(rename = "maxDepth")]
413    #[serde(skip_serializing_if = "Option::is_none")]
414    pub max_depth: Option<i64>,
415    /// <p><p> Used with <code>startTime</code> or <code>endTime</code> to specify the time range for the returned aggregated profile. Specify using the ISO 8601 format. For example, <code>P1DT1H1M1S</code>. </p> <pre><code> &lt;p&gt; To get the latest aggregated profile, specify only &lt;code&gt;period&lt;/code&gt;. &lt;/p&gt; </code></pre></p>
416    #[serde(rename = "period")]
417    #[serde(skip_serializing_if = "Option::is_none")]
418    pub period: Option<String>,
419    /// <p>The name of the profiling group to get.</p>
420    #[serde(rename = "profilingGroupName")]
421    pub profiling_group_name: String,
422    /// <p><p>The start time of the profile to get. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p> <pre><code> &lt;p&gt; If you specify &lt;code&gt;startTime&lt;/code&gt;, then you must also specify &lt;code&gt;period&lt;/code&gt; or &lt;code&gt;endTime&lt;/code&gt;, but not both. &lt;/p&gt; </code></pre></p>
423    #[serde(rename = "startTime")]
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub start_time: Option<f64>,
426}
427
428/// <p>The structure representing the getProfileResponse.</p>
429#[derive(Clone, Debug, Default, PartialEq)]
430pub struct GetProfileResponse {
431    /// <p>The content encoding of the profile.</p>
432    pub content_encoding: Option<String>,
433    /// <p>The content type of the profile in the payload. It is either <code>application/json</code> or the default <code>application/x-amzn-ion</code>.</p>
434    pub content_type: String,
435    /// <p>Information about the profile.</p>
436    pub profile: bytes::Bytes,
437}
438
439/// <p>The structure representing the GetRecommendationsRequest.</p>
440#[derive(Clone, Debug, Default, PartialEq, Serialize)]
441#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
442pub struct GetRecommendationsRequest {
443    /// <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
444    #[serde(rename = "endTime")]
445    pub end_time: f64,
446    /// <p><p> The language used to provide analysis. Specify using a string that is one of the following <code>BCP 47</code> language codes. </p> <ul> <li> <p> <code>de-DE</code> - German, Germany </p> </li> <li> <p> <code>en-GB</code> - English, United Kingdom </p> </li> <li> <p> <code>en-US</code> - English, United States </p> </li> <li> <p> <code>es-ES</code> - Spanish, Spain </p> </li> <li> <p> <code>fr-FR</code> - French, France </p> </li> <li> <p> <code>it-IT</code> - Italian, Italy </p> </li> <li> <p> <code>ja-JP</code> - Japanese, Japan </p> </li> <li> <p> <code>ko-KR</code> - Korean, Republic of Korea </p> </li> <li> <p> <code>pt-BR</code> - Portugese, Brazil </p> </li> <li> <p> <code>zh-CN</code> - Chinese, China </p> </li> <li> <p> <code>zh-TW</code> - Chinese, Taiwan </p> </li> </ul></p>
447    #[serde(rename = "locale")]
448    #[serde(skip_serializing_if = "Option::is_none")]
449    pub locale: Option<String>,
450    /// <p> The name of the profiling group to get analysis data about. </p>
451    #[serde(rename = "profilingGroupName")]
452    pub profiling_group_name: String,
453    /// <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
454    #[serde(rename = "startTime")]
455    pub start_time: f64,
456}
457
458/// <p>The structure representing the GetRecommendationsResponse.</p>
459#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
460#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
461pub struct GetRecommendationsResponse {
462    /// <p> The list of anomalies that the analysis has found for this profile. </p>
463    #[serde(rename = "anomalies")]
464    pub anomalies: Vec<Anomaly>,
465    /// <p> The end time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
466    #[serde(rename = "profileEndTime")]
467    pub profile_end_time: f64,
468    /// <p> The start time of the profile the analysis data is about. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
469    #[serde(rename = "profileStartTime")]
470    pub profile_start_time: f64,
471    /// <p>The name of the profiling group the analysis data is about.</p>
472    #[serde(rename = "profilingGroupName")]
473    pub profiling_group_name: String,
474    /// <p>The list of recommendations that the analysis found for this profile.</p>
475    #[serde(rename = "recommendations")]
476    pub recommendations: Vec<Recommendation>,
477}
478
479/// <p>The structure representing the ListFindingsReportsRequest.</p>
480#[derive(Clone, Debug, Default, PartialEq, Serialize)]
481#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
482pub struct ListFindingsReportsRequest {
483    /// <p>A <code>Boolean</code> value indicating whether to only return reports from daily profiles. If set to <code>True</code>, only analysis data from daily profiles is returned. If set to <code>False</code>, analysis data is returned from smaller time windows (for example, one hour).</p>
484    #[serde(rename = "dailyReportsOnly")]
485    #[serde(skip_serializing_if = "Option::is_none")]
486    pub daily_reports_only: Option<bool>,
487    /// <p> The end time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
488    #[serde(rename = "endTime")]
489    pub end_time: f64,
490    /// <p>The maximum number of report results returned by <code>ListFindingsReports</code> in paginated output. When this parameter is used, <code>ListFindingsReports</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListFindingsReports</code> request with the returned <code>nextToken</code> value.</p>
491    #[serde(rename = "maxResults")]
492    #[serde(skip_serializing_if = "Option::is_none")]
493    pub max_results: Option<i64>,
494    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>ListFindingsReportsRequest</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
495    #[serde(rename = "nextToken")]
496    #[serde(skip_serializing_if = "Option::is_none")]
497    pub next_token: Option<String>,
498    /// <p>The name of the profiling group from which to search for analysis data.</p>
499    #[serde(rename = "profilingGroupName")]
500    pub profiling_group_name: String,
501    /// <p> The start time of the profile to get analysis data about. You must specify <code>startTime</code> and <code>endTime</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
502    #[serde(rename = "startTime")]
503    pub start_time: f64,
504}
505
506/// <p>The structure representing the ListFindingsReportsResponse.</p>
507#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
508#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
509pub struct ListFindingsReportsResponse {
510    /// <p>The list of analysis results summaries.</p>
511    #[serde(rename = "findingsReportSummaries")]
512    pub findings_report_summaries: Vec<FindingsReportSummary>,
513    /// <p>The <code>nextToken</code> value to include in a future <code>ListFindingsReports</code> request. When the results of a <code>ListFindingsReports</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return.</p>
514    #[serde(rename = "nextToken")]
515    #[serde(skip_serializing_if = "Option::is_none")]
516    pub next_token: Option<String>,
517}
518
519/// <p>The structure representing the listProfileTimesRequest.</p>
520#[derive(Clone, Debug, Default, PartialEq, Serialize)]
521#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
522pub struct ListProfileTimesRequest {
523    /// <p>The end time of the time range from which to list the profiles.</p>
524    #[serde(rename = "endTime")]
525    pub end_time: f64,
526    /// <p>The maximum number of profile time results returned by <code>ListProfileTimes</code> in paginated output. When this parameter is used, <code>ListProfileTimes</code> only returns <code>maxResults</code> results in a single page with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfileTimes</code> request with the returned <code>nextToken</code> value. </p>
527    #[serde(rename = "maxResults")]
528    #[serde(skip_serializing_if = "Option::is_none")]
529    pub max_results: Option<i64>,
530    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfileTimes</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
531    #[serde(rename = "nextToken")]
532    #[serde(skip_serializing_if = "Option::is_none")]
533    pub next_token: Option<String>,
534    /// <p>The order (ascending or descending by start time of the profile) to use when listing profiles. Defaults to <code>TIMESTAMP_DESCENDING</code>. </p>
535    #[serde(rename = "orderBy")]
536    #[serde(skip_serializing_if = "Option::is_none")]
537    pub order_by: Option<String>,
538    /// <p><p> The aggregation period. This specifies the period during which an aggregation profile collects posted agent profiles for a profiling group. There are 3 valid values. </p> <ul> <li> <p> <code>P1D</code> — 1 day </p> </li> <li> <p> <code>PT1H</code> — 1 hour </p> </li> <li> <p> <code>PT5M</code> — 5 minutes </p> </li> </ul></p>
539    #[serde(rename = "period")]
540    pub period: String,
541    /// <p>The name of the profiling group.</p>
542    #[serde(rename = "profilingGroupName")]
543    pub profiling_group_name: String,
544    /// <p>The start time of the time range from which to list the profiles.</p>
545    #[serde(rename = "startTime")]
546    pub start_time: f64,
547}
548
549/// <p>The structure representing the listProfileTimesResponse.</p>
550#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
551#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
552pub struct ListProfileTimesResponse {
553    /// <p>The <code>nextToken</code> value to include in a future <code>ListProfileTimes</code> request. When the results of a <code>ListProfileTimes</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return. </p>
554    #[serde(rename = "nextToken")]
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub next_token: Option<String>,
557    /// <p>The list of start times of the available profiles for the aggregation period in the specified time range. </p>
558    #[serde(rename = "profileTimes")]
559    pub profile_times: Vec<ProfileTime>,
560}
561
562/// <p>The structure representing the listProfilingGroupsRequest.</p>
563#[derive(Clone, Debug, Default, PartialEq, Serialize)]
564#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
565pub struct ListProfilingGroupsRequest {
566    /// <p>A <code>Boolean</code> value indicating whether to include a description. If <code>true</code>, then a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects that contain detailed information about profiling groups is returned. If <code>false</code>, then a list of profiling group names is returned.</p>
567    #[serde(rename = "includeDescription")]
568    #[serde(skip_serializing_if = "Option::is_none")]
569    pub include_description: Option<bool>,
570    /// <p>The maximum number of profiling groups results returned by <code>ListProfilingGroups</code> in paginated output. When this parameter is used, <code>ListProfilingGroups</code> only returns <code>maxResults</code> results in a single page along with a <code>nextToken</code> response element. The remaining results of the initial request can be seen by sending another <code>ListProfilingGroups</code> request with the returned <code>nextToken</code> value. </p>
571    #[serde(rename = "maxResults")]
572    #[serde(skip_serializing_if = "Option::is_none")]
573    pub max_results: Option<i64>,
574    /// <p><p>The <code>nextToken</code> value returned from a previous paginated <code>ListProfilingGroups</code> request where <code>maxResults</code> was used and the results exceeded the value of that parameter. Pagination continues from the end of the previous results that returned the <code>nextToken</code> value. </p> <note> <p>This token should be treated as an opaque identifier that is only used to retrieve the next items in a list and not for other programmatic purposes.</p> </note></p>
575    #[serde(rename = "nextToken")]
576    #[serde(skip_serializing_if = "Option::is_none")]
577    pub next_token: Option<String>,
578}
579
580/// <p>The structure representing the listProfilingGroupsResponse.</p>
581#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
582#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
583pub struct ListProfilingGroupsResponse {
584    /// <p>The <code>nextToken</code> value to include in a future <code>ListProfilingGroups</code> request. When the results of a <code>ListProfilingGroups</code> request exceed <code>maxResults</code>, this value can be used to retrieve the next page of results. This value is <code>null</code> when there are no more results to return. </p>
585    #[serde(rename = "nextToken")]
586    #[serde(skip_serializing_if = "Option::is_none")]
587    pub next_token: Option<String>,
588    /// <p> A returned list of profiling group names. A list of the names is returned only if <code>includeDescription</code> is <code>false</code>, otherwise a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects is returned. </p>
589    #[serde(rename = "profilingGroupNames")]
590    pub profiling_group_names: Vec<String>,
591    /// <p> A returned list <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects. A list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects is returned only if <code>includeDescription</code> is <code>true</code>, otherwise a list of profiling group names is returned. </p>
592    #[serde(rename = "profilingGroups")]
593    #[serde(skip_serializing_if = "Option::is_none")]
594    pub profiling_groups: Option<Vec<ProfilingGroupDescription>>,
595}
596
597/// <p>The part of a profile that contains a recommendation found during analysis.</p>
598#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
599#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
600pub struct Match {
601    /// <p>The location in the profiling graph that contains a recommendation found during analysis.</p>
602    #[serde(rename = "frameAddress")]
603    #[serde(skip_serializing_if = "Option::is_none")]
604    pub frame_address: Option<String>,
605    /// <p>The target frame that triggered a match.</p>
606    #[serde(rename = "targetFramesIndex")]
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub target_frames_index: Option<i64>,
609    /// <p>The value in the profile data that exceeded the recommendation threshold.</p>
610    #[serde(rename = "thresholdBreachValue")]
611    #[serde(skip_serializing_if = "Option::is_none")]
612    pub threshold_breach_value: Option<f64>,
613}
614
615/// <p> Details about the metric that the analysis used when it detected the anomaly. The metric what is analyzed to create recommendations. It includes the name of the frame that was analyzed and the type and thread states used to derive the metric value for that frame. </p>
616#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
617#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
618pub struct Metric {
619    /// <p> The name of the method that appears as a frame in any stack in a profile. </p>
620    #[serde(rename = "frameName")]
621    pub frame_name: String,
622    /// <p> The list of application runtime thread states that is used to calculate the metric value for the frame. </p>
623    #[serde(rename = "threadStates")]
624    pub thread_states: Vec<String>,
625    /// <p> A type that specifies how a metric for a frame is analyzed. The supported value <code>AggregatedRelativeTotalTime</code> is an aggregation of the metric value for one frame that is calculated across the occurences of all frames in a profile.</p>
626    #[serde(rename = "type")]
627    pub type_: String,
628}
629
630/// <p>The configuration for notifications stored for each profiling group. This includes up to to two channels and a list of event publishers associated with each channel.</p>
631#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
632#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
633pub struct NotificationConfiguration {
634    /// <p>List of up to two channels to be used for sending notifications for events detected from the application profile.</p>
635    #[serde(rename = "channels")]
636    #[serde(skip_serializing_if = "Option::is_none")]
637    pub channels: Option<Vec<Channel>>,
638}
639
640/// <p> A set of rules used to make a recommendation during an analysis. </p>
641#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
642#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
643pub struct Pattern {
644    /// <p> A list of the different counters used to determine if there is a match. </p>
645    #[serde(rename = "countersToAggregate")]
646    #[serde(skip_serializing_if = "Option::is_none")]
647    pub counters_to_aggregate: Option<Vec<String>>,
648    /// <p>The description of the recommendation. This explains a potential inefficiency in a profiled application.</p>
649    #[serde(rename = "description")]
650    #[serde(skip_serializing_if = "Option::is_none")]
651    pub description: Option<String>,
652    /// <p>The universally unique identifier (UUID) of this pattern.</p>
653    #[serde(rename = "id")]
654    #[serde(skip_serializing_if = "Option::is_none")]
655    pub id: Option<String>,
656    /// <p>The name for this pattern.</p>
657    #[serde(rename = "name")]
658    #[serde(skip_serializing_if = "Option::is_none")]
659    pub name: Option<String>,
660    /// <p> A string that contains the steps recommended to address the potential inefficiency. </p>
661    #[serde(rename = "resolutionSteps")]
662    #[serde(skip_serializing_if = "Option::is_none")]
663    pub resolution_steps: Option<String>,
664    /// <p>A list of frame names that were searched during the analysis that generated a recommendation.</p>
665    #[serde(rename = "targetFrames")]
666    #[serde(skip_serializing_if = "Option::is_none")]
667    pub target_frames: Option<Vec<Vec<String>>>,
668    /// <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>
669    #[serde(rename = "thresholdPercent")]
670    #[serde(skip_serializing_if = "Option::is_none")]
671    pub threshold_percent: Option<f64>,
672}
673
674/// <p>The structure representing the postAgentProfileRequest.</p>
675#[derive(Clone, Debug, Default, PartialEq, Serialize)]
676#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
677pub struct PostAgentProfileRequest {
678    /// <p> The submitted profiling data. </p>
679    #[serde(rename = "agentProfile")]
680    #[serde(
681        deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
682        serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
683        default
684    )]
685    pub agent_profile: bytes::Bytes,
686    /// <p><p> The format of the submitted profiling data. The format maps to the <code>Accept</code> and <code>Content-Type</code> headers of the HTTP request. You can specify one of the following: or the default . </p> <pre><code> &lt;ul&gt; &lt;li&gt; &lt;p&gt; &lt;code&gt;application/json&lt;/code&gt; — standard JSON format &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; &lt;code&gt;application/x-amzn-ion&lt;/code&gt; — the Amazon Ion data format. For more information, see &lt;a href=&quot;http://amzn.github.io/ion-docs/&quot;&gt;Amazon Ion&lt;/a&gt;. &lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre></p>
687    #[serde(rename = "contentType")]
688    pub content_type: String,
689    /// <p> Amazon CodeGuru Profiler uses this universally unique identifier (UUID) to prevent the accidental submission of duplicate profiling data if there are failures and retries. </p>
690    #[serde(rename = "profileToken")]
691    #[serde(skip_serializing_if = "Option::is_none")]
692    pub profile_token: Option<String>,
693    /// <p> The name of the profiling group with the aggregated profile that receives the submitted profiling data. </p>
694    #[serde(rename = "profilingGroupName")]
695    pub profiling_group_name: String,
696}
697
698/// <p>The structure representing the postAgentProfileResponse.</p>
699#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
700#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
701pub struct PostAgentProfileResponse {}
702
703/// <p> Contains the start time of a profile. </p>
704#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
705#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
706pub struct ProfileTime {
707    /// <p>The start time of a profile. It is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
708    #[serde(rename = "start")]
709    #[serde(skip_serializing_if = "Option::is_none")]
710    pub start: Option<f64>,
711}
712
713/// <p> Contains information about a profiling group. </p>
714#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
715#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
716pub struct ProfilingGroupDescription {
717    /// <p> An <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AgentOrchestrationConfig.html"> <code>AgentOrchestrationConfig</code> </a> object that indicates if the profiling group is enabled for profiled or not. </p>
718    #[serde(rename = "agentOrchestrationConfig")]
719    #[serde(skip_serializing_if = "Option::is_none")]
720    pub agent_orchestration_config: Option<AgentOrchestrationConfig>,
721    /// <p>The Amazon Resource Name (ARN) identifying the profiling group resource.</p>
722    #[serde(rename = "arn")]
723    #[serde(skip_serializing_if = "Option::is_none")]
724    pub arn: Option<String>,
725    /// <p> The compute platform of the profiling group. If it is set to <code>AWSLambda</code>, then the profiled application runs on AWS Lambda. If it is set to <code>Default</code>, then the profiled application runs on a compute platform that is not AWS Lambda, such an Amazon EC2 instance, an on-premises server, or a different platform. The default is <code>Default</code>. </p>
726    #[serde(rename = "computePlatform")]
727    #[serde(skip_serializing_if = "Option::is_none")]
728    pub compute_platform: Option<String>,
729    /// <p>The time when the profiling group was created. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
730    #[serde(rename = "createdAt")]
731    #[serde(skip_serializing_if = "Option::is_none")]
732    pub created_at: Option<f64>,
733    /// <p>The name of the profiling group.</p>
734    #[serde(rename = "name")]
735    #[serde(skip_serializing_if = "Option::is_none")]
736    pub name: Option<String>,
737    /// <p> A <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingStatus.html"> <code>ProfilingStatus</code> </a> object that includes information about the last time a profile agent pinged back, the last time a profile was received, and the aggregation period and start time for the most recent aggregated profile. </p>
738    #[serde(rename = "profilingStatus")]
739    #[serde(skip_serializing_if = "Option::is_none")]
740    pub profiling_status: Option<ProfilingStatus>,
741    /// <p> The date and time when the profiling group was last updated. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
742    #[serde(rename = "updatedAt")]
743    #[serde(skip_serializing_if = "Option::is_none")]
744    pub updated_at: Option<f64>,
745}
746
747/// <p> Profiling status includes information about the last time a profile agent pinged back, the last time a profile was received, and the aggregation period and start time for the most recent aggregated profile. </p>
748#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
749#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
750pub struct ProfilingStatus {
751    /// <p>The date and time when the profiling agent most recently pinged back. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
752    #[serde(rename = "latestAgentOrchestratedAt")]
753    #[serde(skip_serializing_if = "Option::is_none")]
754    pub latest_agent_orchestrated_at: Option<f64>,
755    /// <p>The date and time when the most recent profile was received. Specify using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
756    #[serde(rename = "latestAgentProfileReportedAt")]
757    #[serde(skip_serializing_if = "Option::is_none")]
758    pub latest_agent_profile_reported_at: Option<f64>,
759    /// <p> An <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AggregatedProfileTime.html"> <code>AggregatedProfileTime</code> </a> object that contains the aggregation period and start time for an aggregated profile. </p>
760    #[serde(rename = "latestAggregatedProfile")]
761    #[serde(skip_serializing_if = "Option::is_none")]
762    pub latest_aggregated_profile: Option<AggregatedProfileTime>,
763}
764
765/// <p>The structure representing the <code>putPermissionRequest</code>.</p>
766#[derive(Clone, Debug, Default, PartialEq, Serialize)]
767#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
768pub struct PutPermissionRequest {
769    /// <p> Specifies an action group that contains permissions to add to a profiling group resource. One action group is supported, <code>agentPermissions</code>, which grants permission to perform actions required by the profiling agent, <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
770    #[serde(rename = "actionGroup")]
771    pub action_group: String,
772    /// <p> A list ARNs for the roles and users you want to grant access to the profiling group. Wildcards are not are supported in the ARNs. </p>
773    #[serde(rename = "principals")]
774    pub principals: Vec<String>,
775    /// <p>The name of the profiling group to grant access to.</p>
776    #[serde(rename = "profilingGroupName")]
777    pub profiling_group_name: String,
778    /// <p> A universally unique identifier (UUID) for the revision of the policy you are adding to the profiling group. Do not specify this when you add permissions to a profiling group for the first time. If a policy already exists on the profiling group, you must specify the <code>revisionId</code>. </p>
779    #[serde(rename = "revisionId")]
780    #[serde(skip_serializing_if = "Option::is_none")]
781    pub revision_id: Option<String>,
782}
783
784/// <p>The structure representing the <code>putPermissionResponse</code>.</p>
785#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
786#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
787pub struct PutPermissionResponse {
788    /// <p> The JSON-formatted resource-based policy on the profiling group that includes the added permissions. </p>
789    #[serde(rename = "policy")]
790    pub policy: String,
791    /// <p> A universally unique identifier (UUID) for the revision of the resource-based policy that includes the added permissions. The JSON-formatted policy is in the <code>policy</code> element of the response. </p>
792    #[serde(rename = "revisionId")]
793    pub revision_id: String,
794}
795
796/// <p>A potential improvement that was found from analyzing the profiling data.</p>
797#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
798#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
799pub struct Recommendation {
800    /// <p>How many different places in the profile graph triggered a match.</p>
801    #[serde(rename = "allMatchesCount")]
802    pub all_matches_count: i64,
803    /// <p>How much of the total sample count is potentially affected.</p>
804    #[serde(rename = "allMatchesSum")]
805    pub all_matches_sum: f64,
806    /// <p>End time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
807    #[serde(rename = "endTime")]
808    pub end_time: f64,
809    /// <p>The pattern that analysis recognized in the profile to make this recommendation.</p>
810    #[serde(rename = "pattern")]
811    pub pattern: Pattern,
812    /// <p>The start time of the profile that was used by this analysis. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC.</p>
813    #[serde(rename = "startTime")]
814    pub start_time: f64,
815    /// <p>List of the matches with most impact. </p>
816    #[serde(rename = "topMatches")]
817    pub top_matches: Vec<Match>,
818}
819
820/// <p>The structure representing the RemoveNotificationChannelRequest.</p>
821#[derive(Clone, Debug, Default, PartialEq, Serialize)]
822#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
823pub struct RemoveNotificationChannelRequest {
824    /// <p>The id of the channel that we want to stop receiving notifications.</p>
825    #[serde(rename = "channelId")]
826    pub channel_id: String,
827    /// <p>The name of the profiling group we want to change notification configuration for.</p>
828    #[serde(rename = "profilingGroupName")]
829    pub profiling_group_name: String,
830}
831
832/// <p>The structure representing the RemoveNotificationChannelResponse.</p>
833#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
834#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
835pub struct RemoveNotificationChannelResponse {
836    /// <p>The new notification configuration for this profiling group.</p>
837    #[serde(rename = "notificationConfiguration")]
838    #[serde(skip_serializing_if = "Option::is_none")]
839    pub notification_configuration: Option<NotificationConfiguration>,
840}
841
842/// <p><p> <pre><code> The structure representing the &lt;code&gt;removePermissionRequest&lt;/code&gt;.&lt;/p&gt; </code></pre></p>
843#[derive(Clone, Debug, Default, PartialEq, Serialize)]
844#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
845pub struct RemovePermissionRequest {
846    /// <p> Specifies an action group that contains the permissions to remove from a profiling group's resource-based policy. One action group is supported, <code>agentPermissions</code>, which grants <code>ConfigureAgent</code> and <code>PostAgentProfile</code> permissions. </p>
847    #[serde(rename = "actionGroup")]
848    pub action_group: String,
849    /// <p>The name of the profiling group.</p>
850    #[serde(rename = "profilingGroupName")]
851    pub profiling_group_name: String,
852    /// <p> A universally unique identifier (UUID) for the revision of the resource-based policy from which you want to remove permissions. </p>
853    #[serde(rename = "revisionId")]
854    pub revision_id: String,
855}
856
857/// <p>The structure representing the <code>removePermissionResponse</code>.</p>
858#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
859#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
860pub struct RemovePermissionResponse {
861    /// <p> The JSON-formatted resource-based policy on the profiling group after the specified permissions were removed. </p>
862    #[serde(rename = "policy")]
863    pub policy: String,
864    /// <p> A universally unique identifier (UUID) for the revision of the resource-based policy after the specified permissions were removed. The updated JSON-formatted policy is in the <code>policy</code> element of the response. </p>
865    #[serde(rename = "revisionId")]
866    pub revision_id: String,
867}
868
869/// <p>The structure representing the SubmitFeedbackRequest.</p>
870#[derive(Clone, Debug, Default, PartialEq, Serialize)]
871#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
872pub struct SubmitFeedbackRequest {
873    /// <p>The universally unique identifier (UUID) of the <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_AnomalyInstance.html"> <code>AnomalyInstance</code> </a> object that is included in the analysis data.</p>
874    #[serde(rename = "anomalyInstanceId")]
875    pub anomaly_instance_id: String,
876    /// <p>Optional feedback about this anomaly.</p>
877    #[serde(rename = "comment")]
878    #[serde(skip_serializing_if = "Option::is_none")]
879    pub comment: Option<String>,
880    /// <p>The name of the profiling group that is associated with the analysis data.</p>
881    #[serde(rename = "profilingGroupName")]
882    pub profiling_group_name: String,
883    /// <p> The feedback tpye. Thee are two valid values, <code>Positive</code> and <code>Negative</code>. </p>
884    #[serde(rename = "type")]
885    pub type_: String,
886}
887
888/// <p>The structure representing the SubmitFeedbackResponse.</p>
889#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
890#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
891pub struct SubmitFeedbackResponse {}
892
893/// <p> A data type that contains a <code>Timestamp</code> object. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
894#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
895#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
896pub struct TimestampStructure {
897    /// <p> A <code>Timestamp</code>. This is specified using the ISO 8601 format. For example, 2020-06-01T13:15:02.001Z represents 1 millisecond past June 1, 2020 1:15:02 PM UTC. </p>
898    #[serde(rename = "value")]
899    pub value: f64,
900}
901
902/// <p>The structure representing the updateProfilingGroupRequest.</p>
903#[derive(Clone, Debug, Default, PartialEq, Serialize)]
904#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
905pub struct UpdateProfilingGroupRequest {
906    /// <p> Specifies whether profiling is enabled or disabled for a profiling group. </p>
907    #[serde(rename = "agentOrchestrationConfig")]
908    pub agent_orchestration_config: AgentOrchestrationConfig,
909    /// <p>The name of the profiling group to update.</p>
910    #[serde(rename = "profilingGroupName")]
911    pub profiling_group_name: String,
912}
913
914/// <p>The structure representing the updateProfilingGroupResponse.</p>
915#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
916#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
917pub struct UpdateProfilingGroupResponse {
918    /// <p> A <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> that contains information about the returned updated profiling group. </p>
919    #[serde(rename = "profilingGroup")]
920    pub profiling_group: ProfilingGroupDescription,
921}
922
923/// <p>Feedback that can be submitted for each instance of an anomaly by the user. Feedback is be used for improvements in generating recommendations for the application.</p>
924#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
925#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
926pub struct UserFeedback {
927    /// <p>Optional <code>Positive</code> or <code>Negative</code> feedback submitted by the user about whether the recommendation is useful or not.</p>
928    #[serde(rename = "type")]
929    pub type_: String,
930}
931
932/// Errors returned by AddNotificationChannels
933#[derive(Debug, PartialEq)]
934pub enum AddNotificationChannelsError {
935    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
936    Conflict(String),
937    /// <p>The server encountered an internal error and is unable to complete the request.</p>
938    InternalServer(String),
939    /// <p>The resource specified in the request does not exist.</p>
940    ResourceNotFound(String),
941    /// <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html">Service Quotas</a> to request a service quota increase. </p>
942    ServiceQuotaExceeded(String),
943    /// <p>The request was denied due to request throttling.</p>
944    Throttling(String),
945}
946
947impl AddNotificationChannelsError {
948    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AddNotificationChannelsError> {
949        if let Some(err) = proto::json::Error::parse_rest(&res) {
950            match err.typ.as_str() {
951                "ConflictException" => {
952                    return RusotoError::Service(AddNotificationChannelsError::Conflict(err.msg))
953                }
954                "InternalServerException" => {
955                    return RusotoError::Service(AddNotificationChannelsError::InternalServer(
956                        err.msg,
957                    ))
958                }
959                "ResourceNotFoundException" => {
960                    return RusotoError::Service(AddNotificationChannelsError::ResourceNotFound(
961                        err.msg,
962                    ))
963                }
964                "ServiceQuotaExceededException" => {
965                    return RusotoError::Service(
966                        AddNotificationChannelsError::ServiceQuotaExceeded(err.msg),
967                    )
968                }
969                "ThrottlingException" => {
970                    return RusotoError::Service(AddNotificationChannelsError::Throttling(err.msg))
971                }
972                "ValidationException" => return RusotoError::Validation(err.msg),
973                _ => {}
974            }
975        }
976        RusotoError::Unknown(res)
977    }
978}
979impl fmt::Display for AddNotificationChannelsError {
980    #[allow(unused_variables)]
981    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
982        match *self {
983            AddNotificationChannelsError::Conflict(ref cause) => write!(f, "{}", cause),
984            AddNotificationChannelsError::InternalServer(ref cause) => write!(f, "{}", cause),
985            AddNotificationChannelsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
986            AddNotificationChannelsError::ServiceQuotaExceeded(ref cause) => write!(f, "{}", cause),
987            AddNotificationChannelsError::Throttling(ref cause) => write!(f, "{}", cause),
988        }
989    }
990}
991impl Error for AddNotificationChannelsError {}
992/// Errors returned by BatchGetFrameMetricData
993#[derive(Debug, PartialEq)]
994pub enum BatchGetFrameMetricDataError {
995    /// <p>The server encountered an internal error and is unable to complete the request.</p>
996    InternalServer(String),
997    /// <p>The resource specified in the request does not exist.</p>
998    ResourceNotFound(String),
999    /// <p>The request was denied due to request throttling.</p>
1000    Throttling(String),
1001}
1002
1003impl BatchGetFrameMetricDataError {
1004    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<BatchGetFrameMetricDataError> {
1005        if let Some(err) = proto::json::Error::parse_rest(&res) {
1006            match err.typ.as_str() {
1007                "InternalServerException" => {
1008                    return RusotoError::Service(BatchGetFrameMetricDataError::InternalServer(
1009                        err.msg,
1010                    ))
1011                }
1012                "ResourceNotFoundException" => {
1013                    return RusotoError::Service(BatchGetFrameMetricDataError::ResourceNotFound(
1014                        err.msg,
1015                    ))
1016                }
1017                "ThrottlingException" => {
1018                    return RusotoError::Service(BatchGetFrameMetricDataError::Throttling(err.msg))
1019                }
1020                "ValidationException" => return RusotoError::Validation(err.msg),
1021                _ => {}
1022            }
1023        }
1024        RusotoError::Unknown(res)
1025    }
1026}
1027impl fmt::Display for BatchGetFrameMetricDataError {
1028    #[allow(unused_variables)]
1029    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1030        match *self {
1031            BatchGetFrameMetricDataError::InternalServer(ref cause) => write!(f, "{}", cause),
1032            BatchGetFrameMetricDataError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1033            BatchGetFrameMetricDataError::Throttling(ref cause) => write!(f, "{}", cause),
1034        }
1035    }
1036}
1037impl Error for BatchGetFrameMetricDataError {}
1038/// Errors returned by ConfigureAgent
1039#[derive(Debug, PartialEq)]
1040pub enum ConfigureAgentError {
1041    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1042    InternalServer(String),
1043    /// <p>The resource specified in the request does not exist.</p>
1044    ResourceNotFound(String),
1045    /// <p>The request was denied due to request throttling.</p>
1046    Throttling(String),
1047}
1048
1049impl ConfigureAgentError {
1050    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ConfigureAgentError> {
1051        if let Some(err) = proto::json::Error::parse_rest(&res) {
1052            match err.typ.as_str() {
1053                "InternalServerException" => {
1054                    return RusotoError::Service(ConfigureAgentError::InternalServer(err.msg))
1055                }
1056                "ResourceNotFoundException" => {
1057                    return RusotoError::Service(ConfigureAgentError::ResourceNotFound(err.msg))
1058                }
1059                "ThrottlingException" => {
1060                    return RusotoError::Service(ConfigureAgentError::Throttling(err.msg))
1061                }
1062                "ValidationException" => return RusotoError::Validation(err.msg),
1063                _ => {}
1064            }
1065        }
1066        RusotoError::Unknown(res)
1067    }
1068}
1069impl fmt::Display for ConfigureAgentError {
1070    #[allow(unused_variables)]
1071    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1072        match *self {
1073            ConfigureAgentError::InternalServer(ref cause) => write!(f, "{}", cause),
1074            ConfigureAgentError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1075            ConfigureAgentError::Throttling(ref cause) => write!(f, "{}", cause),
1076        }
1077    }
1078}
1079impl Error for ConfigureAgentError {}
1080/// Errors returned by CreateProfilingGroup
1081#[derive(Debug, PartialEq)]
1082pub enum CreateProfilingGroupError {
1083    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1084    Conflict(String),
1085    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1086    InternalServer(String),
1087    /// <p>You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use <a href="https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html">Service Quotas</a> to request a service quota increase. </p>
1088    ServiceQuotaExceeded(String),
1089    /// <p>The request was denied due to request throttling.</p>
1090    Throttling(String),
1091}
1092
1093impl CreateProfilingGroupError {
1094    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateProfilingGroupError> {
1095        if let Some(err) = proto::json::Error::parse_rest(&res) {
1096            match err.typ.as_str() {
1097                "ConflictException" => {
1098                    return RusotoError::Service(CreateProfilingGroupError::Conflict(err.msg))
1099                }
1100                "InternalServerException" => {
1101                    return RusotoError::Service(CreateProfilingGroupError::InternalServer(err.msg))
1102                }
1103                "ServiceQuotaExceededException" => {
1104                    return RusotoError::Service(CreateProfilingGroupError::ServiceQuotaExceeded(
1105                        err.msg,
1106                    ))
1107                }
1108                "ThrottlingException" => {
1109                    return RusotoError::Service(CreateProfilingGroupError::Throttling(err.msg))
1110                }
1111                "ValidationException" => return RusotoError::Validation(err.msg),
1112                _ => {}
1113            }
1114        }
1115        RusotoError::Unknown(res)
1116    }
1117}
1118impl fmt::Display for CreateProfilingGroupError {
1119    #[allow(unused_variables)]
1120    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1121        match *self {
1122            CreateProfilingGroupError::Conflict(ref cause) => write!(f, "{}", cause),
1123            CreateProfilingGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1124            CreateProfilingGroupError::ServiceQuotaExceeded(ref cause) => write!(f, "{}", cause),
1125            CreateProfilingGroupError::Throttling(ref cause) => write!(f, "{}", cause),
1126        }
1127    }
1128}
1129impl Error for CreateProfilingGroupError {}
1130/// Errors returned by DeleteProfilingGroup
1131#[derive(Debug, PartialEq)]
1132pub enum DeleteProfilingGroupError {
1133    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1134    InternalServer(String),
1135    /// <p>The resource specified in the request does not exist.</p>
1136    ResourceNotFound(String),
1137    /// <p>The request was denied due to request throttling.</p>
1138    Throttling(String),
1139}
1140
1141impl DeleteProfilingGroupError {
1142    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteProfilingGroupError> {
1143        if let Some(err) = proto::json::Error::parse_rest(&res) {
1144            match err.typ.as_str() {
1145                "InternalServerException" => {
1146                    return RusotoError::Service(DeleteProfilingGroupError::InternalServer(err.msg))
1147                }
1148                "ResourceNotFoundException" => {
1149                    return RusotoError::Service(DeleteProfilingGroupError::ResourceNotFound(
1150                        err.msg,
1151                    ))
1152                }
1153                "ThrottlingException" => {
1154                    return RusotoError::Service(DeleteProfilingGroupError::Throttling(err.msg))
1155                }
1156                "ValidationException" => return RusotoError::Validation(err.msg),
1157                _ => {}
1158            }
1159        }
1160        RusotoError::Unknown(res)
1161    }
1162}
1163impl fmt::Display for DeleteProfilingGroupError {
1164    #[allow(unused_variables)]
1165    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1166        match *self {
1167            DeleteProfilingGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1168            DeleteProfilingGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1169            DeleteProfilingGroupError::Throttling(ref cause) => write!(f, "{}", cause),
1170        }
1171    }
1172}
1173impl Error for DeleteProfilingGroupError {}
1174/// Errors returned by DescribeProfilingGroup
1175#[derive(Debug, PartialEq)]
1176pub enum DescribeProfilingGroupError {
1177    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1178    InternalServer(String),
1179    /// <p>The resource specified in the request does not exist.</p>
1180    ResourceNotFound(String),
1181    /// <p>The request was denied due to request throttling.</p>
1182    Throttling(String),
1183}
1184
1185impl DescribeProfilingGroupError {
1186    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeProfilingGroupError> {
1187        if let Some(err) = proto::json::Error::parse_rest(&res) {
1188            match err.typ.as_str() {
1189                "InternalServerException" => {
1190                    return RusotoError::Service(DescribeProfilingGroupError::InternalServer(
1191                        err.msg,
1192                    ))
1193                }
1194                "ResourceNotFoundException" => {
1195                    return RusotoError::Service(DescribeProfilingGroupError::ResourceNotFound(
1196                        err.msg,
1197                    ))
1198                }
1199                "ThrottlingException" => {
1200                    return RusotoError::Service(DescribeProfilingGroupError::Throttling(err.msg))
1201                }
1202                "ValidationException" => return RusotoError::Validation(err.msg),
1203                _ => {}
1204            }
1205        }
1206        RusotoError::Unknown(res)
1207    }
1208}
1209impl fmt::Display for DescribeProfilingGroupError {
1210    #[allow(unused_variables)]
1211    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1212        match *self {
1213            DescribeProfilingGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1214            DescribeProfilingGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1215            DescribeProfilingGroupError::Throttling(ref cause) => write!(f, "{}", cause),
1216        }
1217    }
1218}
1219impl Error for DescribeProfilingGroupError {}
1220/// Errors returned by GetFindingsReportAccountSummary
1221#[derive(Debug, PartialEq)]
1222pub enum GetFindingsReportAccountSummaryError {
1223    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1224    InternalServer(String),
1225    /// <p>The request was denied due to request throttling.</p>
1226    Throttling(String),
1227}
1228
1229impl GetFindingsReportAccountSummaryError {
1230    pub fn from_response(
1231        res: BufferedHttpResponse,
1232    ) -> RusotoError<GetFindingsReportAccountSummaryError> {
1233        if let Some(err) = proto::json::Error::parse_rest(&res) {
1234            match err.typ.as_str() {
1235                "InternalServerException" => {
1236                    return RusotoError::Service(
1237                        GetFindingsReportAccountSummaryError::InternalServer(err.msg),
1238                    )
1239                }
1240                "ThrottlingException" => {
1241                    return RusotoError::Service(GetFindingsReportAccountSummaryError::Throttling(
1242                        err.msg,
1243                    ))
1244                }
1245                "ValidationException" => return RusotoError::Validation(err.msg),
1246                _ => {}
1247            }
1248        }
1249        RusotoError::Unknown(res)
1250    }
1251}
1252impl fmt::Display for GetFindingsReportAccountSummaryError {
1253    #[allow(unused_variables)]
1254    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1255        match *self {
1256            GetFindingsReportAccountSummaryError::InternalServer(ref cause) => {
1257                write!(f, "{}", cause)
1258            }
1259            GetFindingsReportAccountSummaryError::Throttling(ref cause) => write!(f, "{}", cause),
1260        }
1261    }
1262}
1263impl Error for GetFindingsReportAccountSummaryError {}
1264/// Errors returned by GetNotificationConfiguration
1265#[derive(Debug, PartialEq)]
1266pub enum GetNotificationConfigurationError {
1267    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1268    InternalServer(String),
1269    /// <p>The resource specified in the request does not exist.</p>
1270    ResourceNotFound(String),
1271    /// <p>The request was denied due to request throttling.</p>
1272    Throttling(String),
1273}
1274
1275impl GetNotificationConfigurationError {
1276    pub fn from_response(
1277        res: BufferedHttpResponse,
1278    ) -> RusotoError<GetNotificationConfigurationError> {
1279        if let Some(err) = proto::json::Error::parse_rest(&res) {
1280            match err.typ.as_str() {
1281                "InternalServerException" => {
1282                    return RusotoError::Service(GetNotificationConfigurationError::InternalServer(
1283                        err.msg,
1284                    ))
1285                }
1286                "ResourceNotFoundException" => {
1287                    return RusotoError::Service(
1288                        GetNotificationConfigurationError::ResourceNotFound(err.msg),
1289                    )
1290                }
1291                "ThrottlingException" => {
1292                    return RusotoError::Service(GetNotificationConfigurationError::Throttling(
1293                        err.msg,
1294                    ))
1295                }
1296                "ValidationException" => return RusotoError::Validation(err.msg),
1297                _ => {}
1298            }
1299        }
1300        RusotoError::Unknown(res)
1301    }
1302}
1303impl fmt::Display for GetNotificationConfigurationError {
1304    #[allow(unused_variables)]
1305    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1306        match *self {
1307            GetNotificationConfigurationError::InternalServer(ref cause) => write!(f, "{}", cause),
1308            GetNotificationConfigurationError::ResourceNotFound(ref cause) => {
1309                write!(f, "{}", cause)
1310            }
1311            GetNotificationConfigurationError::Throttling(ref cause) => write!(f, "{}", cause),
1312        }
1313    }
1314}
1315impl Error for GetNotificationConfigurationError {}
1316/// Errors returned by GetPolicy
1317#[derive(Debug, PartialEq)]
1318pub enum GetPolicyError {
1319    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1320    InternalServer(String),
1321    /// <p>The resource specified in the request does not exist.</p>
1322    ResourceNotFound(String),
1323    /// <p>The request was denied due to request throttling.</p>
1324    Throttling(String),
1325}
1326
1327impl GetPolicyError {
1328    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetPolicyError> {
1329        if let Some(err) = proto::json::Error::parse_rest(&res) {
1330            match err.typ.as_str() {
1331                "InternalServerException" => {
1332                    return RusotoError::Service(GetPolicyError::InternalServer(err.msg))
1333                }
1334                "ResourceNotFoundException" => {
1335                    return RusotoError::Service(GetPolicyError::ResourceNotFound(err.msg))
1336                }
1337                "ThrottlingException" => {
1338                    return RusotoError::Service(GetPolicyError::Throttling(err.msg))
1339                }
1340                "ValidationException" => return RusotoError::Validation(err.msg),
1341                _ => {}
1342            }
1343        }
1344        RusotoError::Unknown(res)
1345    }
1346}
1347impl fmt::Display for GetPolicyError {
1348    #[allow(unused_variables)]
1349    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1350        match *self {
1351            GetPolicyError::InternalServer(ref cause) => write!(f, "{}", cause),
1352            GetPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1353            GetPolicyError::Throttling(ref cause) => write!(f, "{}", cause),
1354        }
1355    }
1356}
1357impl Error for GetPolicyError {}
1358/// Errors returned by GetProfile
1359#[derive(Debug, PartialEq)]
1360pub enum GetProfileError {
1361    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1362    InternalServer(String),
1363    /// <p>The resource specified in the request does not exist.</p>
1364    ResourceNotFound(String),
1365    /// <p>The request was denied due to request throttling.</p>
1366    Throttling(String),
1367}
1368
1369impl GetProfileError {
1370    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetProfileError> {
1371        if let Some(err) = proto::json::Error::parse_rest(&res) {
1372            match err.typ.as_str() {
1373                "InternalServerException" => {
1374                    return RusotoError::Service(GetProfileError::InternalServer(err.msg))
1375                }
1376                "ResourceNotFoundException" => {
1377                    return RusotoError::Service(GetProfileError::ResourceNotFound(err.msg))
1378                }
1379                "ThrottlingException" => {
1380                    return RusotoError::Service(GetProfileError::Throttling(err.msg))
1381                }
1382                "ValidationException" => return RusotoError::Validation(err.msg),
1383                _ => {}
1384            }
1385        }
1386        RusotoError::Unknown(res)
1387    }
1388}
1389impl fmt::Display for GetProfileError {
1390    #[allow(unused_variables)]
1391    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1392        match *self {
1393            GetProfileError::InternalServer(ref cause) => write!(f, "{}", cause),
1394            GetProfileError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1395            GetProfileError::Throttling(ref cause) => write!(f, "{}", cause),
1396        }
1397    }
1398}
1399impl Error for GetProfileError {}
1400/// Errors returned by GetRecommendations
1401#[derive(Debug, PartialEq)]
1402pub enum GetRecommendationsError {
1403    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1404    InternalServer(String),
1405    /// <p>The resource specified in the request does not exist.</p>
1406    ResourceNotFound(String),
1407    /// <p>The request was denied due to request throttling.</p>
1408    Throttling(String),
1409}
1410
1411impl GetRecommendationsError {
1412    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetRecommendationsError> {
1413        if let Some(err) = proto::json::Error::parse_rest(&res) {
1414            match err.typ.as_str() {
1415                "InternalServerException" => {
1416                    return RusotoError::Service(GetRecommendationsError::InternalServer(err.msg))
1417                }
1418                "ResourceNotFoundException" => {
1419                    return RusotoError::Service(GetRecommendationsError::ResourceNotFound(err.msg))
1420                }
1421                "ThrottlingException" => {
1422                    return RusotoError::Service(GetRecommendationsError::Throttling(err.msg))
1423                }
1424                "ValidationException" => return RusotoError::Validation(err.msg),
1425                _ => {}
1426            }
1427        }
1428        RusotoError::Unknown(res)
1429    }
1430}
1431impl fmt::Display for GetRecommendationsError {
1432    #[allow(unused_variables)]
1433    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1434        match *self {
1435            GetRecommendationsError::InternalServer(ref cause) => write!(f, "{}", cause),
1436            GetRecommendationsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1437            GetRecommendationsError::Throttling(ref cause) => write!(f, "{}", cause),
1438        }
1439    }
1440}
1441impl Error for GetRecommendationsError {}
1442/// Errors returned by ListFindingsReports
1443#[derive(Debug, PartialEq)]
1444pub enum ListFindingsReportsError {
1445    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1446    InternalServer(String),
1447    /// <p>The resource specified in the request does not exist.</p>
1448    ResourceNotFound(String),
1449    /// <p>The request was denied due to request throttling.</p>
1450    Throttling(String),
1451}
1452
1453impl ListFindingsReportsError {
1454    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListFindingsReportsError> {
1455        if let Some(err) = proto::json::Error::parse_rest(&res) {
1456            match err.typ.as_str() {
1457                "InternalServerException" => {
1458                    return RusotoError::Service(ListFindingsReportsError::InternalServer(err.msg))
1459                }
1460                "ResourceNotFoundException" => {
1461                    return RusotoError::Service(ListFindingsReportsError::ResourceNotFound(
1462                        err.msg,
1463                    ))
1464                }
1465                "ThrottlingException" => {
1466                    return RusotoError::Service(ListFindingsReportsError::Throttling(err.msg))
1467                }
1468                "ValidationException" => return RusotoError::Validation(err.msg),
1469                _ => {}
1470            }
1471        }
1472        RusotoError::Unknown(res)
1473    }
1474}
1475impl fmt::Display for ListFindingsReportsError {
1476    #[allow(unused_variables)]
1477    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1478        match *self {
1479            ListFindingsReportsError::InternalServer(ref cause) => write!(f, "{}", cause),
1480            ListFindingsReportsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1481            ListFindingsReportsError::Throttling(ref cause) => write!(f, "{}", cause),
1482        }
1483    }
1484}
1485impl Error for ListFindingsReportsError {}
1486/// Errors returned by ListProfileTimes
1487#[derive(Debug, PartialEq)]
1488pub enum ListProfileTimesError {
1489    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1490    InternalServer(String),
1491    /// <p>The resource specified in the request does not exist.</p>
1492    ResourceNotFound(String),
1493    /// <p>The request was denied due to request throttling.</p>
1494    Throttling(String),
1495}
1496
1497impl ListProfileTimesError {
1498    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListProfileTimesError> {
1499        if let Some(err) = proto::json::Error::parse_rest(&res) {
1500            match err.typ.as_str() {
1501                "InternalServerException" => {
1502                    return RusotoError::Service(ListProfileTimesError::InternalServer(err.msg))
1503                }
1504                "ResourceNotFoundException" => {
1505                    return RusotoError::Service(ListProfileTimesError::ResourceNotFound(err.msg))
1506                }
1507                "ThrottlingException" => {
1508                    return RusotoError::Service(ListProfileTimesError::Throttling(err.msg))
1509                }
1510                "ValidationException" => return RusotoError::Validation(err.msg),
1511                _ => {}
1512            }
1513        }
1514        RusotoError::Unknown(res)
1515    }
1516}
1517impl fmt::Display for ListProfileTimesError {
1518    #[allow(unused_variables)]
1519    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1520        match *self {
1521            ListProfileTimesError::InternalServer(ref cause) => write!(f, "{}", cause),
1522            ListProfileTimesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1523            ListProfileTimesError::Throttling(ref cause) => write!(f, "{}", cause),
1524        }
1525    }
1526}
1527impl Error for ListProfileTimesError {}
1528/// Errors returned by ListProfilingGroups
1529#[derive(Debug, PartialEq)]
1530pub enum ListProfilingGroupsError {
1531    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1532    InternalServer(String),
1533    /// <p>The request was denied due to request throttling.</p>
1534    Throttling(String),
1535}
1536
1537impl ListProfilingGroupsError {
1538    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListProfilingGroupsError> {
1539        if let Some(err) = proto::json::Error::parse_rest(&res) {
1540            match err.typ.as_str() {
1541                "InternalServerException" => {
1542                    return RusotoError::Service(ListProfilingGroupsError::InternalServer(err.msg))
1543                }
1544                "ThrottlingException" => {
1545                    return RusotoError::Service(ListProfilingGroupsError::Throttling(err.msg))
1546                }
1547                "ValidationException" => return RusotoError::Validation(err.msg),
1548                _ => {}
1549            }
1550        }
1551        RusotoError::Unknown(res)
1552    }
1553}
1554impl fmt::Display for ListProfilingGroupsError {
1555    #[allow(unused_variables)]
1556    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1557        match *self {
1558            ListProfilingGroupsError::InternalServer(ref cause) => write!(f, "{}", cause),
1559            ListProfilingGroupsError::Throttling(ref cause) => write!(f, "{}", cause),
1560        }
1561    }
1562}
1563impl Error for ListProfilingGroupsError {}
1564/// Errors returned by PostAgentProfile
1565#[derive(Debug, PartialEq)]
1566pub enum PostAgentProfileError {
1567    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1568    InternalServer(String),
1569    /// <p>The resource specified in the request does not exist.</p>
1570    ResourceNotFound(String),
1571    /// <p>The request was denied due to request throttling.</p>
1572    Throttling(String),
1573}
1574
1575impl PostAgentProfileError {
1576    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PostAgentProfileError> {
1577        if let Some(err) = proto::json::Error::parse_rest(&res) {
1578            match err.typ.as_str() {
1579                "InternalServerException" => {
1580                    return RusotoError::Service(PostAgentProfileError::InternalServer(err.msg))
1581                }
1582                "ResourceNotFoundException" => {
1583                    return RusotoError::Service(PostAgentProfileError::ResourceNotFound(err.msg))
1584                }
1585                "ThrottlingException" => {
1586                    return RusotoError::Service(PostAgentProfileError::Throttling(err.msg))
1587                }
1588                "ValidationException" => return RusotoError::Validation(err.msg),
1589                _ => {}
1590            }
1591        }
1592        RusotoError::Unknown(res)
1593    }
1594}
1595impl fmt::Display for PostAgentProfileError {
1596    #[allow(unused_variables)]
1597    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1598        match *self {
1599            PostAgentProfileError::InternalServer(ref cause) => write!(f, "{}", cause),
1600            PostAgentProfileError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1601            PostAgentProfileError::Throttling(ref cause) => write!(f, "{}", cause),
1602        }
1603    }
1604}
1605impl Error for PostAgentProfileError {}
1606/// Errors returned by PutPermission
1607#[derive(Debug, PartialEq)]
1608pub enum PutPermissionError {
1609    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1610    Conflict(String),
1611    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1612    InternalServer(String),
1613    /// <p>The resource specified in the request does not exist.</p>
1614    ResourceNotFound(String),
1615    /// <p>The request was denied due to request throttling.</p>
1616    Throttling(String),
1617}
1618
1619impl PutPermissionError {
1620    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutPermissionError> {
1621        if let Some(err) = proto::json::Error::parse_rest(&res) {
1622            match err.typ.as_str() {
1623                "ConflictException" => {
1624                    return RusotoError::Service(PutPermissionError::Conflict(err.msg))
1625                }
1626                "InternalServerException" => {
1627                    return RusotoError::Service(PutPermissionError::InternalServer(err.msg))
1628                }
1629                "ResourceNotFoundException" => {
1630                    return RusotoError::Service(PutPermissionError::ResourceNotFound(err.msg))
1631                }
1632                "ThrottlingException" => {
1633                    return RusotoError::Service(PutPermissionError::Throttling(err.msg))
1634                }
1635                "ValidationException" => return RusotoError::Validation(err.msg),
1636                _ => {}
1637            }
1638        }
1639        RusotoError::Unknown(res)
1640    }
1641}
1642impl fmt::Display for PutPermissionError {
1643    #[allow(unused_variables)]
1644    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1645        match *self {
1646            PutPermissionError::Conflict(ref cause) => write!(f, "{}", cause),
1647            PutPermissionError::InternalServer(ref cause) => write!(f, "{}", cause),
1648            PutPermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1649            PutPermissionError::Throttling(ref cause) => write!(f, "{}", cause),
1650        }
1651    }
1652}
1653impl Error for PutPermissionError {}
1654/// Errors returned by RemoveNotificationChannel
1655#[derive(Debug, PartialEq)]
1656pub enum RemoveNotificationChannelError {
1657    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1658    InternalServer(String),
1659    /// <p>The resource specified in the request does not exist.</p>
1660    ResourceNotFound(String),
1661    /// <p>The request was denied due to request throttling.</p>
1662    Throttling(String),
1663}
1664
1665impl RemoveNotificationChannelError {
1666    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemoveNotificationChannelError> {
1667        if let Some(err) = proto::json::Error::parse_rest(&res) {
1668            match err.typ.as_str() {
1669                "InternalServerException" => {
1670                    return RusotoError::Service(RemoveNotificationChannelError::InternalServer(
1671                        err.msg,
1672                    ))
1673                }
1674                "ResourceNotFoundException" => {
1675                    return RusotoError::Service(RemoveNotificationChannelError::ResourceNotFound(
1676                        err.msg,
1677                    ))
1678                }
1679                "ThrottlingException" => {
1680                    return RusotoError::Service(RemoveNotificationChannelError::Throttling(
1681                        err.msg,
1682                    ))
1683                }
1684                "ValidationException" => return RusotoError::Validation(err.msg),
1685                _ => {}
1686            }
1687        }
1688        RusotoError::Unknown(res)
1689    }
1690}
1691impl fmt::Display for RemoveNotificationChannelError {
1692    #[allow(unused_variables)]
1693    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1694        match *self {
1695            RemoveNotificationChannelError::InternalServer(ref cause) => write!(f, "{}", cause),
1696            RemoveNotificationChannelError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1697            RemoveNotificationChannelError::Throttling(ref cause) => write!(f, "{}", cause),
1698        }
1699    }
1700}
1701impl Error for RemoveNotificationChannelError {}
1702/// Errors returned by RemovePermission
1703#[derive(Debug, PartialEq)]
1704pub enum RemovePermissionError {
1705    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1706    Conflict(String),
1707    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1708    InternalServer(String),
1709    /// <p>The resource specified in the request does not exist.</p>
1710    ResourceNotFound(String),
1711    /// <p>The request was denied due to request throttling.</p>
1712    Throttling(String),
1713}
1714
1715impl RemovePermissionError {
1716    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RemovePermissionError> {
1717        if let Some(err) = proto::json::Error::parse_rest(&res) {
1718            match err.typ.as_str() {
1719                "ConflictException" => {
1720                    return RusotoError::Service(RemovePermissionError::Conflict(err.msg))
1721                }
1722                "InternalServerException" => {
1723                    return RusotoError::Service(RemovePermissionError::InternalServer(err.msg))
1724                }
1725                "ResourceNotFoundException" => {
1726                    return RusotoError::Service(RemovePermissionError::ResourceNotFound(err.msg))
1727                }
1728                "ThrottlingException" => {
1729                    return RusotoError::Service(RemovePermissionError::Throttling(err.msg))
1730                }
1731                "ValidationException" => return RusotoError::Validation(err.msg),
1732                _ => {}
1733            }
1734        }
1735        RusotoError::Unknown(res)
1736    }
1737}
1738impl fmt::Display for RemovePermissionError {
1739    #[allow(unused_variables)]
1740    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1741        match *self {
1742            RemovePermissionError::Conflict(ref cause) => write!(f, "{}", cause),
1743            RemovePermissionError::InternalServer(ref cause) => write!(f, "{}", cause),
1744            RemovePermissionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1745            RemovePermissionError::Throttling(ref cause) => write!(f, "{}", cause),
1746        }
1747    }
1748}
1749impl Error for RemovePermissionError {}
1750/// Errors returned by SubmitFeedback
1751#[derive(Debug, PartialEq)]
1752pub enum SubmitFeedbackError {
1753    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1754    InternalServer(String),
1755    /// <p>The resource specified in the request does not exist.</p>
1756    ResourceNotFound(String),
1757    /// <p>The request was denied due to request throttling.</p>
1758    Throttling(String),
1759}
1760
1761impl SubmitFeedbackError {
1762    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<SubmitFeedbackError> {
1763        if let Some(err) = proto::json::Error::parse_rest(&res) {
1764            match err.typ.as_str() {
1765                "InternalServerException" => {
1766                    return RusotoError::Service(SubmitFeedbackError::InternalServer(err.msg))
1767                }
1768                "ResourceNotFoundException" => {
1769                    return RusotoError::Service(SubmitFeedbackError::ResourceNotFound(err.msg))
1770                }
1771                "ThrottlingException" => {
1772                    return RusotoError::Service(SubmitFeedbackError::Throttling(err.msg))
1773                }
1774                "ValidationException" => return RusotoError::Validation(err.msg),
1775                _ => {}
1776            }
1777        }
1778        RusotoError::Unknown(res)
1779    }
1780}
1781impl fmt::Display for SubmitFeedbackError {
1782    #[allow(unused_variables)]
1783    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1784        match *self {
1785            SubmitFeedbackError::InternalServer(ref cause) => write!(f, "{}", cause),
1786            SubmitFeedbackError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1787            SubmitFeedbackError::Throttling(ref cause) => write!(f, "{}", cause),
1788        }
1789    }
1790}
1791impl Error for SubmitFeedbackError {}
1792/// Errors returned by UpdateProfilingGroup
1793#[derive(Debug, PartialEq)]
1794pub enum UpdateProfilingGroupError {
1795    /// <p>The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request. </p>
1796    Conflict(String),
1797    /// <p>The server encountered an internal error and is unable to complete the request.</p>
1798    InternalServer(String),
1799    /// <p>The resource specified in the request does not exist.</p>
1800    ResourceNotFound(String),
1801    /// <p>The request was denied due to request throttling.</p>
1802    Throttling(String),
1803}
1804
1805impl UpdateProfilingGroupError {
1806    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateProfilingGroupError> {
1807        if let Some(err) = proto::json::Error::parse_rest(&res) {
1808            match err.typ.as_str() {
1809                "ConflictException" => {
1810                    return RusotoError::Service(UpdateProfilingGroupError::Conflict(err.msg))
1811                }
1812                "InternalServerException" => {
1813                    return RusotoError::Service(UpdateProfilingGroupError::InternalServer(err.msg))
1814                }
1815                "ResourceNotFoundException" => {
1816                    return RusotoError::Service(UpdateProfilingGroupError::ResourceNotFound(
1817                        err.msg,
1818                    ))
1819                }
1820                "ThrottlingException" => {
1821                    return RusotoError::Service(UpdateProfilingGroupError::Throttling(err.msg))
1822                }
1823                "ValidationException" => return RusotoError::Validation(err.msg),
1824                _ => {}
1825            }
1826        }
1827        RusotoError::Unknown(res)
1828    }
1829}
1830impl fmt::Display for UpdateProfilingGroupError {
1831    #[allow(unused_variables)]
1832    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1833        match *self {
1834            UpdateProfilingGroupError::Conflict(ref cause) => write!(f, "{}", cause),
1835            UpdateProfilingGroupError::InternalServer(ref cause) => write!(f, "{}", cause),
1836            UpdateProfilingGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1837            UpdateProfilingGroupError::Throttling(ref cause) => write!(f, "{}", cause),
1838        }
1839    }
1840}
1841impl Error for UpdateProfilingGroupError {}
1842/// Trait representing the capabilities of the Amazon CodeGuru Profiler API. Amazon CodeGuru Profiler clients implement this trait.
1843#[async_trait]
1844pub trait CodeGuruProfiler {
1845    /// <p>Add up to 2 anomaly notifications channels for a profiling group.</p>
1846    async fn add_notification_channels(
1847        &self,
1848        input: AddNotificationChannelsRequest,
1849    ) -> Result<AddNotificationChannelsResponse, RusotoError<AddNotificationChannelsError>>;
1850
1851    /// <p> Returns the time series of values for a requested list of frame metrics from a time period.</p>
1852    async fn batch_get_frame_metric_data(
1853        &self,
1854        input: BatchGetFrameMetricDataRequest,
1855    ) -> Result<BatchGetFrameMetricDataResponse, RusotoError<BatchGetFrameMetricDataError>>;
1856
1857    /// <p> Used by profiler agents to report their current state and to receive remote configuration updates. For example, <code>ConfigureAgent</code> can be used to tell and agent whether to profile or not and for how long to return profiling data. </p>
1858    async fn configure_agent(
1859        &self,
1860        input: ConfigureAgentRequest,
1861    ) -> Result<ConfigureAgentResponse, RusotoError<ConfigureAgentError>>;
1862
1863    /// <p>Creates a profiling group.</p>
1864    async fn create_profiling_group(
1865        &self,
1866        input: CreateProfilingGroupRequest,
1867    ) -> Result<CreateProfilingGroupResponse, RusotoError<CreateProfilingGroupError>>;
1868
1869    /// <p>Deletes a profiling group.</p>
1870    async fn delete_profiling_group(
1871        &self,
1872        input: DeleteProfilingGroupRequest,
1873    ) -> Result<DeleteProfilingGroupResponse, RusotoError<DeleteProfilingGroupError>>;
1874
1875    /// <p> Returns a <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> object that contains information about the requested profiling group. </p>
1876    async fn describe_profiling_group(
1877        &self,
1878        input: DescribeProfilingGroupRequest,
1879    ) -> Result<DescribeProfilingGroupResponse, RusotoError<DescribeProfilingGroupError>>;
1880
1881    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_FindingsReportSummary.html"> <code>FindingsReportSummary</code> </a> objects that contain analysis results for all profiling groups in your AWS account. </p>
1882    async fn get_findings_report_account_summary(
1883        &self,
1884        input: GetFindingsReportAccountSummaryRequest,
1885    ) -> Result<
1886        GetFindingsReportAccountSummaryResponse,
1887        RusotoError<GetFindingsReportAccountSummaryError>,
1888    >;
1889
1890    /// <p>Get the current configuration for anomaly notifications for a profiling group.</p>
1891    async fn get_notification_configuration(
1892        &self,
1893        input: GetNotificationConfigurationRequest,
1894    ) -> Result<GetNotificationConfigurationResponse, RusotoError<GetNotificationConfigurationError>>;
1895
1896    /// <p> Returns the JSON-formatted resource-based policy on a profiling group. </p>
1897    async fn get_policy(
1898        &self,
1899        input: GetPolicyRequest,
1900    ) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>>;
1901
1902    /// <p><p> Gets the aggregated profile of a profiling group for a specified time range. Amazon CodeGuru Profiler collects posted agent profiles for a profiling group into aggregated profiles. </p> <pre><code> &lt;note&gt; &lt;p&gt; Because aggregated profiles expire over time &lt;code&gt;GetProfile&lt;/code&gt; is not idempotent. &lt;/p&gt; &lt;/note&gt; &lt;p&gt; Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: &lt;code&gt;startTime&lt;/code&gt;, &lt;code&gt;endTime&lt;/code&gt;, &lt;code&gt;period&lt;/code&gt;. The maximum time range allowed is 7 days. If you specify all 3 parameters, an exception is thrown. If you specify only &lt;code&gt;period&lt;/code&gt;, the latest aggregated profile is returned. &lt;/p&gt; &lt;p&gt; Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to UTC. The aggregation period of an aggregated profile determines how long it is retained. For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API<em>AggregatedProfileTime.html&quot;&gt; &lt;code&gt;AggregatedProfileTime&lt;/code&gt; &lt;/a&gt;. The aggregated profile&#39;s aggregation period determines how long it is retained by CodeGuru Profiler. &lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 1 hour, the aggregated profile is retained for 60 days. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 1 day, the aggregated profile is retained for 3 years. &lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;There are two use cases for calling &lt;code&gt;GetProfile&lt;/code&gt;.&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;p&gt; If you want to return an aggregated profile that already exists, use &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API</em>ListProfileTimes.html&quot;&gt; &lt;code&gt;ListProfileTimes&lt;/code&gt; &lt;/a&gt; to view the time ranges of existing aggregated profiles. Use them in a &lt;code&gt;GetProfile&lt;/code&gt; request to return a specific, existing aggregated profile. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If you want to return an aggregated profile for a time range that doesn&#39;t align with an existing aggregated profile, then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time range and return them as one aggregated profile. &lt;/p&gt; &lt;p&gt; If aggregated profiles do not exist for the full time range requested, then aggregated profiles for a smaller time range are returned. For example, if the requested time range is from 00:00 to 00:20, and the existing aggregated profiles are from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned. &lt;/p&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre></p>
1903    async fn get_profile(
1904        &self,
1905        input: GetProfileRequest,
1906    ) -> Result<GetProfileResponse, RusotoError<GetProfileError>>;
1907
1908    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned. </p>
1909    async fn get_recommendations(
1910        &self,
1911        input: GetRecommendationsRequest,
1912    ) -> Result<GetRecommendationsResponse, RusotoError<GetRecommendationsError>>;
1913
1914    /// <p>List the available reports for a given profiling group and time range.</p>
1915    async fn list_findings_reports(
1916        &self,
1917        input: ListFindingsReportsRequest,
1918    ) -> Result<ListFindingsReportsResponse, RusotoError<ListFindingsReportsError>>;
1919
1920    /// <p>Lists the start times of the available aggregated profiles of a profiling group for an aggregation period within the specified time range.</p>
1921    async fn list_profile_times(
1922        &self,
1923        input: ListProfileTimesRequest,
1924    ) -> Result<ListProfileTimesResponse, RusotoError<ListProfileTimesError>>;
1925
1926    /// <p> Returns a list of profiling groups. The profiling groups are returned as <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects. </p>
1927    async fn list_profiling_groups(
1928        &self,
1929        input: ListProfilingGroupsRequest,
1930    ) -> Result<ListProfilingGroupsResponse, RusotoError<ListProfilingGroupsError>>;
1931
1932    /// <p> Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_GetProfile.html"> <code>GetProfile</code> </a>. </p>
1933    async fn post_agent_profile(
1934        &self,
1935        input: PostAgentProfileRequest,
1936    ) -> Result<PostAgentProfileResponse, RusotoError<PostAgentProfileError>>;
1937
1938    /// <p><p> Adds permissions to a profiling group&#39;s resource-based policy that are provided using an action group. If a profiling group doesn&#39;t have a resource-based policy, one is created for it using the permissions in the action group and the roles and users in the <code>principals</code> parameter. </p> <pre><code> &lt;p&gt; The one supported action group that can be added is &lt;code&gt;agentPermission&lt;/code&gt; which grants &lt;code&gt;ConfigureAgent&lt;/code&gt; and &lt;code&gt;PostAgent&lt;/code&gt; permissions. For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html&quot;&gt;Resource-based policies in CodeGuru Profiler&lt;/a&gt; in the &lt;i&gt;Amazon CodeGuru Profiler User Guide&lt;/i&gt;, &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API<em>ConfigureAgent.html&quot;&gt; &lt;code&gt;ConfigureAgent&lt;/code&gt; &lt;/a&gt;, and &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API</em>PostAgentProfile.html&quot;&gt; &lt;code&gt;PostAgentProfile&lt;/code&gt; &lt;/a&gt;. &lt;/p&gt; &lt;p&gt; The first time you call &lt;code&gt;PutPermission&lt;/code&gt; on a profiling group, do not specify a &lt;code&gt;revisionId&lt;/code&gt; because it doesn&#39;t have a resource-based policy. Subsequent calls must provide a &lt;code&gt;revisionId&lt;/code&gt; to specify which revision of the resource-based policy to add the permissions to. &lt;/p&gt; &lt;p&gt; The response contains the profiling group&#39;s JSON-formatted resource policy. &lt;/p&gt; </code></pre></p>
1939    async fn put_permission(
1940        &self,
1941        input: PutPermissionRequest,
1942    ) -> Result<PutPermissionResponse, RusotoError<PutPermissionError>>;
1943
1944    /// <p>Remove one anomaly notifications channel for a profiling group.</p>
1945    async fn remove_notification_channel(
1946        &self,
1947        input: RemoveNotificationChannelRequest,
1948    ) -> Result<RemoveNotificationChannelResponse, RusotoError<RemoveNotificationChannelError>>;
1949
1950    /// <p> Removes permissions from a profiling group's resource-based policy that are provided using an action group. The one supported action group that can be removed is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html"> <code>PostAgentProfile</code> </a>. </p>
1951    async fn remove_permission(
1952        &self,
1953        input: RemovePermissionRequest,
1954    ) -> Result<RemovePermissionResponse, RusotoError<RemovePermissionError>>;
1955
1956    /// <p>Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is useful or not.</p>
1957    async fn submit_feedback(
1958        &self,
1959        input: SubmitFeedbackRequest,
1960    ) -> Result<SubmitFeedbackResponse, RusotoError<SubmitFeedbackError>>;
1961
1962    /// <p>Updates a profiling group.</p>
1963    async fn update_profiling_group(
1964        &self,
1965        input: UpdateProfilingGroupRequest,
1966    ) -> Result<UpdateProfilingGroupResponse, RusotoError<UpdateProfilingGroupError>>;
1967}
1968/// A client for the Amazon CodeGuru Profiler API.
1969#[derive(Clone)]
1970pub struct CodeGuruProfilerClient {
1971    client: Client,
1972    region: region::Region,
1973}
1974
1975impl CodeGuruProfilerClient {
1976    /// Creates a client backed by the default tokio event loop.
1977    ///
1978    /// The client will use the default credentials provider and tls client.
1979    pub fn new(region: region::Region) -> CodeGuruProfilerClient {
1980        CodeGuruProfilerClient {
1981            client: Client::shared(),
1982            region,
1983        }
1984    }
1985
1986    pub fn new_with<P, D>(
1987        request_dispatcher: D,
1988        credentials_provider: P,
1989        region: region::Region,
1990    ) -> CodeGuruProfilerClient
1991    where
1992        P: ProvideAwsCredentials + Send + Sync + 'static,
1993        D: DispatchSignedRequest + Send + Sync + 'static,
1994    {
1995        CodeGuruProfilerClient {
1996            client: Client::new_with(credentials_provider, request_dispatcher),
1997            region,
1998        }
1999    }
2000
2001    pub fn new_with_client(client: Client, region: region::Region) -> CodeGuruProfilerClient {
2002        CodeGuruProfilerClient { client, region }
2003    }
2004}
2005
2006#[async_trait]
2007impl CodeGuruProfiler for CodeGuruProfilerClient {
2008    /// <p>Add up to 2 anomaly notifications channels for a profiling group.</p>
2009    #[allow(unused_mut)]
2010    async fn add_notification_channels(
2011        &self,
2012        input: AddNotificationChannelsRequest,
2013    ) -> Result<AddNotificationChannelsResponse, RusotoError<AddNotificationChannelsError>> {
2014        let request_uri = format!(
2015            "/profilingGroups/{profiling_group_name}/notificationConfiguration",
2016            profiling_group_name = input.profiling_group_name
2017        );
2018
2019        let mut request =
2020            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2021        request.set_content_type("application/x-amz-json-1.1".to_owned());
2022
2023        let encoded = Some(serde_json::to_vec(&input).unwrap());
2024        request.set_payload(encoded);
2025
2026        let mut response = self
2027            .client
2028            .sign_and_dispatch(request)
2029            .await
2030            .map_err(RusotoError::from)?;
2031        if response.status.as_u16() == 200 {
2032            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2033            let result = proto::json::ResponsePayload::new(&response)
2034                .deserialize::<AddNotificationChannelsResponse, _>()?;
2035
2036            Ok(result)
2037        } else {
2038            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2039            Err(AddNotificationChannelsError::from_response(response))
2040        }
2041    }
2042
2043    /// <p> Returns the time series of values for a requested list of frame metrics from a time period.</p>
2044    #[allow(unused_mut)]
2045    async fn batch_get_frame_metric_data(
2046        &self,
2047        input: BatchGetFrameMetricDataRequest,
2048    ) -> Result<BatchGetFrameMetricDataResponse, RusotoError<BatchGetFrameMetricDataError>> {
2049        let request_uri = format!(
2050            "/profilingGroups/{profiling_group_name}/frames/-/metrics",
2051            profiling_group_name = input.profiling_group_name
2052        );
2053
2054        let mut request =
2055            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2056        request.set_content_type("application/x-amz-json-1.1".to_owned());
2057
2058        let encoded = Some(serde_json::to_vec(&input).unwrap());
2059        request.set_payload(encoded);
2060
2061        let mut params = Params::new();
2062        if let Some(ref x) = input.end_time {
2063            params.put("endTime", x);
2064        }
2065        if let Some(ref x) = input.period {
2066            params.put("period", x);
2067        }
2068        if let Some(ref x) = input.start_time {
2069            params.put("startTime", x);
2070        }
2071        if let Some(ref x) = input.target_resolution {
2072            params.put("targetResolution", x);
2073        }
2074        request.set_params(params);
2075
2076        let mut response = self
2077            .client
2078            .sign_and_dispatch(request)
2079            .await
2080            .map_err(RusotoError::from)?;
2081        if response.status.as_u16() == 200 {
2082            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2083            let result = proto::json::ResponsePayload::new(&response)
2084                .deserialize::<BatchGetFrameMetricDataResponse, _>()?;
2085
2086            Ok(result)
2087        } else {
2088            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2089            Err(BatchGetFrameMetricDataError::from_response(response))
2090        }
2091    }
2092
2093    /// <p> Used by profiler agents to report their current state and to receive remote configuration updates. For example, <code>ConfigureAgent</code> can be used to tell and agent whether to profile or not and for how long to return profiling data. </p>
2094    #[allow(unused_mut)]
2095    async fn configure_agent(
2096        &self,
2097        input: ConfigureAgentRequest,
2098    ) -> Result<ConfigureAgentResponse, RusotoError<ConfigureAgentError>> {
2099        let request_uri = format!(
2100            "/profilingGroups/{profiling_group_name}/configureAgent",
2101            profiling_group_name = input.profiling_group_name
2102        );
2103
2104        let mut request =
2105            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2106        request.set_content_type("application/x-amz-json-1.1".to_owned());
2107
2108        let encoded = Some(serde_json::to_vec(&input).unwrap());
2109        request.set_payload(encoded);
2110
2111        let mut response = self
2112            .client
2113            .sign_and_dispatch(request)
2114            .await
2115            .map_err(RusotoError::from)?;
2116        if response.status.as_u16() == 200 {
2117            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2118            let result = proto::json::ResponsePayload::new(&response)
2119                .deserialize::<ConfigureAgentResponse, _>()?;
2120
2121            Ok(result)
2122        } else {
2123            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2124            Err(ConfigureAgentError::from_response(response))
2125        }
2126    }
2127
2128    /// <p>Creates a profiling group.</p>
2129    #[allow(unused_mut)]
2130    async fn create_profiling_group(
2131        &self,
2132        input: CreateProfilingGroupRequest,
2133    ) -> Result<CreateProfilingGroupResponse, RusotoError<CreateProfilingGroupError>> {
2134        let request_uri = "/profilingGroups";
2135
2136        let mut request =
2137            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2138        request.set_content_type("application/x-amz-json-1.1".to_owned());
2139
2140        let encoded = Some(serde_json::to_vec(&input).unwrap());
2141        request.set_payload(encoded);
2142
2143        let mut params = Params::new();
2144        params.put("clientToken", &input.client_token);
2145        request.set_params(params);
2146
2147        let mut response = self
2148            .client
2149            .sign_and_dispatch(request)
2150            .await
2151            .map_err(RusotoError::from)?;
2152        if response.status.as_u16() == 201 {
2153            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2154            let result = proto::json::ResponsePayload::new(&response)
2155                .deserialize::<CreateProfilingGroupResponse, _>()?;
2156
2157            Ok(result)
2158        } else {
2159            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2160            Err(CreateProfilingGroupError::from_response(response))
2161        }
2162    }
2163
2164    /// <p>Deletes a profiling group.</p>
2165    #[allow(unused_mut)]
2166    async fn delete_profiling_group(
2167        &self,
2168        input: DeleteProfilingGroupRequest,
2169    ) -> Result<DeleteProfilingGroupResponse, RusotoError<DeleteProfilingGroupError>> {
2170        let request_uri = format!(
2171            "/profilingGroups/{profiling_group_name}",
2172            profiling_group_name = input.profiling_group_name
2173        );
2174
2175        let mut request =
2176            SignedRequest::new("DELETE", "codeguru-profiler", &self.region, &request_uri);
2177        request.set_content_type("application/x-amz-json-1.1".to_owned());
2178
2179        let mut response = self
2180            .client
2181            .sign_and_dispatch(request)
2182            .await
2183            .map_err(RusotoError::from)?;
2184        if response.status.as_u16() == 204 {
2185            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2186            let result = proto::json::ResponsePayload::new(&response)
2187                .deserialize::<DeleteProfilingGroupResponse, _>()?;
2188
2189            Ok(result)
2190        } else {
2191            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2192            Err(DeleteProfilingGroupError::from_response(response))
2193        }
2194    }
2195
2196    /// <p> Returns a <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> object that contains information about the requested profiling group. </p>
2197    #[allow(unused_mut)]
2198    async fn describe_profiling_group(
2199        &self,
2200        input: DescribeProfilingGroupRequest,
2201    ) -> Result<DescribeProfilingGroupResponse, RusotoError<DescribeProfilingGroupError>> {
2202        let request_uri = format!(
2203            "/profilingGroups/{profiling_group_name}",
2204            profiling_group_name = input.profiling_group_name
2205        );
2206
2207        let mut request =
2208            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2209        request.set_content_type("application/x-amz-json-1.1".to_owned());
2210
2211        let mut response = self
2212            .client
2213            .sign_and_dispatch(request)
2214            .await
2215            .map_err(RusotoError::from)?;
2216        if response.status.as_u16() == 200 {
2217            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2218            let result = proto::json::ResponsePayload::new(&response)
2219                .deserialize::<DescribeProfilingGroupResponse, _>()?;
2220
2221            Ok(result)
2222        } else {
2223            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2224            Err(DescribeProfilingGroupError::from_response(response))
2225        }
2226    }
2227
2228    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_FindingsReportSummary.html"> <code>FindingsReportSummary</code> </a> objects that contain analysis results for all profiling groups in your AWS account. </p>
2229    #[allow(unused_mut)]
2230    async fn get_findings_report_account_summary(
2231        &self,
2232        input: GetFindingsReportAccountSummaryRequest,
2233    ) -> Result<
2234        GetFindingsReportAccountSummaryResponse,
2235        RusotoError<GetFindingsReportAccountSummaryError>,
2236    > {
2237        let request_uri = "/internal/findingsReports";
2238
2239        let mut request =
2240            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2241        request.set_content_type("application/x-amz-json-1.1".to_owned());
2242
2243        let mut params = Params::new();
2244        if let Some(ref x) = input.daily_reports_only {
2245            params.put("dailyReportsOnly", x);
2246        }
2247        if let Some(ref x) = input.max_results {
2248            params.put("maxResults", x);
2249        }
2250        if let Some(ref x) = input.next_token {
2251            params.put("nextToken", x);
2252        }
2253        request.set_params(params);
2254
2255        let mut response = self
2256            .client
2257            .sign_and_dispatch(request)
2258            .await
2259            .map_err(RusotoError::from)?;
2260        if response.status.as_u16() == 200 {
2261            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2262            let result = proto::json::ResponsePayload::new(&response)
2263                .deserialize::<GetFindingsReportAccountSummaryResponse, _>()?;
2264
2265            Ok(result)
2266        } else {
2267            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2268            Err(GetFindingsReportAccountSummaryError::from_response(
2269                response,
2270            ))
2271        }
2272    }
2273
2274    /// <p>Get the current configuration for anomaly notifications for a profiling group.</p>
2275    #[allow(unused_mut)]
2276    async fn get_notification_configuration(
2277        &self,
2278        input: GetNotificationConfigurationRequest,
2279    ) -> Result<GetNotificationConfigurationResponse, RusotoError<GetNotificationConfigurationError>>
2280    {
2281        let request_uri = format!(
2282            "/profilingGroups/{profiling_group_name}/notificationConfiguration",
2283            profiling_group_name = input.profiling_group_name
2284        );
2285
2286        let mut request =
2287            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2288        request.set_content_type("application/x-amz-json-1.1".to_owned());
2289
2290        let mut response = self
2291            .client
2292            .sign_and_dispatch(request)
2293            .await
2294            .map_err(RusotoError::from)?;
2295        if response.status.as_u16() == 200 {
2296            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2297            let result = proto::json::ResponsePayload::new(&response)
2298                .deserialize::<GetNotificationConfigurationResponse, _>()?;
2299
2300            Ok(result)
2301        } else {
2302            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2303            Err(GetNotificationConfigurationError::from_response(response))
2304        }
2305    }
2306
2307    /// <p> Returns the JSON-formatted resource-based policy on a profiling group. </p>
2308    #[allow(unused_mut)]
2309    async fn get_policy(
2310        &self,
2311        input: GetPolicyRequest,
2312    ) -> Result<GetPolicyResponse, RusotoError<GetPolicyError>> {
2313        let request_uri = format!(
2314            "/profilingGroups/{profiling_group_name}/policy",
2315            profiling_group_name = input.profiling_group_name
2316        );
2317
2318        let mut request =
2319            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2320        request.set_content_type("application/x-amz-json-1.1".to_owned());
2321
2322        let mut response = self
2323            .client
2324            .sign_and_dispatch(request)
2325            .await
2326            .map_err(RusotoError::from)?;
2327        if response.status.as_u16() == 200 {
2328            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2329            let result = proto::json::ResponsePayload::new(&response)
2330                .deserialize::<GetPolicyResponse, _>()?;
2331
2332            Ok(result)
2333        } else {
2334            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2335            Err(GetPolicyError::from_response(response))
2336        }
2337    }
2338
2339    /// <p><p> Gets the aggregated profile of a profiling group for a specified time range. Amazon CodeGuru Profiler collects posted agent profiles for a profiling group into aggregated profiles. </p> <pre><code> &lt;note&gt; &lt;p&gt; Because aggregated profiles expire over time &lt;code&gt;GetProfile&lt;/code&gt; is not idempotent. &lt;/p&gt; &lt;/note&gt; &lt;p&gt; Specify the time range for the requested aggregated profile using 1 or 2 of the following parameters: &lt;code&gt;startTime&lt;/code&gt;, &lt;code&gt;endTime&lt;/code&gt;, &lt;code&gt;period&lt;/code&gt;. The maximum time range allowed is 7 days. If you specify all 3 parameters, an exception is thrown. If you specify only &lt;code&gt;period&lt;/code&gt;, the latest aggregated profile is returned. &lt;/p&gt; &lt;p&gt; Aggregated profiles are available with aggregation periods of 5 minutes, 1 hour, and 1 day, aligned to UTC. The aggregation period of an aggregated profile determines how long it is retained. For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API<em>AggregatedProfileTime.html&quot;&gt; &lt;code&gt;AggregatedProfileTime&lt;/code&gt; &lt;/a&gt;. The aggregated profile&#39;s aggregation period determines how long it is retained by CodeGuru Profiler. &lt;/p&gt; &lt;ul&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 5 minutes, the aggregated profile is retained for 15 days. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 1 hour, the aggregated profile is retained for 60 days. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If the aggregation period is 1 day, the aggregated profile is retained for 3 years. &lt;/p&gt; &lt;/li&gt; &lt;/ul&gt; &lt;p&gt;There are two use cases for calling &lt;code&gt;GetProfile&lt;/code&gt;.&lt;/p&gt; &lt;ol&gt; &lt;li&gt; &lt;p&gt; If you want to return an aggregated profile that already exists, use &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API</em>ListProfileTimes.html&quot;&gt; &lt;code&gt;ListProfileTimes&lt;/code&gt; &lt;/a&gt; to view the time ranges of existing aggregated profiles. Use them in a &lt;code&gt;GetProfile&lt;/code&gt; request to return a specific, existing aggregated profile. &lt;/p&gt; &lt;/li&gt; &lt;li&gt; &lt;p&gt; If you want to return an aggregated profile for a time range that doesn&#39;t align with an existing aggregated profile, then CodeGuru Profiler makes a best effort to combine existing aggregated profiles from the requested time range and return them as one aggregated profile. &lt;/p&gt; &lt;p&gt; If aggregated profiles do not exist for the full time range requested, then aggregated profiles for a smaller time range are returned. For example, if the requested time range is from 00:00 to 00:20, and the existing aggregated profiles are from 00:15 and 00:25, then the aggregated profiles from 00:15 to 00:20 are returned. &lt;/p&gt; &lt;/li&gt; &lt;/ol&gt; </code></pre></p>
2340    #[allow(unused_mut)]
2341    async fn get_profile(
2342        &self,
2343        input: GetProfileRequest,
2344    ) -> Result<GetProfileResponse, RusotoError<GetProfileError>> {
2345        let request_uri = format!(
2346            "/profilingGroups/{profiling_group_name}/profile",
2347            profiling_group_name = input.profiling_group_name
2348        );
2349
2350        let mut request =
2351            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2352        request.set_content_type("application/x-amz-json-1.1".to_owned());
2353
2354        request.add_optional_header("Accept", input.accept.as_ref());
2355        let mut params = Params::new();
2356        if let Some(ref x) = input.end_time {
2357            params.put("endTime", x);
2358        }
2359        if let Some(ref x) = input.max_depth {
2360            params.put("maxDepth", x);
2361        }
2362        if let Some(ref x) = input.period {
2363            params.put("period", x);
2364        }
2365        if let Some(ref x) = input.start_time {
2366            params.put("startTime", x);
2367        }
2368        request.set_params(params);
2369
2370        let mut response = self
2371            .client
2372            .sign_and_dispatch(request)
2373            .await
2374            .map_err(RusotoError::from)?;
2375        if response.status.as_u16() == 200 {
2376            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2377
2378            let mut result = GetProfileResponse::default();
2379            result.profile = response.body;
2380
2381            result.content_encoding = response.headers.remove("Content-Encoding");
2382            let value = response.headers.remove("Content-Type").unwrap();
2383            result.content_type = value;
2384
2385            Ok(result)
2386        } else {
2387            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2388            Err(GetProfileError::from_response(response))
2389        }
2390    }
2391
2392    /// <p> Returns a list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Recommendation.html"> <code>Recommendation</code> </a> objects that contain recommendations for a profiling group for a given time period. A list of <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_Anomaly.html"> <code>Anomaly</code> </a> objects that contains details about anomalies detected in the profiling group for the same time period is also returned. </p>
2393    #[allow(unused_mut)]
2394    async fn get_recommendations(
2395        &self,
2396        input: GetRecommendationsRequest,
2397    ) -> Result<GetRecommendationsResponse, RusotoError<GetRecommendationsError>> {
2398        let request_uri = format!(
2399            "/internal/profilingGroups/{profiling_group_name}/recommendations",
2400            profiling_group_name = input.profiling_group_name
2401        );
2402
2403        let mut request =
2404            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2405        request.set_content_type("application/x-amz-json-1.1".to_owned());
2406
2407        let mut params = Params::new();
2408        params.put("endTime", &input.end_time);
2409        if let Some(ref x) = input.locale {
2410            params.put("locale", x);
2411        }
2412        params.put("startTime", &input.start_time);
2413        request.set_params(params);
2414
2415        let mut response = self
2416            .client
2417            .sign_and_dispatch(request)
2418            .await
2419            .map_err(RusotoError::from)?;
2420        if response.status.as_u16() == 200 {
2421            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2422            let result = proto::json::ResponsePayload::new(&response)
2423                .deserialize::<GetRecommendationsResponse, _>()?;
2424
2425            Ok(result)
2426        } else {
2427            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2428            Err(GetRecommendationsError::from_response(response))
2429        }
2430    }
2431
2432    /// <p>List the available reports for a given profiling group and time range.</p>
2433    #[allow(unused_mut)]
2434    async fn list_findings_reports(
2435        &self,
2436        input: ListFindingsReportsRequest,
2437    ) -> Result<ListFindingsReportsResponse, RusotoError<ListFindingsReportsError>> {
2438        let request_uri = format!(
2439            "/internal/profilingGroups/{profiling_group_name}/findingsReports",
2440            profiling_group_name = input.profiling_group_name
2441        );
2442
2443        let mut request =
2444            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2445        request.set_content_type("application/x-amz-json-1.1".to_owned());
2446
2447        let mut params = Params::new();
2448        if let Some(ref x) = input.daily_reports_only {
2449            params.put("dailyReportsOnly", x);
2450        }
2451        params.put("endTime", &input.end_time);
2452        if let Some(ref x) = input.max_results {
2453            params.put("maxResults", x);
2454        }
2455        if let Some(ref x) = input.next_token {
2456            params.put("nextToken", x);
2457        }
2458        params.put("startTime", &input.start_time);
2459        request.set_params(params);
2460
2461        let mut response = self
2462            .client
2463            .sign_and_dispatch(request)
2464            .await
2465            .map_err(RusotoError::from)?;
2466        if response.status.as_u16() == 200 {
2467            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2468            let result = proto::json::ResponsePayload::new(&response)
2469                .deserialize::<ListFindingsReportsResponse, _>()?;
2470
2471            Ok(result)
2472        } else {
2473            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2474            Err(ListFindingsReportsError::from_response(response))
2475        }
2476    }
2477
2478    /// <p>Lists the start times of the available aggregated profiles of a profiling group for an aggregation period within the specified time range.</p>
2479    #[allow(unused_mut)]
2480    async fn list_profile_times(
2481        &self,
2482        input: ListProfileTimesRequest,
2483    ) -> Result<ListProfileTimesResponse, RusotoError<ListProfileTimesError>> {
2484        let request_uri = format!(
2485            "/profilingGroups/{profiling_group_name}/profileTimes",
2486            profiling_group_name = input.profiling_group_name
2487        );
2488
2489        let mut request =
2490            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2491        request.set_content_type("application/x-amz-json-1.1".to_owned());
2492
2493        let mut params = Params::new();
2494        params.put("endTime", &input.end_time);
2495        if let Some(ref x) = input.max_results {
2496            params.put("maxResults", x);
2497        }
2498        if let Some(ref x) = input.next_token {
2499            params.put("nextToken", x);
2500        }
2501        if let Some(ref x) = input.order_by {
2502            params.put("orderBy", x);
2503        }
2504        params.put("period", &input.period);
2505        params.put("startTime", &input.start_time);
2506        request.set_params(params);
2507
2508        let mut response = self
2509            .client
2510            .sign_and_dispatch(request)
2511            .await
2512            .map_err(RusotoError::from)?;
2513        if response.status.as_u16() == 200 {
2514            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2515            let result = proto::json::ResponsePayload::new(&response)
2516                .deserialize::<ListProfileTimesResponse, _>()?;
2517
2518            Ok(result)
2519        } else {
2520            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2521            Err(ListProfileTimesError::from_response(response))
2522        }
2523    }
2524
2525    /// <p> Returns a list of profiling groups. The profiling groups are returned as <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ProfilingGroupDescription.html"> <code>ProfilingGroupDescription</code> </a> objects. </p>
2526    #[allow(unused_mut)]
2527    async fn list_profiling_groups(
2528        &self,
2529        input: ListProfilingGroupsRequest,
2530    ) -> Result<ListProfilingGroupsResponse, RusotoError<ListProfilingGroupsError>> {
2531        let request_uri = "/profilingGroups";
2532
2533        let mut request =
2534            SignedRequest::new("GET", "codeguru-profiler", &self.region, &request_uri);
2535        request.set_content_type("application/x-amz-json-1.1".to_owned());
2536
2537        let mut params = Params::new();
2538        if let Some(ref x) = input.include_description {
2539            params.put("includeDescription", x);
2540        }
2541        if let Some(ref x) = input.max_results {
2542            params.put("maxResults", x);
2543        }
2544        if let Some(ref x) = input.next_token {
2545            params.put("nextToken", x);
2546        }
2547        request.set_params(params);
2548
2549        let mut response = self
2550            .client
2551            .sign_and_dispatch(request)
2552            .await
2553            .map_err(RusotoError::from)?;
2554        if response.status.as_u16() == 200 {
2555            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2556            let result = proto::json::ResponsePayload::new(&response)
2557                .deserialize::<ListProfilingGroupsResponse, _>()?;
2558
2559            Ok(result)
2560        } else {
2561            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2562            Err(ListProfilingGroupsError::from_response(response))
2563        }
2564    }
2565
2566    /// <p> Submits profiling data to an aggregated profile of a profiling group. To get an aggregated profile that is created with this profiling data, use <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_GetProfile.html"> <code>GetProfile</code> </a>. </p>
2567    #[allow(unused_mut)]
2568    async fn post_agent_profile(
2569        &self,
2570        input: PostAgentProfileRequest,
2571    ) -> Result<PostAgentProfileResponse, RusotoError<PostAgentProfileError>> {
2572        let request_uri = format!(
2573            "/profilingGroups/{profiling_group_name}/agentProfile",
2574            profiling_group_name = input.profiling_group_name
2575        );
2576
2577        let mut request =
2578            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2579        request.set_content_type("application/x-amz-json-1.1".to_owned());
2580
2581        let encoded = Some(input.agent_profile.to_owned());
2582        request.set_payload(encoded);
2583        request.add_header("Content-Type", &input.content_type.to_string());
2584        let mut params = Params::new();
2585        if let Some(ref x) = input.profile_token {
2586            params.put("profileToken", x);
2587        }
2588        request.set_params(params);
2589
2590        let mut response = self
2591            .client
2592            .sign_and_dispatch(request)
2593            .await
2594            .map_err(RusotoError::from)?;
2595        if response.status.as_u16() == 204 {
2596            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2597            let result = proto::json::ResponsePayload::new(&response)
2598                .deserialize::<PostAgentProfileResponse, _>()?;
2599
2600            Ok(result)
2601        } else {
2602            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2603            Err(PostAgentProfileError::from_response(response))
2604        }
2605    }
2606
2607    /// <p><p> Adds permissions to a profiling group&#39;s resource-based policy that are provided using an action group. If a profiling group doesn&#39;t have a resource-based policy, one is created for it using the permissions in the action group and the roles and users in the <code>principals</code> parameter. </p> <pre><code> &lt;p&gt; The one supported action group that can be added is &lt;code&gt;agentPermission&lt;/code&gt; which grants &lt;code&gt;ConfigureAgent&lt;/code&gt; and &lt;code&gt;PostAgent&lt;/code&gt; permissions. For more information, see &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html&quot;&gt;Resource-based policies in CodeGuru Profiler&lt;/a&gt; in the &lt;i&gt;Amazon CodeGuru Profiler User Guide&lt;/i&gt;, &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API<em>ConfigureAgent.html&quot;&gt; &lt;code&gt;ConfigureAgent&lt;/code&gt; &lt;/a&gt;, and &lt;a href=&quot;https://docs.aws.amazon.com/codeguru/latest/profiler-api/API</em>PostAgentProfile.html&quot;&gt; &lt;code&gt;PostAgentProfile&lt;/code&gt; &lt;/a&gt;. &lt;/p&gt; &lt;p&gt; The first time you call &lt;code&gt;PutPermission&lt;/code&gt; on a profiling group, do not specify a &lt;code&gt;revisionId&lt;/code&gt; because it doesn&#39;t have a resource-based policy. Subsequent calls must provide a &lt;code&gt;revisionId&lt;/code&gt; to specify which revision of the resource-based policy to add the permissions to. &lt;/p&gt; &lt;p&gt; The response contains the profiling group&#39;s JSON-formatted resource policy. &lt;/p&gt; </code></pre></p>
2608    #[allow(unused_mut)]
2609    async fn put_permission(
2610        &self,
2611        input: PutPermissionRequest,
2612    ) -> Result<PutPermissionResponse, RusotoError<PutPermissionError>> {
2613        let request_uri = format!(
2614            "/profilingGroups/{profiling_group_name}/policy/{action_group}",
2615            action_group = input.action_group,
2616            profiling_group_name = input.profiling_group_name
2617        );
2618
2619        let mut request =
2620            SignedRequest::new("PUT", "codeguru-profiler", &self.region, &request_uri);
2621        request.set_content_type("application/x-amz-json-1.1".to_owned());
2622
2623        let encoded = Some(serde_json::to_vec(&input).unwrap());
2624        request.set_payload(encoded);
2625
2626        let mut response = self
2627            .client
2628            .sign_and_dispatch(request)
2629            .await
2630            .map_err(RusotoError::from)?;
2631        if response.status.as_u16() == 200 {
2632            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2633            let result = proto::json::ResponsePayload::new(&response)
2634                .deserialize::<PutPermissionResponse, _>()?;
2635
2636            Ok(result)
2637        } else {
2638            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2639            Err(PutPermissionError::from_response(response))
2640        }
2641    }
2642
2643    /// <p>Remove one anomaly notifications channel for a profiling group.</p>
2644    #[allow(unused_mut)]
2645    async fn remove_notification_channel(
2646        &self,
2647        input: RemoveNotificationChannelRequest,
2648    ) -> Result<RemoveNotificationChannelResponse, RusotoError<RemoveNotificationChannelError>>
2649    {
2650        let request_uri = format!(
2651            "/profilingGroups/{profiling_group_name}/notificationConfiguration/{channel_id}",
2652            channel_id = input.channel_id,
2653            profiling_group_name = input.profiling_group_name
2654        );
2655
2656        let mut request =
2657            SignedRequest::new("DELETE", "codeguru-profiler", &self.region, &request_uri);
2658        request.set_content_type("application/x-amz-json-1.1".to_owned());
2659
2660        let mut response = self
2661            .client
2662            .sign_and_dispatch(request)
2663            .await
2664            .map_err(RusotoError::from)?;
2665        if response.status.as_u16() == 200 {
2666            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2667            let result = proto::json::ResponsePayload::new(&response)
2668                .deserialize::<RemoveNotificationChannelResponse, _>()?;
2669
2670            Ok(result)
2671        } else {
2672            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2673            Err(RemoveNotificationChannelError::from_response(response))
2674        }
2675    }
2676
2677    /// <p> Removes permissions from a profiling group's resource-based policy that are provided using an action group. The one supported action group that can be removed is <code>agentPermission</code> which grants <code>ConfigureAgent</code> and <code>PostAgent</code> permissions. For more information, see <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-ug/resource-based-policies.html">Resource-based policies in CodeGuru Profiler</a> in the <i>Amazon CodeGuru Profiler User Guide</i>, <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_ConfigureAgent.html"> <code>ConfigureAgent</code> </a>, and <a href="https://docs.aws.amazon.com/codeguru/latest/profiler-api/API_PostAgentProfile.html"> <code>PostAgentProfile</code> </a>. </p>
2678    #[allow(unused_mut)]
2679    async fn remove_permission(
2680        &self,
2681        input: RemovePermissionRequest,
2682    ) -> Result<RemovePermissionResponse, RusotoError<RemovePermissionError>> {
2683        let request_uri = format!(
2684            "/profilingGroups/{profiling_group_name}/policy/{action_group}",
2685            action_group = input.action_group,
2686            profiling_group_name = input.profiling_group_name
2687        );
2688
2689        let mut request =
2690            SignedRequest::new("DELETE", "codeguru-profiler", &self.region, &request_uri);
2691        request.set_content_type("application/x-amz-json-1.1".to_owned());
2692
2693        let mut params = Params::new();
2694        params.put("revisionId", &input.revision_id);
2695        request.set_params(params);
2696
2697        let mut response = self
2698            .client
2699            .sign_and_dispatch(request)
2700            .await
2701            .map_err(RusotoError::from)?;
2702        if response.status.as_u16() == 200 {
2703            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2704            let result = proto::json::ResponsePayload::new(&response)
2705                .deserialize::<RemovePermissionResponse, _>()?;
2706
2707            Ok(result)
2708        } else {
2709            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2710            Err(RemovePermissionError::from_response(response))
2711        }
2712    }
2713
2714    /// <p>Sends feedback to CodeGuru Profiler about whether the anomaly detected by the analysis is useful or not.</p>
2715    #[allow(unused_mut)]
2716    async fn submit_feedback(
2717        &self,
2718        input: SubmitFeedbackRequest,
2719    ) -> Result<SubmitFeedbackResponse, RusotoError<SubmitFeedbackError>> {
2720        let request_uri = format!("/internal/profilingGroups/{profiling_group_name}/anomalies/{anomaly_instance_id}/feedback", anomaly_instance_id = input.anomaly_instance_id, profiling_group_name = input.profiling_group_name);
2721
2722        let mut request =
2723            SignedRequest::new("POST", "codeguru-profiler", &self.region, &request_uri);
2724        request.set_content_type("application/x-amz-json-1.1".to_owned());
2725
2726        let encoded = Some(serde_json::to_vec(&input).unwrap());
2727        request.set_payload(encoded);
2728
2729        let mut response = self
2730            .client
2731            .sign_and_dispatch(request)
2732            .await
2733            .map_err(RusotoError::from)?;
2734        if response.status.as_u16() == 204 {
2735            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2736            let result = proto::json::ResponsePayload::new(&response)
2737                .deserialize::<SubmitFeedbackResponse, _>()?;
2738
2739            Ok(result)
2740        } else {
2741            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2742            Err(SubmitFeedbackError::from_response(response))
2743        }
2744    }
2745
2746    /// <p>Updates a profiling group.</p>
2747    #[allow(unused_mut)]
2748    async fn update_profiling_group(
2749        &self,
2750        input: UpdateProfilingGroupRequest,
2751    ) -> Result<UpdateProfilingGroupResponse, RusotoError<UpdateProfilingGroupError>> {
2752        let request_uri = format!(
2753            "/profilingGroups/{profiling_group_name}",
2754            profiling_group_name = input.profiling_group_name
2755        );
2756
2757        let mut request =
2758            SignedRequest::new("PUT", "codeguru-profiler", &self.region, &request_uri);
2759        request.set_content_type("application/x-amz-json-1.1".to_owned());
2760
2761        let encoded = Some(serde_json::to_vec(&input).unwrap());
2762        request.set_payload(encoded);
2763
2764        let mut response = self
2765            .client
2766            .sign_and_dispatch(request)
2767            .await
2768            .map_err(RusotoError::from)?;
2769        if response.status.as_u16() == 200 {
2770            let mut response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2771            let result = proto::json::ResponsePayload::new(&response)
2772                .deserialize::<UpdateProfilingGroupResponse, _>()?;
2773
2774            Ok(result)
2775        } else {
2776            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
2777            Err(UpdateProfilingGroupError::from_response(response))
2778        }
2779    }
2780}