use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct AssociateKmsKeyRequest {
#[serde(rename = "kmsKeyId")]
pub kms_key_id: String,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CancelExportTaskRequest {
#[serde(rename = "taskId")]
pub task_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateExportTaskRequest {
#[serde(rename = "destination")]
pub destination: String,
#[serde(rename = "destinationPrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_prefix: Option<String>,
#[serde(rename = "from")]
pub from: i64,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name_prefix: Option<String>,
#[serde(rename = "taskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_name: Option<String>,
#[serde(rename = "to")]
pub to: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateExportTaskResponse {
#[serde(rename = "taskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLogGroupRequest {
#[serde(rename = "kmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateLogStreamRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamName")]
pub log_stream_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDestinationRequest {
#[serde(rename = "destinationName")]
pub destination_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLogGroupRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteLogStreamRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamName")]
pub log_stream_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteMetricFilterRequest {
#[serde(rename = "filterName")]
pub filter_name: String,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteResourcePolicyRequest {
#[serde(rename = "policyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRetentionPolicyRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteSubscriptionFilterRequest {
#[serde(rename = "filterName")]
pub filter_name: String,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDestinationsRequest {
#[serde(rename = "DestinationNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_name_prefix: Option<String>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDestinationsResponse {
#[serde(rename = "destinations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destinations: Option<Vec<Destination>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeExportTasksRequest {
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "statusCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status_code: Option<String>,
#[serde(rename = "taskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeExportTasksResponse {
#[serde(rename = "exportTasks")]
#[serde(skip_serializing_if = "Option::is_none")]
pub export_tasks: Option<Vec<ExportTask>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeLogGroupsRequest {
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name_prefix: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeLogGroupsResponse {
#[serde(rename = "logGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_groups: Option<Vec<LogGroup>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeLogStreamsRequest {
#[serde(rename = "descending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub descending: Option<bool>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name_prefix: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "orderBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub order_by: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeLogStreamsResponse {
#[serde(rename = "logStreams")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_streams: Option<Vec<LogStream>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeMetricFiltersRequest {
#[serde(rename = "filterNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_name_prefix: Option<String>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "metricName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_name: Option<String>,
#[serde(rename = "metricNamespace")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_namespace: Option<String>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeMetricFiltersResponse {
#[serde(rename = "metricFilters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_filters: Option<Vec<MetricFilter>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeQueriesRequest {
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "maxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeQueriesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "queries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub queries: Option<Vec<QueryInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeResourcePoliciesRequest {
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeResourcePoliciesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resourcePolicies")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_policies: Option<Vec<ResourcePolicy>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSubscriptionFiltersRequest {
#[serde(rename = "filterNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_name_prefix: Option<String>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSubscriptionFiltersResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "subscriptionFilters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription_filters: Option<Vec<SubscriptionFilter>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Destination {
#[serde(rename = "accessPolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub access_policy: Option<String>,
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
#[serde(rename = "destinationName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_name: Option<String>,
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
#[serde(rename = "targetArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DisassociateKmsKeyRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportTask {
#[serde(rename = "destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination: Option<String>,
#[serde(rename = "destinationPrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_prefix: Option<String>,
#[serde(rename = "executionInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub execution_info: Option<ExportTaskExecutionInfo>,
#[serde(rename = "from")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from: Option<i64>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<ExportTaskStatus>,
#[serde(rename = "taskId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_id: Option<String>,
#[serde(rename = "taskName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub task_name: Option<String>,
#[serde(rename = "to")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportTaskExecutionInfo {
#[serde(rename = "completionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub completion_time: Option<i64>,
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ExportTaskStatus {
#[serde(rename = "code")]
#[serde(skip_serializing_if = "Option::is_none")]
pub code: Option<String>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct FilterLogEventsRequest {
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<i64>,
#[serde(rename = "filterPattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_pattern: Option<String>,
#[serde(rename = "interleaved")]
#[serde(skip_serializing_if = "Option::is_none")]
pub interleaved: Option<bool>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamNamePrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name_prefix: Option<String>,
#[serde(rename = "logStreamNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_names: Option<Vec<String>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FilterLogEventsResponse {
#[serde(rename = "events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<FilteredLogEvent>>,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "searchedLogStreams")]
#[serde(skip_serializing_if = "Option::is_none")]
pub searched_log_streams: Option<Vec<SearchedLogStream>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct FilteredLogEvent {
#[serde(rename = "eventId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_id: Option<String>,
#[serde(rename = "ingestionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ingestion_time: Option<i64>,
#[serde(rename = "logStreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name: Option<String>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLogEventsRequest {
#[serde(rename = "endTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<i64>,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamName")]
pub log_stream_name: String,
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "startFromHead")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_from_head: Option<bool>,
#[serde(rename = "startTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLogEventsResponse {
#[serde(rename = "events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<OutputLogEvent>>,
#[serde(rename = "nextBackwardToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_backward_token: Option<String>,
#[serde(rename = "nextForwardToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_forward_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLogGroupFieldsRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "time")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLogGroupFieldsResponse {
#[serde(rename = "logGroupFields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_fields: Option<Vec<LogGroupField>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetLogRecordRequest {
#[serde(rename = "logRecordPointer")]
pub log_record_pointer: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetLogRecordResponse {
#[serde(rename = "logRecord")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_record: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetQueryResultsRequest {
#[serde(rename = "queryId")]
pub query_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetQueryResultsResponse {
#[serde(rename = "results")]
#[serde(skip_serializing_if = "Option::is_none")]
pub results: Option<Vec<Vec<ResultField>>>,
#[serde(rename = "statistics")]
#[serde(skip_serializing_if = "Option::is_none")]
pub statistics: Option<QueryStatistics>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct InputLogEvent {
#[serde(rename = "message")]
pub message: String,
#[serde(rename = "timestamp")]
pub timestamp: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsLogGroupRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsLogGroupResponse {
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LogGroup {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
#[serde(rename = "kmsKeyId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kms_key_id: Option<String>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "metricFilterCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_filter_count: Option<i64>,
#[serde(rename = "retentionInDays")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retention_in_days: Option<i64>,
#[serde(rename = "storedBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stored_bytes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LogGroupField {
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "percent")]
#[serde(skip_serializing_if = "Option::is_none")]
pub percent: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LogStream {
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
#[serde(rename = "firstEventTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub first_event_timestamp: Option<i64>,
#[serde(rename = "lastEventTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_event_timestamp: Option<i64>,
#[serde(rename = "lastIngestionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_ingestion_time: Option<i64>,
#[serde(rename = "logStreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name: Option<String>,
#[serde(rename = "storedBytes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub stored_bytes: Option<i64>,
#[serde(rename = "uploadSequenceToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub upload_sequence_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MetricFilter {
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
#[serde(rename = "filterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_name: Option<String>,
#[serde(rename = "filterPattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_pattern: Option<String>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "metricTransformations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub metric_transformations: Option<Vec<MetricTransformation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct MetricFilterMatchRecord {
#[serde(rename = "eventMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_message: Option<String>,
#[serde(rename = "eventNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_number: Option<i64>,
#[serde(rename = "extractedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub extracted_values: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct MetricTransformation {
#[serde(rename = "defaultValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub default_value: Option<f64>,
#[serde(rename = "metricName")]
pub metric_name: String,
#[serde(rename = "metricNamespace")]
pub metric_namespace: String,
#[serde(rename = "metricValue")]
pub metric_value: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct OutputLogEvent {
#[serde(rename = "ingestionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ingestion_time: Option<i64>,
#[serde(rename = "message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutDestinationPolicyRequest {
#[serde(rename = "accessPolicy")]
pub access_policy: String,
#[serde(rename = "destinationName")]
pub destination_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutDestinationRequest {
#[serde(rename = "destinationName")]
pub destination_name: String,
#[serde(rename = "roleArn")]
pub role_arn: String,
#[serde(rename = "targetArn")]
pub target_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutDestinationResponse {
#[serde(rename = "destination")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination: Option<Destination>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutLogEventsRequest {
#[serde(rename = "logEvents")]
pub log_events: Vec<InputLogEvent>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "logStreamName")]
pub log_stream_name: String,
#[serde(rename = "sequenceToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sequence_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutLogEventsResponse {
#[serde(rename = "nextSequenceToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_sequence_token: Option<String>,
#[serde(rename = "rejectedLogEventsInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub rejected_log_events_info: Option<RejectedLogEventsInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutMetricFilterRequest {
#[serde(rename = "filterName")]
pub filter_name: String,
#[serde(rename = "filterPattern")]
pub filter_pattern: String,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "metricTransformations")]
pub metric_transformations: Vec<MetricTransformation>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutResourcePolicyRequest {
#[serde(rename = "policyDocument")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_document: Option<String>,
#[serde(rename = "policyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutResourcePolicyResponse {
#[serde(rename = "resourcePolicy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_policy: Option<ResourcePolicy>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutRetentionPolicyRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "retentionInDays")]
pub retention_in_days: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutSubscriptionFilterRequest {
#[serde(rename = "destinationArn")]
pub destination_arn: String,
#[serde(rename = "distribution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distribution: Option<String>,
#[serde(rename = "filterName")]
pub filter_name: String,
#[serde(rename = "filterPattern")]
pub filter_pattern: String,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryCompileError {
pub location: Option<QueryCompileErrorLocation>,
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct QueryCompileErrorLocation {
pub end_char_offset: Option<i64>,
pub start_char_offset: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryInfo {
#[serde(rename = "createTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub create_time: Option<i64>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "queryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_id: Option<String>,
#[serde(rename = "queryString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_string: Option<String>,
#[serde(rename = "status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct QueryStatistics {
#[serde(rename = "bytesScanned")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bytes_scanned: Option<f64>,
#[serde(rename = "recordsMatched")]
#[serde(skip_serializing_if = "Option::is_none")]
pub records_matched: Option<f64>,
#[serde(rename = "recordsScanned")]
#[serde(skip_serializing_if = "Option::is_none")]
pub records_scanned: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RejectedLogEventsInfo {
#[serde(rename = "expiredLogEventEndIndex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub expired_log_event_end_index: Option<i64>,
#[serde(rename = "tooNewLogEventStartIndex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub too_new_log_event_start_index: Option<i64>,
#[serde(rename = "tooOldLogEventEndIndex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub too_old_log_event_end_index: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourcePolicy {
#[serde(rename = "lastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<i64>,
#[serde(rename = "policyDocument")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_document: Option<String>,
#[serde(rename = "policyName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub policy_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResultField {
#[serde(rename = "field")]
#[serde(skip_serializing_if = "Option::is_none")]
pub field: Option<String>,
#[serde(rename = "value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SearchedLogStream {
#[serde(rename = "logStreamName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_stream_name: Option<String>,
#[serde(rename = "searchedCompletely")]
#[serde(skip_serializing_if = "Option::is_none")]
pub searched_completely: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartQueryRequest {
#[serde(rename = "endTime")]
pub end_time: i64,
#[serde(rename = "limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "queryString")]
pub query_string: String,
#[serde(rename = "startTime")]
pub start_time: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartQueryResponse {
#[serde(rename = "queryId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub query_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopQueryRequest {
#[serde(rename = "queryId")]
pub query_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StopQueryResponse {
#[serde(rename = "success")]
#[serde(skip_serializing_if = "Option::is_none")]
pub success: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SubscriptionFilter {
#[serde(rename = "creationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<i64>,
#[serde(rename = "destinationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub destination_arn: Option<String>,
#[serde(rename = "distribution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub distribution: Option<String>,
#[serde(rename = "filterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_name: Option<String>,
#[serde(rename = "filterPattern")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filter_pattern: Option<String>,
#[serde(rename = "logGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_group_name: Option<String>,
#[serde(rename = "roleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagLogGroupRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TestMetricFilterRequest {
#[serde(rename = "filterPattern")]
pub filter_pattern: String,
#[serde(rename = "logEventMessages")]
pub log_event_messages: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TestMetricFilterResponse {
#[serde(rename = "matches")]
#[serde(skip_serializing_if = "Option::is_none")]
pub matches: Option<Vec<MetricFilterMatchRecord>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagLogGroupRequest {
#[serde(rename = "logGroupName")]
pub log_group_name: String,
#[serde(rename = "tags")]
pub tags: Vec<String>,
}
#[derive(Debug, PartialEq)]
pub enum AssociateKmsKeyError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl AssociateKmsKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateKmsKeyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(AssociateKmsKeyError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(AssociateKmsKeyError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AssociateKmsKeyError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(AssociateKmsKeyError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for AssociateKmsKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for AssociateKmsKeyError {
fn description(&self) -> &str {
match *self {
AssociateKmsKeyError::InvalidParameter(ref cause) => cause,
AssociateKmsKeyError::OperationAborted(ref cause) => cause,
AssociateKmsKeyError::ResourceNotFound(ref cause) => cause,
AssociateKmsKeyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CancelExportTaskError {
InvalidOperation(String),
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl CancelExportTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CancelExportTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidOperationException" => {
return RusotoError::Service(CancelExportTaskError::InvalidOperation(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(CancelExportTaskError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CancelExportTaskError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CancelExportTaskError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CancelExportTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CancelExportTaskError {
fn description(&self) -> &str {
match *self {
CancelExportTaskError::InvalidOperation(ref cause) => cause,
CancelExportTaskError::InvalidParameter(ref cause) => cause,
CancelExportTaskError::ResourceNotFound(ref cause) => cause,
CancelExportTaskError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateExportTaskError {
InvalidParameter(String),
LimitExceeded(String),
OperationAborted(String),
ResourceAlreadyExists(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl CreateExportTaskError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateExportTaskError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(CreateExportTaskError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateExportTaskError::LimitExceeded(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(CreateExportTaskError::OperationAborted(err.msg))
}
"ResourceAlreadyExistsException" => {
return RusotoError::Service(CreateExportTaskError::ResourceAlreadyExists(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateExportTaskError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateExportTaskError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateExportTaskError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateExportTaskError {
fn description(&self) -> &str {
match *self {
CreateExportTaskError::InvalidParameter(ref cause) => cause,
CreateExportTaskError::LimitExceeded(ref cause) => cause,
CreateExportTaskError::OperationAborted(ref cause) => cause,
CreateExportTaskError::ResourceAlreadyExists(ref cause) => cause,
CreateExportTaskError::ResourceNotFound(ref cause) => cause,
CreateExportTaskError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLogGroupError {
InvalidParameter(String),
LimitExceeded(String),
OperationAborted(String),
ResourceAlreadyExists(String),
ServiceUnavailable(String),
}
impl CreateLogGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLogGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(CreateLogGroupError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateLogGroupError::LimitExceeded(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(CreateLogGroupError::OperationAborted(err.msg))
}
"ResourceAlreadyExistsException" => {
return RusotoError::Service(CreateLogGroupError::ResourceAlreadyExists(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateLogGroupError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateLogGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLogGroupError {
fn description(&self) -> &str {
match *self {
CreateLogGroupError::InvalidParameter(ref cause) => cause,
CreateLogGroupError::LimitExceeded(ref cause) => cause,
CreateLogGroupError::OperationAborted(ref cause) => cause,
CreateLogGroupError::ResourceAlreadyExists(ref cause) => cause,
CreateLogGroupError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateLogStreamError {
InvalidParameter(String),
ResourceAlreadyExists(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl CreateLogStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateLogStreamError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(CreateLogStreamError::InvalidParameter(err.msg))
}
"ResourceAlreadyExistsException" => {
return RusotoError::Service(CreateLogStreamError::ResourceAlreadyExists(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateLogStreamError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateLogStreamError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateLogStreamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateLogStreamError {
fn description(&self) -> &str {
match *self {
CreateLogStreamError::InvalidParameter(ref cause) => cause,
CreateLogStreamError::ResourceAlreadyExists(ref cause) => cause,
CreateLogStreamError::ResourceNotFound(ref cause) => cause,
CreateLogStreamError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDestinationError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteDestinationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteDestinationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteDestinationError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteDestinationError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteDestinationError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteDestinationError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteDestinationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDestinationError {
fn description(&self) -> &str {
match *self {
DeleteDestinationError::InvalidParameter(ref cause) => cause,
DeleteDestinationError::OperationAborted(ref cause) => cause,
DeleteDestinationError::ResourceNotFound(ref cause) => cause,
DeleteDestinationError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLogGroupError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteLogGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLogGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteLogGroupError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteLogGroupError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteLogGroupError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteLogGroupError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLogGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLogGroupError {
fn description(&self) -> &str {
match *self {
DeleteLogGroupError::InvalidParameter(ref cause) => cause,
DeleteLogGroupError::OperationAborted(ref cause) => cause,
DeleteLogGroupError::ResourceNotFound(ref cause) => cause,
DeleteLogGroupError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteLogStreamError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteLogStreamError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteLogStreamError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteLogStreamError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteLogStreamError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteLogStreamError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteLogStreamError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteLogStreamError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteLogStreamError {
fn description(&self) -> &str {
match *self {
DeleteLogStreamError::InvalidParameter(ref cause) => cause,
DeleteLogStreamError::OperationAborted(ref cause) => cause,
DeleteLogStreamError::ResourceNotFound(ref cause) => cause,
DeleteLogStreamError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteMetricFilterError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteMetricFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteMetricFilterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteMetricFilterError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteMetricFilterError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteMetricFilterError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteMetricFilterError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteMetricFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteMetricFilterError {
fn description(&self) -> &str {
match *self {
DeleteMetricFilterError::InvalidParameter(ref cause) => cause,
DeleteMetricFilterError::OperationAborted(ref cause) => cause,
DeleteMetricFilterError::ResourceNotFound(ref cause) => cause,
DeleteMetricFilterError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteResourcePolicyError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteResourcePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteResourcePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteResourcePolicyError::InvalidParameter(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteResourcePolicyError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteResourcePolicyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteResourcePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteResourcePolicyError {
fn description(&self) -> &str {
match *self {
DeleteResourcePolicyError::InvalidParameter(ref cause) => cause,
DeleteResourcePolicyError::ResourceNotFound(ref cause) => cause,
DeleteResourcePolicyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRetentionPolicyError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteRetentionPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteRetentionPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteRetentionPolicyError::InvalidParameter(
err.msg,
))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteRetentionPolicyError::OperationAborted(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteRetentionPolicyError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteRetentionPolicyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteRetentionPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRetentionPolicyError {
fn description(&self) -> &str {
match *self {
DeleteRetentionPolicyError::InvalidParameter(ref cause) => cause,
DeleteRetentionPolicyError::OperationAborted(ref cause) => cause,
DeleteRetentionPolicyError::ResourceNotFound(ref cause) => cause,
DeleteRetentionPolicyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSubscriptionFilterError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DeleteSubscriptionFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSubscriptionFilterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DeleteSubscriptionFilterError::InvalidParameter(
err.msg,
))
}
"OperationAbortedException" => {
return RusotoError::Service(DeleteSubscriptionFilterError::OperationAborted(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteSubscriptionFilterError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DeleteSubscriptionFilterError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteSubscriptionFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSubscriptionFilterError {
fn description(&self) -> &str {
match *self {
DeleteSubscriptionFilterError::InvalidParameter(ref cause) => cause,
DeleteSubscriptionFilterError::OperationAborted(ref cause) => cause,
DeleteSubscriptionFilterError::ResourceNotFound(ref cause) => cause,
DeleteSubscriptionFilterError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDestinationsError {
InvalidParameter(String),
ServiceUnavailable(String),
}
impl DescribeDestinationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDestinationsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeDestinationsError::InvalidParameter(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeDestinationsError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDestinationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDestinationsError {
fn description(&self) -> &str {
match *self {
DescribeDestinationsError::InvalidParameter(ref cause) => cause,
DescribeDestinationsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeExportTasksError {
InvalidParameter(String),
ServiceUnavailable(String),
}
impl DescribeExportTasksError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeExportTasksError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeExportTasksError::InvalidParameter(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeExportTasksError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeExportTasksError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeExportTasksError {
fn description(&self) -> &str {
match *self {
DescribeExportTasksError::InvalidParameter(ref cause) => cause,
DescribeExportTasksError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLogGroupsError {
InvalidParameter(String),
ServiceUnavailable(String),
}
impl DescribeLogGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLogGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeLogGroupsError::InvalidParameter(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeLogGroupsError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeLogGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLogGroupsError {
fn description(&self) -> &str {
match *self {
DescribeLogGroupsError::InvalidParameter(ref cause) => cause,
DescribeLogGroupsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeLogStreamsError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeLogStreamsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeLogStreamsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeLogStreamsError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeLogStreamsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeLogStreamsError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeLogStreamsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeLogStreamsError {
fn description(&self) -> &str {
match *self {
DescribeLogStreamsError::InvalidParameter(ref cause) => cause,
DescribeLogStreamsError::ResourceNotFound(ref cause) => cause,
DescribeLogStreamsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeMetricFiltersError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeMetricFiltersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeMetricFiltersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeMetricFiltersError::InvalidParameter(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeMetricFiltersError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeMetricFiltersError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeMetricFiltersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeMetricFiltersError {
fn description(&self) -> &str {
match *self {
DescribeMetricFiltersError::InvalidParameter(ref cause) => cause,
DescribeMetricFiltersError::ResourceNotFound(ref cause) => cause,
DescribeMetricFiltersError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeQueriesError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeQueriesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeQueriesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeQueriesError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeQueriesError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeQueriesError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeQueriesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeQueriesError {
fn description(&self) -> &str {
match *self {
DescribeQueriesError::InvalidParameter(ref cause) => cause,
DescribeQueriesError::ResourceNotFound(ref cause) => cause,
DescribeQueriesError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeResourcePoliciesError {
InvalidParameter(String),
ServiceUnavailable(String),
}
impl DescribeResourcePoliciesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeResourcePoliciesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DescribeResourcePoliciesError::InvalidParameter(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeResourcePoliciesError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeResourcePoliciesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeResourcePoliciesError {
fn description(&self) -> &str {
match *self {
DescribeResourcePoliciesError::InvalidParameter(ref cause) => cause,
DescribeResourcePoliciesError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSubscriptionFiltersError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DescribeSubscriptionFiltersError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeSubscriptionFiltersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(
DescribeSubscriptionFiltersError::InvalidParameter(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeSubscriptionFiltersError::ResourceNotFound(err.msg),
)
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DescribeSubscriptionFiltersError::ServiceUnavailable(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeSubscriptionFiltersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSubscriptionFiltersError {
fn description(&self) -> &str {
match *self {
DescribeSubscriptionFiltersError::InvalidParameter(ref cause) => cause,
DescribeSubscriptionFiltersError::ResourceNotFound(ref cause) => cause,
DescribeSubscriptionFiltersError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DisassociateKmsKeyError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl DisassociateKmsKeyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateKmsKeyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(DisassociateKmsKeyError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(DisassociateKmsKeyError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DisassociateKmsKeyError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DisassociateKmsKeyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DisassociateKmsKeyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DisassociateKmsKeyError {
fn description(&self) -> &str {
match *self {
DisassociateKmsKeyError::InvalidParameter(ref cause) => cause,
DisassociateKmsKeyError::OperationAborted(ref cause) => cause,
DisassociateKmsKeyError::ResourceNotFound(ref cause) => cause,
DisassociateKmsKeyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum FilterLogEventsError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl FilterLogEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<FilterLogEventsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(FilterLogEventsError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(FilterLogEventsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(FilterLogEventsError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for FilterLogEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for FilterLogEventsError {
fn description(&self) -> &str {
match *self {
FilterLogEventsError::InvalidParameter(ref cause) => cause,
FilterLogEventsError::ResourceNotFound(ref cause) => cause,
FilterLogEventsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLogEventsError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl GetLogEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogEventsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetLogEventsError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLogEventsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetLogEventsError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLogEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLogEventsError {
fn description(&self) -> &str {
match *self {
GetLogEventsError::InvalidParameter(ref cause) => cause,
GetLogEventsError::ResourceNotFound(ref cause) => cause,
GetLogEventsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLogGroupFieldsError {
InvalidParameter(String),
LimitExceeded(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl GetLogGroupFieldsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogGroupFieldsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetLogGroupFieldsError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetLogGroupFieldsError::LimitExceeded(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLogGroupFieldsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetLogGroupFieldsError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLogGroupFieldsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLogGroupFieldsError {
fn description(&self) -> &str {
match *self {
GetLogGroupFieldsError::InvalidParameter(ref cause) => cause,
GetLogGroupFieldsError::LimitExceeded(ref cause) => cause,
GetLogGroupFieldsError::ResourceNotFound(ref cause) => cause,
GetLogGroupFieldsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetLogRecordError {
InvalidParameter(String),
LimitExceeded(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl GetLogRecordError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetLogRecordError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetLogRecordError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(GetLogRecordError::LimitExceeded(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetLogRecordError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetLogRecordError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetLogRecordError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetLogRecordError {
fn description(&self) -> &str {
match *self {
GetLogRecordError::InvalidParameter(ref cause) => cause,
GetLogRecordError::LimitExceeded(ref cause) => cause,
GetLogRecordError::ResourceNotFound(ref cause) => cause,
GetLogRecordError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetQueryResultsError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl GetQueryResultsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetQueryResultsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(GetQueryResultsError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(GetQueryResultsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(GetQueryResultsError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetQueryResultsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetQueryResultsError {
fn description(&self) -> &str {
match *self {
GetQueryResultsError::InvalidParameter(ref cause) => cause,
GetQueryResultsError::ResourceNotFound(ref cause) => cause,
GetQueryResultsError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsLogGroupError {
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl ListTagsLogGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsLogGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ResourceNotFoundException" => {
return RusotoError::Service(ListTagsLogGroupError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListTagsLogGroupError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsLogGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsLogGroupError {
fn description(&self) -> &str {
match *self {
ListTagsLogGroupError::ResourceNotFound(ref cause) => cause,
ListTagsLogGroupError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutDestinationError {
InvalidParameter(String),
OperationAborted(String),
ServiceUnavailable(String),
}
impl PutDestinationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDestinationError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutDestinationError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(PutDestinationError::OperationAborted(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutDestinationError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutDestinationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutDestinationError {
fn description(&self) -> &str {
match *self {
PutDestinationError::InvalidParameter(ref cause) => cause,
PutDestinationError::OperationAborted(ref cause) => cause,
PutDestinationError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutDestinationPolicyError {
InvalidParameter(String),
OperationAborted(String),
ServiceUnavailable(String),
}
impl PutDestinationPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutDestinationPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutDestinationPolicyError::InvalidParameter(
err.msg,
))
}
"OperationAbortedException" => {
return RusotoError::Service(PutDestinationPolicyError::OperationAborted(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutDestinationPolicyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutDestinationPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutDestinationPolicyError {
fn description(&self) -> &str {
match *self {
PutDestinationPolicyError::InvalidParameter(ref cause) => cause,
PutDestinationPolicyError::OperationAborted(ref cause) => cause,
PutDestinationPolicyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutLogEventsError {
DataAlreadyAccepted(String),
InvalidParameter(String),
InvalidSequenceToken(String),
ResourceNotFound(String),
ServiceUnavailable(String),
UnrecognizedClient(String),
}
impl PutLogEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutLogEventsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"DataAlreadyAcceptedException" => {
return RusotoError::Service(PutLogEventsError::DataAlreadyAccepted(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(PutLogEventsError::InvalidParameter(err.msg))
}
"InvalidSequenceTokenException" => {
return RusotoError::Service(PutLogEventsError::InvalidSequenceToken(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutLogEventsError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutLogEventsError::ServiceUnavailable(err.msg))
}
"UnrecognizedClientException" => {
return RusotoError::Service(PutLogEventsError::UnrecognizedClient(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutLogEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutLogEventsError {
fn description(&self) -> &str {
match *self {
PutLogEventsError::DataAlreadyAccepted(ref cause) => cause,
PutLogEventsError::InvalidParameter(ref cause) => cause,
PutLogEventsError::InvalidSequenceToken(ref cause) => cause,
PutLogEventsError::ResourceNotFound(ref cause) => cause,
PutLogEventsError::ServiceUnavailable(ref cause) => cause,
PutLogEventsError::UnrecognizedClient(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutMetricFilterError {
InvalidParameter(String),
LimitExceeded(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl PutMetricFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutMetricFilterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutMetricFilterError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(PutMetricFilterError::LimitExceeded(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(PutMetricFilterError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutMetricFilterError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutMetricFilterError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutMetricFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutMetricFilterError {
fn description(&self) -> &str {
match *self {
PutMetricFilterError::InvalidParameter(ref cause) => cause,
PutMetricFilterError::LimitExceeded(ref cause) => cause,
PutMetricFilterError::OperationAborted(ref cause) => cause,
PutMetricFilterError::ResourceNotFound(ref cause) => cause,
PutMetricFilterError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutResourcePolicyError {
InvalidParameter(String),
LimitExceeded(String),
ServiceUnavailable(String),
}
impl PutResourcePolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutResourcePolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutResourcePolicyError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(PutResourcePolicyError::LimitExceeded(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutResourcePolicyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutResourcePolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutResourcePolicyError {
fn description(&self) -> &str {
match *self {
PutResourcePolicyError::InvalidParameter(ref cause) => cause,
PutResourcePolicyError::LimitExceeded(ref cause) => cause,
PutResourcePolicyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutRetentionPolicyError {
InvalidParameter(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl PutRetentionPolicyError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutRetentionPolicyError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutRetentionPolicyError::InvalidParameter(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(PutRetentionPolicyError::OperationAborted(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutRetentionPolicyError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutRetentionPolicyError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutRetentionPolicyError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutRetentionPolicyError {
fn description(&self) -> &str {
match *self {
PutRetentionPolicyError::InvalidParameter(ref cause) => cause,
PutRetentionPolicyError::OperationAborted(ref cause) => cause,
PutRetentionPolicyError::ResourceNotFound(ref cause) => cause,
PutRetentionPolicyError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutSubscriptionFilterError {
InvalidParameter(String),
LimitExceeded(String),
OperationAborted(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl PutSubscriptionFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<PutSubscriptionFilterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(PutSubscriptionFilterError::InvalidParameter(
err.msg,
))
}
"LimitExceededException" => {
return RusotoError::Service(PutSubscriptionFilterError::LimitExceeded(err.msg))
}
"OperationAbortedException" => {
return RusotoError::Service(PutSubscriptionFilterError::OperationAborted(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(PutSubscriptionFilterError::ResourceNotFound(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(PutSubscriptionFilterError::ServiceUnavailable(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for PutSubscriptionFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutSubscriptionFilterError {
fn description(&self) -> &str {
match *self {
PutSubscriptionFilterError::InvalidParameter(ref cause) => cause,
PutSubscriptionFilterError::LimitExceeded(ref cause) => cause,
PutSubscriptionFilterError::OperationAborted(ref cause) => cause,
PutSubscriptionFilterError::ResourceNotFound(ref cause) => cause,
PutSubscriptionFilterError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartQueryError {
InvalidParameter(String),
LimitExceeded(String),
MalformedQuery(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl StartQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StartQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(StartQueryError::InvalidParameter(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(StartQueryError::LimitExceeded(err.msg))
}
"MalformedQueryException" => {
return RusotoError::Service(StartQueryError::MalformedQuery(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(StartQueryError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(StartQueryError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StartQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartQueryError {
fn description(&self) -> &str {
match *self {
StartQueryError::InvalidParameter(ref cause) => cause,
StartQueryError::LimitExceeded(ref cause) => cause,
StartQueryError::MalformedQuery(ref cause) => cause,
StartQueryError::ResourceNotFound(ref cause) => cause,
StartQueryError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopQueryError {
InvalidParameter(String),
ResourceNotFound(String),
ServiceUnavailable(String),
}
impl StopQueryError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<StopQueryError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(StopQueryError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(StopQueryError::ResourceNotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(StopQueryError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for StopQueryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopQueryError {
fn description(&self) -> &str {
match *self {
StopQueryError::InvalidParameter(ref cause) => cause,
StopQueryError::ResourceNotFound(ref cause) => cause,
StopQueryError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagLogGroupError {
InvalidParameter(String),
ResourceNotFound(String),
}
impl TagLogGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagLogGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(TagLogGroupError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(TagLogGroupError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagLogGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagLogGroupError {
fn description(&self) -> &str {
match *self {
TagLogGroupError::InvalidParameter(ref cause) => cause,
TagLogGroupError::ResourceNotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TestMetricFilterError {
InvalidParameter(String),
ServiceUnavailable(String),
}
impl TestMetricFilterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TestMetricFilterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterException" => {
return RusotoError::Service(TestMetricFilterError::InvalidParameter(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(TestMetricFilterError::ServiceUnavailable(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TestMetricFilterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TestMetricFilterError {
fn description(&self) -> &str {
match *self {
TestMetricFilterError::InvalidParameter(ref cause) => cause,
TestMetricFilterError::ServiceUnavailable(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagLogGroupError {
ResourceNotFound(String),
}
impl UntagLogGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagLogGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ResourceNotFoundException" => {
return RusotoError::Service(UntagLogGroupError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagLogGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagLogGroupError {
fn description(&self) -> &str {
match *self {
UntagLogGroupError::ResourceNotFound(ref cause) => cause,
}
}
}
pub trait CloudWatchLogs {
fn associate_kms_key(
&self,
input: AssociateKmsKeyRequest,
) -> RusotoFuture<(), AssociateKmsKeyError>;
fn cancel_export_task(
&self,
input: CancelExportTaskRequest,
) -> RusotoFuture<(), CancelExportTaskError>;
fn create_export_task(
&self,
input: CreateExportTaskRequest,
) -> RusotoFuture<CreateExportTaskResponse, CreateExportTaskError>;
fn create_log_group(
&self,
input: CreateLogGroupRequest,
) -> RusotoFuture<(), CreateLogGroupError>;
fn create_log_stream(
&self,
input: CreateLogStreamRequest,
) -> RusotoFuture<(), CreateLogStreamError>;
fn delete_destination(
&self,
input: DeleteDestinationRequest,
) -> RusotoFuture<(), DeleteDestinationError>;
fn delete_log_group(
&self,
input: DeleteLogGroupRequest,
) -> RusotoFuture<(), DeleteLogGroupError>;
fn delete_log_stream(
&self,
input: DeleteLogStreamRequest,
) -> RusotoFuture<(), DeleteLogStreamError>;
fn delete_metric_filter(
&self,
input: DeleteMetricFilterRequest,
) -> RusotoFuture<(), DeleteMetricFilterError>;
fn delete_resource_policy(
&self,
input: DeleteResourcePolicyRequest,
) -> RusotoFuture<(), DeleteResourcePolicyError>;
fn delete_retention_policy(
&self,
input: DeleteRetentionPolicyRequest,
) -> RusotoFuture<(), DeleteRetentionPolicyError>;
fn delete_subscription_filter(
&self,
input: DeleteSubscriptionFilterRequest,
) -> RusotoFuture<(), DeleteSubscriptionFilterError>;
fn describe_destinations(
&self,
input: DescribeDestinationsRequest,
) -> RusotoFuture<DescribeDestinationsResponse, DescribeDestinationsError>;
fn describe_export_tasks(
&self,
input: DescribeExportTasksRequest,
) -> RusotoFuture<DescribeExportTasksResponse, DescribeExportTasksError>;
fn describe_log_groups(
&self,
input: DescribeLogGroupsRequest,
) -> RusotoFuture<DescribeLogGroupsResponse, DescribeLogGroupsError>;
fn describe_log_streams(
&self,
input: DescribeLogStreamsRequest,
) -> RusotoFuture<DescribeLogStreamsResponse, DescribeLogStreamsError>;
fn describe_metric_filters(
&self,
input: DescribeMetricFiltersRequest,
) -> RusotoFuture<DescribeMetricFiltersResponse, DescribeMetricFiltersError>;
fn describe_queries(
&self,
input: DescribeQueriesRequest,
) -> RusotoFuture<DescribeQueriesResponse, DescribeQueriesError>;
fn describe_resource_policies(
&self,
input: DescribeResourcePoliciesRequest,
) -> RusotoFuture<DescribeResourcePoliciesResponse, DescribeResourcePoliciesError>;
fn describe_subscription_filters(
&self,
input: DescribeSubscriptionFiltersRequest,
) -> RusotoFuture<DescribeSubscriptionFiltersResponse, DescribeSubscriptionFiltersError>;
fn disassociate_kms_key(
&self,
input: DisassociateKmsKeyRequest,
) -> RusotoFuture<(), DisassociateKmsKeyError>;
fn filter_log_events(
&self,
input: FilterLogEventsRequest,
) -> RusotoFuture<FilterLogEventsResponse, FilterLogEventsError>;
fn get_log_events(
&self,
input: GetLogEventsRequest,
) -> RusotoFuture<GetLogEventsResponse, GetLogEventsError>;
fn get_log_group_fields(
&self,
input: GetLogGroupFieldsRequest,
) -> RusotoFuture<GetLogGroupFieldsResponse, GetLogGroupFieldsError>;
fn get_log_record(
&self,
input: GetLogRecordRequest,
) -> RusotoFuture<GetLogRecordResponse, GetLogRecordError>;
fn get_query_results(
&self,
input: GetQueryResultsRequest,
) -> RusotoFuture<GetQueryResultsResponse, GetQueryResultsError>;
fn list_tags_log_group(
&self,
input: ListTagsLogGroupRequest,
) -> RusotoFuture<ListTagsLogGroupResponse, ListTagsLogGroupError>;
fn put_destination(
&self,
input: PutDestinationRequest,
) -> RusotoFuture<PutDestinationResponse, PutDestinationError>;
fn put_destination_policy(
&self,
input: PutDestinationPolicyRequest,
) -> RusotoFuture<(), PutDestinationPolicyError>;
fn put_log_events(
&self,
input: PutLogEventsRequest,
) -> RusotoFuture<PutLogEventsResponse, PutLogEventsError>;
fn put_metric_filter(
&self,
input: PutMetricFilterRequest,
) -> RusotoFuture<(), PutMetricFilterError>;
fn put_resource_policy(
&self,
input: PutResourcePolicyRequest,
) -> RusotoFuture<PutResourcePolicyResponse, PutResourcePolicyError>;
fn put_retention_policy(
&self,
input: PutRetentionPolicyRequest,
) -> RusotoFuture<(), PutRetentionPolicyError>;
fn put_subscription_filter(
&self,
input: PutSubscriptionFilterRequest,
) -> RusotoFuture<(), PutSubscriptionFilterError>;
fn start_query(
&self,
input: StartQueryRequest,
) -> RusotoFuture<StartQueryResponse, StartQueryError>;
fn stop_query(
&self,
input: StopQueryRequest,
) -> RusotoFuture<StopQueryResponse, StopQueryError>;
fn tag_log_group(&self, input: TagLogGroupRequest) -> RusotoFuture<(), TagLogGroupError>;
fn test_metric_filter(
&self,
input: TestMetricFilterRequest,
) -> RusotoFuture<TestMetricFilterResponse, TestMetricFilterError>;
fn untag_log_group(&self, input: UntagLogGroupRequest) -> RusotoFuture<(), UntagLogGroupError>;
}
#[derive(Clone)]
pub struct CloudWatchLogsClient {
client: Client,
region: region::Region,
}
impl CloudWatchLogsClient {
pub fn new(region: region::Region) -> CloudWatchLogsClient {
CloudWatchLogsClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> CloudWatchLogsClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
CloudWatchLogsClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl CloudWatchLogs for CloudWatchLogsClient {
fn associate_kms_key(
&self,
input: AssociateKmsKeyRequest,
) -> RusotoFuture<(), AssociateKmsKeyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.AssociateKmsKey");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(AssociateKmsKeyError::from_response(response))),
)
}
})
}
fn cancel_export_task(
&self,
input: CancelExportTaskRequest,
) -> RusotoFuture<(), CancelExportTaskError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.CancelExportTask");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CancelExportTaskError::from_response(response))),
)
}
})
}
fn create_export_task(
&self,
input: CreateExportTaskRequest,
) -> RusotoFuture<CreateExportTaskResponse, CreateExportTaskError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.CreateExportTask");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateExportTaskResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateExportTaskError::from_response(response))),
)
}
})
}
fn create_log_group(
&self,
input: CreateLogGroupRequest,
) -> RusotoFuture<(), CreateLogGroupError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.CreateLogGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateLogGroupError::from_response(response))),
)
}
})
}
fn create_log_stream(
&self,
input: CreateLogStreamRequest,
) -> RusotoFuture<(), CreateLogStreamError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.CreateLogStream");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateLogStreamError::from_response(response))),
)
}
})
}
fn delete_destination(
&self,
input: DeleteDestinationRequest,
) -> RusotoFuture<(), DeleteDestinationError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteDestination");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteDestinationError::from_response(response))),
)
}
})
}
fn delete_log_group(
&self,
input: DeleteLogGroupRequest,
) -> RusotoFuture<(), DeleteLogGroupError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteLogGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteLogGroupError::from_response(response))),
)
}
})
}
fn delete_log_stream(
&self,
input: DeleteLogStreamRequest,
) -> RusotoFuture<(), DeleteLogStreamError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteLogStream");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteLogStreamError::from_response(response))),
)
}
})
}
fn delete_metric_filter(
&self,
input: DeleteMetricFilterRequest,
) -> RusotoFuture<(), DeleteMetricFilterError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteMetricFilter");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteMetricFilterError::from_response(response))),
)
}
})
}
fn delete_resource_policy(
&self,
input: DeleteResourcePolicyRequest,
) -> RusotoFuture<(), DeleteResourcePolicyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteResourcePolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteResourcePolicyError::from_response(response))
}),
)
}
})
}
fn delete_retention_policy(
&self,
input: DeleteRetentionPolicyRequest,
) -> RusotoFuture<(), DeleteRetentionPolicyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteRetentionPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteRetentionPolicyError::from_response(response))
}),
)
}
})
}
fn delete_subscription_filter(
&self,
input: DeleteSubscriptionFilterRequest,
) -> RusotoFuture<(), DeleteSubscriptionFilterError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DeleteSubscriptionFilter");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteSubscriptionFilterError::from_response(response))
}))
}
})
}
fn describe_destinations(
&self,
input: DescribeDestinationsRequest,
) -> RusotoFuture<DescribeDestinationsResponse, DescribeDestinationsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeDestinations");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDestinationsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeDestinationsError::from_response(response))
}),
)
}
})
}
fn describe_export_tasks(
&self,
input: DescribeExportTasksRequest,
) -> RusotoFuture<DescribeExportTasksResponse, DescribeExportTasksError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeExportTasks");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeExportTasksResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeExportTasksError::from_response(response))
}),
)
}
})
}
fn describe_log_groups(
&self,
input: DescribeLogGroupsRequest,
) -> RusotoFuture<DescribeLogGroupsResponse, DescribeLogGroupsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeLogGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeLogGroupsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeLogGroupsError::from_response(response))),
)
}
})
}
fn describe_log_streams(
&self,
input: DescribeLogStreamsRequest,
) -> RusotoFuture<DescribeLogStreamsResponse, DescribeLogStreamsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeLogStreams");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeLogStreamsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeLogStreamsError::from_response(response))),
)
}
})
}
fn describe_metric_filters(
&self,
input: DescribeMetricFiltersRequest,
) -> RusotoFuture<DescribeMetricFiltersResponse, DescribeMetricFiltersError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeMetricFilters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeMetricFiltersResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeMetricFiltersError::from_response(response))
}),
)
}
})
}
fn describe_queries(
&self,
input: DescribeQueriesRequest,
) -> RusotoFuture<DescribeQueriesResponse, DescribeQueriesError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeQueries");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeQueriesResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeQueriesError::from_response(response))),
)
}
})
}
fn describe_resource_policies(
&self,
input: DescribeResourcePoliciesRequest,
) -> RusotoFuture<DescribeResourcePoliciesResponse, DescribeResourcePoliciesError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeResourcePolicies");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeResourcePoliciesResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeResourcePoliciesError::from_response(response))
}))
}
})
}
fn describe_subscription_filters(
&self,
input: DescribeSubscriptionFiltersRequest,
) -> RusotoFuture<DescribeSubscriptionFiltersResponse, DescribeSubscriptionFiltersError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DescribeSubscriptionFilters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSubscriptionFiltersResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeSubscriptionFiltersError::from_response(response))
}))
}
})
}
fn disassociate_kms_key(
&self,
input: DisassociateKmsKeyRequest,
) -> RusotoFuture<(), DisassociateKmsKeyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.DisassociateKmsKey");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DisassociateKmsKeyError::from_response(response))),
)
}
})
}
fn filter_log_events(
&self,
input: FilterLogEventsRequest,
) -> RusotoFuture<FilterLogEventsResponse, FilterLogEventsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.FilterLogEvents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<FilterLogEventsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(FilterLogEventsError::from_response(response))),
)
}
})
}
fn get_log_events(
&self,
input: GetLogEventsRequest,
) -> RusotoFuture<GetLogEventsResponse, GetLogEventsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.GetLogEvents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLogEventsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLogEventsError::from_response(response))),
)
}
})
}
fn get_log_group_fields(
&self,
input: GetLogGroupFieldsRequest,
) -> RusotoFuture<GetLogGroupFieldsResponse, GetLogGroupFieldsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.GetLogGroupFields");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLogGroupFieldsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLogGroupFieldsError::from_response(response))),
)
}
})
}
fn get_log_record(
&self,
input: GetLogRecordRequest,
) -> RusotoFuture<GetLogRecordResponse, GetLogRecordError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.GetLogRecord");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetLogRecordResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetLogRecordError::from_response(response))),
)
}
})
}
fn get_query_results(
&self,
input: GetQueryResultsRequest,
) -> RusotoFuture<GetQueryResultsResponse, GetQueryResultsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.GetQueryResults");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<GetQueryResultsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(GetQueryResultsError::from_response(response))),
)
}
})
}
fn list_tags_log_group(
&self,
input: ListTagsLogGroupRequest,
) -> RusotoFuture<ListTagsLogGroupResponse, ListTagsLogGroupError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.ListTagsLogGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsLogGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsLogGroupError::from_response(response))),
)
}
})
}
fn put_destination(
&self,
input: PutDestinationRequest,
) -> RusotoFuture<PutDestinationResponse, PutDestinationError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutDestination");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutDestinationResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutDestinationError::from_response(response))),
)
}
})
}
fn put_destination_policy(
&self,
input: PutDestinationPolicyRequest,
) -> RusotoFuture<(), PutDestinationPolicyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutDestinationPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutDestinationPolicyError::from_response(response))
}),
)
}
})
}
fn put_log_events(
&self,
input: PutLogEventsRequest,
) -> RusotoFuture<PutLogEventsResponse, PutLogEventsError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutLogEvents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutLogEventsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutLogEventsError::from_response(response))),
)
}
})
}
fn put_metric_filter(
&self,
input: PutMetricFilterRequest,
) -> RusotoFuture<(), PutMetricFilterError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutMetricFilter");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutMetricFilterError::from_response(response))),
)
}
})
}
fn put_resource_policy(
&self,
input: PutResourcePolicyRequest,
) -> RusotoFuture<PutResourcePolicyResponse, PutResourcePolicyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutResourcePolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<PutResourcePolicyResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutResourcePolicyError::from_response(response))),
)
}
})
}
fn put_retention_policy(
&self,
input: PutRetentionPolicyRequest,
) -> RusotoFuture<(), PutRetentionPolicyError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutRetentionPolicy");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutRetentionPolicyError::from_response(response))),
)
}
})
}
fn put_subscription_filter(
&self,
input: PutSubscriptionFilterRequest,
) -> RusotoFuture<(), PutSubscriptionFilterError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.PutSubscriptionFilter");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(PutSubscriptionFilterError::from_response(response))
}),
)
}
})
}
fn start_query(
&self,
input: StartQueryRequest,
) -> RusotoFuture<StartQueryResponse, StartQueryError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.StartQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StartQueryResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StartQueryError::from_response(response))),
)
}
})
}
fn stop_query(
&self,
input: StopQueryRequest,
) -> RusotoFuture<StopQueryResponse, StopQueryError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.StopQuery");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<StopQueryResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(StopQueryError::from_response(response))),
)
}
})
}
fn tag_log_group(&self, input: TagLogGroupRequest) -> RusotoFuture<(), TagLogGroupError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.TagLogGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagLogGroupError::from_response(response))),
)
}
})
}
fn test_metric_filter(
&self,
input: TestMetricFilterRequest,
) -> RusotoFuture<TestMetricFilterResponse, TestMetricFilterError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.TestMetricFilter");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TestMetricFilterResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TestMetricFilterError::from_response(response))),
)
}
})
}
fn untag_log_group(&self, input: UntagLogGroupRequest) -> RusotoFuture<(), UntagLogGroupError> {
let mut request = SignedRequest::new("POST", "logs", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "Logs_20140328.UntagLogGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(future::ok(::std::mem::drop(response)))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagLogGroupError::from_response(response))),
)
}
})
}
}