rusoto_logs/
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::proto;
23use rusoto_core::request::HttpResponse;
24use rusoto_core::signature::SignedRequest;
25#[allow(unused_imports)]
26use serde::{Deserialize, Serialize};
27
28impl CloudWatchLogsClient {
29    fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
30        let mut request = SignedRequest::new(http_method, "logs", &self.region, request_uri);
31
32        request.set_content_type("application/x-amz-json-1.1".to_owned());
33
34        request
35    }
36
37    async fn sign_and_dispatch<E>(
38        &self,
39        request: SignedRequest,
40        from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
41    ) -> Result<HttpResponse, RusotoError<E>> {
42        let mut response = self.client.sign_and_dispatch(request).await?;
43        if !response.status.is_success() {
44            let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
45            return Err(from_response(response));
46        }
47
48        Ok(response)
49    }
50}
51
52use serde_json;
53#[derive(Clone, Debug, Default, PartialEq, Serialize)]
54#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
55pub struct AssociateKmsKeyRequest {
56    /// <p>The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. This must be a symmetric CMK. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms">Amazon Resource Names - AWS Key Management Service (AWS KMS)</a> and <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p>
57    #[serde(rename = "kmsKeyId")]
58    pub kms_key_id: String,
59    /// <p>The name of the log group.</p>
60    #[serde(rename = "logGroupName")]
61    pub log_group_name: String,
62}
63
64#[derive(Clone, Debug, Default, PartialEq, Serialize)]
65#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
66pub struct CancelExportTaskRequest {
67    /// <p>The ID of the export task.</p>
68    #[serde(rename = "taskId")]
69    pub task_id: String,
70}
71
72#[derive(Clone, Debug, Default, PartialEq, Serialize)]
73#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
74pub struct CreateExportTaskRequest {
75    /// <p>The name of S3 bucket for the exported log data. The bucket must be in the same AWS region.</p>
76    #[serde(rename = "destination")]
77    pub destination: String,
78    /// <p>The prefix used as the start of the key for every object exported. If you don't specify a value, the default is <code>exportedlogs</code>.</p>
79    #[serde(rename = "destinationPrefix")]
80    #[serde(skip_serializing_if = "Option::is_none")]
81    pub destination_prefix: Option<String>,
82    /// <p>The start time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp earlier than this time are not exported.</p>
83    #[serde(rename = "from")]
84    pub from: i64,
85    /// <p>The name of the log group.</p>
86    #[serde(rename = "logGroupName")]
87    pub log_group_name: String,
88    /// <p>Export only log streams that match the provided prefix. If you don't specify a value, no prefix filter is applied.</p>
89    #[serde(rename = "logStreamNamePrefix")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub log_stream_name_prefix: Option<String>,
92    /// <p>The name of the export task.</p>
93    #[serde(rename = "taskName")]
94    #[serde(skip_serializing_if = "Option::is_none")]
95    pub task_name: Option<String>,
96    /// <p>The end time of the range for the request, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.</p>
97    #[serde(rename = "to")]
98    pub to: i64,
99}
100
101#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
102#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
103pub struct CreateExportTaskResponse {
104    /// <p>The ID of the export task.</p>
105    #[serde(rename = "taskId")]
106    #[serde(skip_serializing_if = "Option::is_none")]
107    pub task_id: Option<String>,
108}
109
110#[derive(Clone, Debug, Default, PartialEq, Serialize)]
111#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
112pub struct CreateLogGroupRequest {
113    /// <p>The Amazon Resource Name (ARN) of the CMK to use when encrypting log data. For more information, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html#arn-syntax-kms">Amazon Resource Names - AWS Key Management Service (AWS KMS)</a>.</p>
114    #[serde(rename = "kmsKeyId")]
115    #[serde(skip_serializing_if = "Option::is_none")]
116    pub kms_key_id: Option<String>,
117    /// <p>The name of the log group.</p>
118    #[serde(rename = "logGroupName")]
119    pub log_group_name: String,
120    /// <p>The key-value pairs to use for the tags.</p>
121    #[serde(rename = "tags")]
122    #[serde(skip_serializing_if = "Option::is_none")]
123    pub tags: Option<::std::collections::HashMap<String, String>>,
124}
125
126#[derive(Clone, Debug, Default, PartialEq, Serialize)]
127#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
128pub struct CreateLogStreamRequest {
129    /// <p>The name of the log group.</p>
130    #[serde(rename = "logGroupName")]
131    pub log_group_name: String,
132    /// <p>The name of the log stream.</p>
133    #[serde(rename = "logStreamName")]
134    pub log_stream_name: String,
135}
136
137#[derive(Clone, Debug, Default, PartialEq, Serialize)]
138#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
139pub struct DeleteDestinationRequest {
140    /// <p>The name of the destination.</p>
141    #[serde(rename = "destinationName")]
142    pub destination_name: String,
143}
144
145#[derive(Clone, Debug, Default, PartialEq, Serialize)]
146#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
147pub struct DeleteLogGroupRequest {
148    /// <p>The name of the log group.</p>
149    #[serde(rename = "logGroupName")]
150    pub log_group_name: String,
151}
152
153#[derive(Clone, Debug, Default, PartialEq, Serialize)]
154#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
155pub struct DeleteLogStreamRequest {
156    /// <p>The name of the log group.</p>
157    #[serde(rename = "logGroupName")]
158    pub log_group_name: String,
159    /// <p>The name of the log stream.</p>
160    #[serde(rename = "logStreamName")]
161    pub log_stream_name: String,
162}
163
164#[derive(Clone, Debug, Default, PartialEq, Serialize)]
165#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
166pub struct DeleteMetricFilterRequest {
167    /// <p>The name of the metric filter.</p>
168    #[serde(rename = "filterName")]
169    pub filter_name: String,
170    /// <p>The name of the log group.</p>
171    #[serde(rename = "logGroupName")]
172    pub log_group_name: String,
173}
174
175#[derive(Clone, Debug, Default, PartialEq, Serialize)]
176#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
177pub struct DeleteQueryDefinitionRequest {
178    #[serde(rename = "queryDefinitionId")]
179    pub query_definition_id: String,
180}
181
182#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
183#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
184pub struct DeleteQueryDefinitionResponse {
185    #[serde(rename = "success")]
186    #[serde(skip_serializing_if = "Option::is_none")]
187    pub success: Option<bool>,
188}
189
190#[derive(Clone, Debug, Default, PartialEq, Serialize)]
191#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
192pub struct DeleteResourcePolicyRequest {
193    /// <p>The name of the policy to be revoked. This parameter is required.</p>
194    #[serde(rename = "policyName")]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub policy_name: Option<String>,
197}
198
199#[derive(Clone, Debug, Default, PartialEq, Serialize)]
200#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
201pub struct DeleteRetentionPolicyRequest {
202    /// <p>The name of the log group.</p>
203    #[serde(rename = "logGroupName")]
204    pub log_group_name: String,
205}
206
207#[derive(Clone, Debug, Default, PartialEq, Serialize)]
208#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
209pub struct DeleteSubscriptionFilterRequest {
210    /// <p>The name of the subscription filter.</p>
211    #[serde(rename = "filterName")]
212    pub filter_name: String,
213    /// <p>The name of the log group.</p>
214    #[serde(rename = "logGroupName")]
215    pub log_group_name: String,
216}
217
218#[derive(Clone, Debug, Default, PartialEq, Serialize)]
219#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
220pub struct DescribeDestinationsRequest {
221    /// <p>The prefix to match. If you don't specify a value, no prefix filter is applied.</p>
222    #[serde(rename = "DestinationNamePrefix")]
223    #[serde(skip_serializing_if = "Option::is_none")]
224    pub destination_name_prefix: Option<String>,
225    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
226    #[serde(rename = "limit")]
227    #[serde(skip_serializing_if = "Option::is_none")]
228    pub limit: Option<i64>,
229    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
230    #[serde(rename = "nextToken")]
231    #[serde(skip_serializing_if = "Option::is_none")]
232    pub next_token: Option<String>,
233}
234
235#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
236#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
237pub struct DescribeDestinationsResponse {
238    /// <p>The destinations.</p>
239    #[serde(rename = "destinations")]
240    #[serde(skip_serializing_if = "Option::is_none")]
241    pub destinations: Option<Vec<Destination>>,
242    #[serde(rename = "nextToken")]
243    #[serde(skip_serializing_if = "Option::is_none")]
244    pub next_token: Option<String>,
245}
246
247#[derive(Clone, Debug, Default, PartialEq, Serialize)]
248#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
249pub struct DescribeExportTasksRequest {
250    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
251    #[serde(rename = "limit")]
252    #[serde(skip_serializing_if = "Option::is_none")]
253    pub limit: Option<i64>,
254    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
255    #[serde(rename = "nextToken")]
256    #[serde(skip_serializing_if = "Option::is_none")]
257    pub next_token: Option<String>,
258    /// <p>The status code of the export task. Specifying a status code filters the results to zero or more export tasks.</p>
259    #[serde(rename = "statusCode")]
260    #[serde(skip_serializing_if = "Option::is_none")]
261    pub status_code: Option<String>,
262    /// <p>The ID of the export task. Specifying a task ID filters the results to zero or one export tasks.</p>
263    #[serde(rename = "taskId")]
264    #[serde(skip_serializing_if = "Option::is_none")]
265    pub task_id: Option<String>,
266}
267
268#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
269#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
270pub struct DescribeExportTasksResponse {
271    /// <p>The export tasks.</p>
272    #[serde(rename = "exportTasks")]
273    #[serde(skip_serializing_if = "Option::is_none")]
274    pub export_tasks: Option<Vec<ExportTask>>,
275    #[serde(rename = "nextToken")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub next_token: Option<String>,
278}
279
280#[derive(Clone, Debug, Default, PartialEq, Serialize)]
281#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
282pub struct DescribeLogGroupsRequest {
283    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
284    #[serde(rename = "limit")]
285    #[serde(skip_serializing_if = "Option::is_none")]
286    pub limit: Option<i64>,
287    /// <p>The prefix to match.</p>
288    #[serde(rename = "logGroupNamePrefix")]
289    #[serde(skip_serializing_if = "Option::is_none")]
290    pub log_group_name_prefix: Option<String>,
291    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
292    #[serde(rename = "nextToken")]
293    #[serde(skip_serializing_if = "Option::is_none")]
294    pub next_token: Option<String>,
295}
296
297#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
298#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
299pub struct DescribeLogGroupsResponse {
300    /// <p>The log groups.</p>
301    #[serde(rename = "logGroups")]
302    #[serde(skip_serializing_if = "Option::is_none")]
303    pub log_groups: Option<Vec<LogGroup>>,
304    #[serde(rename = "nextToken")]
305    #[serde(skip_serializing_if = "Option::is_none")]
306    pub next_token: Option<String>,
307}
308
309#[derive(Clone, Debug, Default, PartialEq, Serialize)]
310#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
311pub struct DescribeLogStreamsRequest {
312    /// <p>If the value is true, results are returned in descending order. If the value is to false, results are returned in ascending order. The default value is false.</p>
313    #[serde(rename = "descending")]
314    #[serde(skip_serializing_if = "Option::is_none")]
315    pub descending: Option<bool>,
316    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
317    #[serde(rename = "limit")]
318    #[serde(skip_serializing_if = "Option::is_none")]
319    pub limit: Option<i64>,
320    /// <p>The name of the log group.</p>
321    #[serde(rename = "logGroupName")]
322    pub log_group_name: String,
323    /// <p>The prefix to match.</p> <p>If <code>orderBy</code> is <code>LastEventTime</code>,you cannot specify this parameter.</p>
324    #[serde(rename = "logStreamNamePrefix")]
325    #[serde(skip_serializing_if = "Option::is_none")]
326    pub log_stream_name_prefix: Option<String>,
327    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
328    #[serde(rename = "nextToken")]
329    #[serde(skip_serializing_if = "Option::is_none")]
330    pub next_token: Option<String>,
331    /// <p>If the value is <code>LogStreamName</code>, the results are ordered by log stream name. If the value is <code>LastEventTime</code>, the results are ordered by the event time. The default value is <code>LogStreamName</code>.</p> <p>If you order the results by event time, you cannot specify the <code>logStreamNamePrefix</code> parameter.</p> <p>lastEventTimestamp represents the time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. lastEventTimeStamp updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, but may take longer in some rare situations.</p>
332    #[serde(rename = "orderBy")]
333    #[serde(skip_serializing_if = "Option::is_none")]
334    pub order_by: Option<String>,
335}
336
337#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
338#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
339pub struct DescribeLogStreamsResponse {
340    /// <p>The log streams.</p>
341    #[serde(rename = "logStreams")]
342    #[serde(skip_serializing_if = "Option::is_none")]
343    pub log_streams: Option<Vec<LogStream>>,
344    #[serde(rename = "nextToken")]
345    #[serde(skip_serializing_if = "Option::is_none")]
346    pub next_token: Option<String>,
347}
348
349#[derive(Clone, Debug, Default, PartialEq, Serialize)]
350#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
351pub struct DescribeMetricFiltersRequest {
352    /// <p>The prefix to match.</p>
353    #[serde(rename = "filterNamePrefix")]
354    #[serde(skip_serializing_if = "Option::is_none")]
355    pub filter_name_prefix: Option<String>,
356    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
357    #[serde(rename = "limit")]
358    #[serde(skip_serializing_if = "Option::is_none")]
359    pub limit: Option<i64>,
360    /// <p>The name of the log group.</p>
361    #[serde(rename = "logGroupName")]
362    #[serde(skip_serializing_if = "Option::is_none")]
363    pub log_group_name: Option<String>,
364    /// <p>Filters results to include only those with the specified metric name. If you include this parameter in your request, you must also include the <code>metricNamespace</code> parameter.</p>
365    #[serde(rename = "metricName")]
366    #[serde(skip_serializing_if = "Option::is_none")]
367    pub metric_name: Option<String>,
368    /// <p>Filters results to include only those in the specified namespace. If you include this parameter in your request, you must also include the <code>metricName</code> parameter.</p>
369    #[serde(rename = "metricNamespace")]
370    #[serde(skip_serializing_if = "Option::is_none")]
371    pub metric_namespace: Option<String>,
372    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
373    #[serde(rename = "nextToken")]
374    #[serde(skip_serializing_if = "Option::is_none")]
375    pub next_token: Option<String>,
376}
377
378#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
379#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
380pub struct DescribeMetricFiltersResponse {
381    /// <p>The metric filters.</p>
382    #[serde(rename = "metricFilters")]
383    #[serde(skip_serializing_if = "Option::is_none")]
384    pub metric_filters: Option<Vec<MetricFilter>>,
385    #[serde(rename = "nextToken")]
386    #[serde(skip_serializing_if = "Option::is_none")]
387    pub next_token: Option<String>,
388}
389
390#[derive(Clone, Debug, Default, PartialEq, Serialize)]
391#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
392pub struct DescribeQueriesRequest {
393    /// <p>Limits the returned queries to only those for the specified log group.</p>
394    #[serde(rename = "logGroupName")]
395    #[serde(skip_serializing_if = "Option::is_none")]
396    pub log_group_name: Option<String>,
397    /// <p>Limits the number of returned queries to the specified number.</p>
398    #[serde(rename = "maxResults")]
399    #[serde(skip_serializing_if = "Option::is_none")]
400    pub max_results: Option<i64>,
401    #[serde(rename = "nextToken")]
402    #[serde(skip_serializing_if = "Option::is_none")]
403    pub next_token: Option<String>,
404    /// <p>Limits the returned queries to only those that have the specified status. Valid values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, and <code>Scheduled</code>.</p>
405    #[serde(rename = "status")]
406    #[serde(skip_serializing_if = "Option::is_none")]
407    pub status: Option<String>,
408}
409
410#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
411#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
412pub struct DescribeQueriesResponse {
413    #[serde(rename = "nextToken")]
414    #[serde(skip_serializing_if = "Option::is_none")]
415    pub next_token: Option<String>,
416    /// <p>The list of queries that match the request.</p>
417    #[serde(rename = "queries")]
418    #[serde(skip_serializing_if = "Option::is_none")]
419    pub queries: Option<Vec<QueryInfo>>,
420}
421
422#[derive(Clone, Debug, Default, PartialEq, Serialize)]
423#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
424pub struct DescribeQueryDefinitionsRequest {
425    #[serde(rename = "maxResults")]
426    #[serde(skip_serializing_if = "Option::is_none")]
427    pub max_results: Option<i64>,
428    #[serde(rename = "nextToken")]
429    #[serde(skip_serializing_if = "Option::is_none")]
430    pub next_token: Option<String>,
431    #[serde(rename = "queryDefinitionNamePrefix")]
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub query_definition_name_prefix: Option<String>,
434}
435
436#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
437#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
438pub struct DescribeQueryDefinitionsResponse {
439    #[serde(rename = "nextToken")]
440    #[serde(skip_serializing_if = "Option::is_none")]
441    pub next_token: Option<String>,
442    #[serde(rename = "queryDefinitions")]
443    #[serde(skip_serializing_if = "Option::is_none")]
444    pub query_definitions: Option<Vec<QueryDefinition>>,
445}
446
447#[derive(Clone, Debug, Default, PartialEq, Serialize)]
448#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
449pub struct DescribeResourcePoliciesRequest {
450    /// <p>The maximum number of resource policies to be displayed with one call of this API.</p>
451    #[serde(rename = "limit")]
452    #[serde(skip_serializing_if = "Option::is_none")]
453    pub limit: Option<i64>,
454    #[serde(rename = "nextToken")]
455    #[serde(skip_serializing_if = "Option::is_none")]
456    pub next_token: Option<String>,
457}
458
459#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
460#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
461pub struct DescribeResourcePoliciesResponse {
462    #[serde(rename = "nextToken")]
463    #[serde(skip_serializing_if = "Option::is_none")]
464    pub next_token: Option<String>,
465    /// <p>The resource policies that exist in this account.</p>
466    #[serde(rename = "resourcePolicies")]
467    #[serde(skip_serializing_if = "Option::is_none")]
468    pub resource_policies: Option<Vec<ResourcePolicy>>,
469}
470
471#[derive(Clone, Debug, Default, PartialEq, Serialize)]
472#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
473pub struct DescribeSubscriptionFiltersRequest {
474    /// <p>The prefix to match. If you don't specify a value, no prefix filter is applied.</p>
475    #[serde(rename = "filterNamePrefix")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub filter_name_prefix: Option<String>,
478    /// <p>The maximum number of items returned. If you don't specify a value, the default is up to 50 items.</p>
479    #[serde(rename = "limit")]
480    #[serde(skip_serializing_if = "Option::is_none")]
481    pub limit: Option<i64>,
482    /// <p>The name of the log group.</p>
483    #[serde(rename = "logGroupName")]
484    pub log_group_name: String,
485    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p>
486    #[serde(rename = "nextToken")]
487    #[serde(skip_serializing_if = "Option::is_none")]
488    pub next_token: Option<String>,
489}
490
491#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
492#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
493pub struct DescribeSubscriptionFiltersResponse {
494    #[serde(rename = "nextToken")]
495    #[serde(skip_serializing_if = "Option::is_none")]
496    pub next_token: Option<String>,
497    /// <p>The subscription filters.</p>
498    #[serde(rename = "subscriptionFilters")]
499    #[serde(skip_serializing_if = "Option::is_none")]
500    pub subscription_filters: Option<Vec<SubscriptionFilter>>,
501}
502
503/// <p>Represents a cross-account destination that receives subscription log events.</p>
504#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
505#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
506pub struct Destination {
507    /// <p>An IAM policy document that governs which AWS accounts can create subscription filters against this destination.</p>
508    #[serde(rename = "accessPolicy")]
509    #[serde(skip_serializing_if = "Option::is_none")]
510    pub access_policy: Option<String>,
511    /// <p>The ARN of this destination.</p>
512    #[serde(rename = "arn")]
513    #[serde(skip_serializing_if = "Option::is_none")]
514    pub arn: Option<String>,
515    /// <p>The creation time of the destination, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
516    #[serde(rename = "creationTime")]
517    #[serde(skip_serializing_if = "Option::is_none")]
518    pub creation_time: Option<i64>,
519    /// <p>The name of the destination.</p>
520    #[serde(rename = "destinationName")]
521    #[serde(skip_serializing_if = "Option::is_none")]
522    pub destination_name: Option<String>,
523    /// <p>A role for impersonation, used when delivering log events to the target.</p>
524    #[serde(rename = "roleArn")]
525    #[serde(skip_serializing_if = "Option::is_none")]
526    pub role_arn: Option<String>,
527    /// <p>The Amazon Resource Name (ARN) of the physical target to where the log events are delivered (for example, a Kinesis stream).</p>
528    #[serde(rename = "targetArn")]
529    #[serde(skip_serializing_if = "Option::is_none")]
530    pub target_arn: Option<String>,
531}
532
533#[derive(Clone, Debug, Default, PartialEq, Serialize)]
534#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
535pub struct DisassociateKmsKeyRequest {
536    /// <p>The name of the log group.</p>
537    #[serde(rename = "logGroupName")]
538    pub log_group_name: String,
539}
540
541/// <p>Represents an export task.</p>
542#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
543#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
544pub struct ExportTask {
545    /// <p>The name of Amazon S3 bucket to which the log data was exported.</p>
546    #[serde(rename = "destination")]
547    #[serde(skip_serializing_if = "Option::is_none")]
548    pub destination: Option<String>,
549    /// <p>The prefix that was used as the start of Amazon S3 key for every object exported.</p>
550    #[serde(rename = "destinationPrefix")]
551    #[serde(skip_serializing_if = "Option::is_none")]
552    pub destination_prefix: Option<String>,
553    /// <p>Execution info about the export task.</p>
554    #[serde(rename = "executionInfo")]
555    #[serde(skip_serializing_if = "Option::is_none")]
556    pub execution_info: Option<ExportTaskExecutionInfo>,
557    /// <p>The start time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not exported.</p>
558    #[serde(rename = "from")]
559    #[serde(skip_serializing_if = "Option::is_none")]
560    pub from: Option<i64>,
561    /// <p>The name of the log group from which logs data was exported.</p>
562    #[serde(rename = "logGroupName")]
563    #[serde(skip_serializing_if = "Option::is_none")]
564    pub log_group_name: Option<String>,
565    /// <p>The status of the export task.</p>
566    #[serde(rename = "status")]
567    #[serde(skip_serializing_if = "Option::is_none")]
568    pub status: Option<ExportTaskStatus>,
569    /// <p>The ID of the export task.</p>
570    #[serde(rename = "taskId")]
571    #[serde(skip_serializing_if = "Option::is_none")]
572    pub task_id: Option<String>,
573    /// <p>The name of the export task.</p>
574    #[serde(rename = "taskName")]
575    #[serde(skip_serializing_if = "Option::is_none")]
576    pub task_name: Option<String>,
577    /// <p>The end time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not exported.</p>
578    #[serde(rename = "to")]
579    #[serde(skip_serializing_if = "Option::is_none")]
580    pub to: Option<i64>,
581}
582
583/// <p>Represents the status of an export task.</p>
584#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
585#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
586pub struct ExportTaskExecutionInfo {
587    /// <p>The completion time of the export task, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
588    #[serde(rename = "completionTime")]
589    #[serde(skip_serializing_if = "Option::is_none")]
590    pub completion_time: Option<i64>,
591    /// <p>The creation time of the export task, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
592    #[serde(rename = "creationTime")]
593    #[serde(skip_serializing_if = "Option::is_none")]
594    pub creation_time: Option<i64>,
595}
596
597/// <p>Represents the status of an export task.</p>
598#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
599#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
600pub struct ExportTaskStatus {
601    /// <p>The status code of the export task.</p>
602    #[serde(rename = "code")]
603    #[serde(skip_serializing_if = "Option::is_none")]
604    pub code: Option<String>,
605    /// <p>The status message related to the status code.</p>
606    #[serde(rename = "message")]
607    #[serde(skip_serializing_if = "Option::is_none")]
608    pub message: Option<String>,
609}
610
611#[derive(Clone, Debug, Default, PartialEq, Serialize)]
612#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
613pub struct FilterLogEventsRequest {
614    /// <p>The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp later than this time are not returned.</p>
615    #[serde(rename = "endTime")]
616    #[serde(skip_serializing_if = "Option::is_none")]
617    pub end_time: Option<i64>,
618    /// <p>The filter pattern to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/FilterAndPatternSyntax.html">Filter and Pattern Syntax</a>.</p> <p>If not provided, all the events are matched.</p>
619    #[serde(rename = "filterPattern")]
620    #[serde(skip_serializing_if = "Option::is_none")]
621    pub filter_pattern: Option<String>,
622    /// <p>The maximum number of events to return. The default is 10,000 events.</p>
623    #[serde(rename = "limit")]
624    #[serde(skip_serializing_if = "Option::is_none")]
625    pub limit: Option<i64>,
626    /// <p>The name of the log group to search.</p>
627    #[serde(rename = "logGroupName")]
628    pub log_group_name: String,
629    /// <p>Filters the results to include only events from log streams that have names starting with this prefix.</p> <p>If you specify a value for both <code>logStreamNamePrefix</code> and <code>logStreamNames</code>, but the value for <code>logStreamNamePrefix</code> does not match any log stream names specified in <code>logStreamNames</code>, the action returns an <code>InvalidParameterException</code> error.</p>
630    #[serde(rename = "logStreamNamePrefix")]
631    #[serde(skip_serializing_if = "Option::is_none")]
632    pub log_stream_name_prefix: Option<String>,
633    /// <p>Filters the results to only logs from the log streams in this list.</p> <p>If you specify a value for both <code>logStreamNamePrefix</code> and <code>logStreamNames</code>, the action returns an <code>InvalidParameterException</code> error.</p>
634    #[serde(rename = "logStreamNames")]
635    #[serde(skip_serializing_if = "Option::is_none")]
636    pub log_stream_names: Option<Vec<String>>,
637    /// <p>The token for the next set of events to return. (You received this token from a previous call.)</p>
638    #[serde(rename = "nextToken")]
639    #[serde(skip_serializing_if = "Option::is_none")]
640    pub next_token: Option<String>,
641    /// <p>The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp before this time are not returned.</p>
642    #[serde(rename = "startTime")]
643    #[serde(skip_serializing_if = "Option::is_none")]
644    pub start_time: Option<i64>,
645}
646
647#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
648#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
649pub struct FilterLogEventsResponse {
650    /// <p>The matched events.</p>
651    #[serde(rename = "events")]
652    #[serde(skip_serializing_if = "Option::is_none")]
653    pub events: Option<Vec<FilteredLogEvent>>,
654    /// <p>The token to use when requesting the next set of items. The token expires after 24 hours.</p>
655    #[serde(rename = "nextToken")]
656    #[serde(skip_serializing_if = "Option::is_none")]
657    pub next_token: Option<String>,
658    /// <p>Indicates which log streams have been searched and whether each has been searched completely.</p>
659    #[serde(rename = "searchedLogStreams")]
660    #[serde(skip_serializing_if = "Option::is_none")]
661    pub searched_log_streams: Option<Vec<SearchedLogStream>>,
662}
663
664/// <p>Represents a matched event.</p>
665#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
666#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
667pub struct FilteredLogEvent {
668    /// <p>The ID of the event.</p>
669    #[serde(rename = "eventId")]
670    #[serde(skip_serializing_if = "Option::is_none")]
671    pub event_id: Option<String>,
672    /// <p>The time the event was ingested, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
673    #[serde(rename = "ingestionTime")]
674    #[serde(skip_serializing_if = "Option::is_none")]
675    pub ingestion_time: Option<i64>,
676    /// <p>The name of the log stream to which this event belongs.</p>
677    #[serde(rename = "logStreamName")]
678    #[serde(skip_serializing_if = "Option::is_none")]
679    pub log_stream_name: Option<String>,
680    /// <p>The data contained in the log event.</p>
681    #[serde(rename = "message")]
682    #[serde(skip_serializing_if = "Option::is_none")]
683    pub message: Option<String>,
684    /// <p>The time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
685    #[serde(rename = "timestamp")]
686    #[serde(skip_serializing_if = "Option::is_none")]
687    pub timestamp: Option<i64>,
688}
689
690#[derive(Clone, Debug, Default, PartialEq, Serialize)]
691#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
692pub struct GetLogEventsRequest {
693    /// <p>The end of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to or later than this time are not included.</p>
694    #[serde(rename = "endTime")]
695    #[serde(skip_serializing_if = "Option::is_none")]
696    pub end_time: Option<i64>,
697    /// <p>The maximum number of log events returned. If you don't specify a value, the maximum is as many log events as can fit in a response size of 1 MB, up to 10,000 log events.</p>
698    #[serde(rename = "limit")]
699    #[serde(skip_serializing_if = "Option::is_none")]
700    pub limit: Option<i64>,
701    /// <p>The name of the log group.</p>
702    #[serde(rename = "logGroupName")]
703    pub log_group_name: String,
704    /// <p>The name of the log stream.</p>
705    #[serde(rename = "logStreamName")]
706    pub log_stream_name: String,
707    /// <p>The token for the next set of items to return. (You received this token from a previous call.)</p> <p>Using this token works only when you specify <code>true</code> for <code>startFromHead</code>.</p>
708    #[serde(rename = "nextToken")]
709    #[serde(skip_serializing_if = "Option::is_none")]
710    pub next_token: Option<String>,
711    /// <p>If the value is true, the earliest log events are returned first. If the value is false, the latest log events are returned first. The default value is false.</p> <p>If you are using <code>nextToken</code> in this operation, you must specify <code>true</code> for <code>startFromHead</code>.</p>
712    #[serde(rename = "startFromHead")]
713    #[serde(skip_serializing_if = "Option::is_none")]
714    pub start_from_head: Option<bool>,
715    /// <p>The start of the time range, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. Events with a timestamp equal to this time or later than this time are included. Events with a timestamp earlier than this time are not included.</p>
716    #[serde(rename = "startTime")]
717    #[serde(skip_serializing_if = "Option::is_none")]
718    pub start_time: Option<i64>,
719}
720
721#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
722#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
723pub struct GetLogEventsResponse {
724    /// <p>The events.</p>
725    #[serde(rename = "events")]
726    #[serde(skip_serializing_if = "Option::is_none")]
727    pub events: Option<Vec<OutputLogEvent>>,
728    /// <p>The token for the next set of items in the backward direction. The token expires after 24 hours. This token will never be null. If you have reached the end of the stream, it will return the same token you passed in.</p>
729    #[serde(rename = "nextBackwardToken")]
730    #[serde(skip_serializing_if = "Option::is_none")]
731    pub next_backward_token: Option<String>,
732    /// <p>The token for the next set of items in the forward direction. The token expires after 24 hours. If you have reached the end of the stream, it will return the same token you passed in.</p>
733    #[serde(rename = "nextForwardToken")]
734    #[serde(skip_serializing_if = "Option::is_none")]
735    pub next_forward_token: Option<String>,
736}
737
738#[derive(Clone, Debug, Default, PartialEq, Serialize)]
739#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
740pub struct GetLogGroupFieldsRequest {
741    /// <p>The name of the log group to search.</p>
742    #[serde(rename = "logGroupName")]
743    pub log_group_name: String,
744    /// <p>The time to set as the center of the query. If you specify <code>time</code>, the 8 minutes before and 8 minutes after this time are searched. If you omit <code>time</code>, the past 15 minutes are queried.</p> <p>The <code>time</code> value is specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.</p>
745    #[serde(rename = "time")]
746    #[serde(skip_serializing_if = "Option::is_none")]
747    pub time: Option<i64>,
748}
749
750#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
751#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
752pub struct GetLogGroupFieldsResponse {
753    /// <p>The array of fields found in the query. Each object in the array contains the name of the field, along with the percentage of time it appeared in the log events that were queried.</p>
754    #[serde(rename = "logGroupFields")]
755    #[serde(skip_serializing_if = "Option::is_none")]
756    pub log_group_fields: Option<Vec<LogGroupField>>,
757}
758
759#[derive(Clone, Debug, Default, PartialEq, Serialize)]
760#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
761pub struct GetLogRecordRequest {
762    /// <p>The pointer corresponding to the log event record you want to retrieve. You get this from the response of a <code>GetQueryResults</code> operation. In that response, the value of the <code>@ptr</code> field for a log event is the value to use as <code>logRecordPointer</code> to retrieve that complete log event record.</p>
763    #[serde(rename = "logRecordPointer")]
764    pub log_record_pointer: String,
765}
766
767#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
768#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
769pub struct GetLogRecordResponse {
770    /// <p>The requested log event, as a JSON string.</p>
771    #[serde(rename = "logRecord")]
772    #[serde(skip_serializing_if = "Option::is_none")]
773    pub log_record: Option<::std::collections::HashMap<String, String>>,
774}
775
776#[derive(Clone, Debug, Default, PartialEq, Serialize)]
777#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
778pub struct GetQueryResultsRequest {
779    /// <p>The ID number of the query.</p>
780    #[serde(rename = "queryId")]
781    pub query_id: String,
782}
783
784#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
785#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
786pub struct GetQueryResultsResponse {
787    /// <p>The log events that matched the query criteria during the most recent time it ran.</p> <p>The <code>results</code> value is an array of arrays. Each log event is one object in the top-level array. Each of these log event objects is an array of <code>field</code>/<code>value</code> pairs.</p>
788    #[serde(rename = "results")]
789    #[serde(skip_serializing_if = "Option::is_none")]
790    pub results: Option<Vec<Vec<ResultField>>>,
791    /// <p>Includes the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned.</p>
792    #[serde(rename = "statistics")]
793    #[serde(skip_serializing_if = "Option::is_none")]
794    pub statistics: Option<QueryStatistics>,
795    /// <p>The status of the most recent running of the query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, <code>Timeout</code>, and <code>Unknown</code>.</p> <p>Queries time out after 15 minutes of execution. To avoid having your queries time out, reduce the time range being searched, or partition your query into a number of queries.</p>
796    #[serde(rename = "status")]
797    #[serde(skip_serializing_if = "Option::is_none")]
798    pub status: Option<String>,
799}
800
801/// <p>Represents a log event, which is a record of activity that was recorded by the application or resource being monitored.</p>
802#[derive(Clone, Debug, Default, PartialEq, Serialize)]
803#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
804pub struct InputLogEvent {
805    /// <p>The raw event message.</p>
806    #[serde(rename = "message")]
807    pub message: String,
808    /// <p>The time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
809    #[serde(rename = "timestamp")]
810    pub timestamp: i64,
811}
812
813#[derive(Clone, Debug, Default, PartialEq, Serialize)]
814#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
815pub struct ListTagsLogGroupRequest {
816    /// <p>The name of the log group.</p>
817    #[serde(rename = "logGroupName")]
818    pub log_group_name: String,
819}
820
821#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
822#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
823pub struct ListTagsLogGroupResponse {
824    /// <p>The tags for the log group.</p>
825    #[serde(rename = "tags")]
826    #[serde(skip_serializing_if = "Option::is_none")]
827    pub tags: Option<::std::collections::HashMap<String, String>>,
828}
829
830/// <p>Represents a log group.</p>
831#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
832#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
833pub struct LogGroup {
834    /// <p>The Amazon Resource Name (ARN) of the log group.</p>
835    #[serde(rename = "arn")]
836    #[serde(skip_serializing_if = "Option::is_none")]
837    pub arn: Option<String>,
838    /// <p>The creation time of the log group, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
839    #[serde(rename = "creationTime")]
840    #[serde(skip_serializing_if = "Option::is_none")]
841    pub creation_time: Option<i64>,
842    /// <p>The Amazon Resource Name (ARN) of the CMK to use when encrypting log data.</p>
843    #[serde(rename = "kmsKeyId")]
844    #[serde(skip_serializing_if = "Option::is_none")]
845    pub kms_key_id: Option<String>,
846    /// <p>The name of the log group.</p>
847    #[serde(rename = "logGroupName")]
848    #[serde(skip_serializing_if = "Option::is_none")]
849    pub log_group_name: Option<String>,
850    /// <p>The number of metric filters.</p>
851    #[serde(rename = "metricFilterCount")]
852    #[serde(skip_serializing_if = "Option::is_none")]
853    pub metric_filter_count: Option<i64>,
854    #[serde(rename = "retentionInDays")]
855    #[serde(skip_serializing_if = "Option::is_none")]
856    pub retention_in_days: Option<i64>,
857    /// <p>The number of bytes stored.</p>
858    #[serde(rename = "storedBytes")]
859    #[serde(skip_serializing_if = "Option::is_none")]
860    pub stored_bytes: Option<i64>,
861}
862
863/// <p>The fields contained in log events found by a <code>GetLogGroupFields</code> operation, along with the percentage of queried log events in which each field appears.</p>
864#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
865#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
866pub struct LogGroupField {
867    /// <p>The name of a log field.</p>
868    #[serde(rename = "name")]
869    #[serde(skip_serializing_if = "Option::is_none")]
870    pub name: Option<String>,
871    /// <p>The percentage of log events queried that contained the field.</p>
872    #[serde(rename = "percent")]
873    #[serde(skip_serializing_if = "Option::is_none")]
874    pub percent: Option<i64>,
875}
876
877/// <p>Represents a log stream, which is a sequence of log events from a single emitter of logs.</p>
878#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
879#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
880pub struct LogStream {
881    /// <p>The Amazon Resource Name (ARN) of the log stream.</p>
882    #[serde(rename = "arn")]
883    #[serde(skip_serializing_if = "Option::is_none")]
884    pub arn: Option<String>,
885    /// <p>The creation time of the stream, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
886    #[serde(rename = "creationTime")]
887    #[serde(skip_serializing_if = "Option::is_none")]
888    pub creation_time: Option<i64>,
889    /// <p>The time of the first event, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
890    #[serde(rename = "firstEventTimestamp")]
891    #[serde(skip_serializing_if = "Option::is_none")]
892    pub first_event_timestamp: Option<i64>,
893    /// <p>The time of the most recent log event in the log stream in CloudWatch Logs. This number is expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. The <code>lastEventTime</code> value updates on an eventual consistency basis. It typically updates in less than an hour from ingestion, but may take longer in some rare situations.</p>
894    #[serde(rename = "lastEventTimestamp")]
895    #[serde(skip_serializing_if = "Option::is_none")]
896    pub last_event_timestamp: Option<i64>,
897    /// <p>The ingestion time, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
898    #[serde(rename = "lastIngestionTime")]
899    #[serde(skip_serializing_if = "Option::is_none")]
900    pub last_ingestion_time: Option<i64>,
901    /// <p>The name of the log stream.</p>
902    #[serde(rename = "logStreamName")]
903    #[serde(skip_serializing_if = "Option::is_none")]
904    pub log_stream_name: Option<String>,
905    /// <p>The sequence token.</p>
906    #[serde(rename = "uploadSequenceToken")]
907    #[serde(skip_serializing_if = "Option::is_none")]
908    pub upload_sequence_token: Option<String>,
909}
910
911/// <p>Metric filters express how CloudWatch Logs would extract metric observations from ingested log events and transform them into metric data in a CloudWatch metric.</p>
912#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
913#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
914pub struct MetricFilter {
915    /// <p>The creation time of the metric filter, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
916    #[serde(rename = "creationTime")]
917    #[serde(skip_serializing_if = "Option::is_none")]
918    pub creation_time: Option<i64>,
919    /// <p>The name of the metric filter.</p>
920    #[serde(rename = "filterName")]
921    #[serde(skip_serializing_if = "Option::is_none")]
922    pub filter_name: Option<String>,
923    #[serde(rename = "filterPattern")]
924    #[serde(skip_serializing_if = "Option::is_none")]
925    pub filter_pattern: Option<String>,
926    /// <p>The name of the log group.</p>
927    #[serde(rename = "logGroupName")]
928    #[serde(skip_serializing_if = "Option::is_none")]
929    pub log_group_name: Option<String>,
930    /// <p>The metric transformations.</p>
931    #[serde(rename = "metricTransformations")]
932    #[serde(skip_serializing_if = "Option::is_none")]
933    pub metric_transformations: Option<Vec<MetricTransformation>>,
934}
935
936/// <p>Represents a matched event.</p>
937#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
938#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
939pub struct MetricFilterMatchRecord {
940    /// <p>The raw event data.</p>
941    #[serde(rename = "eventMessage")]
942    #[serde(skip_serializing_if = "Option::is_none")]
943    pub event_message: Option<String>,
944    /// <p>The event number.</p>
945    #[serde(rename = "eventNumber")]
946    #[serde(skip_serializing_if = "Option::is_none")]
947    pub event_number: Option<i64>,
948    /// <p>The values extracted from the event data by the filter.</p>
949    #[serde(rename = "extractedValues")]
950    #[serde(skip_serializing_if = "Option::is_none")]
951    pub extracted_values: Option<::std::collections::HashMap<String, String>>,
952}
953
954/// <p>Indicates how to transform ingested log events to metric data in a CloudWatch metric.</p>
955#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
956pub struct MetricTransformation {
957    /// <p>(Optional) The value to emit when a filter pattern does not match a log event. This value can be null.</p>
958    #[serde(rename = "defaultValue")]
959    #[serde(skip_serializing_if = "Option::is_none")]
960    pub default_value: Option<f64>,
961    /// <p>The name of the CloudWatch metric.</p>
962    #[serde(rename = "metricName")]
963    pub metric_name: String,
964    /// <p>A custom namespace to contain your metric in CloudWatch. Use namespaces to group together metrics that are similar. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Namespace">Namespaces</a>.</p>
965    #[serde(rename = "metricNamespace")]
966    pub metric_namespace: String,
967    /// <p>The value to publish to the CloudWatch metric when a filter pattern matches a log event.</p>
968    #[serde(rename = "metricValue")]
969    pub metric_value: String,
970}
971
972/// <p>Represents a log event.</p>
973#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
974#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
975pub struct OutputLogEvent {
976    /// <p>The time the event was ingested, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
977    #[serde(rename = "ingestionTime")]
978    #[serde(skip_serializing_if = "Option::is_none")]
979    pub ingestion_time: Option<i64>,
980    /// <p>The data contained in the log event.</p>
981    #[serde(rename = "message")]
982    #[serde(skip_serializing_if = "Option::is_none")]
983    pub message: Option<String>,
984    /// <p>The time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
985    #[serde(rename = "timestamp")]
986    #[serde(skip_serializing_if = "Option::is_none")]
987    pub timestamp: Option<i64>,
988}
989
990#[derive(Clone, Debug, Default, PartialEq, Serialize)]
991#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
992pub struct PutDestinationPolicyRequest {
993    /// <p>An IAM policy document that authorizes cross-account users to deliver their log events to the associated destination.</p>
994    #[serde(rename = "accessPolicy")]
995    pub access_policy: String,
996    /// <p>A name for an existing destination.</p>
997    #[serde(rename = "destinationName")]
998    pub destination_name: String,
999}
1000
1001#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1002#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1003pub struct PutDestinationRequest {
1004    /// <p>A name for the destination.</p>
1005    #[serde(rename = "destinationName")]
1006    pub destination_name: String,
1007    /// <p>The ARN of an IAM role that grants CloudWatch Logs permissions to call the Amazon Kinesis PutRecord operation on the destination stream.</p>
1008    #[serde(rename = "roleArn")]
1009    pub role_arn: String,
1010    /// <p>The ARN of an Amazon Kinesis stream to which to deliver matching log events.</p>
1011    #[serde(rename = "targetArn")]
1012    pub target_arn: String,
1013}
1014
1015#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1016#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1017pub struct PutDestinationResponse {
1018    /// <p>The destination.</p>
1019    #[serde(rename = "destination")]
1020    #[serde(skip_serializing_if = "Option::is_none")]
1021    pub destination: Option<Destination>,
1022}
1023
1024#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1025#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1026pub struct PutLogEventsRequest {
1027    /// <p>The log events.</p>
1028    #[serde(rename = "logEvents")]
1029    pub log_events: Vec<InputLogEvent>,
1030    /// <p>The name of the log group.</p>
1031    #[serde(rename = "logGroupName")]
1032    pub log_group_name: String,
1033    /// <p>The name of the log stream.</p>
1034    #[serde(rename = "logStreamName")]
1035    pub log_stream_name: String,
1036    /// <p>The sequence token obtained from the response of the previous <code>PutLogEvents</code> call. An upload in a newly created log stream does not require a sequence token. You can also get the sequence token using <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeLogStreams.html">DescribeLogStreams</a>. If you call <code>PutLogEvents</code> twice within a narrow time period using the same value for <code>sequenceToken</code>, both calls may be successful, or one may be rejected.</p>
1037    #[serde(rename = "sequenceToken")]
1038    #[serde(skip_serializing_if = "Option::is_none")]
1039    pub sequence_token: Option<String>,
1040}
1041
1042#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1043#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1044pub struct PutLogEventsResponse {
1045    /// <p>The next sequence token.</p>
1046    #[serde(rename = "nextSequenceToken")]
1047    #[serde(skip_serializing_if = "Option::is_none")]
1048    pub next_sequence_token: Option<String>,
1049    /// <p>The rejected events.</p>
1050    #[serde(rename = "rejectedLogEventsInfo")]
1051    #[serde(skip_serializing_if = "Option::is_none")]
1052    pub rejected_log_events_info: Option<RejectedLogEventsInfo>,
1053}
1054
1055#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1056#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1057pub struct PutMetricFilterRequest {
1058    /// <p>A name for the metric filter.</p>
1059    #[serde(rename = "filterName")]
1060    pub filter_name: String,
1061    /// <p>A filter pattern for extracting metric data out of ingested log events.</p>
1062    #[serde(rename = "filterPattern")]
1063    pub filter_pattern: String,
1064    /// <p>The name of the log group.</p>
1065    #[serde(rename = "logGroupName")]
1066    pub log_group_name: String,
1067    /// <p>A collection of information that defines how metric data gets emitted.</p>
1068    #[serde(rename = "metricTransformations")]
1069    pub metric_transformations: Vec<MetricTransformation>,
1070}
1071
1072#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1073#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1074pub struct PutQueryDefinitionRequest {
1075    #[serde(rename = "logGroupNames")]
1076    #[serde(skip_serializing_if = "Option::is_none")]
1077    pub log_group_names: Option<Vec<String>>,
1078    #[serde(rename = "name")]
1079    pub name: String,
1080    #[serde(rename = "queryDefinitionId")]
1081    #[serde(skip_serializing_if = "Option::is_none")]
1082    pub query_definition_id: Option<String>,
1083    #[serde(rename = "queryString")]
1084    pub query_string: String,
1085}
1086
1087#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1088#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1089pub struct PutQueryDefinitionResponse {
1090    #[serde(rename = "queryDefinitionId")]
1091    #[serde(skip_serializing_if = "Option::is_none")]
1092    pub query_definition_id: Option<String>,
1093}
1094
1095#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1096#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1097pub struct PutResourcePolicyRequest {
1098    /// <p>Details of the new policy, including the identity of the principal that is enabled to put logs to this account. This is formatted as a JSON string. This parameter is required.</p> <p>The following example creates a resource policy enabling the Route 53 service to put DNS query logs in to the specified log group. Replace "logArn" with the ARN of your CloudWatch Logs resource, such as a log group or log stream.</p> <p> <code>{ "Version": "2012-10-17", "Statement": [ { "Sid": "Route53LogsToCloudWatchLogs", "Effect": "Allow", "Principal": { "Service": [ "route53.amazonaws.com" ] }, "Action":"logs:PutLogEvents", "Resource": "logArn" } ] } </code> </p>
1099    #[serde(rename = "policyDocument")]
1100    #[serde(skip_serializing_if = "Option::is_none")]
1101    pub policy_document: Option<String>,
1102    /// <p>Name of the new policy. This parameter is required.</p>
1103    #[serde(rename = "policyName")]
1104    #[serde(skip_serializing_if = "Option::is_none")]
1105    pub policy_name: Option<String>,
1106}
1107
1108#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1109#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1110pub struct PutResourcePolicyResponse {
1111    /// <p>The new policy.</p>
1112    #[serde(rename = "resourcePolicy")]
1113    #[serde(skip_serializing_if = "Option::is_none")]
1114    pub resource_policy: Option<ResourcePolicy>,
1115}
1116
1117#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1118#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1119pub struct PutRetentionPolicyRequest {
1120    /// <p>The name of the log group.</p>
1121    #[serde(rename = "logGroupName")]
1122    pub log_group_name: String,
1123    #[serde(rename = "retentionInDays")]
1124    pub retention_in_days: i64,
1125}
1126
1127#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1128#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1129pub struct PutSubscriptionFilterRequest {
1130    /// <p><p>The ARN of the destination to deliver matching log events to. Currently, the supported destinations are:</p> <ul> <li> <p>An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>A logical destination (specified using an ARN) belonging to a different account, for cross-account delivery.</p> </li> <li> <p>An Amazon Kinesis Firehose delivery stream belonging to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>An AWS Lambda function belonging to the same account as the subscription filter, for same-account delivery.</p> </li> </ul></p>
1131    #[serde(rename = "destinationArn")]
1132    pub destination_arn: String,
1133    /// <p>The method used to distribute log data to the destination. By default log data is grouped by log stream, but the grouping can be set to random for a more even distribution. This property is only applicable when the destination is an Amazon Kinesis stream. </p>
1134    #[serde(rename = "distribution")]
1135    #[serde(skip_serializing_if = "Option::is_none")]
1136    pub distribution: Option<String>,
1137    /// <p>A name for the subscription filter. If you are updating an existing filter, you must specify the correct name in <code>filterName</code>. Otherwise, the call fails because you cannot associate a second filter with a log group. To find the name of the filter currently associated with a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeSubscriptionFilters.html">DescribeSubscriptionFilters</a>.</p>
1138    #[serde(rename = "filterName")]
1139    pub filter_name: String,
1140    /// <p>A filter pattern for subscribing to a filtered stream of log events.</p>
1141    #[serde(rename = "filterPattern")]
1142    pub filter_pattern: String,
1143    /// <p>The name of the log group.</p>
1144    #[serde(rename = "logGroupName")]
1145    pub log_group_name: String,
1146    /// <p>The ARN of an IAM role that grants CloudWatch Logs permissions to deliver ingested log events to the destination stream. You don't need to provide the ARN when you are working with a logical destination for cross-account delivery.</p>
1147    #[serde(rename = "roleArn")]
1148    #[serde(skip_serializing_if = "Option::is_none")]
1149    pub role_arn: Option<String>,
1150}
1151
1152/// <p>Reserved.</p>
1153#[derive(Clone, Debug, Default, PartialEq)]
1154pub struct QueryCompileError {
1155    /// <p>Reserved.</p>
1156    pub location: Option<QueryCompileErrorLocation>,
1157    /// <p>Reserved.</p>
1158    pub message: Option<String>,
1159}
1160
1161/// <p>Reserved.</p>
1162#[derive(Clone, Debug, Default, PartialEq)]
1163pub struct QueryCompileErrorLocation {
1164    /// <p>Reserved.</p>
1165    pub end_char_offset: Option<i64>,
1166    /// <p>Reserved.</p>
1167    pub start_char_offset: Option<i64>,
1168}
1169
1170#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1171#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1172pub struct QueryDefinition {
1173    #[serde(rename = "lastModified")]
1174    #[serde(skip_serializing_if = "Option::is_none")]
1175    pub last_modified: Option<i64>,
1176    #[serde(rename = "logGroupNames")]
1177    #[serde(skip_serializing_if = "Option::is_none")]
1178    pub log_group_names: Option<Vec<String>>,
1179    #[serde(rename = "name")]
1180    #[serde(skip_serializing_if = "Option::is_none")]
1181    pub name: Option<String>,
1182    #[serde(rename = "queryDefinitionId")]
1183    #[serde(skip_serializing_if = "Option::is_none")]
1184    pub query_definition_id: Option<String>,
1185    #[serde(rename = "queryString")]
1186    #[serde(skip_serializing_if = "Option::is_none")]
1187    pub query_string: Option<String>,
1188}
1189
1190/// <p>Information about one CloudWatch Logs Insights query that matches the request in a <code>DescribeQueries</code> operation. </p>
1191#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1192#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1193pub struct QueryInfo {
1194    /// <p>The date and time that this query was created.</p>
1195    #[serde(rename = "createTime")]
1196    #[serde(skip_serializing_if = "Option::is_none")]
1197    pub create_time: Option<i64>,
1198    /// <p>The name of the log group scanned by this query.</p>
1199    #[serde(rename = "logGroupName")]
1200    #[serde(skip_serializing_if = "Option::is_none")]
1201    pub log_group_name: Option<String>,
1202    /// <p>The unique ID number of this query.</p>
1203    #[serde(rename = "queryId")]
1204    #[serde(skip_serializing_if = "Option::is_none")]
1205    pub query_id: Option<String>,
1206    /// <p>The query string used in this query.</p>
1207    #[serde(rename = "queryString")]
1208    #[serde(skip_serializing_if = "Option::is_none")]
1209    pub query_string: Option<String>,
1210    /// <p>The status of this query. Possible values are <code>Cancelled</code>, <code>Complete</code>, <code>Failed</code>, <code>Running</code>, <code>Scheduled</code>, and <code>Unknown</code>.</p>
1211    #[serde(rename = "status")]
1212    #[serde(skip_serializing_if = "Option::is_none")]
1213    pub status: Option<String>,
1214}
1215
1216/// <p>Contains the number of log events scanned by the query, the number of log events that matched the query criteria, and the total number of bytes in the log events that were scanned.</p>
1217#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1218#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1219pub struct QueryStatistics {
1220    /// <p>The total number of bytes in the log events scanned during the query.</p>
1221    #[serde(rename = "bytesScanned")]
1222    #[serde(skip_serializing_if = "Option::is_none")]
1223    pub bytes_scanned: Option<f64>,
1224    /// <p>The number of log events that matched the query string.</p>
1225    #[serde(rename = "recordsMatched")]
1226    #[serde(skip_serializing_if = "Option::is_none")]
1227    pub records_matched: Option<f64>,
1228    /// <p>The total number of log events scanned during the query.</p>
1229    #[serde(rename = "recordsScanned")]
1230    #[serde(skip_serializing_if = "Option::is_none")]
1231    pub records_scanned: Option<f64>,
1232}
1233
1234/// <p>Represents the rejected events.</p>
1235#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1236#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1237pub struct RejectedLogEventsInfo {
1238    /// <p>The expired log events.</p>
1239    #[serde(rename = "expiredLogEventEndIndex")]
1240    #[serde(skip_serializing_if = "Option::is_none")]
1241    pub expired_log_event_end_index: Option<i64>,
1242    /// <p>The log events that are too new.</p>
1243    #[serde(rename = "tooNewLogEventStartIndex")]
1244    #[serde(skip_serializing_if = "Option::is_none")]
1245    pub too_new_log_event_start_index: Option<i64>,
1246    /// <p>The log events that are too old.</p>
1247    #[serde(rename = "tooOldLogEventEndIndex")]
1248    #[serde(skip_serializing_if = "Option::is_none")]
1249    pub too_old_log_event_end_index: Option<i64>,
1250}
1251
1252/// <p>A policy enabling one or more entities to put logs to a log group in this account.</p>
1253#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1254#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1255pub struct ResourcePolicy {
1256    /// <p>Timestamp showing when this policy was last updated, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
1257    #[serde(rename = "lastUpdatedTime")]
1258    #[serde(skip_serializing_if = "Option::is_none")]
1259    pub last_updated_time: Option<i64>,
1260    /// <p>The details of the policy.</p>
1261    #[serde(rename = "policyDocument")]
1262    #[serde(skip_serializing_if = "Option::is_none")]
1263    pub policy_document: Option<String>,
1264    /// <p>The name of the resource policy.</p>
1265    #[serde(rename = "policyName")]
1266    #[serde(skip_serializing_if = "Option::is_none")]
1267    pub policy_name: Option<String>,
1268}
1269
1270/// <p>Contains one field from one log event returned by a CloudWatch Logs Insights query, along with the value of that field.</p> <p>For more information about the fields that are generated by CloudWatch logs, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html">Supported Logs and Discovered Fields</a>.</p>
1271#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1272#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1273pub struct ResultField {
1274    /// <p>The log event field.</p>
1275    #[serde(rename = "field")]
1276    #[serde(skip_serializing_if = "Option::is_none")]
1277    pub field: Option<String>,
1278    /// <p>The value of this field.</p>
1279    #[serde(rename = "value")]
1280    #[serde(skip_serializing_if = "Option::is_none")]
1281    pub value: Option<String>,
1282}
1283
1284/// <p>Represents the search status of a log stream.</p>
1285#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1286#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1287pub struct SearchedLogStream {
1288    /// <p>The name of the log stream.</p>
1289    #[serde(rename = "logStreamName")]
1290    #[serde(skip_serializing_if = "Option::is_none")]
1291    pub log_stream_name: Option<String>,
1292    /// <p>Indicates whether all the events in this log stream were searched.</p>
1293    #[serde(rename = "searchedCompletely")]
1294    #[serde(skip_serializing_if = "Option::is_none")]
1295    pub searched_completely: Option<bool>,
1296}
1297
1298#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1299#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1300pub struct StartQueryRequest {
1301    /// <p>The end of the time range to query. The range is inclusive, so the specified end time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.</p>
1302    #[serde(rename = "endTime")]
1303    pub end_time: i64,
1304    /// <p>The maximum number of log events to return in the query. If the query string uses the <code>fields</code> command, only the specified fields and their values are returned. The default is 1000.</p>
1305    #[serde(rename = "limit")]
1306    #[serde(skip_serializing_if = "Option::is_none")]
1307    pub limit: Option<i64>,
1308    /// <p>The log group on which to perform the query.</p> <p>A <code>StartQuery</code> operation must include a <code>logGroupNames</code> or a <code>logGroupName</code> parameter, but not both.</p>
1309    #[serde(rename = "logGroupName")]
1310    #[serde(skip_serializing_if = "Option::is_none")]
1311    pub log_group_name: Option<String>,
1312    /// <p>The list of log groups to be queried. You can include up to 20 log groups.</p> <p>A <code>StartQuery</code> operation must include a <code>logGroupNames</code> or a <code>logGroupName</code> parameter, but not both.</p>
1313    #[serde(rename = "logGroupNames")]
1314    #[serde(skip_serializing_if = "Option::is_none")]
1315    pub log_group_names: Option<Vec<String>>,
1316    /// <p>The query string to use. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
1317    #[serde(rename = "queryString")]
1318    pub query_string: String,
1319    /// <p>The beginning of the time range to query. The range is inclusive, so the specified start time is included in the query. Specified as epoch time, the number of seconds since January 1, 1970, 00:00:00 UTC.</p>
1320    #[serde(rename = "startTime")]
1321    pub start_time: i64,
1322}
1323
1324#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1325#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1326pub struct StartQueryResponse {
1327    /// <p>The unique ID of the query. </p>
1328    #[serde(rename = "queryId")]
1329    #[serde(skip_serializing_if = "Option::is_none")]
1330    pub query_id: Option<String>,
1331}
1332
1333#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1334#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1335pub struct StopQueryRequest {
1336    /// <p>The ID number of the query to stop. If necessary, you can use <code>DescribeQueries</code> to find this ID number.</p>
1337    #[serde(rename = "queryId")]
1338    pub query_id: String,
1339}
1340
1341#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1342#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1343pub struct StopQueryResponse {
1344    /// <p>This is true if the query was stopped by the <code>StopQuery</code> operation.</p>
1345    #[serde(rename = "success")]
1346    #[serde(skip_serializing_if = "Option::is_none")]
1347    pub success: Option<bool>,
1348}
1349
1350/// <p>Represents a subscription filter.</p>
1351#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1352#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1353pub struct SubscriptionFilter {
1354    /// <p>The creation time of the subscription filter, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC.</p>
1355    #[serde(rename = "creationTime")]
1356    #[serde(skip_serializing_if = "Option::is_none")]
1357    pub creation_time: Option<i64>,
1358    /// <p>The Amazon Resource Name (ARN) of the destination.</p>
1359    #[serde(rename = "destinationArn")]
1360    #[serde(skip_serializing_if = "Option::is_none")]
1361    pub destination_arn: Option<String>,
1362    #[serde(rename = "distribution")]
1363    #[serde(skip_serializing_if = "Option::is_none")]
1364    pub distribution: Option<String>,
1365    /// <p>The name of the subscription filter.</p>
1366    #[serde(rename = "filterName")]
1367    #[serde(skip_serializing_if = "Option::is_none")]
1368    pub filter_name: Option<String>,
1369    #[serde(rename = "filterPattern")]
1370    #[serde(skip_serializing_if = "Option::is_none")]
1371    pub filter_pattern: Option<String>,
1372    /// <p>The name of the log group.</p>
1373    #[serde(rename = "logGroupName")]
1374    #[serde(skip_serializing_if = "Option::is_none")]
1375    pub log_group_name: Option<String>,
1376    /// <p><p/></p>
1377    #[serde(rename = "roleArn")]
1378    #[serde(skip_serializing_if = "Option::is_none")]
1379    pub role_arn: Option<String>,
1380}
1381
1382#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1383#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1384pub struct TagLogGroupRequest {
1385    /// <p>The name of the log group.</p>
1386    #[serde(rename = "logGroupName")]
1387    pub log_group_name: String,
1388    /// <p>The key-value pairs to use for the tags.</p>
1389    #[serde(rename = "tags")]
1390    pub tags: ::std::collections::HashMap<String, String>,
1391}
1392
1393#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1394#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1395pub struct TestMetricFilterRequest {
1396    #[serde(rename = "filterPattern")]
1397    pub filter_pattern: String,
1398    /// <p>The log event messages to test.</p>
1399    #[serde(rename = "logEventMessages")]
1400    pub log_event_messages: Vec<String>,
1401}
1402
1403#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
1404#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
1405pub struct TestMetricFilterResponse {
1406    /// <p>The matched events.</p>
1407    #[serde(rename = "matches")]
1408    #[serde(skip_serializing_if = "Option::is_none")]
1409    pub matches: Option<Vec<MetricFilterMatchRecord>>,
1410}
1411
1412#[derive(Clone, Debug, Default, PartialEq, Serialize)]
1413#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
1414pub struct UntagLogGroupRequest {
1415    /// <p>The name of the log group.</p>
1416    #[serde(rename = "logGroupName")]
1417    pub log_group_name: String,
1418    /// <p>The tag keys. The corresponding tags are removed from the log group.</p>
1419    #[serde(rename = "tags")]
1420    pub tags: Vec<String>,
1421}
1422
1423/// Errors returned by AssociateKmsKey
1424#[derive(Debug, PartialEq)]
1425pub enum AssociateKmsKeyError {
1426    /// <p>A parameter is specified incorrectly.</p>
1427    InvalidParameter(String),
1428    /// <p>Multiple requests to update the same resource were in conflict.</p>
1429    OperationAborted(String),
1430    /// <p>The specified resource does not exist.</p>
1431    ResourceNotFound(String),
1432    /// <p>The service cannot complete the request.</p>
1433    ServiceUnavailable(String),
1434}
1435
1436impl AssociateKmsKeyError {
1437    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateKmsKeyError> {
1438        if let Some(err) = proto::json::Error::parse(&res) {
1439            match err.typ.as_str() {
1440                "InvalidParameterException" => {
1441                    return RusotoError::Service(AssociateKmsKeyError::InvalidParameter(err.msg))
1442                }
1443                "OperationAbortedException" => {
1444                    return RusotoError::Service(AssociateKmsKeyError::OperationAborted(err.msg))
1445                }
1446                "ResourceNotFoundException" => {
1447                    return RusotoError::Service(AssociateKmsKeyError::ResourceNotFound(err.msg))
1448                }
1449                "ServiceUnavailableException" => {
1450                    return RusotoError::Service(AssociateKmsKeyError::ServiceUnavailable(err.msg))
1451                }
1452                "ValidationException" => return RusotoError::Validation(err.msg),
1453                _ => {}
1454            }
1455        }
1456        RusotoError::Unknown(res)
1457    }
1458}
1459impl fmt::Display for AssociateKmsKeyError {
1460    #[allow(unused_variables)]
1461    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1462        match *self {
1463            AssociateKmsKeyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1464            AssociateKmsKeyError::OperationAborted(ref cause) => write!(f, "{}", cause),
1465            AssociateKmsKeyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1466            AssociateKmsKeyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1467        }
1468    }
1469}
1470impl Error for AssociateKmsKeyError {}
1471/// Errors returned by CancelExportTask
1472#[derive(Debug, PartialEq)]
1473pub enum CancelExportTaskError {
1474    /// <p>The operation is not valid on the specified resource.</p>
1475    InvalidOperation(String),
1476    /// <p>A parameter is specified incorrectly.</p>
1477    InvalidParameter(String),
1478    /// <p>The specified resource does not exist.</p>
1479    ResourceNotFound(String),
1480    /// <p>The service cannot complete the request.</p>
1481    ServiceUnavailable(String),
1482}
1483
1484impl CancelExportTaskError {
1485    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelExportTaskError> {
1486        if let Some(err) = proto::json::Error::parse(&res) {
1487            match err.typ.as_str() {
1488                "InvalidOperationException" => {
1489                    return RusotoError::Service(CancelExportTaskError::InvalidOperation(err.msg))
1490                }
1491                "InvalidParameterException" => {
1492                    return RusotoError::Service(CancelExportTaskError::InvalidParameter(err.msg))
1493                }
1494                "ResourceNotFoundException" => {
1495                    return RusotoError::Service(CancelExportTaskError::ResourceNotFound(err.msg))
1496                }
1497                "ServiceUnavailableException" => {
1498                    return RusotoError::Service(CancelExportTaskError::ServiceUnavailable(err.msg))
1499                }
1500                "ValidationException" => return RusotoError::Validation(err.msg),
1501                _ => {}
1502            }
1503        }
1504        RusotoError::Unknown(res)
1505    }
1506}
1507impl fmt::Display for CancelExportTaskError {
1508    #[allow(unused_variables)]
1509    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1510        match *self {
1511            CancelExportTaskError::InvalidOperation(ref cause) => write!(f, "{}", cause),
1512            CancelExportTaskError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1513            CancelExportTaskError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1514            CancelExportTaskError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1515        }
1516    }
1517}
1518impl Error for CancelExportTaskError {}
1519/// Errors returned by CreateExportTask
1520#[derive(Debug, PartialEq)]
1521pub enum CreateExportTaskError {
1522    /// <p>A parameter is specified incorrectly.</p>
1523    InvalidParameter(String),
1524    /// <p>You have reached the maximum number of resources that can be created.</p>
1525    LimitExceeded(String),
1526    /// <p>Multiple requests to update the same resource were in conflict.</p>
1527    OperationAborted(String),
1528    /// <p>The specified resource already exists.</p>
1529    ResourceAlreadyExists(String),
1530    /// <p>The specified resource does not exist.</p>
1531    ResourceNotFound(String),
1532    /// <p>The service cannot complete the request.</p>
1533    ServiceUnavailable(String),
1534}
1535
1536impl CreateExportTaskError {
1537    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateExportTaskError> {
1538        if let Some(err) = proto::json::Error::parse(&res) {
1539            match err.typ.as_str() {
1540                "InvalidParameterException" => {
1541                    return RusotoError::Service(CreateExportTaskError::InvalidParameter(err.msg))
1542                }
1543                "LimitExceededException" => {
1544                    return RusotoError::Service(CreateExportTaskError::LimitExceeded(err.msg))
1545                }
1546                "OperationAbortedException" => {
1547                    return RusotoError::Service(CreateExportTaskError::OperationAborted(err.msg))
1548                }
1549                "ResourceAlreadyExistsException" => {
1550                    return RusotoError::Service(CreateExportTaskError::ResourceAlreadyExists(
1551                        err.msg,
1552                    ))
1553                }
1554                "ResourceNotFoundException" => {
1555                    return RusotoError::Service(CreateExportTaskError::ResourceNotFound(err.msg))
1556                }
1557                "ServiceUnavailableException" => {
1558                    return RusotoError::Service(CreateExportTaskError::ServiceUnavailable(err.msg))
1559                }
1560                "ValidationException" => return RusotoError::Validation(err.msg),
1561                _ => {}
1562            }
1563        }
1564        RusotoError::Unknown(res)
1565    }
1566}
1567impl fmt::Display for CreateExportTaskError {
1568    #[allow(unused_variables)]
1569    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1570        match *self {
1571            CreateExportTaskError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1572            CreateExportTaskError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1573            CreateExportTaskError::OperationAborted(ref cause) => write!(f, "{}", cause),
1574            CreateExportTaskError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
1575            CreateExportTaskError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1576            CreateExportTaskError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1577        }
1578    }
1579}
1580impl Error for CreateExportTaskError {}
1581/// Errors returned by CreateLogGroup
1582#[derive(Debug, PartialEq)]
1583pub enum CreateLogGroupError {
1584    /// <p>A parameter is specified incorrectly.</p>
1585    InvalidParameter(String),
1586    /// <p>You have reached the maximum number of resources that can be created.</p>
1587    LimitExceeded(String),
1588    /// <p>Multiple requests to update the same resource were in conflict.</p>
1589    OperationAborted(String),
1590    /// <p>The specified resource already exists.</p>
1591    ResourceAlreadyExists(String),
1592    /// <p>The service cannot complete the request.</p>
1593    ServiceUnavailable(String),
1594}
1595
1596impl CreateLogGroupError {
1597    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLogGroupError> {
1598        if let Some(err) = proto::json::Error::parse(&res) {
1599            match err.typ.as_str() {
1600                "InvalidParameterException" => {
1601                    return RusotoError::Service(CreateLogGroupError::InvalidParameter(err.msg))
1602                }
1603                "LimitExceededException" => {
1604                    return RusotoError::Service(CreateLogGroupError::LimitExceeded(err.msg))
1605                }
1606                "OperationAbortedException" => {
1607                    return RusotoError::Service(CreateLogGroupError::OperationAborted(err.msg))
1608                }
1609                "ResourceAlreadyExistsException" => {
1610                    return RusotoError::Service(CreateLogGroupError::ResourceAlreadyExists(
1611                        err.msg,
1612                    ))
1613                }
1614                "ServiceUnavailableException" => {
1615                    return RusotoError::Service(CreateLogGroupError::ServiceUnavailable(err.msg))
1616                }
1617                "ValidationException" => return RusotoError::Validation(err.msg),
1618                _ => {}
1619            }
1620        }
1621        RusotoError::Unknown(res)
1622    }
1623}
1624impl fmt::Display for CreateLogGroupError {
1625    #[allow(unused_variables)]
1626    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1627        match *self {
1628            CreateLogGroupError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1629            CreateLogGroupError::LimitExceeded(ref cause) => write!(f, "{}", cause),
1630            CreateLogGroupError::OperationAborted(ref cause) => write!(f, "{}", cause),
1631            CreateLogGroupError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
1632            CreateLogGroupError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1633        }
1634    }
1635}
1636impl Error for CreateLogGroupError {}
1637/// Errors returned by CreateLogStream
1638#[derive(Debug, PartialEq)]
1639pub enum CreateLogStreamError {
1640    /// <p>A parameter is specified incorrectly.</p>
1641    InvalidParameter(String),
1642    /// <p>The specified resource already exists.</p>
1643    ResourceAlreadyExists(String),
1644    /// <p>The specified resource does not exist.</p>
1645    ResourceNotFound(String),
1646    /// <p>The service cannot complete the request.</p>
1647    ServiceUnavailable(String),
1648}
1649
1650impl CreateLogStreamError {
1651    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLogStreamError> {
1652        if let Some(err) = proto::json::Error::parse(&res) {
1653            match err.typ.as_str() {
1654                "InvalidParameterException" => {
1655                    return RusotoError::Service(CreateLogStreamError::InvalidParameter(err.msg))
1656                }
1657                "ResourceAlreadyExistsException" => {
1658                    return RusotoError::Service(CreateLogStreamError::ResourceAlreadyExists(
1659                        err.msg,
1660                    ))
1661                }
1662                "ResourceNotFoundException" => {
1663                    return RusotoError::Service(CreateLogStreamError::ResourceNotFound(err.msg))
1664                }
1665                "ServiceUnavailableException" => {
1666                    return RusotoError::Service(CreateLogStreamError::ServiceUnavailable(err.msg))
1667                }
1668                "ValidationException" => return RusotoError::Validation(err.msg),
1669                _ => {}
1670            }
1671        }
1672        RusotoError::Unknown(res)
1673    }
1674}
1675impl fmt::Display for CreateLogStreamError {
1676    #[allow(unused_variables)]
1677    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1678        match *self {
1679            CreateLogStreamError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1680            CreateLogStreamError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
1681            CreateLogStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1682            CreateLogStreamError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1683        }
1684    }
1685}
1686impl Error for CreateLogStreamError {}
1687/// Errors returned by DeleteDestination
1688#[derive(Debug, PartialEq)]
1689pub enum DeleteDestinationError {
1690    /// <p>A parameter is specified incorrectly.</p>
1691    InvalidParameter(String),
1692    /// <p>Multiple requests to update the same resource were in conflict.</p>
1693    OperationAborted(String),
1694    /// <p>The specified resource does not exist.</p>
1695    ResourceNotFound(String),
1696    /// <p>The service cannot complete the request.</p>
1697    ServiceUnavailable(String),
1698}
1699
1700impl DeleteDestinationError {
1701    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDestinationError> {
1702        if let Some(err) = proto::json::Error::parse(&res) {
1703            match err.typ.as_str() {
1704                "InvalidParameterException" => {
1705                    return RusotoError::Service(DeleteDestinationError::InvalidParameter(err.msg))
1706                }
1707                "OperationAbortedException" => {
1708                    return RusotoError::Service(DeleteDestinationError::OperationAborted(err.msg))
1709                }
1710                "ResourceNotFoundException" => {
1711                    return RusotoError::Service(DeleteDestinationError::ResourceNotFound(err.msg))
1712                }
1713                "ServiceUnavailableException" => {
1714                    return RusotoError::Service(DeleteDestinationError::ServiceUnavailable(
1715                        err.msg,
1716                    ))
1717                }
1718                "ValidationException" => return RusotoError::Validation(err.msg),
1719                _ => {}
1720            }
1721        }
1722        RusotoError::Unknown(res)
1723    }
1724}
1725impl fmt::Display for DeleteDestinationError {
1726    #[allow(unused_variables)]
1727    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1728        match *self {
1729            DeleteDestinationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1730            DeleteDestinationError::OperationAborted(ref cause) => write!(f, "{}", cause),
1731            DeleteDestinationError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1732            DeleteDestinationError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1733        }
1734    }
1735}
1736impl Error for DeleteDestinationError {}
1737/// Errors returned by DeleteLogGroup
1738#[derive(Debug, PartialEq)]
1739pub enum DeleteLogGroupError {
1740    /// <p>A parameter is specified incorrectly.</p>
1741    InvalidParameter(String),
1742    /// <p>Multiple requests to update the same resource were in conflict.</p>
1743    OperationAborted(String),
1744    /// <p>The specified resource does not exist.</p>
1745    ResourceNotFound(String),
1746    /// <p>The service cannot complete the request.</p>
1747    ServiceUnavailable(String),
1748}
1749
1750impl DeleteLogGroupError {
1751    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLogGroupError> {
1752        if let Some(err) = proto::json::Error::parse(&res) {
1753            match err.typ.as_str() {
1754                "InvalidParameterException" => {
1755                    return RusotoError::Service(DeleteLogGroupError::InvalidParameter(err.msg))
1756                }
1757                "OperationAbortedException" => {
1758                    return RusotoError::Service(DeleteLogGroupError::OperationAborted(err.msg))
1759                }
1760                "ResourceNotFoundException" => {
1761                    return RusotoError::Service(DeleteLogGroupError::ResourceNotFound(err.msg))
1762                }
1763                "ServiceUnavailableException" => {
1764                    return RusotoError::Service(DeleteLogGroupError::ServiceUnavailable(err.msg))
1765                }
1766                "ValidationException" => return RusotoError::Validation(err.msg),
1767                _ => {}
1768            }
1769        }
1770        RusotoError::Unknown(res)
1771    }
1772}
1773impl fmt::Display for DeleteLogGroupError {
1774    #[allow(unused_variables)]
1775    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1776        match *self {
1777            DeleteLogGroupError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1778            DeleteLogGroupError::OperationAborted(ref cause) => write!(f, "{}", cause),
1779            DeleteLogGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1780            DeleteLogGroupError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1781        }
1782    }
1783}
1784impl Error for DeleteLogGroupError {}
1785/// Errors returned by DeleteLogStream
1786#[derive(Debug, PartialEq)]
1787pub enum DeleteLogStreamError {
1788    /// <p>A parameter is specified incorrectly.</p>
1789    InvalidParameter(String),
1790    /// <p>Multiple requests to update the same resource were in conflict.</p>
1791    OperationAborted(String),
1792    /// <p>The specified resource does not exist.</p>
1793    ResourceNotFound(String),
1794    /// <p>The service cannot complete the request.</p>
1795    ServiceUnavailable(String),
1796}
1797
1798impl DeleteLogStreamError {
1799    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLogStreamError> {
1800        if let Some(err) = proto::json::Error::parse(&res) {
1801            match err.typ.as_str() {
1802                "InvalidParameterException" => {
1803                    return RusotoError::Service(DeleteLogStreamError::InvalidParameter(err.msg))
1804                }
1805                "OperationAbortedException" => {
1806                    return RusotoError::Service(DeleteLogStreamError::OperationAborted(err.msg))
1807                }
1808                "ResourceNotFoundException" => {
1809                    return RusotoError::Service(DeleteLogStreamError::ResourceNotFound(err.msg))
1810                }
1811                "ServiceUnavailableException" => {
1812                    return RusotoError::Service(DeleteLogStreamError::ServiceUnavailable(err.msg))
1813                }
1814                "ValidationException" => return RusotoError::Validation(err.msg),
1815                _ => {}
1816            }
1817        }
1818        RusotoError::Unknown(res)
1819    }
1820}
1821impl fmt::Display for DeleteLogStreamError {
1822    #[allow(unused_variables)]
1823    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1824        match *self {
1825            DeleteLogStreamError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1826            DeleteLogStreamError::OperationAborted(ref cause) => write!(f, "{}", cause),
1827            DeleteLogStreamError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1828            DeleteLogStreamError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1829        }
1830    }
1831}
1832impl Error for DeleteLogStreamError {}
1833/// Errors returned by DeleteMetricFilter
1834#[derive(Debug, PartialEq)]
1835pub enum DeleteMetricFilterError {
1836    /// <p>A parameter is specified incorrectly.</p>
1837    InvalidParameter(String),
1838    /// <p>Multiple requests to update the same resource were in conflict.</p>
1839    OperationAborted(String),
1840    /// <p>The specified resource does not exist.</p>
1841    ResourceNotFound(String),
1842    /// <p>The service cannot complete the request.</p>
1843    ServiceUnavailable(String),
1844}
1845
1846impl DeleteMetricFilterError {
1847    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMetricFilterError> {
1848        if let Some(err) = proto::json::Error::parse(&res) {
1849            match err.typ.as_str() {
1850                "InvalidParameterException" => {
1851                    return RusotoError::Service(DeleteMetricFilterError::InvalidParameter(err.msg))
1852                }
1853                "OperationAbortedException" => {
1854                    return RusotoError::Service(DeleteMetricFilterError::OperationAborted(err.msg))
1855                }
1856                "ResourceNotFoundException" => {
1857                    return RusotoError::Service(DeleteMetricFilterError::ResourceNotFound(err.msg))
1858                }
1859                "ServiceUnavailableException" => {
1860                    return RusotoError::Service(DeleteMetricFilterError::ServiceUnavailable(
1861                        err.msg,
1862                    ))
1863                }
1864                "ValidationException" => return RusotoError::Validation(err.msg),
1865                _ => {}
1866            }
1867        }
1868        RusotoError::Unknown(res)
1869    }
1870}
1871impl fmt::Display for DeleteMetricFilterError {
1872    #[allow(unused_variables)]
1873    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1874        match *self {
1875            DeleteMetricFilterError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1876            DeleteMetricFilterError::OperationAborted(ref cause) => write!(f, "{}", cause),
1877            DeleteMetricFilterError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1878            DeleteMetricFilterError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1879        }
1880    }
1881}
1882impl Error for DeleteMetricFilterError {}
1883/// Errors returned by DeleteQueryDefinition
1884#[derive(Debug, PartialEq)]
1885pub enum DeleteQueryDefinitionError {
1886    /// <p>A parameter is specified incorrectly.</p>
1887    InvalidParameter(String),
1888    /// <p>The specified resource does not exist.</p>
1889    ResourceNotFound(String),
1890    /// <p>The service cannot complete the request.</p>
1891    ServiceUnavailable(String),
1892}
1893
1894impl DeleteQueryDefinitionError {
1895    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteQueryDefinitionError> {
1896        if let Some(err) = proto::json::Error::parse(&res) {
1897            match err.typ.as_str() {
1898                "InvalidParameterException" => {
1899                    return RusotoError::Service(DeleteQueryDefinitionError::InvalidParameter(
1900                        err.msg,
1901                    ))
1902                }
1903                "ResourceNotFoundException" => {
1904                    return RusotoError::Service(DeleteQueryDefinitionError::ResourceNotFound(
1905                        err.msg,
1906                    ))
1907                }
1908                "ServiceUnavailableException" => {
1909                    return RusotoError::Service(DeleteQueryDefinitionError::ServiceUnavailable(
1910                        err.msg,
1911                    ))
1912                }
1913                "ValidationException" => return RusotoError::Validation(err.msg),
1914                _ => {}
1915            }
1916        }
1917        RusotoError::Unknown(res)
1918    }
1919}
1920impl fmt::Display for DeleteQueryDefinitionError {
1921    #[allow(unused_variables)]
1922    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1923        match *self {
1924            DeleteQueryDefinitionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1925            DeleteQueryDefinitionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1926            DeleteQueryDefinitionError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1927        }
1928    }
1929}
1930impl Error for DeleteQueryDefinitionError {}
1931/// Errors returned by DeleteResourcePolicy
1932#[derive(Debug, PartialEq)]
1933pub enum DeleteResourcePolicyError {
1934    /// <p>A parameter is specified incorrectly.</p>
1935    InvalidParameter(String),
1936    /// <p>The specified resource does not exist.</p>
1937    ResourceNotFound(String),
1938    /// <p>The service cannot complete the request.</p>
1939    ServiceUnavailable(String),
1940}
1941
1942impl DeleteResourcePolicyError {
1943    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteResourcePolicyError> {
1944        if let Some(err) = proto::json::Error::parse(&res) {
1945            match err.typ.as_str() {
1946                "InvalidParameterException" => {
1947                    return RusotoError::Service(DeleteResourcePolicyError::InvalidParameter(
1948                        err.msg,
1949                    ))
1950                }
1951                "ResourceNotFoundException" => {
1952                    return RusotoError::Service(DeleteResourcePolicyError::ResourceNotFound(
1953                        err.msg,
1954                    ))
1955                }
1956                "ServiceUnavailableException" => {
1957                    return RusotoError::Service(DeleteResourcePolicyError::ServiceUnavailable(
1958                        err.msg,
1959                    ))
1960                }
1961                "ValidationException" => return RusotoError::Validation(err.msg),
1962                _ => {}
1963            }
1964        }
1965        RusotoError::Unknown(res)
1966    }
1967}
1968impl fmt::Display for DeleteResourcePolicyError {
1969    #[allow(unused_variables)]
1970    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
1971        match *self {
1972            DeleteResourcePolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
1973            DeleteResourcePolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
1974            DeleteResourcePolicyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
1975        }
1976    }
1977}
1978impl Error for DeleteResourcePolicyError {}
1979/// Errors returned by DeleteRetentionPolicy
1980#[derive(Debug, PartialEq)]
1981pub enum DeleteRetentionPolicyError {
1982    /// <p>A parameter is specified incorrectly.</p>
1983    InvalidParameter(String),
1984    /// <p>Multiple requests to update the same resource were in conflict.</p>
1985    OperationAborted(String),
1986    /// <p>The specified resource does not exist.</p>
1987    ResourceNotFound(String),
1988    /// <p>The service cannot complete the request.</p>
1989    ServiceUnavailable(String),
1990}
1991
1992impl DeleteRetentionPolicyError {
1993    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRetentionPolicyError> {
1994        if let Some(err) = proto::json::Error::parse(&res) {
1995            match err.typ.as_str() {
1996                "InvalidParameterException" => {
1997                    return RusotoError::Service(DeleteRetentionPolicyError::InvalidParameter(
1998                        err.msg,
1999                    ))
2000                }
2001                "OperationAbortedException" => {
2002                    return RusotoError::Service(DeleteRetentionPolicyError::OperationAborted(
2003                        err.msg,
2004                    ))
2005                }
2006                "ResourceNotFoundException" => {
2007                    return RusotoError::Service(DeleteRetentionPolicyError::ResourceNotFound(
2008                        err.msg,
2009                    ))
2010                }
2011                "ServiceUnavailableException" => {
2012                    return RusotoError::Service(DeleteRetentionPolicyError::ServiceUnavailable(
2013                        err.msg,
2014                    ))
2015                }
2016                "ValidationException" => return RusotoError::Validation(err.msg),
2017                _ => {}
2018            }
2019        }
2020        RusotoError::Unknown(res)
2021    }
2022}
2023impl fmt::Display for DeleteRetentionPolicyError {
2024    #[allow(unused_variables)]
2025    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2026        match *self {
2027            DeleteRetentionPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2028            DeleteRetentionPolicyError::OperationAborted(ref cause) => write!(f, "{}", cause),
2029            DeleteRetentionPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2030            DeleteRetentionPolicyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2031        }
2032    }
2033}
2034impl Error for DeleteRetentionPolicyError {}
2035/// Errors returned by DeleteSubscriptionFilter
2036#[derive(Debug, PartialEq)]
2037pub enum DeleteSubscriptionFilterError {
2038    /// <p>A parameter is specified incorrectly.</p>
2039    InvalidParameter(String),
2040    /// <p>Multiple requests to update the same resource were in conflict.</p>
2041    OperationAborted(String),
2042    /// <p>The specified resource does not exist.</p>
2043    ResourceNotFound(String),
2044    /// <p>The service cannot complete the request.</p>
2045    ServiceUnavailable(String),
2046}
2047
2048impl DeleteSubscriptionFilterError {
2049    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSubscriptionFilterError> {
2050        if let Some(err) = proto::json::Error::parse(&res) {
2051            match err.typ.as_str() {
2052                "InvalidParameterException" => {
2053                    return RusotoError::Service(DeleteSubscriptionFilterError::InvalidParameter(
2054                        err.msg,
2055                    ))
2056                }
2057                "OperationAbortedException" => {
2058                    return RusotoError::Service(DeleteSubscriptionFilterError::OperationAborted(
2059                        err.msg,
2060                    ))
2061                }
2062                "ResourceNotFoundException" => {
2063                    return RusotoError::Service(DeleteSubscriptionFilterError::ResourceNotFound(
2064                        err.msg,
2065                    ))
2066                }
2067                "ServiceUnavailableException" => {
2068                    return RusotoError::Service(DeleteSubscriptionFilterError::ServiceUnavailable(
2069                        err.msg,
2070                    ))
2071                }
2072                "ValidationException" => return RusotoError::Validation(err.msg),
2073                _ => {}
2074            }
2075        }
2076        RusotoError::Unknown(res)
2077    }
2078}
2079impl fmt::Display for DeleteSubscriptionFilterError {
2080    #[allow(unused_variables)]
2081    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2082        match *self {
2083            DeleteSubscriptionFilterError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2084            DeleteSubscriptionFilterError::OperationAborted(ref cause) => write!(f, "{}", cause),
2085            DeleteSubscriptionFilterError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2086            DeleteSubscriptionFilterError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2087        }
2088    }
2089}
2090impl Error for DeleteSubscriptionFilterError {}
2091/// Errors returned by DescribeDestinations
2092#[derive(Debug, PartialEq)]
2093pub enum DescribeDestinationsError {
2094    /// <p>A parameter is specified incorrectly.</p>
2095    InvalidParameter(String),
2096    /// <p>The service cannot complete the request.</p>
2097    ServiceUnavailable(String),
2098}
2099
2100impl DescribeDestinationsError {
2101    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDestinationsError> {
2102        if let Some(err) = proto::json::Error::parse(&res) {
2103            match err.typ.as_str() {
2104                "InvalidParameterException" => {
2105                    return RusotoError::Service(DescribeDestinationsError::InvalidParameter(
2106                        err.msg,
2107                    ))
2108                }
2109                "ServiceUnavailableException" => {
2110                    return RusotoError::Service(DescribeDestinationsError::ServiceUnavailable(
2111                        err.msg,
2112                    ))
2113                }
2114                "ValidationException" => return RusotoError::Validation(err.msg),
2115                _ => {}
2116            }
2117        }
2118        RusotoError::Unknown(res)
2119    }
2120}
2121impl fmt::Display for DescribeDestinationsError {
2122    #[allow(unused_variables)]
2123    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2124        match *self {
2125            DescribeDestinationsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2126            DescribeDestinationsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2127        }
2128    }
2129}
2130impl Error for DescribeDestinationsError {}
2131/// Errors returned by DescribeExportTasks
2132#[derive(Debug, PartialEq)]
2133pub enum DescribeExportTasksError {
2134    /// <p>A parameter is specified incorrectly.</p>
2135    InvalidParameter(String),
2136    /// <p>The service cannot complete the request.</p>
2137    ServiceUnavailable(String),
2138}
2139
2140impl DescribeExportTasksError {
2141    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeExportTasksError> {
2142        if let Some(err) = proto::json::Error::parse(&res) {
2143            match err.typ.as_str() {
2144                "InvalidParameterException" => {
2145                    return RusotoError::Service(DescribeExportTasksError::InvalidParameter(
2146                        err.msg,
2147                    ))
2148                }
2149                "ServiceUnavailableException" => {
2150                    return RusotoError::Service(DescribeExportTasksError::ServiceUnavailable(
2151                        err.msg,
2152                    ))
2153                }
2154                "ValidationException" => return RusotoError::Validation(err.msg),
2155                _ => {}
2156            }
2157        }
2158        RusotoError::Unknown(res)
2159    }
2160}
2161impl fmt::Display for DescribeExportTasksError {
2162    #[allow(unused_variables)]
2163    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2164        match *self {
2165            DescribeExportTasksError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2166            DescribeExportTasksError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2167        }
2168    }
2169}
2170impl Error for DescribeExportTasksError {}
2171/// Errors returned by DescribeLogGroups
2172#[derive(Debug, PartialEq)]
2173pub enum DescribeLogGroupsError {
2174    /// <p>A parameter is specified incorrectly.</p>
2175    InvalidParameter(String),
2176    /// <p>The service cannot complete the request.</p>
2177    ServiceUnavailable(String),
2178}
2179
2180impl DescribeLogGroupsError {
2181    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLogGroupsError> {
2182        if let Some(err) = proto::json::Error::parse(&res) {
2183            match err.typ.as_str() {
2184                "InvalidParameterException" => {
2185                    return RusotoError::Service(DescribeLogGroupsError::InvalidParameter(err.msg))
2186                }
2187                "ServiceUnavailableException" => {
2188                    return RusotoError::Service(DescribeLogGroupsError::ServiceUnavailable(
2189                        err.msg,
2190                    ))
2191                }
2192                "ValidationException" => return RusotoError::Validation(err.msg),
2193                _ => {}
2194            }
2195        }
2196        RusotoError::Unknown(res)
2197    }
2198}
2199impl fmt::Display for DescribeLogGroupsError {
2200    #[allow(unused_variables)]
2201    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2202        match *self {
2203            DescribeLogGroupsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2204            DescribeLogGroupsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2205        }
2206    }
2207}
2208impl Error for DescribeLogGroupsError {}
2209/// Errors returned by DescribeLogStreams
2210#[derive(Debug, PartialEq)]
2211pub enum DescribeLogStreamsError {
2212    /// <p>A parameter is specified incorrectly.</p>
2213    InvalidParameter(String),
2214    /// <p>The specified resource does not exist.</p>
2215    ResourceNotFound(String),
2216    /// <p>The service cannot complete the request.</p>
2217    ServiceUnavailable(String),
2218}
2219
2220impl DescribeLogStreamsError {
2221    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLogStreamsError> {
2222        if let Some(err) = proto::json::Error::parse(&res) {
2223            match err.typ.as_str() {
2224                "InvalidParameterException" => {
2225                    return RusotoError::Service(DescribeLogStreamsError::InvalidParameter(err.msg))
2226                }
2227                "ResourceNotFoundException" => {
2228                    return RusotoError::Service(DescribeLogStreamsError::ResourceNotFound(err.msg))
2229                }
2230                "ServiceUnavailableException" => {
2231                    return RusotoError::Service(DescribeLogStreamsError::ServiceUnavailable(
2232                        err.msg,
2233                    ))
2234                }
2235                "ValidationException" => return RusotoError::Validation(err.msg),
2236                _ => {}
2237            }
2238        }
2239        RusotoError::Unknown(res)
2240    }
2241}
2242impl fmt::Display for DescribeLogStreamsError {
2243    #[allow(unused_variables)]
2244    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2245        match *self {
2246            DescribeLogStreamsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2247            DescribeLogStreamsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2248            DescribeLogStreamsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2249        }
2250    }
2251}
2252impl Error for DescribeLogStreamsError {}
2253/// Errors returned by DescribeMetricFilters
2254#[derive(Debug, PartialEq)]
2255pub enum DescribeMetricFiltersError {
2256    /// <p>A parameter is specified incorrectly.</p>
2257    InvalidParameter(String),
2258    /// <p>The specified resource does not exist.</p>
2259    ResourceNotFound(String),
2260    /// <p>The service cannot complete the request.</p>
2261    ServiceUnavailable(String),
2262}
2263
2264impl DescribeMetricFiltersError {
2265    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeMetricFiltersError> {
2266        if let Some(err) = proto::json::Error::parse(&res) {
2267            match err.typ.as_str() {
2268                "InvalidParameterException" => {
2269                    return RusotoError::Service(DescribeMetricFiltersError::InvalidParameter(
2270                        err.msg,
2271                    ))
2272                }
2273                "ResourceNotFoundException" => {
2274                    return RusotoError::Service(DescribeMetricFiltersError::ResourceNotFound(
2275                        err.msg,
2276                    ))
2277                }
2278                "ServiceUnavailableException" => {
2279                    return RusotoError::Service(DescribeMetricFiltersError::ServiceUnavailable(
2280                        err.msg,
2281                    ))
2282                }
2283                "ValidationException" => return RusotoError::Validation(err.msg),
2284                _ => {}
2285            }
2286        }
2287        RusotoError::Unknown(res)
2288    }
2289}
2290impl fmt::Display for DescribeMetricFiltersError {
2291    #[allow(unused_variables)]
2292    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2293        match *self {
2294            DescribeMetricFiltersError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2295            DescribeMetricFiltersError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2296            DescribeMetricFiltersError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2297        }
2298    }
2299}
2300impl Error for DescribeMetricFiltersError {}
2301/// Errors returned by DescribeQueries
2302#[derive(Debug, PartialEq)]
2303pub enum DescribeQueriesError {
2304    /// <p>A parameter is specified incorrectly.</p>
2305    InvalidParameter(String),
2306    /// <p>The specified resource does not exist.</p>
2307    ResourceNotFound(String),
2308    /// <p>The service cannot complete the request.</p>
2309    ServiceUnavailable(String),
2310}
2311
2312impl DescribeQueriesError {
2313    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeQueriesError> {
2314        if let Some(err) = proto::json::Error::parse(&res) {
2315            match err.typ.as_str() {
2316                "InvalidParameterException" => {
2317                    return RusotoError::Service(DescribeQueriesError::InvalidParameter(err.msg))
2318                }
2319                "ResourceNotFoundException" => {
2320                    return RusotoError::Service(DescribeQueriesError::ResourceNotFound(err.msg))
2321                }
2322                "ServiceUnavailableException" => {
2323                    return RusotoError::Service(DescribeQueriesError::ServiceUnavailable(err.msg))
2324                }
2325                "ValidationException" => return RusotoError::Validation(err.msg),
2326                _ => {}
2327            }
2328        }
2329        RusotoError::Unknown(res)
2330    }
2331}
2332impl fmt::Display for DescribeQueriesError {
2333    #[allow(unused_variables)]
2334    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2335        match *self {
2336            DescribeQueriesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2337            DescribeQueriesError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2338            DescribeQueriesError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2339        }
2340    }
2341}
2342impl Error for DescribeQueriesError {}
2343/// Errors returned by DescribeQueryDefinitions
2344#[derive(Debug, PartialEq)]
2345pub enum DescribeQueryDefinitionsError {
2346    /// <p>A parameter is specified incorrectly.</p>
2347    InvalidParameter(String),
2348    /// <p>The service cannot complete the request.</p>
2349    ServiceUnavailable(String),
2350}
2351
2352impl DescribeQueryDefinitionsError {
2353    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeQueryDefinitionsError> {
2354        if let Some(err) = proto::json::Error::parse(&res) {
2355            match err.typ.as_str() {
2356                "InvalidParameterException" => {
2357                    return RusotoError::Service(DescribeQueryDefinitionsError::InvalidParameter(
2358                        err.msg,
2359                    ))
2360                }
2361                "ServiceUnavailableException" => {
2362                    return RusotoError::Service(DescribeQueryDefinitionsError::ServiceUnavailable(
2363                        err.msg,
2364                    ))
2365                }
2366                "ValidationException" => return RusotoError::Validation(err.msg),
2367                _ => {}
2368            }
2369        }
2370        RusotoError::Unknown(res)
2371    }
2372}
2373impl fmt::Display for DescribeQueryDefinitionsError {
2374    #[allow(unused_variables)]
2375    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2376        match *self {
2377            DescribeQueryDefinitionsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2378            DescribeQueryDefinitionsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2379        }
2380    }
2381}
2382impl Error for DescribeQueryDefinitionsError {}
2383/// Errors returned by DescribeResourcePolicies
2384#[derive(Debug, PartialEq)]
2385pub enum DescribeResourcePoliciesError {
2386    /// <p>A parameter is specified incorrectly.</p>
2387    InvalidParameter(String),
2388    /// <p>The service cannot complete the request.</p>
2389    ServiceUnavailable(String),
2390}
2391
2392impl DescribeResourcePoliciesError {
2393    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeResourcePoliciesError> {
2394        if let Some(err) = proto::json::Error::parse(&res) {
2395            match err.typ.as_str() {
2396                "InvalidParameterException" => {
2397                    return RusotoError::Service(DescribeResourcePoliciesError::InvalidParameter(
2398                        err.msg,
2399                    ))
2400                }
2401                "ServiceUnavailableException" => {
2402                    return RusotoError::Service(DescribeResourcePoliciesError::ServiceUnavailable(
2403                        err.msg,
2404                    ))
2405                }
2406                "ValidationException" => return RusotoError::Validation(err.msg),
2407                _ => {}
2408            }
2409        }
2410        RusotoError::Unknown(res)
2411    }
2412}
2413impl fmt::Display for DescribeResourcePoliciesError {
2414    #[allow(unused_variables)]
2415    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2416        match *self {
2417            DescribeResourcePoliciesError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2418            DescribeResourcePoliciesError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2419        }
2420    }
2421}
2422impl Error for DescribeResourcePoliciesError {}
2423/// Errors returned by DescribeSubscriptionFilters
2424#[derive(Debug, PartialEq)]
2425pub enum DescribeSubscriptionFiltersError {
2426    /// <p>A parameter is specified incorrectly.</p>
2427    InvalidParameter(String),
2428    /// <p>The specified resource does not exist.</p>
2429    ResourceNotFound(String),
2430    /// <p>The service cannot complete the request.</p>
2431    ServiceUnavailable(String),
2432}
2433
2434impl DescribeSubscriptionFiltersError {
2435    pub fn from_response(
2436        res: BufferedHttpResponse,
2437    ) -> RusotoError<DescribeSubscriptionFiltersError> {
2438        if let Some(err) = proto::json::Error::parse(&res) {
2439            match err.typ.as_str() {
2440                "InvalidParameterException" => {
2441                    return RusotoError::Service(
2442                        DescribeSubscriptionFiltersError::InvalidParameter(err.msg),
2443                    )
2444                }
2445                "ResourceNotFoundException" => {
2446                    return RusotoError::Service(
2447                        DescribeSubscriptionFiltersError::ResourceNotFound(err.msg),
2448                    )
2449                }
2450                "ServiceUnavailableException" => {
2451                    return RusotoError::Service(
2452                        DescribeSubscriptionFiltersError::ServiceUnavailable(err.msg),
2453                    )
2454                }
2455                "ValidationException" => return RusotoError::Validation(err.msg),
2456                _ => {}
2457            }
2458        }
2459        RusotoError::Unknown(res)
2460    }
2461}
2462impl fmt::Display for DescribeSubscriptionFiltersError {
2463    #[allow(unused_variables)]
2464    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2465        match *self {
2466            DescribeSubscriptionFiltersError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2467            DescribeSubscriptionFiltersError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2468            DescribeSubscriptionFiltersError::ServiceUnavailable(ref cause) => {
2469                write!(f, "{}", cause)
2470            }
2471        }
2472    }
2473}
2474impl Error for DescribeSubscriptionFiltersError {}
2475/// Errors returned by DisassociateKmsKey
2476#[derive(Debug, PartialEq)]
2477pub enum DisassociateKmsKeyError {
2478    /// <p>A parameter is specified incorrectly.</p>
2479    InvalidParameter(String),
2480    /// <p>Multiple requests to update the same resource were in conflict.</p>
2481    OperationAborted(String),
2482    /// <p>The specified resource does not exist.</p>
2483    ResourceNotFound(String),
2484    /// <p>The service cannot complete the request.</p>
2485    ServiceUnavailable(String),
2486}
2487
2488impl DisassociateKmsKeyError {
2489    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateKmsKeyError> {
2490        if let Some(err) = proto::json::Error::parse(&res) {
2491            match err.typ.as_str() {
2492                "InvalidParameterException" => {
2493                    return RusotoError::Service(DisassociateKmsKeyError::InvalidParameter(err.msg))
2494                }
2495                "OperationAbortedException" => {
2496                    return RusotoError::Service(DisassociateKmsKeyError::OperationAborted(err.msg))
2497                }
2498                "ResourceNotFoundException" => {
2499                    return RusotoError::Service(DisassociateKmsKeyError::ResourceNotFound(err.msg))
2500                }
2501                "ServiceUnavailableException" => {
2502                    return RusotoError::Service(DisassociateKmsKeyError::ServiceUnavailable(
2503                        err.msg,
2504                    ))
2505                }
2506                "ValidationException" => return RusotoError::Validation(err.msg),
2507                _ => {}
2508            }
2509        }
2510        RusotoError::Unknown(res)
2511    }
2512}
2513impl fmt::Display for DisassociateKmsKeyError {
2514    #[allow(unused_variables)]
2515    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2516        match *self {
2517            DisassociateKmsKeyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2518            DisassociateKmsKeyError::OperationAborted(ref cause) => write!(f, "{}", cause),
2519            DisassociateKmsKeyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2520            DisassociateKmsKeyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2521        }
2522    }
2523}
2524impl Error for DisassociateKmsKeyError {}
2525/// Errors returned by FilterLogEvents
2526#[derive(Debug, PartialEq)]
2527pub enum FilterLogEventsError {
2528    /// <p>A parameter is specified incorrectly.</p>
2529    InvalidParameter(String),
2530    /// <p>The specified resource does not exist.</p>
2531    ResourceNotFound(String),
2532    /// <p>The service cannot complete the request.</p>
2533    ServiceUnavailable(String),
2534}
2535
2536impl FilterLogEventsError {
2537    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<FilterLogEventsError> {
2538        if let Some(err) = proto::json::Error::parse(&res) {
2539            match err.typ.as_str() {
2540                "InvalidParameterException" => {
2541                    return RusotoError::Service(FilterLogEventsError::InvalidParameter(err.msg))
2542                }
2543                "ResourceNotFoundException" => {
2544                    return RusotoError::Service(FilterLogEventsError::ResourceNotFound(err.msg))
2545                }
2546                "ServiceUnavailableException" => {
2547                    return RusotoError::Service(FilterLogEventsError::ServiceUnavailable(err.msg))
2548                }
2549                "ValidationException" => return RusotoError::Validation(err.msg),
2550                _ => {}
2551            }
2552        }
2553        RusotoError::Unknown(res)
2554    }
2555}
2556impl fmt::Display for FilterLogEventsError {
2557    #[allow(unused_variables)]
2558    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2559        match *self {
2560            FilterLogEventsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2561            FilterLogEventsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2562            FilterLogEventsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2563        }
2564    }
2565}
2566impl Error for FilterLogEventsError {}
2567/// Errors returned by GetLogEvents
2568#[derive(Debug, PartialEq)]
2569pub enum GetLogEventsError {
2570    /// <p>A parameter is specified incorrectly.</p>
2571    InvalidParameter(String),
2572    /// <p>The specified resource does not exist.</p>
2573    ResourceNotFound(String),
2574    /// <p>The service cannot complete the request.</p>
2575    ServiceUnavailable(String),
2576}
2577
2578impl GetLogEventsError {
2579    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogEventsError> {
2580        if let Some(err) = proto::json::Error::parse(&res) {
2581            match err.typ.as_str() {
2582                "InvalidParameterException" => {
2583                    return RusotoError::Service(GetLogEventsError::InvalidParameter(err.msg))
2584                }
2585                "ResourceNotFoundException" => {
2586                    return RusotoError::Service(GetLogEventsError::ResourceNotFound(err.msg))
2587                }
2588                "ServiceUnavailableException" => {
2589                    return RusotoError::Service(GetLogEventsError::ServiceUnavailable(err.msg))
2590                }
2591                "ValidationException" => return RusotoError::Validation(err.msg),
2592                _ => {}
2593            }
2594        }
2595        RusotoError::Unknown(res)
2596    }
2597}
2598impl fmt::Display for GetLogEventsError {
2599    #[allow(unused_variables)]
2600    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2601        match *self {
2602            GetLogEventsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2603            GetLogEventsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2604            GetLogEventsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2605        }
2606    }
2607}
2608impl Error for GetLogEventsError {}
2609/// Errors returned by GetLogGroupFields
2610#[derive(Debug, PartialEq)]
2611pub enum GetLogGroupFieldsError {
2612    /// <p>A parameter is specified incorrectly.</p>
2613    InvalidParameter(String),
2614    /// <p>You have reached the maximum number of resources that can be created.</p>
2615    LimitExceeded(String),
2616    /// <p>The specified resource does not exist.</p>
2617    ResourceNotFound(String),
2618    /// <p>The service cannot complete the request.</p>
2619    ServiceUnavailable(String),
2620}
2621
2622impl GetLogGroupFieldsError {
2623    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogGroupFieldsError> {
2624        if let Some(err) = proto::json::Error::parse(&res) {
2625            match err.typ.as_str() {
2626                "InvalidParameterException" => {
2627                    return RusotoError::Service(GetLogGroupFieldsError::InvalidParameter(err.msg))
2628                }
2629                "LimitExceededException" => {
2630                    return RusotoError::Service(GetLogGroupFieldsError::LimitExceeded(err.msg))
2631                }
2632                "ResourceNotFoundException" => {
2633                    return RusotoError::Service(GetLogGroupFieldsError::ResourceNotFound(err.msg))
2634                }
2635                "ServiceUnavailableException" => {
2636                    return RusotoError::Service(GetLogGroupFieldsError::ServiceUnavailable(
2637                        err.msg,
2638                    ))
2639                }
2640                "ValidationException" => return RusotoError::Validation(err.msg),
2641                _ => {}
2642            }
2643        }
2644        RusotoError::Unknown(res)
2645    }
2646}
2647impl fmt::Display for GetLogGroupFieldsError {
2648    #[allow(unused_variables)]
2649    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2650        match *self {
2651            GetLogGroupFieldsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2652            GetLogGroupFieldsError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2653            GetLogGroupFieldsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2654            GetLogGroupFieldsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2655        }
2656    }
2657}
2658impl Error for GetLogGroupFieldsError {}
2659/// Errors returned by GetLogRecord
2660#[derive(Debug, PartialEq)]
2661pub enum GetLogRecordError {
2662    /// <p>A parameter is specified incorrectly.</p>
2663    InvalidParameter(String),
2664    /// <p>You have reached the maximum number of resources that can be created.</p>
2665    LimitExceeded(String),
2666    /// <p>The specified resource does not exist.</p>
2667    ResourceNotFound(String),
2668    /// <p>The service cannot complete the request.</p>
2669    ServiceUnavailable(String),
2670}
2671
2672impl GetLogRecordError {
2673    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogRecordError> {
2674        if let Some(err) = proto::json::Error::parse(&res) {
2675            match err.typ.as_str() {
2676                "InvalidParameterException" => {
2677                    return RusotoError::Service(GetLogRecordError::InvalidParameter(err.msg))
2678                }
2679                "LimitExceededException" => {
2680                    return RusotoError::Service(GetLogRecordError::LimitExceeded(err.msg))
2681                }
2682                "ResourceNotFoundException" => {
2683                    return RusotoError::Service(GetLogRecordError::ResourceNotFound(err.msg))
2684                }
2685                "ServiceUnavailableException" => {
2686                    return RusotoError::Service(GetLogRecordError::ServiceUnavailable(err.msg))
2687                }
2688                "ValidationException" => return RusotoError::Validation(err.msg),
2689                _ => {}
2690            }
2691        }
2692        RusotoError::Unknown(res)
2693    }
2694}
2695impl fmt::Display for GetLogRecordError {
2696    #[allow(unused_variables)]
2697    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2698        match *self {
2699            GetLogRecordError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2700            GetLogRecordError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2701            GetLogRecordError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2702            GetLogRecordError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2703        }
2704    }
2705}
2706impl Error for GetLogRecordError {}
2707/// Errors returned by GetQueryResults
2708#[derive(Debug, PartialEq)]
2709pub enum GetQueryResultsError {
2710    /// <p>A parameter is specified incorrectly.</p>
2711    InvalidParameter(String),
2712    /// <p>The specified resource does not exist.</p>
2713    ResourceNotFound(String),
2714    /// <p>The service cannot complete the request.</p>
2715    ServiceUnavailable(String),
2716}
2717
2718impl GetQueryResultsError {
2719    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryResultsError> {
2720        if let Some(err) = proto::json::Error::parse(&res) {
2721            match err.typ.as_str() {
2722                "InvalidParameterException" => {
2723                    return RusotoError::Service(GetQueryResultsError::InvalidParameter(err.msg))
2724                }
2725                "ResourceNotFoundException" => {
2726                    return RusotoError::Service(GetQueryResultsError::ResourceNotFound(err.msg))
2727                }
2728                "ServiceUnavailableException" => {
2729                    return RusotoError::Service(GetQueryResultsError::ServiceUnavailable(err.msg))
2730                }
2731                "ValidationException" => return RusotoError::Validation(err.msg),
2732                _ => {}
2733            }
2734        }
2735        RusotoError::Unknown(res)
2736    }
2737}
2738impl fmt::Display for GetQueryResultsError {
2739    #[allow(unused_variables)]
2740    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2741        match *self {
2742            GetQueryResultsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2743            GetQueryResultsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2744            GetQueryResultsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2745        }
2746    }
2747}
2748impl Error for GetQueryResultsError {}
2749/// Errors returned by ListTagsLogGroup
2750#[derive(Debug, PartialEq)]
2751pub enum ListTagsLogGroupError {
2752    /// <p>The specified resource does not exist.</p>
2753    ResourceNotFound(String),
2754    /// <p>The service cannot complete the request.</p>
2755    ServiceUnavailable(String),
2756}
2757
2758impl ListTagsLogGroupError {
2759    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsLogGroupError> {
2760        if let Some(err) = proto::json::Error::parse(&res) {
2761            match err.typ.as_str() {
2762                "ResourceNotFoundException" => {
2763                    return RusotoError::Service(ListTagsLogGroupError::ResourceNotFound(err.msg))
2764                }
2765                "ServiceUnavailableException" => {
2766                    return RusotoError::Service(ListTagsLogGroupError::ServiceUnavailable(err.msg))
2767                }
2768                "ValidationException" => return RusotoError::Validation(err.msg),
2769                _ => {}
2770            }
2771        }
2772        RusotoError::Unknown(res)
2773    }
2774}
2775impl fmt::Display for ListTagsLogGroupError {
2776    #[allow(unused_variables)]
2777    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2778        match *self {
2779            ListTagsLogGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2780            ListTagsLogGroupError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2781        }
2782    }
2783}
2784impl Error for ListTagsLogGroupError {}
2785/// Errors returned by PutDestination
2786#[derive(Debug, PartialEq)]
2787pub enum PutDestinationError {
2788    /// <p>A parameter is specified incorrectly.</p>
2789    InvalidParameter(String),
2790    /// <p>Multiple requests to update the same resource were in conflict.</p>
2791    OperationAborted(String),
2792    /// <p>The service cannot complete the request.</p>
2793    ServiceUnavailable(String),
2794}
2795
2796impl PutDestinationError {
2797    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDestinationError> {
2798        if let Some(err) = proto::json::Error::parse(&res) {
2799            match err.typ.as_str() {
2800                "InvalidParameterException" => {
2801                    return RusotoError::Service(PutDestinationError::InvalidParameter(err.msg))
2802                }
2803                "OperationAbortedException" => {
2804                    return RusotoError::Service(PutDestinationError::OperationAborted(err.msg))
2805                }
2806                "ServiceUnavailableException" => {
2807                    return RusotoError::Service(PutDestinationError::ServiceUnavailable(err.msg))
2808                }
2809                "ValidationException" => return RusotoError::Validation(err.msg),
2810                _ => {}
2811            }
2812        }
2813        RusotoError::Unknown(res)
2814    }
2815}
2816impl fmt::Display for PutDestinationError {
2817    #[allow(unused_variables)]
2818    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2819        match *self {
2820            PutDestinationError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2821            PutDestinationError::OperationAborted(ref cause) => write!(f, "{}", cause),
2822            PutDestinationError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2823        }
2824    }
2825}
2826impl Error for PutDestinationError {}
2827/// Errors returned by PutDestinationPolicy
2828#[derive(Debug, PartialEq)]
2829pub enum PutDestinationPolicyError {
2830    /// <p>A parameter is specified incorrectly.</p>
2831    InvalidParameter(String),
2832    /// <p>Multiple requests to update the same resource were in conflict.</p>
2833    OperationAborted(String),
2834    /// <p>The service cannot complete the request.</p>
2835    ServiceUnavailable(String),
2836}
2837
2838impl PutDestinationPolicyError {
2839    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDestinationPolicyError> {
2840        if let Some(err) = proto::json::Error::parse(&res) {
2841            match err.typ.as_str() {
2842                "InvalidParameterException" => {
2843                    return RusotoError::Service(PutDestinationPolicyError::InvalidParameter(
2844                        err.msg,
2845                    ))
2846                }
2847                "OperationAbortedException" => {
2848                    return RusotoError::Service(PutDestinationPolicyError::OperationAborted(
2849                        err.msg,
2850                    ))
2851                }
2852                "ServiceUnavailableException" => {
2853                    return RusotoError::Service(PutDestinationPolicyError::ServiceUnavailable(
2854                        err.msg,
2855                    ))
2856                }
2857                "ValidationException" => return RusotoError::Validation(err.msg),
2858                _ => {}
2859            }
2860        }
2861        RusotoError::Unknown(res)
2862    }
2863}
2864impl fmt::Display for PutDestinationPolicyError {
2865    #[allow(unused_variables)]
2866    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2867        match *self {
2868            PutDestinationPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2869            PutDestinationPolicyError::OperationAborted(ref cause) => write!(f, "{}", cause),
2870            PutDestinationPolicyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2871        }
2872    }
2873}
2874impl Error for PutDestinationPolicyError {}
2875/// Errors returned by PutLogEvents
2876#[derive(Debug, PartialEq)]
2877pub enum PutLogEventsError {
2878    /// <p>The event was already logged.</p>
2879    DataAlreadyAccepted(String),
2880    /// <p>A parameter is specified incorrectly.</p>
2881    InvalidParameter(String),
2882    /// <p>The sequence token is not valid. You can get the correct sequence token in the <code>expectedSequenceToken</code> field in the <code>InvalidSequenceTokenException</code> message. </p>
2883    InvalidSequenceToken(String),
2884    /// <p>The specified resource does not exist.</p>
2885    ResourceNotFound(String),
2886    /// <p>The service cannot complete the request.</p>
2887    ServiceUnavailable(String),
2888    /// <p>The most likely cause is an invalid AWS access key ID or secret key.</p>
2889    UnrecognizedClient(String),
2890}
2891
2892impl PutLogEventsError {
2893    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutLogEventsError> {
2894        if let Some(err) = proto::json::Error::parse(&res) {
2895            match err.typ.as_str() {
2896                "DataAlreadyAcceptedException" => {
2897                    return RusotoError::Service(PutLogEventsError::DataAlreadyAccepted(err.msg))
2898                }
2899                "InvalidParameterException" => {
2900                    return RusotoError::Service(PutLogEventsError::InvalidParameter(err.msg))
2901                }
2902                "InvalidSequenceTokenException" => {
2903                    return RusotoError::Service(PutLogEventsError::InvalidSequenceToken(err.msg))
2904                }
2905                "ResourceNotFoundException" => {
2906                    return RusotoError::Service(PutLogEventsError::ResourceNotFound(err.msg))
2907                }
2908                "ServiceUnavailableException" => {
2909                    return RusotoError::Service(PutLogEventsError::ServiceUnavailable(err.msg))
2910                }
2911                "UnrecognizedClientException" => {
2912                    return RusotoError::Service(PutLogEventsError::UnrecognizedClient(err.msg))
2913                }
2914                "ValidationException" => return RusotoError::Validation(err.msg),
2915                _ => {}
2916            }
2917        }
2918        RusotoError::Unknown(res)
2919    }
2920}
2921impl fmt::Display for PutLogEventsError {
2922    #[allow(unused_variables)]
2923    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2924        match *self {
2925            PutLogEventsError::DataAlreadyAccepted(ref cause) => write!(f, "{}", cause),
2926            PutLogEventsError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2927            PutLogEventsError::InvalidSequenceToken(ref cause) => write!(f, "{}", cause),
2928            PutLogEventsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2929            PutLogEventsError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2930            PutLogEventsError::UnrecognizedClient(ref cause) => write!(f, "{}", cause),
2931        }
2932    }
2933}
2934impl Error for PutLogEventsError {}
2935/// Errors returned by PutMetricFilter
2936#[derive(Debug, PartialEq)]
2937pub enum PutMetricFilterError {
2938    /// <p>A parameter is specified incorrectly.</p>
2939    InvalidParameter(String),
2940    /// <p>You have reached the maximum number of resources that can be created.</p>
2941    LimitExceeded(String),
2942    /// <p>Multiple requests to update the same resource were in conflict.</p>
2943    OperationAborted(String),
2944    /// <p>The specified resource does not exist.</p>
2945    ResourceNotFound(String),
2946    /// <p>The service cannot complete the request.</p>
2947    ServiceUnavailable(String),
2948}
2949
2950impl PutMetricFilterError {
2951    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutMetricFilterError> {
2952        if let Some(err) = proto::json::Error::parse(&res) {
2953            match err.typ.as_str() {
2954                "InvalidParameterException" => {
2955                    return RusotoError::Service(PutMetricFilterError::InvalidParameter(err.msg))
2956                }
2957                "LimitExceededException" => {
2958                    return RusotoError::Service(PutMetricFilterError::LimitExceeded(err.msg))
2959                }
2960                "OperationAbortedException" => {
2961                    return RusotoError::Service(PutMetricFilterError::OperationAborted(err.msg))
2962                }
2963                "ResourceNotFoundException" => {
2964                    return RusotoError::Service(PutMetricFilterError::ResourceNotFound(err.msg))
2965                }
2966                "ServiceUnavailableException" => {
2967                    return RusotoError::Service(PutMetricFilterError::ServiceUnavailable(err.msg))
2968                }
2969                "ValidationException" => return RusotoError::Validation(err.msg),
2970                _ => {}
2971            }
2972        }
2973        RusotoError::Unknown(res)
2974    }
2975}
2976impl fmt::Display for PutMetricFilterError {
2977    #[allow(unused_variables)]
2978    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
2979        match *self {
2980            PutMetricFilterError::InvalidParameter(ref cause) => write!(f, "{}", cause),
2981            PutMetricFilterError::LimitExceeded(ref cause) => write!(f, "{}", cause),
2982            PutMetricFilterError::OperationAborted(ref cause) => write!(f, "{}", cause),
2983            PutMetricFilterError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
2984            PutMetricFilterError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
2985        }
2986    }
2987}
2988impl Error for PutMetricFilterError {}
2989/// Errors returned by PutQueryDefinition
2990#[derive(Debug, PartialEq)]
2991pub enum PutQueryDefinitionError {
2992    /// <p>A parameter is specified incorrectly.</p>
2993    InvalidParameter(String),
2994    /// <p>The specified resource does not exist.</p>
2995    ResourceNotFound(String),
2996    /// <p>The service cannot complete the request.</p>
2997    ServiceUnavailable(String),
2998}
2999
3000impl PutQueryDefinitionError {
3001    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutQueryDefinitionError> {
3002        if let Some(err) = proto::json::Error::parse(&res) {
3003            match err.typ.as_str() {
3004                "InvalidParameterException" => {
3005                    return RusotoError::Service(PutQueryDefinitionError::InvalidParameter(err.msg))
3006                }
3007                "ResourceNotFoundException" => {
3008                    return RusotoError::Service(PutQueryDefinitionError::ResourceNotFound(err.msg))
3009                }
3010                "ServiceUnavailableException" => {
3011                    return RusotoError::Service(PutQueryDefinitionError::ServiceUnavailable(
3012                        err.msg,
3013                    ))
3014                }
3015                "ValidationException" => return RusotoError::Validation(err.msg),
3016                _ => {}
3017            }
3018        }
3019        RusotoError::Unknown(res)
3020    }
3021}
3022impl fmt::Display for PutQueryDefinitionError {
3023    #[allow(unused_variables)]
3024    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3025        match *self {
3026            PutQueryDefinitionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3027            PutQueryDefinitionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3028            PutQueryDefinitionError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3029        }
3030    }
3031}
3032impl Error for PutQueryDefinitionError {}
3033/// Errors returned by PutResourcePolicy
3034#[derive(Debug, PartialEq)]
3035pub enum PutResourcePolicyError {
3036    /// <p>A parameter is specified incorrectly.</p>
3037    InvalidParameter(String),
3038    /// <p>You have reached the maximum number of resources that can be created.</p>
3039    LimitExceeded(String),
3040    /// <p>The service cannot complete the request.</p>
3041    ServiceUnavailable(String),
3042}
3043
3044impl PutResourcePolicyError {
3045    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutResourcePolicyError> {
3046        if let Some(err) = proto::json::Error::parse(&res) {
3047            match err.typ.as_str() {
3048                "InvalidParameterException" => {
3049                    return RusotoError::Service(PutResourcePolicyError::InvalidParameter(err.msg))
3050                }
3051                "LimitExceededException" => {
3052                    return RusotoError::Service(PutResourcePolicyError::LimitExceeded(err.msg))
3053                }
3054                "ServiceUnavailableException" => {
3055                    return RusotoError::Service(PutResourcePolicyError::ServiceUnavailable(
3056                        err.msg,
3057                    ))
3058                }
3059                "ValidationException" => return RusotoError::Validation(err.msg),
3060                _ => {}
3061            }
3062        }
3063        RusotoError::Unknown(res)
3064    }
3065}
3066impl fmt::Display for PutResourcePolicyError {
3067    #[allow(unused_variables)]
3068    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3069        match *self {
3070            PutResourcePolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3071            PutResourcePolicyError::LimitExceeded(ref cause) => write!(f, "{}", cause),
3072            PutResourcePolicyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3073        }
3074    }
3075}
3076impl Error for PutResourcePolicyError {}
3077/// Errors returned by PutRetentionPolicy
3078#[derive(Debug, PartialEq)]
3079pub enum PutRetentionPolicyError {
3080    /// <p>A parameter is specified incorrectly.</p>
3081    InvalidParameter(String),
3082    /// <p>Multiple requests to update the same resource were in conflict.</p>
3083    OperationAborted(String),
3084    /// <p>The specified resource does not exist.</p>
3085    ResourceNotFound(String),
3086    /// <p>The service cannot complete the request.</p>
3087    ServiceUnavailable(String),
3088}
3089
3090impl PutRetentionPolicyError {
3091    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutRetentionPolicyError> {
3092        if let Some(err) = proto::json::Error::parse(&res) {
3093            match err.typ.as_str() {
3094                "InvalidParameterException" => {
3095                    return RusotoError::Service(PutRetentionPolicyError::InvalidParameter(err.msg))
3096                }
3097                "OperationAbortedException" => {
3098                    return RusotoError::Service(PutRetentionPolicyError::OperationAborted(err.msg))
3099                }
3100                "ResourceNotFoundException" => {
3101                    return RusotoError::Service(PutRetentionPolicyError::ResourceNotFound(err.msg))
3102                }
3103                "ServiceUnavailableException" => {
3104                    return RusotoError::Service(PutRetentionPolicyError::ServiceUnavailable(
3105                        err.msg,
3106                    ))
3107                }
3108                "ValidationException" => return RusotoError::Validation(err.msg),
3109                _ => {}
3110            }
3111        }
3112        RusotoError::Unknown(res)
3113    }
3114}
3115impl fmt::Display for PutRetentionPolicyError {
3116    #[allow(unused_variables)]
3117    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3118        match *self {
3119            PutRetentionPolicyError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3120            PutRetentionPolicyError::OperationAborted(ref cause) => write!(f, "{}", cause),
3121            PutRetentionPolicyError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3122            PutRetentionPolicyError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3123        }
3124    }
3125}
3126impl Error for PutRetentionPolicyError {}
3127/// Errors returned by PutSubscriptionFilter
3128#[derive(Debug, PartialEq)]
3129pub enum PutSubscriptionFilterError {
3130    /// <p>A parameter is specified incorrectly.</p>
3131    InvalidParameter(String),
3132    /// <p>You have reached the maximum number of resources that can be created.</p>
3133    LimitExceeded(String),
3134    /// <p>Multiple requests to update the same resource were in conflict.</p>
3135    OperationAborted(String),
3136    /// <p>The specified resource does not exist.</p>
3137    ResourceNotFound(String),
3138    /// <p>The service cannot complete the request.</p>
3139    ServiceUnavailable(String),
3140}
3141
3142impl PutSubscriptionFilterError {
3143    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutSubscriptionFilterError> {
3144        if let Some(err) = proto::json::Error::parse(&res) {
3145            match err.typ.as_str() {
3146                "InvalidParameterException" => {
3147                    return RusotoError::Service(PutSubscriptionFilterError::InvalidParameter(
3148                        err.msg,
3149                    ))
3150                }
3151                "LimitExceededException" => {
3152                    return RusotoError::Service(PutSubscriptionFilterError::LimitExceeded(err.msg))
3153                }
3154                "OperationAbortedException" => {
3155                    return RusotoError::Service(PutSubscriptionFilterError::OperationAborted(
3156                        err.msg,
3157                    ))
3158                }
3159                "ResourceNotFoundException" => {
3160                    return RusotoError::Service(PutSubscriptionFilterError::ResourceNotFound(
3161                        err.msg,
3162                    ))
3163                }
3164                "ServiceUnavailableException" => {
3165                    return RusotoError::Service(PutSubscriptionFilterError::ServiceUnavailable(
3166                        err.msg,
3167                    ))
3168                }
3169                "ValidationException" => return RusotoError::Validation(err.msg),
3170                _ => {}
3171            }
3172        }
3173        RusotoError::Unknown(res)
3174    }
3175}
3176impl fmt::Display for PutSubscriptionFilterError {
3177    #[allow(unused_variables)]
3178    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3179        match *self {
3180            PutSubscriptionFilterError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3181            PutSubscriptionFilterError::LimitExceeded(ref cause) => write!(f, "{}", cause),
3182            PutSubscriptionFilterError::OperationAborted(ref cause) => write!(f, "{}", cause),
3183            PutSubscriptionFilterError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3184            PutSubscriptionFilterError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3185        }
3186    }
3187}
3188impl Error for PutSubscriptionFilterError {}
3189/// Errors returned by StartQuery
3190#[derive(Debug, PartialEq)]
3191pub enum StartQueryError {
3192    /// <p>A parameter is specified incorrectly.</p>
3193    InvalidParameter(String),
3194    /// <p>You have reached the maximum number of resources that can be created.</p>
3195    LimitExceeded(String),
3196    /// <p>The query string is not valid. Details about this error are displayed in a <code>QueryCompileError</code> object. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_QueryCompileError.html">QueryCompileError</a>"/&gt;.</p> <p>For more information about valid query syntax, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p>
3197    MalformedQuery(String),
3198    /// <p>The specified resource does not exist.</p>
3199    ResourceNotFound(String),
3200    /// <p>The service cannot complete the request.</p>
3201    ServiceUnavailable(String),
3202}
3203
3204impl StartQueryError {
3205    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartQueryError> {
3206        if let Some(err) = proto::json::Error::parse(&res) {
3207            match err.typ.as_str() {
3208                "InvalidParameterException" => {
3209                    return RusotoError::Service(StartQueryError::InvalidParameter(err.msg))
3210                }
3211                "LimitExceededException" => {
3212                    return RusotoError::Service(StartQueryError::LimitExceeded(err.msg))
3213                }
3214                "MalformedQueryException" => {
3215                    return RusotoError::Service(StartQueryError::MalformedQuery(err.msg))
3216                }
3217                "ResourceNotFoundException" => {
3218                    return RusotoError::Service(StartQueryError::ResourceNotFound(err.msg))
3219                }
3220                "ServiceUnavailableException" => {
3221                    return RusotoError::Service(StartQueryError::ServiceUnavailable(err.msg))
3222                }
3223                "ValidationException" => return RusotoError::Validation(err.msg),
3224                _ => {}
3225            }
3226        }
3227        RusotoError::Unknown(res)
3228    }
3229}
3230impl fmt::Display for StartQueryError {
3231    #[allow(unused_variables)]
3232    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3233        match *self {
3234            StartQueryError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3235            StartQueryError::LimitExceeded(ref cause) => write!(f, "{}", cause),
3236            StartQueryError::MalformedQuery(ref cause) => write!(f, "{}", cause),
3237            StartQueryError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3238            StartQueryError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3239        }
3240    }
3241}
3242impl Error for StartQueryError {}
3243/// Errors returned by StopQuery
3244#[derive(Debug, PartialEq)]
3245pub enum StopQueryError {
3246    /// <p>A parameter is specified incorrectly.</p>
3247    InvalidParameter(String),
3248    /// <p>The specified resource does not exist.</p>
3249    ResourceNotFound(String),
3250    /// <p>The service cannot complete the request.</p>
3251    ServiceUnavailable(String),
3252}
3253
3254impl StopQueryError {
3255    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopQueryError> {
3256        if let Some(err) = proto::json::Error::parse(&res) {
3257            match err.typ.as_str() {
3258                "InvalidParameterException" => {
3259                    return RusotoError::Service(StopQueryError::InvalidParameter(err.msg))
3260                }
3261                "ResourceNotFoundException" => {
3262                    return RusotoError::Service(StopQueryError::ResourceNotFound(err.msg))
3263                }
3264                "ServiceUnavailableException" => {
3265                    return RusotoError::Service(StopQueryError::ServiceUnavailable(err.msg))
3266                }
3267                "ValidationException" => return RusotoError::Validation(err.msg),
3268                _ => {}
3269            }
3270        }
3271        RusotoError::Unknown(res)
3272    }
3273}
3274impl fmt::Display for StopQueryError {
3275    #[allow(unused_variables)]
3276    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3277        match *self {
3278            StopQueryError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3279            StopQueryError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3280            StopQueryError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3281        }
3282    }
3283}
3284impl Error for StopQueryError {}
3285/// Errors returned by TagLogGroup
3286#[derive(Debug, PartialEq)]
3287pub enum TagLogGroupError {
3288    /// <p>A parameter is specified incorrectly.</p>
3289    InvalidParameter(String),
3290    /// <p>The specified resource does not exist.</p>
3291    ResourceNotFound(String),
3292}
3293
3294impl TagLogGroupError {
3295    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagLogGroupError> {
3296        if let Some(err) = proto::json::Error::parse(&res) {
3297            match err.typ.as_str() {
3298                "InvalidParameterException" => {
3299                    return RusotoError::Service(TagLogGroupError::InvalidParameter(err.msg))
3300                }
3301                "ResourceNotFoundException" => {
3302                    return RusotoError::Service(TagLogGroupError::ResourceNotFound(err.msg))
3303                }
3304                "ValidationException" => return RusotoError::Validation(err.msg),
3305                _ => {}
3306            }
3307        }
3308        RusotoError::Unknown(res)
3309    }
3310}
3311impl fmt::Display for TagLogGroupError {
3312    #[allow(unused_variables)]
3313    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3314        match *self {
3315            TagLogGroupError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3316            TagLogGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3317        }
3318    }
3319}
3320impl Error for TagLogGroupError {}
3321/// Errors returned by TestMetricFilter
3322#[derive(Debug, PartialEq)]
3323pub enum TestMetricFilterError {
3324    /// <p>A parameter is specified incorrectly.</p>
3325    InvalidParameter(String),
3326    /// <p>The service cannot complete the request.</p>
3327    ServiceUnavailable(String),
3328}
3329
3330impl TestMetricFilterError {
3331    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TestMetricFilterError> {
3332        if let Some(err) = proto::json::Error::parse(&res) {
3333            match err.typ.as_str() {
3334                "InvalidParameterException" => {
3335                    return RusotoError::Service(TestMetricFilterError::InvalidParameter(err.msg))
3336                }
3337                "ServiceUnavailableException" => {
3338                    return RusotoError::Service(TestMetricFilterError::ServiceUnavailable(err.msg))
3339                }
3340                "ValidationException" => return RusotoError::Validation(err.msg),
3341                _ => {}
3342            }
3343        }
3344        RusotoError::Unknown(res)
3345    }
3346}
3347impl fmt::Display for TestMetricFilterError {
3348    #[allow(unused_variables)]
3349    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3350        match *self {
3351            TestMetricFilterError::InvalidParameter(ref cause) => write!(f, "{}", cause),
3352            TestMetricFilterError::ServiceUnavailable(ref cause) => write!(f, "{}", cause),
3353        }
3354    }
3355}
3356impl Error for TestMetricFilterError {}
3357/// Errors returned by UntagLogGroup
3358#[derive(Debug, PartialEq)]
3359pub enum UntagLogGroupError {
3360    /// <p>The specified resource does not exist.</p>
3361    ResourceNotFound(String),
3362}
3363
3364impl UntagLogGroupError {
3365    pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagLogGroupError> {
3366        if let Some(err) = proto::json::Error::parse(&res) {
3367            match err.typ.as_str() {
3368                "ResourceNotFoundException" => {
3369                    return RusotoError::Service(UntagLogGroupError::ResourceNotFound(err.msg))
3370                }
3371                "ValidationException" => return RusotoError::Validation(err.msg),
3372                _ => {}
3373            }
3374        }
3375        RusotoError::Unknown(res)
3376    }
3377}
3378impl fmt::Display for UntagLogGroupError {
3379    #[allow(unused_variables)]
3380    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
3381        match *self {
3382            UntagLogGroupError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
3383        }
3384    }
3385}
3386impl Error for UntagLogGroupError {}
3387/// Trait representing the capabilities of the Amazon CloudWatch Logs API. Amazon CloudWatch Logs clients implement this trait.
3388#[async_trait]
3389pub trait CloudWatchLogs {
3390    /// <p>Associates the specified AWS Key Management Service (AWS KMS) customer master key (CMK) with the specified log group.</p> <p>Associating an AWS KMS CMK with a log group overrides any existing associations between the log group and a CMK. After a CMK is associated with a log group, all newly ingested data for the log group is encrypted using the CMK. This association is stored as long as the data encrypted with the CMK is still within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt this data whenever it is requested.</p> <note> <p> <b>Important:</b> CloudWatch Logs supports only symmetric CMKs. Do not use an associate an asymmetric CMK with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p> </note> <p>Note that it can take up to 5 minutes for this operation to take effect.</p> <p>If you attempt to associate a CMK with a log group but the CMK does not exist or the CMK is disabled, you will receive an <code>InvalidParameterException</code> error. </p>
3391    async fn associate_kms_key(
3392        &self,
3393        input: AssociateKmsKeyRequest,
3394    ) -> Result<(), RusotoError<AssociateKmsKeyError>>;
3395
3396    /// <p>Cancels the specified export task.</p> <p>The task must be in the <code>PENDING</code> or <code>RUNNING</code> state.</p>
3397    async fn cancel_export_task(
3398        &self,
3399        input: CancelExportTaskRequest,
3400    ) -> Result<(), RusotoError<CancelExportTaskError>>;
3401
3402    /// <p>Creates an export task, which allows you to efficiently export data from a log group to an Amazon S3 bucket.</p> <p>This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html">DescribeExportTasks</a> to get the status of the export task. Each account can only have one active (<code>RUNNING</code> or <code>PENDING</code>) export task at a time. To cancel an export task, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html">CancelExportTask</a>.</p> <p>You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate out log data for each export task, you can specify a prefix to be used as the Amazon S3 key prefix for all exported objects.</p> <p>Exporting to S3 buckets that are encrypted with AES-256 is supported. Exporting to S3 buckets encrypted with SSE-KMS is not supported. </p>
3403    async fn create_export_task(
3404        &self,
3405        input: CreateExportTaskRequest,
3406    ) -> Result<CreateExportTaskResponse, RusotoError<CreateExportTaskError>>;
3407
3408    /// <p><p>Creates a log group with the specified name.</p> <p>You can create up to 20,000 log groups per account.</p> <p>You must use the following guidelines when naming a log group:</p> <ul> <li> <p>Log group names must be unique within a region for an AWS account.</p> </li> <li> <p>Log group names can be between 1 and 512 characters long.</p> </li> <li> <p>Log group names consist of the following characters: a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (hyphen), &#39;/&#39; (forward slash), &#39;.&#39; (period), and &#39;#&#39; (number sign)</p> </li> </ul> <p>If you associate a AWS Key Management Service (AWS KMS) customer master key (CMK) with the log group, ingested data is encrypted using the CMK. This association is stored as long as the data encrypted with the CMK is still within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt this data whenever it is requested.</p> <p>If you attempt to associate a CMK with the log group but the CMK does not exist or the CMK is disabled, you will receive an <code>InvalidParameterException</code> error. </p> <note> <p> <b>Important:</b> CloudWatch Logs supports only symmetric CMKs. Do not associate an asymmetric CMK with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p> </note></p>
3409    async fn create_log_group(
3410        &self,
3411        input: CreateLogGroupRequest,
3412    ) -> Result<(), RusotoError<CreateLogGroupError>>;
3413
3414    /// <p><p>Creates a log stream for the specified log group.</p> <p>There is no limit on the number of log streams that you can create for a log group. There is a limit of 50 TPS on <code>CreateLogStream</code> operations, after which transactions are throttled.</p> <p>You must use the following guidelines when naming a log stream:</p> <ul> <li> <p>Log stream names must be unique within the log group.</p> </li> <li> <p>Log stream names can be between 1 and 512 characters long.</p> </li> <li> <p>The &#39;:&#39; (colon) and &#39;*&#39; (asterisk) characters are not allowed.</p> </li> </ul></p>
3415    async fn create_log_stream(
3416        &self,
3417        input: CreateLogStreamRequest,
3418    ) -> Result<(), RusotoError<CreateLogStreamError>>;
3419
3420    /// <p>Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.</p>
3421    async fn delete_destination(
3422        &self,
3423        input: DeleteDestinationRequest,
3424    ) -> Result<(), RusotoError<DeleteDestinationError>>;
3425
3426    /// <p>Deletes the specified log group and permanently deletes all the archived log events associated with the log group.</p>
3427    async fn delete_log_group(
3428        &self,
3429        input: DeleteLogGroupRequest,
3430    ) -> Result<(), RusotoError<DeleteLogGroupError>>;
3431
3432    /// <p>Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.</p>
3433    async fn delete_log_stream(
3434        &self,
3435        input: DeleteLogStreamRequest,
3436    ) -> Result<(), RusotoError<DeleteLogStreamError>>;
3437
3438    /// <p>Deletes the specified metric filter.</p>
3439    async fn delete_metric_filter(
3440        &self,
3441        input: DeleteMetricFilterRequest,
3442    ) -> Result<(), RusotoError<DeleteMetricFilterError>>;
3443
3444    async fn delete_query_definition(
3445        &self,
3446        input: DeleteQueryDefinitionRequest,
3447    ) -> Result<DeleteQueryDefinitionResponse, RusotoError<DeleteQueryDefinitionError>>;
3448
3449    /// <p>Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.</p>
3450    async fn delete_resource_policy(
3451        &self,
3452        input: DeleteResourcePolicyRequest,
3453    ) -> Result<(), RusotoError<DeleteResourcePolicyError>>;
3454
3455    /// <p>Deletes the specified retention policy.</p> <p>Log events do not expire if they belong to log groups without a retention policy.</p>
3456    async fn delete_retention_policy(
3457        &self,
3458        input: DeleteRetentionPolicyRequest,
3459    ) -> Result<(), RusotoError<DeleteRetentionPolicyError>>;
3460
3461    /// <p>Deletes the specified subscription filter.</p>
3462    async fn delete_subscription_filter(
3463        &self,
3464        input: DeleteSubscriptionFilterRequest,
3465    ) -> Result<(), RusotoError<DeleteSubscriptionFilterError>>;
3466
3467    /// <p>Lists all your destinations. The results are ASCII-sorted by destination name.</p>
3468    async fn describe_destinations(
3469        &self,
3470        input: DescribeDestinationsRequest,
3471    ) -> Result<DescribeDestinationsResponse, RusotoError<DescribeDestinationsError>>;
3472
3473    /// <p>Lists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.</p>
3474    async fn describe_export_tasks(
3475        &self,
3476        input: DescribeExportTasksRequest,
3477    ) -> Result<DescribeExportTasksResponse, RusotoError<DescribeExportTasksError>>;
3478
3479    /// <p>Lists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.</p>
3480    async fn describe_log_groups(
3481        &self,
3482        input: DescribeLogGroupsRequest,
3483    ) -> Result<DescribeLogGroupsResponse, RusotoError<DescribeLogGroupsError>>;
3484
3485    /// <p>Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.</p> <p>This operation has a limit of five transactions per second, after which transactions are throttled.</p>
3486    async fn describe_log_streams(
3487        &self,
3488        input: DescribeLogStreamsRequest,
3489    ) -> Result<DescribeLogStreamsResponse, RusotoError<DescribeLogStreamsError>>;
3490
3491    /// <p>Lists the specified metric filters. You can list all the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.</p>
3492    async fn describe_metric_filters(
3493        &self,
3494        input: DescribeMetricFiltersRequest,
3495    ) -> Result<DescribeMetricFiltersResponse, RusotoError<DescribeMetricFiltersError>>;
3496
3497    /// <p>Returns a list of CloudWatch Logs Insights queries that are scheduled, executing, or have been executed recently in this account. You can request all queries, or limit it to queries of a specific log group or queries with a certain status.</p>
3498    async fn describe_queries(
3499        &self,
3500        input: DescribeQueriesRequest,
3501    ) -> Result<DescribeQueriesResponse, RusotoError<DescribeQueriesError>>;
3502
3503    async fn describe_query_definitions(
3504        &self,
3505        input: DescribeQueryDefinitionsRequest,
3506    ) -> Result<DescribeQueryDefinitionsResponse, RusotoError<DescribeQueryDefinitionsError>>;
3507
3508    /// <p>Lists the resource policies in this account.</p>
3509    async fn describe_resource_policies(
3510        &self,
3511        input: DescribeResourcePoliciesRequest,
3512    ) -> Result<DescribeResourcePoliciesResponse, RusotoError<DescribeResourcePoliciesError>>;
3513
3514    /// <p>Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.</p>
3515    async fn describe_subscription_filters(
3516        &self,
3517        input: DescribeSubscriptionFiltersRequest,
3518    ) -> Result<DescribeSubscriptionFiltersResponse, RusotoError<DescribeSubscriptionFiltersError>>;
3519
3520    /// <p>Disassociates the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group.</p> <p>After the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.</p> <p>Note that it can take up to 5 minutes for this operation to take effect.</p>
3521    async fn disassociate_kms_key(
3522        &self,
3523        input: DisassociateKmsKeyRequest,
3524    ) -> Result<(), RusotoError<DisassociateKmsKeyError>>;
3525
3526    /// <p>Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.</p> <p>By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events), or all the events found within the time range that you specify. If the results include a token, then there are more log events available, and you can get additional results by specifying the token in a subsequent call.</p>
3527    async fn filter_log_events(
3528        &self,
3529        input: FilterLogEventsRequest,
3530    ) -> Result<FilterLogEventsResponse, RusotoError<FilterLogEventsError>>;
3531
3532    /// <p>Lists log events from the specified log stream. You can list all the log events or filter using a time range.</p> <p>By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events). You can get additional log events by specifying one of the tokens in a subsequent call.</p>
3533    async fn get_log_events(
3534        &self,
3535        input: GetLogEventsRequest,
3536    ) -> Result<GetLogEventsResponse, RusotoError<GetLogEventsError>>;
3537
3538    /// <p>Returns a list of the fields that are included in log events in the specified log group, along with the percentage of log events that contain each field. The search is limited to a time period that you specify.</p> <p>In the results, fields that start with @ are fields generated by CloudWatch Logs. For example, <code>@timestamp</code> is the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html">Supported Logs and Discovered Fields</a>.</p> <p>The response results are sorted by the frequency percentage, starting with the highest percentage.</p>
3539    async fn get_log_group_fields(
3540        &self,
3541        input: GetLogGroupFieldsRequest,
3542    ) -> Result<GetLogGroupFieldsResponse, RusotoError<GetLogGroupFieldsError>>;
3543
3544    /// <p>Retrieves all the fields and values of a single log event. All fields are retrieved, even if the original query that produced the <code>logRecordPointer</code> retrieved only a subset of fields. Fields are returned as field name/field value pairs.</p> <p>Additionally, the entire unparsed log event is returned within <code>@message</code>.</p>
3545    async fn get_log_record(
3546        &self,
3547        input: GetLogRecordRequest,
3548    ) -> Result<GetLogRecordResponse, RusotoError<GetLogRecordError>>;
3549
3550    /// <p>Returns the results from the specified query.</p> <p>Only the fields requested in the query are returned, along with a <code>@ptr</code> field which is the identifier for the log record. You can use the value of <code>@ptr</code> in a <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogRecord.html">GetLogRecord</a> operation to get the full log record.</p> <p> <code>GetQueryResults</code> does not start a query execution. To run a query, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a>.</p> <p>If the value of the <code>Status</code> field in the output is <code>Running</code>, this operation returns only partial results. If you see a value of <code>Scheduled</code> or <code>Running</code> for the status, you can retry the operation later to see the final results. </p>
3551    async fn get_query_results(
3552        &self,
3553        input: GetQueryResultsRequest,
3554    ) -> Result<GetQueryResultsResponse, RusotoError<GetQueryResultsError>>;
3555
3556    /// <p>Lists the tags for the specified log group.</p>
3557    async fn list_tags_log_group(
3558        &self,
3559        input: ListTagsLogGroupRequest,
3560    ) -> Result<ListTagsLogGroupResponse, RusotoError<ListTagsLogGroupError>>;
3561
3562    /// <p>Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions.</p> <p>A destination encapsulates a physical resource (such as an Amazon Kinesis stream) and enables you to subscribe to a real-time stream of log events for a different account, ingested using <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a>.</p> <p>Through an access policy, a destination controls what is written to it. By default, <code>PutDestination</code> does not set any access policy with the destination, which means a cross-account user cannot call <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutSubscriptionFilter.html">PutSubscriptionFilter</a> against this destination. To enable this, the destination owner must call <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html">PutDestinationPolicy</a> after <code>PutDestination</code>.</p>
3563    async fn put_destination(
3564        &self,
3565        input: PutDestinationRequest,
3566    ) -> Result<PutDestinationResponse, RusotoError<PutDestinationError>>;
3567
3568    /// <p>Creates or updates an access policy associated with an existing destination. An access policy is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html">IAM policy document</a> that is used to authorize claims to register a subscription filter against a given destination.</p>
3569    async fn put_destination_policy(
3570        &self,
3571        input: PutDestinationPolicyRequest,
3572    ) -> Result<(), RusotoError<PutDestinationPolicyError>>;
3573
3574    /// <p>Uploads a batch of log events to the specified log stream.</p> <p>You must include the sequence token obtained from the response of the previous call. An upload in a newly created log stream does not require a sequence token. You can also get the sequence token in the <code>expectedSequenceToken</code> field from <code>InvalidSequenceTokenException</code>. If you call <code>PutLogEvents</code> twice within a narrow time period using the same value for <code>sequenceToken</code>, both calls may be successful, or one may be rejected.</p> <p>The batch of events must satisfy the following constraints:</p> <ul> <li> <p>The maximum batch size is 1,048,576 bytes, and this size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.</p> </li> <li> <p>None of the log events in the batch can be more than 2 hours in the future.</p> </li> <li> <p>None of the log events in the batch can be older than 14 days or older than the retention period of the log group.</p> </li> <li> <p>The log events in the batch must be in chronological ordered by their timestamp. The timestamp is the time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. (In AWS Tools for PowerShell and the AWS SDK for .NET, the timestamp is specified in .NET format: yyyy-mm-ddThh:mm:ss. For example, 2017-09-15T13:45:30.) </p> </li> <li> <p>A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.</p> </li> <li> <p>The maximum number of log events in a batch is 10,000.</p> </li> <li> <p>There is a quota of 5 requests per second per log stream. Additional requests are throttled. This quota can't be changed.</p> </li> </ul> <p>If a call to PutLogEvents returns "UnrecognizedClientException" the most likely cause is an invalid AWS access key ID or secret key. </p>
3575    async fn put_log_events(
3576        &self,
3577        input: PutLogEventsRequest,
3578    ) -> Result<PutLogEventsResponse, RusotoError<PutLogEventsError>>;
3579
3580    /// <p>Creates or updates a metric filter and associates it with the specified log group. Metric filters allow you to configure rules to extract metric data from log events ingested through <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a>.</p> <p>The maximum number of metric filters that can be associated with a log group is 100.</p>
3581    async fn put_metric_filter(
3582        &self,
3583        input: PutMetricFilterRequest,
3584    ) -> Result<(), RusotoError<PutMetricFilterError>>;
3585
3586    async fn put_query_definition(
3587        &self,
3588        input: PutQueryDefinitionRequest,
3589    ) -> Result<PutQueryDefinitionResponse, RusotoError<PutQueryDefinitionError>>;
3590
3591    /// <p>Creates or updates a resource policy allowing other AWS services to put log events to this account, such as Amazon Route 53. An account can have up to 10 resource policies per region.</p>
3592    async fn put_resource_policy(
3593        &self,
3594        input: PutResourcePolicyRequest,
3595    ) -> Result<PutResourcePolicyResponse, RusotoError<PutResourcePolicyError>>;
3596
3597    /// <p>Sets the retention of the specified log group. A retention policy allows you to configure the number of days for which to retain log events in the specified log group.</p>
3598    async fn put_retention_policy(
3599        &self,
3600        input: PutRetentionPolicyRequest,
3601    ) -> Result<(), RusotoError<PutRetentionPolicyError>>;
3602
3603    /// <p>Creates or updates a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events ingested through <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a> and have them delivered to a specific destination. Currently, the supported destinations are:</p> <ul> <li> <p>An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>A logical destination that belongs to a different account, for cross-account delivery.</p> </li> <li> <p>An Amazon Kinesis Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.</p> </li> </ul> <p>There can only be one subscription filter associated with a log group. If you are updating an existing filter, you must specify the correct name in <code>filterName</code>. Otherwise, the call fails because you cannot associate a second filter with a log group.</p>
3604    async fn put_subscription_filter(
3605        &self,
3606        input: PutSubscriptionFilterRequest,
3607    ) -> Result<(), RusotoError<PutSubscriptionFilterError>>;
3608
3609    /// <p>Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query, and the query string to use.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p> <p>Queries time out after 15 minutes of execution. If your queries are timing out, reduce the time range being searched, or partition your query into a number of queries.</p>
3610    async fn start_query(
3611        &self,
3612        input: StartQueryRequest,
3613    ) -> Result<StartQueryResponse, RusotoError<StartQueryError>>;
3614
3615    /// <p>Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.</p>
3616    async fn stop_query(
3617        &self,
3618        input: StopQueryRequest,
3619    ) -> Result<StopQueryResponse, RusotoError<StopQueryError>>;
3620
3621    /// <p>Adds or updates the specified tags for the specified log group.</p> <p>To list the tags for a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsLogGroup.html">ListTagsLogGroup</a>. To remove tags, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagLogGroup.html">UntagLogGroup</a>.</p> <p>For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging">Tag Log Groups in Amazon CloudWatch Logs</a> in the <i>Amazon CloudWatch Logs User Guide</i>.</p>
3622    async fn tag_log_group(
3623        &self,
3624        input: TagLogGroupRequest,
3625    ) -> Result<(), RusotoError<TagLogGroupError>>;
3626
3627    /// <p>Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.</p>
3628    async fn test_metric_filter(
3629        &self,
3630        input: TestMetricFilterRequest,
3631    ) -> Result<TestMetricFilterResponse, RusotoError<TestMetricFilterError>>;
3632
3633    /// <p>Removes the specified tags from the specified log group.</p> <p>To list the tags for a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsLogGroup.html">ListTagsLogGroup</a>. To add tags, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagLogGroup.html">TagLogGroup</a>.</p>
3634    async fn untag_log_group(
3635        &self,
3636        input: UntagLogGroupRequest,
3637    ) -> Result<(), RusotoError<UntagLogGroupError>>;
3638}
3639/// A client for the Amazon CloudWatch Logs API.
3640#[derive(Clone)]
3641pub struct CloudWatchLogsClient {
3642    client: Client,
3643    region: region::Region,
3644}
3645
3646impl CloudWatchLogsClient {
3647    /// Creates a client backed by the default tokio event loop.
3648    ///
3649    /// The client will use the default credentials provider and tls client.
3650    pub fn new(region: region::Region) -> CloudWatchLogsClient {
3651        CloudWatchLogsClient {
3652            client: Client::shared(),
3653            region,
3654        }
3655    }
3656
3657    pub fn new_with<P, D>(
3658        request_dispatcher: D,
3659        credentials_provider: P,
3660        region: region::Region,
3661    ) -> CloudWatchLogsClient
3662    where
3663        P: ProvideAwsCredentials + Send + Sync + 'static,
3664        D: DispatchSignedRequest + Send + Sync + 'static,
3665    {
3666        CloudWatchLogsClient {
3667            client: Client::new_with(credentials_provider, request_dispatcher),
3668            region,
3669        }
3670    }
3671
3672    pub fn new_with_client(client: Client, region: region::Region) -> CloudWatchLogsClient {
3673        CloudWatchLogsClient { client, region }
3674    }
3675}
3676
3677#[async_trait]
3678impl CloudWatchLogs for CloudWatchLogsClient {
3679    /// <p>Associates the specified AWS Key Management Service (AWS KMS) customer master key (CMK) with the specified log group.</p> <p>Associating an AWS KMS CMK with a log group overrides any existing associations between the log group and a CMK. After a CMK is associated with a log group, all newly ingested data for the log group is encrypted using the CMK. This association is stored as long as the data encrypted with the CMK is still within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt this data whenever it is requested.</p> <note> <p> <b>Important:</b> CloudWatch Logs supports only symmetric CMKs. Do not use an associate an asymmetric CMK with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p> </note> <p>Note that it can take up to 5 minutes for this operation to take effect.</p> <p>If you attempt to associate a CMK with a log group but the CMK does not exist or the CMK is disabled, you will receive an <code>InvalidParameterException</code> error. </p>
3680    async fn associate_kms_key(
3681        &self,
3682        input: AssociateKmsKeyRequest,
3683    ) -> Result<(), RusotoError<AssociateKmsKeyError>> {
3684        let mut request = self.new_signed_request("POST", "/");
3685        request.add_header("x-amz-target", "Logs_20140328.AssociateKmsKey");
3686        let encoded = serde_json::to_string(&input).unwrap();
3687        request.set_payload(Some(encoded));
3688
3689        let response = self
3690            .sign_and_dispatch(request, AssociateKmsKeyError::from_response)
3691            .await?;
3692        std::mem::drop(response);
3693        Ok(())
3694    }
3695
3696    /// <p>Cancels the specified export task.</p> <p>The task must be in the <code>PENDING</code> or <code>RUNNING</code> state.</p>
3697    async fn cancel_export_task(
3698        &self,
3699        input: CancelExportTaskRequest,
3700    ) -> Result<(), RusotoError<CancelExportTaskError>> {
3701        let mut request = self.new_signed_request("POST", "/");
3702        request.add_header("x-amz-target", "Logs_20140328.CancelExportTask");
3703        let encoded = serde_json::to_string(&input).unwrap();
3704        request.set_payload(Some(encoded));
3705
3706        let response = self
3707            .sign_and_dispatch(request, CancelExportTaskError::from_response)
3708            .await?;
3709        std::mem::drop(response);
3710        Ok(())
3711    }
3712
3713    /// <p>Creates an export task, which allows you to efficiently export data from a log group to an Amazon S3 bucket.</p> <p>This is an asynchronous call. If all the required information is provided, this operation initiates an export task and responds with the ID of the task. After the task has started, you can use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeExportTasks.html">DescribeExportTasks</a> to get the status of the export task. Each account can only have one active (<code>RUNNING</code> or <code>PENDING</code>) export task at a time. To cancel an export task, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CancelExportTask.html">CancelExportTask</a>.</p> <p>You can export logs from multiple log groups or multiple time ranges to the same S3 bucket. To separate out log data for each export task, you can specify a prefix to be used as the Amazon S3 key prefix for all exported objects.</p> <p>Exporting to S3 buckets that are encrypted with AES-256 is supported. Exporting to S3 buckets encrypted with SSE-KMS is not supported. </p>
3714    async fn create_export_task(
3715        &self,
3716        input: CreateExportTaskRequest,
3717    ) -> Result<CreateExportTaskResponse, RusotoError<CreateExportTaskError>> {
3718        let mut request = self.new_signed_request("POST", "/");
3719        request.add_header("x-amz-target", "Logs_20140328.CreateExportTask");
3720        let encoded = serde_json::to_string(&input).unwrap();
3721        request.set_payload(Some(encoded));
3722
3723        let response = self
3724            .sign_and_dispatch(request, CreateExportTaskError::from_response)
3725            .await?;
3726        let mut response = response;
3727        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3728        proto::json::ResponsePayload::new(&response).deserialize::<CreateExportTaskResponse, _>()
3729    }
3730
3731    /// <p><p>Creates a log group with the specified name.</p> <p>You can create up to 20,000 log groups per account.</p> <p>You must use the following guidelines when naming a log group:</p> <ul> <li> <p>Log group names must be unique within a region for an AWS account.</p> </li> <li> <p>Log group names can be between 1 and 512 characters long.</p> </li> <li> <p>Log group names consist of the following characters: a-z, A-Z, 0-9, &#39;_&#39; (underscore), &#39;-&#39; (hyphen), &#39;/&#39; (forward slash), &#39;.&#39; (period), and &#39;#&#39; (number sign)</p> </li> </ul> <p>If you associate a AWS Key Management Service (AWS KMS) customer master key (CMK) with the log group, ingested data is encrypted using the CMK. This association is stored as long as the data encrypted with the CMK is still within Amazon CloudWatch Logs. This enables Amazon CloudWatch Logs to decrypt this data whenever it is requested.</p> <p>If you attempt to associate a CMK with the log group but the CMK does not exist or the CMK is disabled, you will receive an <code>InvalidParameterException</code> error. </p> <note> <p> <b>Important:</b> CloudWatch Logs supports only symmetric CMKs. Do not associate an asymmetric CMK with your log group. For more information, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html">Using Symmetric and Asymmetric Keys</a>.</p> </note></p>
3732    async fn create_log_group(
3733        &self,
3734        input: CreateLogGroupRequest,
3735    ) -> Result<(), RusotoError<CreateLogGroupError>> {
3736        let mut request = self.new_signed_request("POST", "/");
3737        request.add_header("x-amz-target", "Logs_20140328.CreateLogGroup");
3738        let encoded = serde_json::to_string(&input).unwrap();
3739        request.set_payload(Some(encoded));
3740
3741        let response = self
3742            .sign_and_dispatch(request, CreateLogGroupError::from_response)
3743            .await?;
3744        std::mem::drop(response);
3745        Ok(())
3746    }
3747
3748    /// <p><p>Creates a log stream for the specified log group.</p> <p>There is no limit on the number of log streams that you can create for a log group. There is a limit of 50 TPS on <code>CreateLogStream</code> operations, after which transactions are throttled.</p> <p>You must use the following guidelines when naming a log stream:</p> <ul> <li> <p>Log stream names must be unique within the log group.</p> </li> <li> <p>Log stream names can be between 1 and 512 characters long.</p> </li> <li> <p>The &#39;:&#39; (colon) and &#39;*&#39; (asterisk) characters are not allowed.</p> </li> </ul></p>
3749    async fn create_log_stream(
3750        &self,
3751        input: CreateLogStreamRequest,
3752    ) -> Result<(), RusotoError<CreateLogStreamError>> {
3753        let mut request = self.new_signed_request("POST", "/");
3754        request.add_header("x-amz-target", "Logs_20140328.CreateLogStream");
3755        let encoded = serde_json::to_string(&input).unwrap();
3756        request.set_payload(Some(encoded));
3757
3758        let response = self
3759            .sign_and_dispatch(request, CreateLogStreamError::from_response)
3760            .await?;
3761        std::mem::drop(response);
3762        Ok(())
3763    }
3764
3765    /// <p>Deletes the specified destination, and eventually disables all the subscription filters that publish to it. This operation does not delete the physical resource encapsulated by the destination.</p>
3766    async fn delete_destination(
3767        &self,
3768        input: DeleteDestinationRequest,
3769    ) -> Result<(), RusotoError<DeleteDestinationError>> {
3770        let mut request = self.new_signed_request("POST", "/");
3771        request.add_header("x-amz-target", "Logs_20140328.DeleteDestination");
3772        let encoded = serde_json::to_string(&input).unwrap();
3773        request.set_payload(Some(encoded));
3774
3775        let response = self
3776            .sign_and_dispatch(request, DeleteDestinationError::from_response)
3777            .await?;
3778        std::mem::drop(response);
3779        Ok(())
3780    }
3781
3782    /// <p>Deletes the specified log group and permanently deletes all the archived log events associated with the log group.</p>
3783    async fn delete_log_group(
3784        &self,
3785        input: DeleteLogGroupRequest,
3786    ) -> Result<(), RusotoError<DeleteLogGroupError>> {
3787        let mut request = self.new_signed_request("POST", "/");
3788        request.add_header("x-amz-target", "Logs_20140328.DeleteLogGroup");
3789        let encoded = serde_json::to_string(&input).unwrap();
3790        request.set_payload(Some(encoded));
3791
3792        let response = self
3793            .sign_and_dispatch(request, DeleteLogGroupError::from_response)
3794            .await?;
3795        std::mem::drop(response);
3796        Ok(())
3797    }
3798
3799    /// <p>Deletes the specified log stream and permanently deletes all the archived log events associated with the log stream.</p>
3800    async fn delete_log_stream(
3801        &self,
3802        input: DeleteLogStreamRequest,
3803    ) -> Result<(), RusotoError<DeleteLogStreamError>> {
3804        let mut request = self.new_signed_request("POST", "/");
3805        request.add_header("x-amz-target", "Logs_20140328.DeleteLogStream");
3806        let encoded = serde_json::to_string(&input).unwrap();
3807        request.set_payload(Some(encoded));
3808
3809        let response = self
3810            .sign_and_dispatch(request, DeleteLogStreamError::from_response)
3811            .await?;
3812        std::mem::drop(response);
3813        Ok(())
3814    }
3815
3816    /// <p>Deletes the specified metric filter.</p>
3817    async fn delete_metric_filter(
3818        &self,
3819        input: DeleteMetricFilterRequest,
3820    ) -> Result<(), RusotoError<DeleteMetricFilterError>> {
3821        let mut request = self.new_signed_request("POST", "/");
3822        request.add_header("x-amz-target", "Logs_20140328.DeleteMetricFilter");
3823        let encoded = serde_json::to_string(&input).unwrap();
3824        request.set_payload(Some(encoded));
3825
3826        let response = self
3827            .sign_and_dispatch(request, DeleteMetricFilterError::from_response)
3828            .await?;
3829        std::mem::drop(response);
3830        Ok(())
3831    }
3832
3833    async fn delete_query_definition(
3834        &self,
3835        input: DeleteQueryDefinitionRequest,
3836    ) -> Result<DeleteQueryDefinitionResponse, RusotoError<DeleteQueryDefinitionError>> {
3837        let mut request = self.new_signed_request("POST", "/");
3838        request.add_header("x-amz-target", "Logs_20140328.DeleteQueryDefinition");
3839        let encoded = serde_json::to_string(&input).unwrap();
3840        request.set_payload(Some(encoded));
3841
3842        let response = self
3843            .sign_and_dispatch(request, DeleteQueryDefinitionError::from_response)
3844            .await?;
3845        let mut response = response;
3846        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3847        proto::json::ResponsePayload::new(&response)
3848            .deserialize::<DeleteQueryDefinitionResponse, _>()
3849    }
3850
3851    /// <p>Deletes a resource policy from this account. This revokes the access of the identities in that policy to put log events to this account.</p>
3852    async fn delete_resource_policy(
3853        &self,
3854        input: DeleteResourcePolicyRequest,
3855    ) -> Result<(), RusotoError<DeleteResourcePolicyError>> {
3856        let mut request = self.new_signed_request("POST", "/");
3857        request.add_header("x-amz-target", "Logs_20140328.DeleteResourcePolicy");
3858        let encoded = serde_json::to_string(&input).unwrap();
3859        request.set_payload(Some(encoded));
3860
3861        let response = self
3862            .sign_and_dispatch(request, DeleteResourcePolicyError::from_response)
3863            .await?;
3864        std::mem::drop(response);
3865        Ok(())
3866    }
3867
3868    /// <p>Deletes the specified retention policy.</p> <p>Log events do not expire if they belong to log groups without a retention policy.</p>
3869    async fn delete_retention_policy(
3870        &self,
3871        input: DeleteRetentionPolicyRequest,
3872    ) -> Result<(), RusotoError<DeleteRetentionPolicyError>> {
3873        let mut request = self.new_signed_request("POST", "/");
3874        request.add_header("x-amz-target", "Logs_20140328.DeleteRetentionPolicy");
3875        let encoded = serde_json::to_string(&input).unwrap();
3876        request.set_payload(Some(encoded));
3877
3878        let response = self
3879            .sign_and_dispatch(request, DeleteRetentionPolicyError::from_response)
3880            .await?;
3881        std::mem::drop(response);
3882        Ok(())
3883    }
3884
3885    /// <p>Deletes the specified subscription filter.</p>
3886    async fn delete_subscription_filter(
3887        &self,
3888        input: DeleteSubscriptionFilterRequest,
3889    ) -> Result<(), RusotoError<DeleteSubscriptionFilterError>> {
3890        let mut request = self.new_signed_request("POST", "/");
3891        request.add_header("x-amz-target", "Logs_20140328.DeleteSubscriptionFilter");
3892        let encoded = serde_json::to_string(&input).unwrap();
3893        request.set_payload(Some(encoded));
3894
3895        let response = self
3896            .sign_and_dispatch(request, DeleteSubscriptionFilterError::from_response)
3897            .await?;
3898        std::mem::drop(response);
3899        Ok(())
3900    }
3901
3902    /// <p>Lists all your destinations. The results are ASCII-sorted by destination name.</p>
3903    async fn describe_destinations(
3904        &self,
3905        input: DescribeDestinationsRequest,
3906    ) -> Result<DescribeDestinationsResponse, RusotoError<DescribeDestinationsError>> {
3907        let mut request = self.new_signed_request("POST", "/");
3908        request.add_header("x-amz-target", "Logs_20140328.DescribeDestinations");
3909        let encoded = serde_json::to_string(&input).unwrap();
3910        request.set_payload(Some(encoded));
3911
3912        let response = self
3913            .sign_and_dispatch(request, DescribeDestinationsError::from_response)
3914            .await?;
3915        let mut response = response;
3916        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3917        proto::json::ResponsePayload::new(&response)
3918            .deserialize::<DescribeDestinationsResponse, _>()
3919    }
3920
3921    /// <p>Lists the specified export tasks. You can list all your export tasks or filter the results based on task ID or task status.</p>
3922    async fn describe_export_tasks(
3923        &self,
3924        input: DescribeExportTasksRequest,
3925    ) -> Result<DescribeExportTasksResponse, RusotoError<DescribeExportTasksError>> {
3926        let mut request = self.new_signed_request("POST", "/");
3927        request.add_header("x-amz-target", "Logs_20140328.DescribeExportTasks");
3928        let encoded = serde_json::to_string(&input).unwrap();
3929        request.set_payload(Some(encoded));
3930
3931        let response = self
3932            .sign_and_dispatch(request, DescribeExportTasksError::from_response)
3933            .await?;
3934        let mut response = response;
3935        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3936        proto::json::ResponsePayload::new(&response).deserialize::<DescribeExportTasksResponse, _>()
3937    }
3938
3939    /// <p>Lists the specified log groups. You can list all your log groups or filter the results by prefix. The results are ASCII-sorted by log group name.</p>
3940    async fn describe_log_groups(
3941        &self,
3942        input: DescribeLogGroupsRequest,
3943    ) -> Result<DescribeLogGroupsResponse, RusotoError<DescribeLogGroupsError>> {
3944        let mut request = self.new_signed_request("POST", "/");
3945        request.add_header("x-amz-target", "Logs_20140328.DescribeLogGroups");
3946        let encoded = serde_json::to_string(&input).unwrap();
3947        request.set_payload(Some(encoded));
3948
3949        let response = self
3950            .sign_and_dispatch(request, DescribeLogGroupsError::from_response)
3951            .await?;
3952        let mut response = response;
3953        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3954        proto::json::ResponsePayload::new(&response).deserialize::<DescribeLogGroupsResponse, _>()
3955    }
3956
3957    /// <p>Lists the log streams for the specified log group. You can list all the log streams or filter the results by prefix. You can also control how the results are ordered.</p> <p>This operation has a limit of five transactions per second, after which transactions are throttled.</p>
3958    async fn describe_log_streams(
3959        &self,
3960        input: DescribeLogStreamsRequest,
3961    ) -> Result<DescribeLogStreamsResponse, RusotoError<DescribeLogStreamsError>> {
3962        let mut request = self.new_signed_request("POST", "/");
3963        request.add_header("x-amz-target", "Logs_20140328.DescribeLogStreams");
3964        let encoded = serde_json::to_string(&input).unwrap();
3965        request.set_payload(Some(encoded));
3966
3967        let response = self
3968            .sign_and_dispatch(request, DescribeLogStreamsError::from_response)
3969            .await?;
3970        let mut response = response;
3971        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3972        proto::json::ResponsePayload::new(&response).deserialize::<DescribeLogStreamsResponse, _>()
3973    }
3974
3975    /// <p>Lists the specified metric filters. You can list all the metric filters or filter the results by log name, prefix, metric name, or metric namespace. The results are ASCII-sorted by filter name.</p>
3976    async fn describe_metric_filters(
3977        &self,
3978        input: DescribeMetricFiltersRequest,
3979    ) -> Result<DescribeMetricFiltersResponse, RusotoError<DescribeMetricFiltersError>> {
3980        let mut request = self.new_signed_request("POST", "/");
3981        request.add_header("x-amz-target", "Logs_20140328.DescribeMetricFilters");
3982        let encoded = serde_json::to_string(&input).unwrap();
3983        request.set_payload(Some(encoded));
3984
3985        let response = self
3986            .sign_and_dispatch(request, DescribeMetricFiltersError::from_response)
3987            .await?;
3988        let mut response = response;
3989        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
3990        proto::json::ResponsePayload::new(&response)
3991            .deserialize::<DescribeMetricFiltersResponse, _>()
3992    }
3993
3994    /// <p>Returns a list of CloudWatch Logs Insights queries that are scheduled, executing, or have been executed recently in this account. You can request all queries, or limit it to queries of a specific log group or queries with a certain status.</p>
3995    async fn describe_queries(
3996        &self,
3997        input: DescribeQueriesRequest,
3998    ) -> Result<DescribeQueriesResponse, RusotoError<DescribeQueriesError>> {
3999        let mut request = self.new_signed_request("POST", "/");
4000        request.add_header("x-amz-target", "Logs_20140328.DescribeQueries");
4001        let encoded = serde_json::to_string(&input).unwrap();
4002        request.set_payload(Some(encoded));
4003
4004        let response = self
4005            .sign_and_dispatch(request, DescribeQueriesError::from_response)
4006            .await?;
4007        let mut response = response;
4008        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4009        proto::json::ResponsePayload::new(&response).deserialize::<DescribeQueriesResponse, _>()
4010    }
4011
4012    async fn describe_query_definitions(
4013        &self,
4014        input: DescribeQueryDefinitionsRequest,
4015    ) -> Result<DescribeQueryDefinitionsResponse, RusotoError<DescribeQueryDefinitionsError>> {
4016        let mut request = self.new_signed_request("POST", "/");
4017        request.add_header("x-amz-target", "Logs_20140328.DescribeQueryDefinitions");
4018        let encoded = serde_json::to_string(&input).unwrap();
4019        request.set_payload(Some(encoded));
4020
4021        let response = self
4022            .sign_and_dispatch(request, DescribeQueryDefinitionsError::from_response)
4023            .await?;
4024        let mut response = response;
4025        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4026        proto::json::ResponsePayload::new(&response)
4027            .deserialize::<DescribeQueryDefinitionsResponse, _>()
4028    }
4029
4030    /// <p>Lists the resource policies in this account.</p>
4031    async fn describe_resource_policies(
4032        &self,
4033        input: DescribeResourcePoliciesRequest,
4034    ) -> Result<DescribeResourcePoliciesResponse, RusotoError<DescribeResourcePoliciesError>> {
4035        let mut request = self.new_signed_request("POST", "/");
4036        request.add_header("x-amz-target", "Logs_20140328.DescribeResourcePolicies");
4037        let encoded = serde_json::to_string(&input).unwrap();
4038        request.set_payload(Some(encoded));
4039
4040        let response = self
4041            .sign_and_dispatch(request, DescribeResourcePoliciesError::from_response)
4042            .await?;
4043        let mut response = response;
4044        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4045        proto::json::ResponsePayload::new(&response)
4046            .deserialize::<DescribeResourcePoliciesResponse, _>()
4047    }
4048
4049    /// <p>Lists the subscription filters for the specified log group. You can list all the subscription filters or filter the results by prefix. The results are ASCII-sorted by filter name.</p>
4050    async fn describe_subscription_filters(
4051        &self,
4052        input: DescribeSubscriptionFiltersRequest,
4053    ) -> Result<DescribeSubscriptionFiltersResponse, RusotoError<DescribeSubscriptionFiltersError>>
4054    {
4055        let mut request = self.new_signed_request("POST", "/");
4056        request.add_header("x-amz-target", "Logs_20140328.DescribeSubscriptionFilters");
4057        let encoded = serde_json::to_string(&input).unwrap();
4058        request.set_payload(Some(encoded));
4059
4060        let response = self
4061            .sign_and_dispatch(request, DescribeSubscriptionFiltersError::from_response)
4062            .await?;
4063        let mut response = response;
4064        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4065        proto::json::ResponsePayload::new(&response)
4066            .deserialize::<DescribeSubscriptionFiltersResponse, _>()
4067    }
4068
4069    /// <p>Disassociates the associated AWS Key Management Service (AWS KMS) customer master key (CMK) from the specified log group.</p> <p>After the AWS KMS CMK is disassociated from the log group, AWS CloudWatch Logs stops encrypting newly ingested data for the log group. All previously ingested data remains encrypted, and AWS CloudWatch Logs requires permissions for the CMK whenever the encrypted data is requested.</p> <p>Note that it can take up to 5 minutes for this operation to take effect.</p>
4070    async fn disassociate_kms_key(
4071        &self,
4072        input: DisassociateKmsKeyRequest,
4073    ) -> Result<(), RusotoError<DisassociateKmsKeyError>> {
4074        let mut request = self.new_signed_request("POST", "/");
4075        request.add_header("x-amz-target", "Logs_20140328.DisassociateKmsKey");
4076        let encoded = serde_json::to_string(&input).unwrap();
4077        request.set_payload(Some(encoded));
4078
4079        let response = self
4080            .sign_and_dispatch(request, DisassociateKmsKeyError::from_response)
4081            .await?;
4082        std::mem::drop(response);
4083        Ok(())
4084    }
4085
4086    /// <p>Lists log events from the specified log group. You can list all the log events or filter the results using a filter pattern, a time range, and the name of the log stream.</p> <p>By default, this operation returns as many log events as can fit in 1 MB (up to 10,000 log events), or all the events found within the time range that you specify. If the results include a token, then there are more log events available, and you can get additional results by specifying the token in a subsequent call.</p>
4087    async fn filter_log_events(
4088        &self,
4089        input: FilterLogEventsRequest,
4090    ) -> Result<FilterLogEventsResponse, RusotoError<FilterLogEventsError>> {
4091        let mut request = self.new_signed_request("POST", "/");
4092        request.add_header("x-amz-target", "Logs_20140328.FilterLogEvents");
4093        let encoded = serde_json::to_string(&input).unwrap();
4094        request.set_payload(Some(encoded));
4095
4096        let response = self
4097            .sign_and_dispatch(request, FilterLogEventsError::from_response)
4098            .await?;
4099        let mut response = response;
4100        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4101        proto::json::ResponsePayload::new(&response).deserialize::<FilterLogEventsResponse, _>()
4102    }
4103
4104    /// <p>Lists log events from the specified log stream. You can list all the log events or filter using a time range.</p> <p>By default, this operation returns as many log events as can fit in a response size of 1MB (up to 10,000 log events). You can get additional log events by specifying one of the tokens in a subsequent call.</p>
4105    async fn get_log_events(
4106        &self,
4107        input: GetLogEventsRequest,
4108    ) -> Result<GetLogEventsResponse, RusotoError<GetLogEventsError>> {
4109        let mut request = self.new_signed_request("POST", "/");
4110        request.add_header("x-amz-target", "Logs_20140328.GetLogEvents");
4111        let encoded = serde_json::to_string(&input).unwrap();
4112        request.set_payload(Some(encoded));
4113
4114        let response = self
4115            .sign_and_dispatch(request, GetLogEventsError::from_response)
4116            .await?;
4117        let mut response = response;
4118        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4119        proto::json::ResponsePayload::new(&response).deserialize::<GetLogEventsResponse, _>()
4120    }
4121
4122    /// <p>Returns a list of the fields that are included in log events in the specified log group, along with the percentage of log events that contain each field. The search is limited to a time period that you specify.</p> <p>In the results, fields that start with @ are fields generated by CloudWatch Logs. For example, <code>@timestamp</code> is the timestamp of each log event. For more information about the fields that are generated by CloudWatch logs, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_AnalyzeLogData-discoverable-fields.html">Supported Logs and Discovered Fields</a>.</p> <p>The response results are sorted by the frequency percentage, starting with the highest percentage.</p>
4123    async fn get_log_group_fields(
4124        &self,
4125        input: GetLogGroupFieldsRequest,
4126    ) -> Result<GetLogGroupFieldsResponse, RusotoError<GetLogGroupFieldsError>> {
4127        let mut request = self.new_signed_request("POST", "/");
4128        request.add_header("x-amz-target", "Logs_20140328.GetLogGroupFields");
4129        let encoded = serde_json::to_string(&input).unwrap();
4130        request.set_payload(Some(encoded));
4131
4132        let response = self
4133            .sign_and_dispatch(request, GetLogGroupFieldsError::from_response)
4134            .await?;
4135        let mut response = response;
4136        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4137        proto::json::ResponsePayload::new(&response).deserialize::<GetLogGroupFieldsResponse, _>()
4138    }
4139
4140    /// <p>Retrieves all the fields and values of a single log event. All fields are retrieved, even if the original query that produced the <code>logRecordPointer</code> retrieved only a subset of fields. Fields are returned as field name/field value pairs.</p> <p>Additionally, the entire unparsed log event is returned within <code>@message</code>.</p>
4141    async fn get_log_record(
4142        &self,
4143        input: GetLogRecordRequest,
4144    ) -> Result<GetLogRecordResponse, RusotoError<GetLogRecordError>> {
4145        let mut request = self.new_signed_request("POST", "/");
4146        request.add_header("x-amz-target", "Logs_20140328.GetLogRecord");
4147        let encoded = serde_json::to_string(&input).unwrap();
4148        request.set_payload(Some(encoded));
4149
4150        let response = self
4151            .sign_and_dispatch(request, GetLogRecordError::from_response)
4152            .await?;
4153        let mut response = response;
4154        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4155        proto::json::ResponsePayload::new(&response).deserialize::<GetLogRecordResponse, _>()
4156    }
4157
4158    /// <p>Returns the results from the specified query.</p> <p>Only the fields requested in the query are returned, along with a <code>@ptr</code> field which is the identifier for the log record. You can use the value of <code>@ptr</code> in a <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogRecord.html">GetLogRecord</a> operation to get the full log record.</p> <p> <code>GetQueryResults</code> does not start a query execution. To run a query, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html">StartQuery</a>.</p> <p>If the value of the <code>Status</code> field in the output is <code>Running</code>, this operation returns only partial results. If you see a value of <code>Scheduled</code> or <code>Running</code> for the status, you can retry the operation later to see the final results. </p>
4159    async fn get_query_results(
4160        &self,
4161        input: GetQueryResultsRequest,
4162    ) -> Result<GetQueryResultsResponse, RusotoError<GetQueryResultsError>> {
4163        let mut request = self.new_signed_request("POST", "/");
4164        request.add_header("x-amz-target", "Logs_20140328.GetQueryResults");
4165        let encoded = serde_json::to_string(&input).unwrap();
4166        request.set_payload(Some(encoded));
4167
4168        let response = self
4169            .sign_and_dispatch(request, GetQueryResultsError::from_response)
4170            .await?;
4171        let mut response = response;
4172        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4173        proto::json::ResponsePayload::new(&response).deserialize::<GetQueryResultsResponse, _>()
4174    }
4175
4176    /// <p>Lists the tags for the specified log group.</p>
4177    async fn list_tags_log_group(
4178        &self,
4179        input: ListTagsLogGroupRequest,
4180    ) -> Result<ListTagsLogGroupResponse, RusotoError<ListTagsLogGroupError>> {
4181        let mut request = self.new_signed_request("POST", "/");
4182        request.add_header("x-amz-target", "Logs_20140328.ListTagsLogGroup");
4183        let encoded = serde_json::to_string(&input).unwrap();
4184        request.set_payload(Some(encoded));
4185
4186        let response = self
4187            .sign_and_dispatch(request, ListTagsLogGroupError::from_response)
4188            .await?;
4189        let mut response = response;
4190        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4191        proto::json::ResponsePayload::new(&response).deserialize::<ListTagsLogGroupResponse, _>()
4192    }
4193
4194    /// <p>Creates or updates a destination. This operation is used only to create destinations for cross-account subscriptions.</p> <p>A destination encapsulates a physical resource (such as an Amazon Kinesis stream) and enables you to subscribe to a real-time stream of log events for a different account, ingested using <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a>.</p> <p>Through an access policy, a destination controls what is written to it. By default, <code>PutDestination</code> does not set any access policy with the destination, which means a cross-account user cannot call <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutSubscriptionFilter.html">PutSubscriptionFilter</a> against this destination. To enable this, the destination owner must call <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestinationPolicy.html">PutDestinationPolicy</a> after <code>PutDestination</code>.</p>
4195    async fn put_destination(
4196        &self,
4197        input: PutDestinationRequest,
4198    ) -> Result<PutDestinationResponse, RusotoError<PutDestinationError>> {
4199        let mut request = self.new_signed_request("POST", "/");
4200        request.add_header("x-amz-target", "Logs_20140328.PutDestination");
4201        let encoded = serde_json::to_string(&input).unwrap();
4202        request.set_payload(Some(encoded));
4203
4204        let response = self
4205            .sign_and_dispatch(request, PutDestinationError::from_response)
4206            .await?;
4207        let mut response = response;
4208        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4209        proto::json::ResponsePayload::new(&response).deserialize::<PutDestinationResponse, _>()
4210    }
4211
4212    /// <p>Creates or updates an access policy associated with an existing destination. An access policy is an <a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/policies_overview.html">IAM policy document</a> that is used to authorize claims to register a subscription filter against a given destination.</p>
4213    async fn put_destination_policy(
4214        &self,
4215        input: PutDestinationPolicyRequest,
4216    ) -> Result<(), RusotoError<PutDestinationPolicyError>> {
4217        let mut request = self.new_signed_request("POST", "/");
4218        request.add_header("x-amz-target", "Logs_20140328.PutDestinationPolicy");
4219        let encoded = serde_json::to_string(&input).unwrap();
4220        request.set_payload(Some(encoded));
4221
4222        let response = self
4223            .sign_and_dispatch(request, PutDestinationPolicyError::from_response)
4224            .await?;
4225        std::mem::drop(response);
4226        Ok(())
4227    }
4228
4229    /// <p>Uploads a batch of log events to the specified log stream.</p> <p>You must include the sequence token obtained from the response of the previous call. An upload in a newly created log stream does not require a sequence token. You can also get the sequence token in the <code>expectedSequenceToken</code> field from <code>InvalidSequenceTokenException</code>. If you call <code>PutLogEvents</code> twice within a narrow time period using the same value for <code>sequenceToken</code>, both calls may be successful, or one may be rejected.</p> <p>The batch of events must satisfy the following constraints:</p> <ul> <li> <p>The maximum batch size is 1,048,576 bytes, and this size is calculated as the sum of all event messages in UTF-8, plus 26 bytes for each log event.</p> </li> <li> <p>None of the log events in the batch can be more than 2 hours in the future.</p> </li> <li> <p>None of the log events in the batch can be older than 14 days or older than the retention period of the log group.</p> </li> <li> <p>The log events in the batch must be in chronological ordered by their timestamp. The timestamp is the time the event occurred, expressed as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. (In AWS Tools for PowerShell and the AWS SDK for .NET, the timestamp is specified in .NET format: yyyy-mm-ddThh:mm:ss. For example, 2017-09-15T13:45:30.) </p> </li> <li> <p>A batch of log events in a single request cannot span more than 24 hours. Otherwise, the operation fails.</p> </li> <li> <p>The maximum number of log events in a batch is 10,000.</p> </li> <li> <p>There is a quota of 5 requests per second per log stream. Additional requests are throttled. This quota can't be changed.</p> </li> </ul> <p>If a call to PutLogEvents returns "UnrecognizedClientException" the most likely cause is an invalid AWS access key ID or secret key. </p>
4230    async fn put_log_events(
4231        &self,
4232        input: PutLogEventsRequest,
4233    ) -> Result<PutLogEventsResponse, RusotoError<PutLogEventsError>> {
4234        let mut request = self.new_signed_request("POST", "/");
4235        request.add_header("x-amz-target", "Logs_20140328.PutLogEvents");
4236        let encoded = serde_json::to_string(&input).unwrap();
4237        request.set_payload(Some(encoded));
4238
4239        let response = self
4240            .sign_and_dispatch(request, PutLogEventsError::from_response)
4241            .await?;
4242        let mut response = response;
4243        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4244        proto::json::ResponsePayload::new(&response).deserialize::<PutLogEventsResponse, _>()
4245    }
4246
4247    /// <p>Creates or updates a metric filter and associates it with the specified log group. Metric filters allow you to configure rules to extract metric data from log events ingested through <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a>.</p> <p>The maximum number of metric filters that can be associated with a log group is 100.</p>
4248    async fn put_metric_filter(
4249        &self,
4250        input: PutMetricFilterRequest,
4251    ) -> Result<(), RusotoError<PutMetricFilterError>> {
4252        let mut request = self.new_signed_request("POST", "/");
4253        request.add_header("x-amz-target", "Logs_20140328.PutMetricFilter");
4254        let encoded = serde_json::to_string(&input).unwrap();
4255        request.set_payload(Some(encoded));
4256
4257        let response = self
4258            .sign_and_dispatch(request, PutMetricFilterError::from_response)
4259            .await?;
4260        std::mem::drop(response);
4261        Ok(())
4262    }
4263
4264    async fn put_query_definition(
4265        &self,
4266        input: PutQueryDefinitionRequest,
4267    ) -> Result<PutQueryDefinitionResponse, RusotoError<PutQueryDefinitionError>> {
4268        let mut request = self.new_signed_request("POST", "/");
4269        request.add_header("x-amz-target", "Logs_20140328.PutQueryDefinition");
4270        let encoded = serde_json::to_string(&input).unwrap();
4271        request.set_payload(Some(encoded));
4272
4273        let response = self
4274            .sign_and_dispatch(request, PutQueryDefinitionError::from_response)
4275            .await?;
4276        let mut response = response;
4277        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4278        proto::json::ResponsePayload::new(&response).deserialize::<PutQueryDefinitionResponse, _>()
4279    }
4280
4281    /// <p>Creates or updates a resource policy allowing other AWS services to put log events to this account, such as Amazon Route 53. An account can have up to 10 resource policies per region.</p>
4282    async fn put_resource_policy(
4283        &self,
4284        input: PutResourcePolicyRequest,
4285    ) -> Result<PutResourcePolicyResponse, RusotoError<PutResourcePolicyError>> {
4286        let mut request = self.new_signed_request("POST", "/");
4287        request.add_header("x-amz-target", "Logs_20140328.PutResourcePolicy");
4288        let encoded = serde_json::to_string(&input).unwrap();
4289        request.set_payload(Some(encoded));
4290
4291        let response = self
4292            .sign_and_dispatch(request, PutResourcePolicyError::from_response)
4293            .await?;
4294        let mut response = response;
4295        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4296        proto::json::ResponsePayload::new(&response).deserialize::<PutResourcePolicyResponse, _>()
4297    }
4298
4299    /// <p>Sets the retention of the specified log group. A retention policy allows you to configure the number of days for which to retain log events in the specified log group.</p>
4300    async fn put_retention_policy(
4301        &self,
4302        input: PutRetentionPolicyRequest,
4303    ) -> Result<(), RusotoError<PutRetentionPolicyError>> {
4304        let mut request = self.new_signed_request("POST", "/");
4305        request.add_header("x-amz-target", "Logs_20140328.PutRetentionPolicy");
4306        let encoded = serde_json::to_string(&input).unwrap();
4307        request.set_payload(Some(encoded));
4308
4309        let response = self
4310            .sign_and_dispatch(request, PutRetentionPolicyError::from_response)
4311            .await?;
4312        std::mem::drop(response);
4313        Ok(())
4314    }
4315
4316    /// <p>Creates or updates a subscription filter and associates it with the specified log group. Subscription filters allow you to subscribe to a real-time stream of log events ingested through <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutLogEvents.html">PutLogEvents</a> and have them delivered to a specific destination. Currently, the supported destinations are:</p> <ul> <li> <p>An Amazon Kinesis stream belonging to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>A logical destination that belongs to a different account, for cross-account delivery.</p> </li> <li> <p>An Amazon Kinesis Firehose delivery stream that belongs to the same account as the subscription filter, for same-account delivery.</p> </li> <li> <p>An AWS Lambda function that belongs to the same account as the subscription filter, for same-account delivery.</p> </li> </ul> <p>There can only be one subscription filter associated with a log group. If you are updating an existing filter, you must specify the correct name in <code>filterName</code>. Otherwise, the call fails because you cannot associate a second filter with a log group.</p>
4317    async fn put_subscription_filter(
4318        &self,
4319        input: PutSubscriptionFilterRequest,
4320    ) -> Result<(), RusotoError<PutSubscriptionFilterError>> {
4321        let mut request = self.new_signed_request("POST", "/");
4322        request.add_header("x-amz-target", "Logs_20140328.PutSubscriptionFilter");
4323        let encoded = serde_json::to_string(&input).unwrap();
4324        request.set_payload(Some(encoded));
4325
4326        let response = self
4327            .sign_and_dispatch(request, PutSubscriptionFilterError::from_response)
4328            .await?;
4329        std::mem::drop(response);
4330        Ok(())
4331    }
4332
4333    /// <p>Schedules a query of a log group using CloudWatch Logs Insights. You specify the log group and time range to query, and the query string to use.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html">CloudWatch Logs Insights Query Syntax</a>.</p> <p>Queries time out after 15 minutes of execution. If your queries are timing out, reduce the time range being searched, or partition your query into a number of queries.</p>
4334    async fn start_query(
4335        &self,
4336        input: StartQueryRequest,
4337    ) -> Result<StartQueryResponse, RusotoError<StartQueryError>> {
4338        let mut request = self.new_signed_request("POST", "/");
4339        request.add_header("x-amz-target", "Logs_20140328.StartQuery");
4340        let encoded = serde_json::to_string(&input).unwrap();
4341        request.set_payload(Some(encoded));
4342
4343        let response = self
4344            .sign_and_dispatch(request, StartQueryError::from_response)
4345            .await?;
4346        let mut response = response;
4347        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4348        proto::json::ResponsePayload::new(&response).deserialize::<StartQueryResponse, _>()
4349    }
4350
4351    /// <p>Stops a CloudWatch Logs Insights query that is in progress. If the query has already ended, the operation returns an error indicating that the specified query is not running.</p>
4352    async fn stop_query(
4353        &self,
4354        input: StopQueryRequest,
4355    ) -> Result<StopQueryResponse, RusotoError<StopQueryError>> {
4356        let mut request = self.new_signed_request("POST", "/");
4357        request.add_header("x-amz-target", "Logs_20140328.StopQuery");
4358        let encoded = serde_json::to_string(&input).unwrap();
4359        request.set_payload(Some(encoded));
4360
4361        let response = self
4362            .sign_and_dispatch(request, StopQueryError::from_response)
4363            .await?;
4364        let mut response = response;
4365        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4366        proto::json::ResponsePayload::new(&response).deserialize::<StopQueryResponse, _>()
4367    }
4368
4369    /// <p>Adds or updates the specified tags for the specified log group.</p> <p>To list the tags for a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsLogGroup.html">ListTagsLogGroup</a>. To remove tags, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_UntagLogGroup.html">UntagLogGroup</a>.</p> <p>For more information about tags, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Working-with-log-groups-and-streams.html#log-group-tagging">Tag Log Groups in Amazon CloudWatch Logs</a> in the <i>Amazon CloudWatch Logs User Guide</i>.</p>
4370    async fn tag_log_group(
4371        &self,
4372        input: TagLogGroupRequest,
4373    ) -> Result<(), RusotoError<TagLogGroupError>> {
4374        let mut request = self.new_signed_request("POST", "/");
4375        request.add_header("x-amz-target", "Logs_20140328.TagLogGroup");
4376        let encoded = serde_json::to_string(&input).unwrap();
4377        request.set_payload(Some(encoded));
4378
4379        let response = self
4380            .sign_and_dispatch(request, TagLogGroupError::from_response)
4381            .await?;
4382        std::mem::drop(response);
4383        Ok(())
4384    }
4385
4386    /// <p>Tests the filter pattern of a metric filter against a sample of log event messages. You can use this operation to validate the correctness of a metric filter pattern.</p>
4387    async fn test_metric_filter(
4388        &self,
4389        input: TestMetricFilterRequest,
4390    ) -> Result<TestMetricFilterResponse, RusotoError<TestMetricFilterError>> {
4391        let mut request = self.new_signed_request("POST", "/");
4392        request.add_header("x-amz-target", "Logs_20140328.TestMetricFilter");
4393        let encoded = serde_json::to_string(&input).unwrap();
4394        request.set_payload(Some(encoded));
4395
4396        let response = self
4397            .sign_and_dispatch(request, TestMetricFilterError::from_response)
4398            .await?;
4399        let mut response = response;
4400        let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
4401        proto::json::ResponsePayload::new(&response).deserialize::<TestMetricFilterResponse, _>()
4402    }
4403
4404    /// <p>Removes the specified tags from the specified log group.</p> <p>To list the tags for a log group, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_ListTagsLogGroup.html">ListTagsLogGroup</a>. To add tags, use <a href="https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_TagLogGroup.html">TagLogGroup</a>.</p>
4405    async fn untag_log_group(
4406        &self,
4407        input: UntagLogGroupRequest,
4408    ) -> Result<(), RusotoError<UntagLogGroupError>> {
4409        let mut request = self.new_signed_request("POST", "/");
4410        request.add_header("x-amz-target", "Logs_20140328.UntagLogGroup");
4411        let encoded = serde_json::to_string(&input).unwrap();
4412        request.set_payload(Some(encoded));
4413
4414        let response = self
4415            .sign_and_dispatch(request, UntagLogGroupError::from_response)
4416            .await?;
4417        std::mem::drop(response);
4418        Ok(())
4419    }
4420}