use std::error::Error;
use std::fmt;
use std::io;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoFuture};
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use rusoto_core::request::HttpDispatchError;
use rusoto_core::signature::SignedRequest;
use serde_json;
use serde_json::from_slice;
use serde_json::Value as SerdeJsonValue;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AccountAggregationSource {
#[serde(rename = "AccountIds")]
pub account_ids: Vec<String>,
#[serde(rename = "AllAwsRegions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub all_aws_regions: Option<bool>,
#[serde(rename = "AwsRegions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_regions: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AggregateComplianceByConfigRule {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "AwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "Compliance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance: Option<Compliance>,
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AggregateComplianceCount {
#[serde(rename = "ComplianceSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_summary: Option<ComplianceSummary>,
#[serde(rename = "GroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AggregateEvaluationResult {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "Annotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub annotation: Option<String>,
#[serde(rename = "AwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "ComplianceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_type: Option<String>,
#[serde(rename = "ConfigRuleInvokedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_invoked_time: Option<f64>,
#[serde(rename = "EvaluationResultIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_result_identifier: Option<EvaluationResultIdentifier>,
#[serde(rename = "ResultRecordedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_recorded_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AggregateResourceIdentifier {
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "ResourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "ResourceType")]
pub resource_type: String,
#[serde(rename = "SourceAccountId")]
pub source_account_id: String,
#[serde(rename = "SourceRegion")]
pub source_region: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AggregatedSourceStatus {
#[serde(rename = "AwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "LastErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_code: Option<String>,
#[serde(rename = "LastErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_message: Option<String>,
#[serde(rename = "LastUpdateStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_update_status: Option<String>,
#[serde(rename = "LastUpdateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_update_time: Option<f64>,
#[serde(rename = "SourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_id: Option<String>,
#[serde(rename = "SourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AggregationAuthorization {
#[serde(rename = "AggregationAuthorizationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregation_authorization_arn: Option<String>,
#[serde(rename = "AuthorizedAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorized_account_id: Option<String>,
#[serde(rename = "AuthorizedAwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub authorized_aws_region: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BaseConfigurationItem {
#[serde(rename = "accountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "awsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<String>,
#[serde(rename = "configurationItemCaptureTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item_capture_time: Option<f64>,
#[serde(rename = "configurationItemStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item_status: Option<String>,
#[serde(rename = "configurationStateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_state_id: Option<String>,
#[serde(rename = "resourceCreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_creation_time: Option<f64>,
#[serde(rename = "resourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "supplementaryConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supplementary_configuration: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchGetAggregateResourceConfigRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "ResourceIdentifiers")]
pub resource_identifiers: Vec<AggregateResourceIdentifier>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchGetAggregateResourceConfigResponse {
#[serde(rename = "BaseConfigurationItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub base_configuration_items: Option<Vec<BaseConfigurationItem>>,
#[serde(rename = "UnprocessedResourceIdentifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_resource_identifiers: Option<Vec<AggregateResourceIdentifier>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct BatchGetResourceConfigRequest {
#[serde(rename = "resourceKeys")]
pub resource_keys: Vec<ResourceKey>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BatchGetResourceConfigResponse {
#[serde(rename = "baseConfigurationItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub base_configuration_items: Option<Vec<BaseConfigurationItem>>,
#[serde(rename = "unprocessedResourceKeys")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unprocessed_resource_keys: Option<Vec<ResourceKey>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Compliance {
#[serde(rename = "ComplianceContributorCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_contributor_count: Option<ComplianceContributorCount>,
#[serde(rename = "ComplianceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ComplianceByConfigRule {
#[serde(rename = "Compliance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance: Option<Compliance>,
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ComplianceByResource {
#[serde(rename = "Compliance")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance: Option<Compliance>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ComplianceContributorCount {
#[serde(rename = "CapExceeded")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cap_exceeded: Option<bool>,
#[serde(rename = "CappedCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub capped_count: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ComplianceSummary {
#[serde(rename = "ComplianceSummaryTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_summary_timestamp: Option<f64>,
#[serde(rename = "CompliantResourceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliant_resource_count: Option<ComplianceContributorCount>,
#[serde(rename = "NonCompliantResourceCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub non_compliant_resource_count: Option<ComplianceContributorCount>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ComplianceSummaryByResourceType {
#[serde(rename = "ComplianceSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_summary: Option<ComplianceSummary>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigExportDeliveryInfo {
#[serde(rename = "lastAttemptTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_attempt_time: Option<f64>,
#[serde(rename = "lastErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_code: Option<String>,
#[serde(rename = "lastErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_message: Option<String>,
#[serde(rename = "lastStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_status: Option<String>,
#[serde(rename = "lastSuccessfulTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_successful_time: Option<f64>,
#[serde(rename = "nextDeliveryTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_delivery_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigRule {
#[serde(rename = "ConfigRuleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_arn: Option<String>,
#[serde(rename = "ConfigRuleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_id: Option<String>,
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
#[serde(rename = "ConfigRuleState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_state: Option<String>,
#[serde(rename = "CreatedBy")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_by: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "InputParameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub input_parameters: Option<String>,
#[serde(rename = "MaximumExecutionFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_execution_frequency: Option<String>,
#[serde(rename = "Scope")]
#[serde(skip_serializing_if = "Option::is_none")]
pub scope: Option<Scope>,
#[serde(rename = "Source")]
pub source: Source,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ConfigRuleComplianceFilters {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "AwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "ComplianceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_type: Option<String>,
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ConfigRuleComplianceSummaryFilters {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "AwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigRuleEvaluationStatus {
#[serde(rename = "ConfigRuleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_arn: Option<String>,
#[serde(rename = "ConfigRuleId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_id: Option<String>,
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
#[serde(rename = "FirstActivatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub first_activated_time: Option<f64>,
#[serde(rename = "FirstEvaluationStarted")]
#[serde(skip_serializing_if = "Option::is_none")]
pub first_evaluation_started: Option<bool>,
#[serde(rename = "LastErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_code: Option<String>,
#[serde(rename = "LastErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_message: Option<String>,
#[serde(rename = "LastFailedEvaluationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_failed_evaluation_time: Option<f64>,
#[serde(rename = "LastFailedInvocationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_failed_invocation_time: Option<f64>,
#[serde(rename = "LastSuccessfulEvaluationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_successful_evaluation_time: Option<f64>,
#[serde(rename = "LastSuccessfulInvocationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_successful_invocation_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigSnapshotDeliveryProperties {
#[serde(rename = "deliveryFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_frequency: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigStreamDeliveryInfo {
#[serde(rename = "lastErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_code: Option<String>,
#[serde(rename = "lastErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_message: Option<String>,
#[serde(rename = "lastStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_status: Option<String>,
#[serde(rename = "lastStatusChangeTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_status_change_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigurationAggregator {
#[serde(rename = "AccountAggregationSources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_aggregation_sources: Option<Vec<AccountAggregationSource>>,
#[serde(rename = "ConfigurationAggregatorArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_aggregator_arn: Option<String>,
#[serde(rename = "ConfigurationAggregatorName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_aggregator_name: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "LastUpdatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_updated_time: Option<f64>,
#[serde(rename = "OrganizationAggregationSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_aggregation_source: Option<OrganizationAggregationSource>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigurationItem {
#[serde(rename = "accountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "availabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "awsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_region: Option<String>,
#[serde(rename = "configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<String>,
#[serde(rename = "configurationItemCaptureTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item_capture_time: Option<f64>,
#[serde(rename = "configurationItemMD5Hash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item_md5_hash: Option<String>,
#[serde(rename = "configurationItemStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item_status: Option<String>,
#[serde(rename = "configurationStateId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_state_id: Option<String>,
#[serde(rename = "relatedEvents")]
#[serde(skip_serializing_if = "Option::is_none")]
pub related_events: Option<Vec<String>>,
#[serde(rename = "relationships")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relationships: Option<Vec<Relationship>>,
#[serde(rename = "resourceCreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_creation_time: Option<f64>,
#[serde(rename = "resourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
#[serde(rename = "supplementaryConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supplementary_configuration: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "version")]
#[serde(skip_serializing_if = "Option::is_none")]
pub version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigurationRecorder {
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "recordingGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recording_group: Option<RecordingGroup>,
#[serde(rename = "roleARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigurationRecorderStatus {
#[serde(rename = "lastErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_code: Option<String>,
#[serde(rename = "lastErrorMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_error_message: Option<String>,
#[serde(rename = "lastStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_start_time: Option<f64>,
#[serde(rename = "lastStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_status: Option<String>,
#[serde(rename = "lastStatusChangeTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_status_change_time: Option<f64>,
#[serde(rename = "lastStopTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_stop_time: Option<f64>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "recording")]
#[serde(skip_serializing_if = "Option::is_none")]
pub recording: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteAggregationAuthorizationRequest {
#[serde(rename = "AuthorizedAccountId")]
pub authorized_account_id: String,
#[serde(rename = "AuthorizedAwsRegion")]
pub authorized_aws_region: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteConfigRuleRequest {
#[serde(rename = "ConfigRuleName")]
pub config_rule_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteConfigurationAggregatorRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteConfigurationRecorderRequest {
#[serde(rename = "ConfigurationRecorderName")]
pub configuration_recorder_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteDeliveryChannelRequest {
#[serde(rename = "DeliveryChannelName")]
pub delivery_channel_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteEvaluationResultsRequest {
#[serde(rename = "ConfigRuleName")]
pub config_rule_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteEvaluationResultsResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeletePendingAggregationRequestRequest {
#[serde(rename = "RequesterAccountId")]
pub requester_account_id: String,
#[serde(rename = "RequesterAwsRegion")]
pub requester_aws_region: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteRetentionConfigurationRequest {
#[serde(rename = "RetentionConfigurationName")]
pub retention_configuration_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeliverConfigSnapshotRequest {
#[serde(rename = "deliveryChannelName")]
pub delivery_channel_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeliverConfigSnapshotResponse {
#[serde(rename = "configSnapshotId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_snapshot_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct DeliveryChannel {
#[serde(rename = "configSnapshotDeliveryProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_snapshot_delivery_properties: Option<ConfigSnapshotDeliveryProperties>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "s3BucketName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s_3_bucket_name: Option<String>,
#[serde(rename = "s3KeyPrefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub s_3_key_prefix: Option<String>,
#[serde(rename = "snsTopicARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sns_topic_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeliveryChannelStatus {
#[serde(rename = "configHistoryDeliveryInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_history_delivery_info: Option<ConfigExportDeliveryInfo>,
#[serde(rename = "configSnapshotDeliveryInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_snapshot_delivery_info: Option<ConfigExportDeliveryInfo>,
#[serde(rename = "configStreamDeliveryInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_stream_delivery_info: Option<ConfigStreamDeliveryInfo>,
#[serde(rename = "name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAggregateComplianceByConfigRulesRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<ConfigRuleComplianceFilters>,
#[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 DescribeAggregateComplianceByConfigRulesResponse {
#[serde(rename = "AggregateComplianceByConfigRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregate_compliance_by_config_rules: Option<Vec<AggregateComplianceByConfigRule>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeAggregationAuthorizationsRequest {
#[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 DescribeAggregationAuthorizationsResponse {
#[serde(rename = "AggregationAuthorizations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregation_authorizations: Option<Vec<AggregationAuthorization>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeComplianceByConfigRuleRequest {
#[serde(rename = "ComplianceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_types: Option<Vec<String>>,
#[serde(rename = "ConfigRuleNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_names: Option<Vec<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 DescribeComplianceByConfigRuleResponse {
#[serde(rename = "ComplianceByConfigRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_by_config_rules: Option<Vec<ComplianceByConfigRule>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeComplianceByResourceRequest {
#[serde(rename = "ComplianceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_types: Option<Vec<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>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeComplianceByResourceResponse {
#[serde(rename = "ComplianceByResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_by_resources: Option<Vec<ComplianceByResource>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigRuleEvaluationStatusRequest {
#[serde(rename = "ConfigRuleNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_names: Option<Vec<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 DescribeConfigRuleEvaluationStatusResponse {
#[serde(rename = "ConfigRulesEvaluationStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rules_evaluation_status: Option<Vec<ConfigRuleEvaluationStatus>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigRulesRequest {
#[serde(rename = "ConfigRuleNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_names: Option<Vec<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 DescribeConfigRulesResponse {
#[serde(rename = "ConfigRules")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rules: Option<Vec<ConfigRule>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationAggregatorSourcesStatusRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: 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>,
#[serde(rename = "UpdateStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub update_status: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationAggregatorSourcesStatusResponse {
#[serde(rename = "AggregatedSourceStatusList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregated_source_status_list: Option<Vec<AggregatedSourceStatus>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationAggregatorsRequest {
#[serde(rename = "ConfigurationAggregatorNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_aggregator_names: Option<Vec<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 DescribeConfigurationAggregatorsResponse {
#[serde(rename = "ConfigurationAggregators")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_aggregators: Option<Vec<ConfigurationAggregator>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationRecorderStatusRequest {
#[serde(rename = "ConfigurationRecorderNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_recorder_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationRecorderStatusResponse {
#[serde(rename = "ConfigurationRecordersStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_recorders_status: Option<Vec<ConfigurationRecorderStatus>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationRecordersRequest {
#[serde(rename = "ConfigurationRecorderNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_recorder_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationRecordersResponse {
#[serde(rename = "ConfigurationRecorders")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_recorders: Option<Vec<ConfigurationRecorder>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDeliveryChannelStatusRequest {
#[serde(rename = "DeliveryChannelNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_channel_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDeliveryChannelStatusResponse {
#[serde(rename = "DeliveryChannelsStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_channels_status: Option<Vec<DeliveryChannelStatus>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDeliveryChannelsRequest {
#[serde(rename = "DeliveryChannelNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_channel_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDeliveryChannelsResponse {
#[serde(rename = "DeliveryChannels")]
#[serde(skip_serializing_if = "Option::is_none")]
pub delivery_channels: Option<Vec<DeliveryChannel>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribePendingAggregationRequestsRequest {
#[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 DescribePendingAggregationRequestsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "PendingAggregationRequests")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_aggregation_requests: Option<Vec<PendingAggregationRequest>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeRetentionConfigurationsRequest {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "RetentionConfigurationNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retention_configuration_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeRetentionConfigurationsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "RetentionConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retention_configurations: Option<Vec<RetentionConfiguration>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Evaluation {
#[serde(rename = "Annotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub annotation: Option<String>,
#[serde(rename = "ComplianceResourceId")]
pub compliance_resource_id: String,
#[serde(rename = "ComplianceResourceType")]
pub compliance_resource_type: String,
#[serde(rename = "ComplianceType")]
pub compliance_type: String,
#[serde(rename = "OrderingTimestamp")]
pub ordering_timestamp: f64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EvaluationResult {
#[serde(rename = "Annotation")]
#[serde(skip_serializing_if = "Option::is_none")]
pub annotation: Option<String>,
#[serde(rename = "ComplianceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_type: Option<String>,
#[serde(rename = "ConfigRuleInvokedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_invoked_time: Option<f64>,
#[serde(rename = "EvaluationResultIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_result_identifier: Option<EvaluationResultIdentifier>,
#[serde(rename = "ResultRecordedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_recorded_time: Option<f64>,
#[serde(rename = "ResultToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub result_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EvaluationResultIdentifier {
#[serde(rename = "EvaluationResultQualifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_result_qualifier: Option<EvaluationResultQualifier>,
#[serde(rename = "OrderingTimestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ordering_timestamp: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EvaluationResultQualifier {
#[serde(rename = "ConfigRuleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_name: Option<String>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAggregateComplianceDetailsByConfigRuleRequest {
#[serde(rename = "AccountId")]
pub account_id: String,
#[serde(rename = "AwsRegion")]
pub aws_region: String,
#[serde(rename = "ComplianceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_type: Option<String>,
#[serde(rename = "ConfigRuleName")]
pub config_rule_name: String,
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: 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 GetAggregateComplianceDetailsByConfigRuleResponse {
#[serde(rename = "AggregateEvaluationResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregate_evaluation_results: Option<Vec<AggregateEvaluationResult>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAggregateConfigRuleComplianceSummaryRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<ConfigRuleComplianceSummaryFilters>,
#[serde(rename = "GroupByKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by_key: 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 GetAggregateConfigRuleComplianceSummaryResponse {
#[serde(rename = "AggregateComplianceCounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregate_compliance_counts: Option<Vec<AggregateComplianceCount>>,
#[serde(rename = "GroupByKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by_key: Option<String>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAggregateDiscoveredResourceCountsRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<ResourceCountFilters>,
#[serde(rename = "GroupByKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by_key: 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 GetAggregateDiscoveredResourceCountsResponse {
#[serde(rename = "GroupByKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub group_by_key: Option<String>,
#[serde(rename = "GroupedResourceCounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub grouped_resource_counts: Option<Vec<GroupedResourceCount>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "TotalDiscoveredResources")]
pub total_discovered_resources: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetAggregateResourceConfigRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "ResourceIdentifier")]
pub resource_identifier: AggregateResourceIdentifier,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetAggregateResourceConfigResponse {
#[serde(rename = "ConfigurationItem")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_item: Option<ConfigurationItem>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetComplianceDetailsByConfigRuleRequest {
#[serde(rename = "ComplianceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_types: Option<Vec<String>>,
#[serde(rename = "ConfigRuleName")]
pub config_rule_name: 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 GetComplianceDetailsByConfigRuleResponse {
#[serde(rename = "EvaluationResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_results: Option<Vec<EvaluationResult>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetComplianceDetailsByResourceRequest {
#[serde(rename = "ComplianceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_types: Option<Vec<String>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceId")]
pub resource_id: String,
#[serde(rename = "ResourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetComplianceDetailsByResourceResponse {
#[serde(rename = "EvaluationResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluation_results: Option<Vec<EvaluationResult>>,
#[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 GetComplianceSummaryByConfigRuleResponse {
#[serde(rename = "ComplianceSummary")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_summary: Option<ComplianceSummary>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetComplianceSummaryByResourceTypeRequest {
#[serde(rename = "ResourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_types: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetComplianceSummaryByResourceTypeResponse {
#[serde(rename = "ComplianceSummariesByResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_summaries_by_resource_type: Option<Vec<ComplianceSummaryByResourceType>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetDiscoveredResourceCountsRequest {
#[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 = "resourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_types: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetDiscoveredResourceCountsResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resourceCounts")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_counts: Option<Vec<ResourceCount>>,
#[serde(rename = "totalDiscoveredResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_discovered_resources: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetResourceConfigHistoryRequest {
#[serde(rename = "chronologicalOrder")]
#[serde(skip_serializing_if = "Option::is_none")]
pub chronological_order: Option<String>,
#[serde(rename = "earlierTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub earlier_time: Option<f64>,
#[serde(rename = "laterTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub later_time: Option<f64>,
#[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 = "resourceId")]
pub resource_id: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetResourceConfigHistoryResponse {
#[serde(rename = "configurationItems")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_items: Option<Vec<ConfigurationItem>>,
#[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 GroupedResourceCount {
#[serde(rename = "GroupName")]
pub group_name: String,
#[serde(rename = "ResourceCount")]
pub resource_count: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListAggregateDiscoveredResourcesRequest {
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "Filters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub filters: Option<ResourceFilters>,
#[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 = "ResourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListAggregateDiscoveredResourcesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceIdentifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_identifiers: Option<Vec<AggregateResourceIdentifier>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListDiscoveredResourcesRequest {
#[serde(rename = "includeDeletedResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_deleted_resources: Option<bool>,
#[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 = "resourceIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_ids: Option<Vec<String>>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListDiscoveredResourcesResponse {
#[serde(rename = "nextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "resourceIdentifiers")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_identifiers: Option<Vec<ResourceIdentifier>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct OrganizationAggregationSource {
#[serde(rename = "AllAwsRegions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub all_aws_regions: Option<bool>,
#[serde(rename = "AwsRegions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aws_regions: Option<Vec<String>>,
#[serde(rename = "RoleArn")]
pub role_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PendingAggregationRequest {
#[serde(rename = "RequesterAccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_account_id: Option<String>,
#[serde(rename = "RequesterAwsRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub requester_aws_region: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutAggregationAuthorizationRequest {
#[serde(rename = "AuthorizedAccountId")]
pub authorized_account_id: String,
#[serde(rename = "AuthorizedAwsRegion")]
pub authorized_aws_region: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutAggregationAuthorizationResponse {
#[serde(rename = "AggregationAuthorization")]
#[serde(skip_serializing_if = "Option::is_none")]
pub aggregation_authorization: Option<AggregationAuthorization>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutConfigRuleRequest {
#[serde(rename = "ConfigRule")]
pub config_rule: ConfigRule,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutConfigurationAggregatorRequest {
#[serde(rename = "AccountAggregationSources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_aggregation_sources: Option<Vec<AccountAggregationSource>>,
#[serde(rename = "ConfigurationAggregatorName")]
pub configuration_aggregator_name: String,
#[serde(rename = "OrganizationAggregationSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub organization_aggregation_source: Option<OrganizationAggregationSource>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutConfigurationAggregatorResponse {
#[serde(rename = "ConfigurationAggregator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_aggregator: Option<ConfigurationAggregator>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutConfigurationRecorderRequest {
#[serde(rename = "ConfigurationRecorder")]
pub configuration_recorder: ConfigurationRecorder,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutDeliveryChannelRequest {
#[serde(rename = "DeliveryChannel")]
pub delivery_channel: DeliveryChannel,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutEvaluationsRequest {
#[serde(rename = "Evaluations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub evaluations: Option<Vec<Evaluation>>,
#[serde(rename = "ResultToken")]
pub result_token: String,
#[serde(rename = "TestMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub test_mode: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutEvaluationsResponse {
#[serde(rename = "FailedEvaluations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub failed_evaluations: Option<Vec<Evaluation>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct PutRetentionConfigurationRequest {
#[serde(rename = "RetentionPeriodInDays")]
pub retention_period_in_days: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PutRetentionConfigurationResponse {
#[serde(rename = "RetentionConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub retention_configuration: Option<RetentionConfiguration>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct RecordingGroup {
#[serde(rename = "allSupported")]
#[serde(skip_serializing_if = "Option::is_none")]
pub all_supported: Option<bool>,
#[serde(rename = "includeGlobalResourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub include_global_resource_types: Option<bool>,
#[serde(rename = "resourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_types: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Relationship {
#[serde(rename = "relationshipName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub relationship_name: Option<String>,
#[serde(rename = "resourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceCount {
#[serde(rename = "count")]
#[serde(skip_serializing_if = "Option::is_none")]
pub count: Option<i64>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ResourceCountFilters {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "ResourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ResourceFilters {
#[serde(rename = "AccountId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<String>,
#[serde(rename = "Region")]
#[serde(skip_serializing_if = "Option::is_none")]
pub region: Option<String>,
#[serde(rename = "ResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "ResourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ResourceIdentifier {
#[serde(rename = "resourceDeletionTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_deletion_time: Option<f64>,
#[serde(rename = "resourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_id: Option<String>,
#[serde(rename = "resourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_name: Option<String>,
#[serde(rename = "resourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ResourceKey {
#[serde(rename = "resourceId")]
pub resource_id: String,
#[serde(rename = "resourceType")]
pub resource_type: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RetentionConfiguration {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "RetentionPeriodInDays")]
pub retention_period_in_days: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Scope {
#[serde(rename = "ComplianceResourceId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_resource_id: Option<String>,
#[serde(rename = "ComplianceResourceTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub compliance_resource_types: Option<Vec<String>>,
#[serde(rename = "TagKey")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_key: Option<String>,
#[serde(rename = "TagValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tag_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Source {
#[serde(rename = "Owner")]
pub owner: String,
#[serde(rename = "SourceDetails")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_details: Option<Vec<SourceDetail>>,
#[serde(rename = "SourceIdentifier")]
pub source_identifier: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SourceDetail {
#[serde(rename = "EventSource")]
#[serde(skip_serializing_if = "Option::is_none")]
pub event_source: Option<String>,
#[serde(rename = "MaximumExecutionFrequency")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maximum_execution_frequency: Option<String>,
#[serde(rename = "MessageType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartConfigRulesEvaluationRequest {
#[serde(rename = "ConfigRuleNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub config_rule_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct StartConfigRulesEvaluationResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StartConfigurationRecorderRequest {
#[serde(rename = "ConfigurationRecorderName")]
pub configuration_recorder_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct StopConfigurationRecorderRequest {
#[serde(rename = "ConfigurationRecorderName")]
pub configuration_recorder_name: String,
}
#[derive(Debug, PartialEq)]
pub enum BatchGetAggregateResourceConfigError {
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl BatchGetAggregateResourceConfigError {
pub fn from_response(res: BufferedHttpResponse) -> BatchGetAggregateResourceConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationAggregatorException" => {
return BatchGetAggregateResourceConfigError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"ValidationException" => {
return BatchGetAggregateResourceConfigError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return BatchGetAggregateResourceConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for BatchGetAggregateResourceConfigError {
fn from(err: serde_json::error::Error) -> BatchGetAggregateResourceConfigError {
BatchGetAggregateResourceConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for BatchGetAggregateResourceConfigError {
fn from(err: CredentialsError) -> BatchGetAggregateResourceConfigError {
BatchGetAggregateResourceConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for BatchGetAggregateResourceConfigError {
fn from(err: HttpDispatchError) -> BatchGetAggregateResourceConfigError {
BatchGetAggregateResourceConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for BatchGetAggregateResourceConfigError {
fn from(err: io::Error) -> BatchGetAggregateResourceConfigError {
BatchGetAggregateResourceConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for BatchGetAggregateResourceConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchGetAggregateResourceConfigError {
fn description(&self) -> &str {
match *self {
BatchGetAggregateResourceConfigError::NoSuchConfigurationAggregator(ref cause) => cause,
BatchGetAggregateResourceConfigError::Validation(ref cause) => cause,
BatchGetAggregateResourceConfigError::Credentials(ref err) => err.description(),
BatchGetAggregateResourceConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
BatchGetAggregateResourceConfigError::ParseError(ref cause) => cause,
BatchGetAggregateResourceConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum BatchGetResourceConfigError {
NoAvailableConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl BatchGetResourceConfigError {
pub fn from_response(res: BufferedHttpResponse) -> BatchGetResourceConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoAvailableConfigurationRecorderException" => {
return BatchGetResourceConfigError::NoAvailableConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return BatchGetResourceConfigError::Validation(error_message.to_string());
}
_ => {}
}
}
return BatchGetResourceConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for BatchGetResourceConfigError {
fn from(err: serde_json::error::Error) -> BatchGetResourceConfigError {
BatchGetResourceConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for BatchGetResourceConfigError {
fn from(err: CredentialsError) -> BatchGetResourceConfigError {
BatchGetResourceConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for BatchGetResourceConfigError {
fn from(err: HttpDispatchError) -> BatchGetResourceConfigError {
BatchGetResourceConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for BatchGetResourceConfigError {
fn from(err: io::Error) -> BatchGetResourceConfigError {
BatchGetResourceConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for BatchGetResourceConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for BatchGetResourceConfigError {
fn description(&self) -> &str {
match *self {
BatchGetResourceConfigError::NoAvailableConfigurationRecorder(ref cause) => cause,
BatchGetResourceConfigError::Validation(ref cause) => cause,
BatchGetResourceConfigError::Credentials(ref err) => err.description(),
BatchGetResourceConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
BatchGetResourceConfigError::ParseError(ref cause) => cause,
BatchGetResourceConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteAggregationAuthorizationError {
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteAggregationAuthorizationError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteAggregationAuthorizationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return DeleteAggregationAuthorizationError::InvalidParameterValue(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteAggregationAuthorizationError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DeleteAggregationAuthorizationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteAggregationAuthorizationError {
fn from(err: serde_json::error::Error) -> DeleteAggregationAuthorizationError {
DeleteAggregationAuthorizationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteAggregationAuthorizationError {
fn from(err: CredentialsError) -> DeleteAggregationAuthorizationError {
DeleteAggregationAuthorizationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteAggregationAuthorizationError {
fn from(err: HttpDispatchError) -> DeleteAggregationAuthorizationError {
DeleteAggregationAuthorizationError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteAggregationAuthorizationError {
fn from(err: io::Error) -> DeleteAggregationAuthorizationError {
DeleteAggregationAuthorizationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteAggregationAuthorizationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteAggregationAuthorizationError {
fn description(&self) -> &str {
match *self {
DeleteAggregationAuthorizationError::InvalidParameterValue(ref cause) => cause,
DeleteAggregationAuthorizationError::Validation(ref cause) => cause,
DeleteAggregationAuthorizationError::Credentials(ref err) => err.description(),
DeleteAggregationAuthorizationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteAggregationAuthorizationError::ParseError(ref cause) => cause,
DeleteAggregationAuthorizationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteConfigRuleError {
NoSuchConfigRule(String),
ResourceInUse(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteConfigRuleError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigRuleException" => {
return DeleteConfigRuleError::NoSuchConfigRule(String::from(error_message));
}
"ResourceInUseException" => {
return DeleteConfigRuleError::ResourceInUse(String::from(error_message));
}
"ValidationException" => {
return DeleteConfigRuleError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteConfigRuleError {
fn from(err: serde_json::error::Error) -> DeleteConfigRuleError {
DeleteConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteConfigRuleError {
fn from(err: CredentialsError) -> DeleteConfigRuleError {
DeleteConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteConfigRuleError {
fn from(err: HttpDispatchError) -> DeleteConfigRuleError {
DeleteConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteConfigRuleError {
fn from(err: io::Error) -> DeleteConfigRuleError {
DeleteConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteConfigRuleError {
fn description(&self) -> &str {
match *self {
DeleteConfigRuleError::NoSuchConfigRule(ref cause) => cause,
DeleteConfigRuleError::ResourceInUse(ref cause) => cause,
DeleteConfigRuleError::Validation(ref cause) => cause,
DeleteConfigRuleError::Credentials(ref err) => err.description(),
DeleteConfigRuleError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteConfigRuleError::ParseError(ref cause) => cause,
DeleteConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteConfigurationAggregatorError {
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteConfigurationAggregatorError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteConfigurationAggregatorError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationAggregatorException" => {
return DeleteConfigurationAggregatorError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"ValidationException" => {
return DeleteConfigurationAggregatorError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteConfigurationAggregatorError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteConfigurationAggregatorError {
fn from(err: serde_json::error::Error) -> DeleteConfigurationAggregatorError {
DeleteConfigurationAggregatorError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteConfigurationAggregatorError {
fn from(err: CredentialsError) -> DeleteConfigurationAggregatorError {
DeleteConfigurationAggregatorError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteConfigurationAggregatorError {
fn from(err: HttpDispatchError) -> DeleteConfigurationAggregatorError {
DeleteConfigurationAggregatorError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteConfigurationAggregatorError {
fn from(err: io::Error) -> DeleteConfigurationAggregatorError {
DeleteConfigurationAggregatorError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteConfigurationAggregatorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteConfigurationAggregatorError {
fn description(&self) -> &str {
match *self {
DeleteConfigurationAggregatorError::NoSuchConfigurationAggregator(ref cause) => cause,
DeleteConfigurationAggregatorError::Validation(ref cause) => cause,
DeleteConfigurationAggregatorError::Credentials(ref err) => err.description(),
DeleteConfigurationAggregatorError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteConfigurationAggregatorError::ParseError(ref cause) => cause,
DeleteConfigurationAggregatorError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteConfigurationRecorderError {
NoSuchConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteConfigurationRecorderError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteConfigurationRecorderError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationRecorderException" => {
return DeleteConfigurationRecorderError::NoSuchConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return DeleteConfigurationRecorderError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteConfigurationRecorderError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteConfigurationRecorderError {
fn from(err: serde_json::error::Error) -> DeleteConfigurationRecorderError {
DeleteConfigurationRecorderError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteConfigurationRecorderError {
fn from(err: CredentialsError) -> DeleteConfigurationRecorderError {
DeleteConfigurationRecorderError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteConfigurationRecorderError {
fn from(err: HttpDispatchError) -> DeleteConfigurationRecorderError {
DeleteConfigurationRecorderError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteConfigurationRecorderError {
fn from(err: io::Error) -> DeleteConfigurationRecorderError {
DeleteConfigurationRecorderError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteConfigurationRecorderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteConfigurationRecorderError {
fn description(&self) -> &str {
match *self {
DeleteConfigurationRecorderError::NoSuchConfigurationRecorder(ref cause) => cause,
DeleteConfigurationRecorderError::Validation(ref cause) => cause,
DeleteConfigurationRecorderError::Credentials(ref err) => err.description(),
DeleteConfigurationRecorderError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteConfigurationRecorderError::ParseError(ref cause) => cause,
DeleteConfigurationRecorderError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteDeliveryChannelError {
LastDeliveryChannelDeleteFailed(String),
NoSuchDeliveryChannel(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteDeliveryChannelError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteDeliveryChannelError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"LastDeliveryChannelDeleteFailedException" => {
return DeleteDeliveryChannelError::LastDeliveryChannelDeleteFailed(
String::from(error_message),
);
}
"NoSuchDeliveryChannelException" => {
return DeleteDeliveryChannelError::NoSuchDeliveryChannel(String::from(
error_message,
));
}
"ValidationException" => {
return DeleteDeliveryChannelError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteDeliveryChannelError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteDeliveryChannelError {
fn from(err: serde_json::error::Error) -> DeleteDeliveryChannelError {
DeleteDeliveryChannelError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteDeliveryChannelError {
fn from(err: CredentialsError) -> DeleteDeliveryChannelError {
DeleteDeliveryChannelError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteDeliveryChannelError {
fn from(err: HttpDispatchError) -> DeleteDeliveryChannelError {
DeleteDeliveryChannelError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteDeliveryChannelError {
fn from(err: io::Error) -> DeleteDeliveryChannelError {
DeleteDeliveryChannelError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteDeliveryChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteDeliveryChannelError {
fn description(&self) -> &str {
match *self {
DeleteDeliveryChannelError::LastDeliveryChannelDeleteFailed(ref cause) => cause,
DeleteDeliveryChannelError::NoSuchDeliveryChannel(ref cause) => cause,
DeleteDeliveryChannelError::Validation(ref cause) => cause,
DeleteDeliveryChannelError::Credentials(ref err) => err.description(),
DeleteDeliveryChannelError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteDeliveryChannelError::ParseError(ref cause) => cause,
DeleteDeliveryChannelError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteEvaluationResultsError {
NoSuchConfigRule(String),
ResourceInUse(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteEvaluationResultsError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteEvaluationResultsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigRuleException" => {
return DeleteEvaluationResultsError::NoSuchConfigRule(String::from(
error_message,
));
}
"ResourceInUseException" => {
return DeleteEvaluationResultsError::ResourceInUse(String::from(error_message));
}
"ValidationException" => {
return DeleteEvaluationResultsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteEvaluationResultsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteEvaluationResultsError {
fn from(err: serde_json::error::Error) -> DeleteEvaluationResultsError {
DeleteEvaluationResultsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteEvaluationResultsError {
fn from(err: CredentialsError) -> DeleteEvaluationResultsError {
DeleteEvaluationResultsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteEvaluationResultsError {
fn from(err: HttpDispatchError) -> DeleteEvaluationResultsError {
DeleteEvaluationResultsError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteEvaluationResultsError {
fn from(err: io::Error) -> DeleteEvaluationResultsError {
DeleteEvaluationResultsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteEvaluationResultsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteEvaluationResultsError {
fn description(&self) -> &str {
match *self {
DeleteEvaluationResultsError::NoSuchConfigRule(ref cause) => cause,
DeleteEvaluationResultsError::ResourceInUse(ref cause) => cause,
DeleteEvaluationResultsError::Validation(ref cause) => cause,
DeleteEvaluationResultsError::Credentials(ref err) => err.description(),
DeleteEvaluationResultsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteEvaluationResultsError::ParseError(ref cause) => cause,
DeleteEvaluationResultsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeletePendingAggregationRequestError {
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeletePendingAggregationRequestError {
pub fn from_response(res: BufferedHttpResponse) -> DeletePendingAggregationRequestError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return DeletePendingAggregationRequestError::InvalidParameterValue(
String::from(error_message),
);
}
"ValidationException" => {
return DeletePendingAggregationRequestError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DeletePendingAggregationRequestError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeletePendingAggregationRequestError {
fn from(err: serde_json::error::Error) -> DeletePendingAggregationRequestError {
DeletePendingAggregationRequestError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeletePendingAggregationRequestError {
fn from(err: CredentialsError) -> DeletePendingAggregationRequestError {
DeletePendingAggregationRequestError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeletePendingAggregationRequestError {
fn from(err: HttpDispatchError) -> DeletePendingAggregationRequestError {
DeletePendingAggregationRequestError::HttpDispatch(err)
}
}
impl From<io::Error> for DeletePendingAggregationRequestError {
fn from(err: io::Error) -> DeletePendingAggregationRequestError {
DeletePendingAggregationRequestError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeletePendingAggregationRequestError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeletePendingAggregationRequestError {
fn description(&self) -> &str {
match *self {
DeletePendingAggregationRequestError::InvalidParameterValue(ref cause) => cause,
DeletePendingAggregationRequestError::Validation(ref cause) => cause,
DeletePendingAggregationRequestError::Credentials(ref err) => err.description(),
DeletePendingAggregationRequestError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeletePendingAggregationRequestError::ParseError(ref cause) => cause,
DeletePendingAggregationRequestError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteRetentionConfigurationError {
InvalidParameterValue(String),
NoSuchRetentionConfiguration(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteRetentionConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteRetentionConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return DeleteRetentionConfigurationError::InvalidParameterValue(String::from(
error_message,
));
}
"NoSuchRetentionConfigurationException" => {
return DeleteRetentionConfigurationError::NoSuchRetentionConfiguration(
String::from(error_message),
);
}
"ValidationException" => {
return DeleteRetentionConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteRetentionConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteRetentionConfigurationError {
fn from(err: serde_json::error::Error) -> DeleteRetentionConfigurationError {
DeleteRetentionConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteRetentionConfigurationError {
fn from(err: CredentialsError) -> DeleteRetentionConfigurationError {
DeleteRetentionConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteRetentionConfigurationError {
fn from(err: HttpDispatchError) -> DeleteRetentionConfigurationError {
DeleteRetentionConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteRetentionConfigurationError {
fn from(err: io::Error) -> DeleteRetentionConfigurationError {
DeleteRetentionConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteRetentionConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteRetentionConfigurationError {
fn description(&self) -> &str {
match *self {
DeleteRetentionConfigurationError::InvalidParameterValue(ref cause) => cause,
DeleteRetentionConfigurationError::NoSuchRetentionConfiguration(ref cause) => cause,
DeleteRetentionConfigurationError::Validation(ref cause) => cause,
DeleteRetentionConfigurationError::Credentials(ref err) => err.description(),
DeleteRetentionConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeleteRetentionConfigurationError::ParseError(ref cause) => cause,
DeleteRetentionConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeliverConfigSnapshotError {
NoAvailableConfigurationRecorder(String),
NoRunningConfigurationRecorder(String),
NoSuchDeliveryChannel(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeliverConfigSnapshotError {
pub fn from_response(res: BufferedHttpResponse) -> DeliverConfigSnapshotError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoAvailableConfigurationRecorderException" => {
return DeliverConfigSnapshotError::NoAvailableConfigurationRecorder(
String::from(error_message),
);
}
"NoRunningConfigurationRecorderException" => {
return DeliverConfigSnapshotError::NoRunningConfigurationRecorder(String::from(
error_message,
));
}
"NoSuchDeliveryChannelException" => {
return DeliverConfigSnapshotError::NoSuchDeliveryChannel(String::from(
error_message,
));
}
"ValidationException" => {
return DeliverConfigSnapshotError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeliverConfigSnapshotError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeliverConfigSnapshotError {
fn from(err: serde_json::error::Error) -> DeliverConfigSnapshotError {
DeliverConfigSnapshotError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeliverConfigSnapshotError {
fn from(err: CredentialsError) -> DeliverConfigSnapshotError {
DeliverConfigSnapshotError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeliverConfigSnapshotError {
fn from(err: HttpDispatchError) -> DeliverConfigSnapshotError {
DeliverConfigSnapshotError::HttpDispatch(err)
}
}
impl From<io::Error> for DeliverConfigSnapshotError {
fn from(err: io::Error) -> DeliverConfigSnapshotError {
DeliverConfigSnapshotError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeliverConfigSnapshotError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeliverConfigSnapshotError {
fn description(&self) -> &str {
match *self {
DeliverConfigSnapshotError::NoAvailableConfigurationRecorder(ref cause) => cause,
DeliverConfigSnapshotError::NoRunningConfigurationRecorder(ref cause) => cause,
DeliverConfigSnapshotError::NoSuchDeliveryChannel(ref cause) => cause,
DeliverConfigSnapshotError::Validation(ref cause) => cause,
DeliverConfigSnapshotError::Credentials(ref err) => err.description(),
DeliverConfigSnapshotError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DeliverConfigSnapshotError::ParseError(ref cause) => cause,
DeliverConfigSnapshotError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAggregateComplianceByConfigRulesError {
InvalidLimit(String),
InvalidNextToken(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeAggregateComplianceByConfigRulesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> DescribeAggregateComplianceByConfigRulesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => return DescribeAggregateComplianceByConfigRulesError::InvalidLimit(String::from(error_message)),
"InvalidNextTokenException" => return DescribeAggregateComplianceByConfigRulesError::InvalidNextToken(String::from(error_message)),
"NoSuchConfigurationAggregatorException" => return DescribeAggregateComplianceByConfigRulesError::NoSuchConfigurationAggregator(String::from(error_message)),
"ValidationException" => return DescribeAggregateComplianceByConfigRulesError::Validation(error_message.to_string()),
_ => {}
}
}
return DescribeAggregateComplianceByConfigRulesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeAggregateComplianceByConfigRulesError {
fn from(err: serde_json::error::Error) -> DescribeAggregateComplianceByConfigRulesError {
DescribeAggregateComplianceByConfigRulesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeAggregateComplianceByConfigRulesError {
fn from(err: CredentialsError) -> DescribeAggregateComplianceByConfigRulesError {
DescribeAggregateComplianceByConfigRulesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeAggregateComplianceByConfigRulesError {
fn from(err: HttpDispatchError) -> DescribeAggregateComplianceByConfigRulesError {
DescribeAggregateComplianceByConfigRulesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeAggregateComplianceByConfigRulesError {
fn from(err: io::Error) -> DescribeAggregateComplianceByConfigRulesError {
DescribeAggregateComplianceByConfigRulesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeAggregateComplianceByConfigRulesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAggregateComplianceByConfigRulesError {
fn description(&self) -> &str {
match *self {
DescribeAggregateComplianceByConfigRulesError::InvalidLimit(ref cause) => cause,
DescribeAggregateComplianceByConfigRulesError::InvalidNextToken(ref cause) => cause,
DescribeAggregateComplianceByConfigRulesError::NoSuchConfigurationAggregator(
ref cause,
) => cause,
DescribeAggregateComplianceByConfigRulesError::Validation(ref cause) => cause,
DescribeAggregateComplianceByConfigRulesError::Credentials(ref err) => {
err.description()
}
DescribeAggregateComplianceByConfigRulesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeAggregateComplianceByConfigRulesError::ParseError(ref cause) => cause,
DescribeAggregateComplianceByConfigRulesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeAggregationAuthorizationsError {
InvalidLimit(String),
InvalidNextToken(String),
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeAggregationAuthorizationsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeAggregationAuthorizationsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return DescribeAggregationAuthorizationsError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return DescribeAggregationAuthorizationsError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeAggregationAuthorizationsError::InvalidParameterValue(
String::from(error_message),
);
}
"ValidationException" => {
return DescribeAggregationAuthorizationsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeAggregationAuthorizationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeAggregationAuthorizationsError {
fn from(err: serde_json::error::Error) -> DescribeAggregationAuthorizationsError {
DescribeAggregationAuthorizationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeAggregationAuthorizationsError {
fn from(err: CredentialsError) -> DescribeAggregationAuthorizationsError {
DescribeAggregationAuthorizationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeAggregationAuthorizationsError {
fn from(err: HttpDispatchError) -> DescribeAggregationAuthorizationsError {
DescribeAggregationAuthorizationsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeAggregationAuthorizationsError {
fn from(err: io::Error) -> DescribeAggregationAuthorizationsError {
DescribeAggregationAuthorizationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeAggregationAuthorizationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeAggregationAuthorizationsError {
fn description(&self) -> &str {
match *self {
DescribeAggregationAuthorizationsError::InvalidLimit(ref cause) => cause,
DescribeAggregationAuthorizationsError::InvalidNextToken(ref cause) => cause,
DescribeAggregationAuthorizationsError::InvalidParameterValue(ref cause) => cause,
DescribeAggregationAuthorizationsError::Validation(ref cause) => cause,
DescribeAggregationAuthorizationsError::Credentials(ref err) => err.description(),
DescribeAggregationAuthorizationsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeAggregationAuthorizationsError::ParseError(ref cause) => cause,
DescribeAggregationAuthorizationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeComplianceByConfigRuleError {
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchConfigRule(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeComplianceByConfigRuleError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeComplianceByConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return DescribeComplianceByConfigRuleError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeComplianceByConfigRuleError::InvalidParameterValue(String::from(
error_message,
));
}
"NoSuchConfigRuleException" => {
return DescribeComplianceByConfigRuleError::NoSuchConfigRule(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeComplianceByConfigRuleError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeComplianceByConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeComplianceByConfigRuleError {
fn from(err: serde_json::error::Error) -> DescribeComplianceByConfigRuleError {
DescribeComplianceByConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeComplianceByConfigRuleError {
fn from(err: CredentialsError) -> DescribeComplianceByConfigRuleError {
DescribeComplianceByConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeComplianceByConfigRuleError {
fn from(err: HttpDispatchError) -> DescribeComplianceByConfigRuleError {
DescribeComplianceByConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeComplianceByConfigRuleError {
fn from(err: io::Error) -> DescribeComplianceByConfigRuleError {
DescribeComplianceByConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeComplianceByConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeComplianceByConfigRuleError {
fn description(&self) -> &str {
match *self {
DescribeComplianceByConfigRuleError::InvalidNextToken(ref cause) => cause,
DescribeComplianceByConfigRuleError::InvalidParameterValue(ref cause) => cause,
DescribeComplianceByConfigRuleError::NoSuchConfigRule(ref cause) => cause,
DescribeComplianceByConfigRuleError::Validation(ref cause) => cause,
DescribeComplianceByConfigRuleError::Credentials(ref err) => err.description(),
DescribeComplianceByConfigRuleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeComplianceByConfigRuleError::ParseError(ref cause) => cause,
DescribeComplianceByConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeComplianceByResourceError {
InvalidNextToken(String),
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeComplianceByResourceError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeComplianceByResourceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return DescribeComplianceByResourceError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeComplianceByResourceError::InvalidParameterValue(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeComplianceByResourceError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeComplianceByResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeComplianceByResourceError {
fn from(err: serde_json::error::Error) -> DescribeComplianceByResourceError {
DescribeComplianceByResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeComplianceByResourceError {
fn from(err: CredentialsError) -> DescribeComplianceByResourceError {
DescribeComplianceByResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeComplianceByResourceError {
fn from(err: HttpDispatchError) -> DescribeComplianceByResourceError {
DescribeComplianceByResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeComplianceByResourceError {
fn from(err: io::Error) -> DescribeComplianceByResourceError {
DescribeComplianceByResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeComplianceByResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeComplianceByResourceError {
fn description(&self) -> &str {
match *self {
DescribeComplianceByResourceError::InvalidNextToken(ref cause) => cause,
DescribeComplianceByResourceError::InvalidParameterValue(ref cause) => cause,
DescribeComplianceByResourceError::Validation(ref cause) => cause,
DescribeComplianceByResourceError::Credentials(ref err) => err.description(),
DescribeComplianceByResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeComplianceByResourceError::ParseError(ref cause) => cause,
DescribeComplianceByResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigRuleEvaluationStatusError {
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchConfigRule(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigRuleEvaluationStatusError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigRuleEvaluationStatusError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return DescribeConfigRuleEvaluationStatusError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeConfigRuleEvaluationStatusError::InvalidParameterValue(
String::from(error_message),
);
}
"NoSuchConfigRuleException" => {
return DescribeConfigRuleEvaluationStatusError::NoSuchConfigRule(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeConfigRuleEvaluationStatusError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeConfigRuleEvaluationStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigRuleEvaluationStatusError {
fn from(err: serde_json::error::Error) -> DescribeConfigRuleEvaluationStatusError {
DescribeConfigRuleEvaluationStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigRuleEvaluationStatusError {
fn from(err: CredentialsError) -> DescribeConfigRuleEvaluationStatusError {
DescribeConfigRuleEvaluationStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigRuleEvaluationStatusError {
fn from(err: HttpDispatchError) -> DescribeConfigRuleEvaluationStatusError {
DescribeConfigRuleEvaluationStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigRuleEvaluationStatusError {
fn from(err: io::Error) -> DescribeConfigRuleEvaluationStatusError {
DescribeConfigRuleEvaluationStatusError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigRuleEvaluationStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigRuleEvaluationStatusError {
fn description(&self) -> &str {
match *self {
DescribeConfigRuleEvaluationStatusError::InvalidNextToken(ref cause) => cause,
DescribeConfigRuleEvaluationStatusError::InvalidParameterValue(ref cause) => cause,
DescribeConfigRuleEvaluationStatusError::NoSuchConfigRule(ref cause) => cause,
DescribeConfigRuleEvaluationStatusError::Validation(ref cause) => cause,
DescribeConfigRuleEvaluationStatusError::Credentials(ref err) => err.description(),
DescribeConfigRuleEvaluationStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigRuleEvaluationStatusError::ParseError(ref cause) => cause,
DescribeConfigRuleEvaluationStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigRulesError {
InvalidNextToken(String),
NoSuchConfigRule(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigRulesError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigRulesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return DescribeConfigRulesError::InvalidNextToken(String::from(error_message));
}
"NoSuchConfigRuleException" => {
return DescribeConfigRulesError::NoSuchConfigRule(String::from(error_message));
}
"ValidationException" => {
return DescribeConfigRulesError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeConfigRulesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigRulesError {
fn from(err: serde_json::error::Error) -> DescribeConfigRulesError {
DescribeConfigRulesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigRulesError {
fn from(err: CredentialsError) -> DescribeConfigRulesError {
DescribeConfigRulesError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigRulesError {
fn from(err: HttpDispatchError) -> DescribeConfigRulesError {
DescribeConfigRulesError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigRulesError {
fn from(err: io::Error) -> DescribeConfigRulesError {
DescribeConfigRulesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigRulesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigRulesError {
fn description(&self) -> &str {
match *self {
DescribeConfigRulesError::InvalidNextToken(ref cause) => cause,
DescribeConfigRulesError::NoSuchConfigRule(ref cause) => cause,
DescribeConfigRulesError::Validation(ref cause) => cause,
DescribeConfigRulesError::Credentials(ref err) => err.description(),
DescribeConfigRulesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigRulesError::ParseError(ref cause) => cause,
DescribeConfigRulesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationAggregatorSourcesStatusError {
InvalidLimit(String),
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationAggregatorSourcesStatusError {
pub fn from_response(
res: BufferedHttpResponse,
) -> DescribeConfigurationAggregatorSourcesStatusError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => return DescribeConfigurationAggregatorSourcesStatusError::InvalidLimit(String::from(error_message)),
"InvalidNextTokenException" => return DescribeConfigurationAggregatorSourcesStatusError::InvalidNextToken(String::from(error_message)),
"InvalidParameterValueException" => return DescribeConfigurationAggregatorSourcesStatusError::InvalidParameterValue(String::from(error_message)),
"NoSuchConfigurationAggregatorException" => return DescribeConfigurationAggregatorSourcesStatusError::NoSuchConfigurationAggregator(String::from(error_message)),
"ValidationException" => return DescribeConfigurationAggregatorSourcesStatusError::Validation(error_message.to_string()),
_ => {}
}
}
return DescribeConfigurationAggregatorSourcesStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationAggregatorSourcesStatusError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationAggregatorSourcesStatusError {
DescribeConfigurationAggregatorSourcesStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationAggregatorSourcesStatusError {
fn from(err: CredentialsError) -> DescribeConfigurationAggregatorSourcesStatusError {
DescribeConfigurationAggregatorSourcesStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationAggregatorSourcesStatusError {
fn from(err: HttpDispatchError) -> DescribeConfigurationAggregatorSourcesStatusError {
DescribeConfigurationAggregatorSourcesStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationAggregatorSourcesStatusError {
fn from(err: io::Error) -> DescribeConfigurationAggregatorSourcesStatusError {
DescribeConfigurationAggregatorSourcesStatusError::HttpDispatch(HttpDispatchError::from(
err,
))
}
}
impl fmt::Display for DescribeConfigurationAggregatorSourcesStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationAggregatorSourcesStatusError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationAggregatorSourcesStatusError::InvalidLimit(ref cause) => cause,
DescribeConfigurationAggregatorSourcesStatusError::InvalidNextToken(ref cause) => cause,
DescribeConfigurationAggregatorSourcesStatusError::InvalidParameterValue(ref cause) => {
cause
}
DescribeConfigurationAggregatorSourcesStatusError::NoSuchConfigurationAggregator(
ref cause,
) => cause,
DescribeConfigurationAggregatorSourcesStatusError::Validation(ref cause) => cause,
DescribeConfigurationAggregatorSourcesStatusError::Credentials(ref err) => {
err.description()
}
DescribeConfigurationAggregatorSourcesStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationAggregatorSourcesStatusError::ParseError(ref cause) => cause,
DescribeConfigurationAggregatorSourcesStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationAggregatorsError {
InvalidLimit(String),
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationAggregatorsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigurationAggregatorsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return DescribeConfigurationAggregatorsError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return DescribeConfigurationAggregatorsError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeConfigurationAggregatorsError::InvalidParameterValue(
String::from(error_message),
);
}
"NoSuchConfigurationAggregatorException" => {
return DescribeConfigurationAggregatorsError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"ValidationException" => {
return DescribeConfigurationAggregatorsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeConfigurationAggregatorsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationAggregatorsError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationAggregatorsError {
DescribeConfigurationAggregatorsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationAggregatorsError {
fn from(err: CredentialsError) -> DescribeConfigurationAggregatorsError {
DescribeConfigurationAggregatorsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationAggregatorsError {
fn from(err: HttpDispatchError) -> DescribeConfigurationAggregatorsError {
DescribeConfigurationAggregatorsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationAggregatorsError {
fn from(err: io::Error) -> DescribeConfigurationAggregatorsError {
DescribeConfigurationAggregatorsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigurationAggregatorsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationAggregatorsError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationAggregatorsError::InvalidLimit(ref cause) => cause,
DescribeConfigurationAggregatorsError::InvalidNextToken(ref cause) => cause,
DescribeConfigurationAggregatorsError::InvalidParameterValue(ref cause) => cause,
DescribeConfigurationAggregatorsError::NoSuchConfigurationAggregator(ref cause) => {
cause
}
DescribeConfigurationAggregatorsError::Validation(ref cause) => cause,
DescribeConfigurationAggregatorsError::Credentials(ref err) => err.description(),
DescribeConfigurationAggregatorsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationAggregatorsError::ParseError(ref cause) => cause,
DescribeConfigurationAggregatorsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationRecorderStatusError {
NoSuchConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationRecorderStatusError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigurationRecorderStatusError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationRecorderException" => {
return DescribeConfigurationRecorderStatusError::NoSuchConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return DescribeConfigurationRecorderStatusError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeConfigurationRecorderStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationRecorderStatusError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationRecorderStatusError {
DescribeConfigurationRecorderStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationRecorderStatusError {
fn from(err: CredentialsError) -> DescribeConfigurationRecorderStatusError {
DescribeConfigurationRecorderStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationRecorderStatusError {
fn from(err: HttpDispatchError) -> DescribeConfigurationRecorderStatusError {
DescribeConfigurationRecorderStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationRecorderStatusError {
fn from(err: io::Error) -> DescribeConfigurationRecorderStatusError {
DescribeConfigurationRecorderStatusError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigurationRecorderStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationRecorderStatusError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationRecorderStatusError::NoSuchConfigurationRecorder(ref cause) => {
cause
}
DescribeConfigurationRecorderStatusError::Validation(ref cause) => cause,
DescribeConfigurationRecorderStatusError::Credentials(ref err) => err.description(),
DescribeConfigurationRecorderStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationRecorderStatusError::ParseError(ref cause) => cause,
DescribeConfigurationRecorderStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationRecordersError {
NoSuchConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationRecordersError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigurationRecordersError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationRecorderException" => {
return DescribeConfigurationRecordersError::NoSuchConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return DescribeConfigurationRecordersError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeConfigurationRecordersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationRecordersError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationRecordersError {
DescribeConfigurationRecordersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationRecordersError {
fn from(err: CredentialsError) -> DescribeConfigurationRecordersError {
DescribeConfigurationRecordersError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationRecordersError {
fn from(err: HttpDispatchError) -> DescribeConfigurationRecordersError {
DescribeConfigurationRecordersError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationRecordersError {
fn from(err: io::Error) -> DescribeConfigurationRecordersError {
DescribeConfigurationRecordersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigurationRecordersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationRecordersError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationRecordersError::NoSuchConfigurationRecorder(ref cause) => cause,
DescribeConfigurationRecordersError::Validation(ref cause) => cause,
DescribeConfigurationRecordersError::Credentials(ref err) => err.description(),
DescribeConfigurationRecordersError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationRecordersError::ParseError(ref cause) => cause,
DescribeConfigurationRecordersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDeliveryChannelStatusError {
NoSuchDeliveryChannel(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeDeliveryChannelStatusError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeDeliveryChannelStatusError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchDeliveryChannelException" => {
return DescribeDeliveryChannelStatusError::NoSuchDeliveryChannel(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeDeliveryChannelStatusError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeDeliveryChannelStatusError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeDeliveryChannelStatusError {
fn from(err: serde_json::error::Error) -> DescribeDeliveryChannelStatusError {
DescribeDeliveryChannelStatusError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeDeliveryChannelStatusError {
fn from(err: CredentialsError) -> DescribeDeliveryChannelStatusError {
DescribeDeliveryChannelStatusError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeDeliveryChannelStatusError {
fn from(err: HttpDispatchError) -> DescribeDeliveryChannelStatusError {
DescribeDeliveryChannelStatusError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeDeliveryChannelStatusError {
fn from(err: io::Error) -> DescribeDeliveryChannelStatusError {
DescribeDeliveryChannelStatusError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeDeliveryChannelStatusError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDeliveryChannelStatusError {
fn description(&self) -> &str {
match *self {
DescribeDeliveryChannelStatusError::NoSuchDeliveryChannel(ref cause) => cause,
DescribeDeliveryChannelStatusError::Validation(ref cause) => cause,
DescribeDeliveryChannelStatusError::Credentials(ref err) => err.description(),
DescribeDeliveryChannelStatusError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeDeliveryChannelStatusError::ParseError(ref cause) => cause,
DescribeDeliveryChannelStatusError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDeliveryChannelsError {
NoSuchDeliveryChannel(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeDeliveryChannelsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeDeliveryChannelsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchDeliveryChannelException" => {
return DescribeDeliveryChannelsError::NoSuchDeliveryChannel(String::from(
error_message,
));
}
"ValidationException" => {
return DescribeDeliveryChannelsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeDeliveryChannelsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeDeliveryChannelsError {
fn from(err: serde_json::error::Error) -> DescribeDeliveryChannelsError {
DescribeDeliveryChannelsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeDeliveryChannelsError {
fn from(err: CredentialsError) -> DescribeDeliveryChannelsError {
DescribeDeliveryChannelsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeDeliveryChannelsError {
fn from(err: HttpDispatchError) -> DescribeDeliveryChannelsError {
DescribeDeliveryChannelsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeDeliveryChannelsError {
fn from(err: io::Error) -> DescribeDeliveryChannelsError {
DescribeDeliveryChannelsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeDeliveryChannelsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDeliveryChannelsError {
fn description(&self) -> &str {
match *self {
DescribeDeliveryChannelsError::NoSuchDeliveryChannel(ref cause) => cause,
DescribeDeliveryChannelsError::Validation(ref cause) => cause,
DescribeDeliveryChannelsError::Credentials(ref err) => err.description(),
DescribeDeliveryChannelsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeDeliveryChannelsError::ParseError(ref cause) => cause,
DescribeDeliveryChannelsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribePendingAggregationRequestsError {
InvalidLimit(String),
InvalidNextToken(String),
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribePendingAggregationRequestsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribePendingAggregationRequestsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return DescribePendingAggregationRequestsError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return DescribePendingAggregationRequestsError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribePendingAggregationRequestsError::InvalidParameterValue(
String::from(error_message),
);
}
"ValidationException" => {
return DescribePendingAggregationRequestsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribePendingAggregationRequestsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribePendingAggregationRequestsError {
fn from(err: serde_json::error::Error) -> DescribePendingAggregationRequestsError {
DescribePendingAggregationRequestsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribePendingAggregationRequestsError {
fn from(err: CredentialsError) -> DescribePendingAggregationRequestsError {
DescribePendingAggregationRequestsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribePendingAggregationRequestsError {
fn from(err: HttpDispatchError) -> DescribePendingAggregationRequestsError {
DescribePendingAggregationRequestsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribePendingAggregationRequestsError {
fn from(err: io::Error) -> DescribePendingAggregationRequestsError {
DescribePendingAggregationRequestsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribePendingAggregationRequestsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribePendingAggregationRequestsError {
fn description(&self) -> &str {
match *self {
DescribePendingAggregationRequestsError::InvalidLimit(ref cause) => cause,
DescribePendingAggregationRequestsError::InvalidNextToken(ref cause) => cause,
DescribePendingAggregationRequestsError::InvalidParameterValue(ref cause) => cause,
DescribePendingAggregationRequestsError::Validation(ref cause) => cause,
DescribePendingAggregationRequestsError::Credentials(ref err) => err.description(),
DescribePendingAggregationRequestsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribePendingAggregationRequestsError::ParseError(ref cause) => cause,
DescribePendingAggregationRequestsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeRetentionConfigurationsError {
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchRetentionConfiguration(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeRetentionConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeRetentionConfigurationsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return DescribeRetentionConfigurationsError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return DescribeRetentionConfigurationsError::InvalidParameterValue(
String::from(error_message),
);
}
"NoSuchRetentionConfigurationException" => {
return DescribeRetentionConfigurationsError::NoSuchRetentionConfiguration(
String::from(error_message),
);
}
"ValidationException" => {
return DescribeRetentionConfigurationsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return DescribeRetentionConfigurationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeRetentionConfigurationsError {
fn from(err: serde_json::error::Error) -> DescribeRetentionConfigurationsError {
DescribeRetentionConfigurationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeRetentionConfigurationsError {
fn from(err: CredentialsError) -> DescribeRetentionConfigurationsError {
DescribeRetentionConfigurationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeRetentionConfigurationsError {
fn from(err: HttpDispatchError) -> DescribeRetentionConfigurationsError {
DescribeRetentionConfigurationsError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeRetentionConfigurationsError {
fn from(err: io::Error) -> DescribeRetentionConfigurationsError {
DescribeRetentionConfigurationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeRetentionConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeRetentionConfigurationsError {
fn description(&self) -> &str {
match *self {
DescribeRetentionConfigurationsError::InvalidNextToken(ref cause) => cause,
DescribeRetentionConfigurationsError::InvalidParameterValue(ref cause) => cause,
DescribeRetentionConfigurationsError::NoSuchRetentionConfiguration(ref cause) => cause,
DescribeRetentionConfigurationsError::Validation(ref cause) => cause,
DescribeRetentionConfigurationsError::Credentials(ref err) => err.description(),
DescribeRetentionConfigurationsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeRetentionConfigurationsError::ParseError(ref cause) => cause,
DescribeRetentionConfigurationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAggregateComplianceDetailsByConfigRuleError {
InvalidLimit(String),
InvalidNextToken(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetAggregateComplianceDetailsByConfigRuleError {
pub fn from_response(
res: BufferedHttpResponse,
) -> GetAggregateComplianceDetailsByConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => return GetAggregateComplianceDetailsByConfigRuleError::InvalidLimit(String::from(error_message)),
"InvalidNextTokenException" => return GetAggregateComplianceDetailsByConfigRuleError::InvalidNextToken(String::from(error_message)),
"NoSuchConfigurationAggregatorException" => return GetAggregateComplianceDetailsByConfigRuleError::NoSuchConfigurationAggregator(String::from(error_message)),
"ValidationException" => return GetAggregateComplianceDetailsByConfigRuleError::Validation(error_message.to_string()),
_ => {}
}
}
return GetAggregateComplianceDetailsByConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetAggregateComplianceDetailsByConfigRuleError {
fn from(err: serde_json::error::Error) -> GetAggregateComplianceDetailsByConfigRuleError {
GetAggregateComplianceDetailsByConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetAggregateComplianceDetailsByConfigRuleError {
fn from(err: CredentialsError) -> GetAggregateComplianceDetailsByConfigRuleError {
GetAggregateComplianceDetailsByConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetAggregateComplianceDetailsByConfigRuleError {
fn from(err: HttpDispatchError) -> GetAggregateComplianceDetailsByConfigRuleError {
GetAggregateComplianceDetailsByConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for GetAggregateComplianceDetailsByConfigRuleError {
fn from(err: io::Error) -> GetAggregateComplianceDetailsByConfigRuleError {
GetAggregateComplianceDetailsByConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetAggregateComplianceDetailsByConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAggregateComplianceDetailsByConfigRuleError {
fn description(&self) -> &str {
match *self {
GetAggregateComplianceDetailsByConfigRuleError::InvalidLimit(ref cause) => cause,
GetAggregateComplianceDetailsByConfigRuleError::InvalidNextToken(ref cause) => cause,
GetAggregateComplianceDetailsByConfigRuleError::NoSuchConfigurationAggregator(
ref cause,
) => cause,
GetAggregateComplianceDetailsByConfigRuleError::Validation(ref cause) => cause,
GetAggregateComplianceDetailsByConfigRuleError::Credentials(ref err) => {
err.description()
}
GetAggregateComplianceDetailsByConfigRuleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetAggregateComplianceDetailsByConfigRuleError::ParseError(ref cause) => cause,
GetAggregateComplianceDetailsByConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAggregateConfigRuleComplianceSummaryError {
InvalidLimit(String),
InvalidNextToken(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetAggregateConfigRuleComplianceSummaryError {
pub fn from_response(
res: BufferedHttpResponse,
) -> GetAggregateConfigRuleComplianceSummaryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => return GetAggregateConfigRuleComplianceSummaryError::InvalidLimit(String::from(error_message)),
"InvalidNextTokenException" => return GetAggregateConfigRuleComplianceSummaryError::InvalidNextToken(String::from(error_message)),
"NoSuchConfigurationAggregatorException" => return GetAggregateConfigRuleComplianceSummaryError::NoSuchConfigurationAggregator(String::from(error_message)),
"ValidationException" => return GetAggregateConfigRuleComplianceSummaryError::Validation(error_message.to_string()),
_ => {}
}
}
return GetAggregateConfigRuleComplianceSummaryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetAggregateConfigRuleComplianceSummaryError {
fn from(err: serde_json::error::Error) -> GetAggregateConfigRuleComplianceSummaryError {
GetAggregateConfigRuleComplianceSummaryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetAggregateConfigRuleComplianceSummaryError {
fn from(err: CredentialsError) -> GetAggregateConfigRuleComplianceSummaryError {
GetAggregateConfigRuleComplianceSummaryError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetAggregateConfigRuleComplianceSummaryError {
fn from(err: HttpDispatchError) -> GetAggregateConfigRuleComplianceSummaryError {
GetAggregateConfigRuleComplianceSummaryError::HttpDispatch(err)
}
}
impl From<io::Error> for GetAggregateConfigRuleComplianceSummaryError {
fn from(err: io::Error) -> GetAggregateConfigRuleComplianceSummaryError {
GetAggregateConfigRuleComplianceSummaryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetAggregateConfigRuleComplianceSummaryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAggregateConfigRuleComplianceSummaryError {
fn description(&self) -> &str {
match *self {
GetAggregateConfigRuleComplianceSummaryError::InvalidLimit(ref cause) => cause,
GetAggregateConfigRuleComplianceSummaryError::InvalidNextToken(ref cause) => cause,
GetAggregateConfigRuleComplianceSummaryError::NoSuchConfigurationAggregator(
ref cause,
) => cause,
GetAggregateConfigRuleComplianceSummaryError::Validation(ref cause) => cause,
GetAggregateConfigRuleComplianceSummaryError::Credentials(ref err) => err.description(),
GetAggregateConfigRuleComplianceSummaryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetAggregateConfigRuleComplianceSummaryError::ParseError(ref cause) => cause,
GetAggregateConfigRuleComplianceSummaryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAggregateDiscoveredResourceCountsError {
InvalidLimit(String),
InvalidNextToken(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetAggregateDiscoveredResourceCountsError {
pub fn from_response(res: BufferedHttpResponse) -> GetAggregateDiscoveredResourceCountsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return GetAggregateDiscoveredResourceCountsError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return GetAggregateDiscoveredResourceCountsError::InvalidNextToken(
String::from(error_message),
);
}
"NoSuchConfigurationAggregatorException" => {
return GetAggregateDiscoveredResourceCountsError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"ValidationException" => {
return GetAggregateDiscoveredResourceCountsError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetAggregateDiscoveredResourceCountsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetAggregateDiscoveredResourceCountsError {
fn from(err: serde_json::error::Error) -> GetAggregateDiscoveredResourceCountsError {
GetAggregateDiscoveredResourceCountsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetAggregateDiscoveredResourceCountsError {
fn from(err: CredentialsError) -> GetAggregateDiscoveredResourceCountsError {
GetAggregateDiscoveredResourceCountsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetAggregateDiscoveredResourceCountsError {
fn from(err: HttpDispatchError) -> GetAggregateDiscoveredResourceCountsError {
GetAggregateDiscoveredResourceCountsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetAggregateDiscoveredResourceCountsError {
fn from(err: io::Error) -> GetAggregateDiscoveredResourceCountsError {
GetAggregateDiscoveredResourceCountsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetAggregateDiscoveredResourceCountsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAggregateDiscoveredResourceCountsError {
fn description(&self) -> &str {
match *self {
GetAggregateDiscoveredResourceCountsError::InvalidLimit(ref cause) => cause,
GetAggregateDiscoveredResourceCountsError::InvalidNextToken(ref cause) => cause,
GetAggregateDiscoveredResourceCountsError::NoSuchConfigurationAggregator(ref cause) => {
cause
}
GetAggregateDiscoveredResourceCountsError::Validation(ref cause) => cause,
GetAggregateDiscoveredResourceCountsError::Credentials(ref err) => err.description(),
GetAggregateDiscoveredResourceCountsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetAggregateDiscoveredResourceCountsError::ParseError(ref cause) => cause,
GetAggregateDiscoveredResourceCountsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetAggregateResourceConfigError {
NoSuchConfigurationAggregator(String),
OversizedConfigurationItem(String),
ResourceNotDiscovered(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetAggregateResourceConfigError {
pub fn from_response(res: BufferedHttpResponse) -> GetAggregateResourceConfigError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationAggregatorException" => {
return GetAggregateResourceConfigError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"OversizedConfigurationItemException" => {
return GetAggregateResourceConfigError::OversizedConfigurationItem(
String::from(error_message),
);
}
"ResourceNotDiscoveredException" => {
return GetAggregateResourceConfigError::ResourceNotDiscovered(String::from(
error_message,
));
}
"ValidationException" => {
return GetAggregateResourceConfigError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetAggregateResourceConfigError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetAggregateResourceConfigError {
fn from(err: serde_json::error::Error) -> GetAggregateResourceConfigError {
GetAggregateResourceConfigError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetAggregateResourceConfigError {
fn from(err: CredentialsError) -> GetAggregateResourceConfigError {
GetAggregateResourceConfigError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetAggregateResourceConfigError {
fn from(err: HttpDispatchError) -> GetAggregateResourceConfigError {
GetAggregateResourceConfigError::HttpDispatch(err)
}
}
impl From<io::Error> for GetAggregateResourceConfigError {
fn from(err: io::Error) -> GetAggregateResourceConfigError {
GetAggregateResourceConfigError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetAggregateResourceConfigError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetAggregateResourceConfigError {
fn description(&self) -> &str {
match *self {
GetAggregateResourceConfigError::NoSuchConfigurationAggregator(ref cause) => cause,
GetAggregateResourceConfigError::OversizedConfigurationItem(ref cause) => cause,
GetAggregateResourceConfigError::ResourceNotDiscovered(ref cause) => cause,
GetAggregateResourceConfigError::Validation(ref cause) => cause,
GetAggregateResourceConfigError::Credentials(ref err) => err.description(),
GetAggregateResourceConfigError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetAggregateResourceConfigError::ParseError(ref cause) => cause,
GetAggregateResourceConfigError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetComplianceDetailsByConfigRuleError {
InvalidNextToken(String),
InvalidParameterValue(String),
NoSuchConfigRule(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetComplianceDetailsByConfigRuleError {
pub fn from_response(res: BufferedHttpResponse) -> GetComplianceDetailsByConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidNextTokenException" => {
return GetComplianceDetailsByConfigRuleError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidParameterValueException" => {
return GetComplianceDetailsByConfigRuleError::InvalidParameterValue(
String::from(error_message),
);
}
"NoSuchConfigRuleException" => {
return GetComplianceDetailsByConfigRuleError::NoSuchConfigRule(String::from(
error_message,
));
}
"ValidationException" => {
return GetComplianceDetailsByConfigRuleError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetComplianceDetailsByConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetComplianceDetailsByConfigRuleError {
fn from(err: serde_json::error::Error) -> GetComplianceDetailsByConfigRuleError {
GetComplianceDetailsByConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetComplianceDetailsByConfigRuleError {
fn from(err: CredentialsError) -> GetComplianceDetailsByConfigRuleError {
GetComplianceDetailsByConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetComplianceDetailsByConfigRuleError {
fn from(err: HttpDispatchError) -> GetComplianceDetailsByConfigRuleError {
GetComplianceDetailsByConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for GetComplianceDetailsByConfigRuleError {
fn from(err: io::Error) -> GetComplianceDetailsByConfigRuleError {
GetComplianceDetailsByConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetComplianceDetailsByConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetComplianceDetailsByConfigRuleError {
fn description(&self) -> &str {
match *self {
GetComplianceDetailsByConfigRuleError::InvalidNextToken(ref cause) => cause,
GetComplianceDetailsByConfigRuleError::InvalidParameterValue(ref cause) => cause,
GetComplianceDetailsByConfigRuleError::NoSuchConfigRule(ref cause) => cause,
GetComplianceDetailsByConfigRuleError::Validation(ref cause) => cause,
GetComplianceDetailsByConfigRuleError::Credentials(ref err) => err.description(),
GetComplianceDetailsByConfigRuleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetComplianceDetailsByConfigRuleError::ParseError(ref cause) => cause,
GetComplianceDetailsByConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetComplianceDetailsByResourceError {
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetComplianceDetailsByResourceError {
pub fn from_response(res: BufferedHttpResponse) -> GetComplianceDetailsByResourceError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return GetComplianceDetailsByResourceError::InvalidParameterValue(String::from(
error_message,
));
}
"ValidationException" => {
return GetComplianceDetailsByResourceError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetComplianceDetailsByResourceError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetComplianceDetailsByResourceError {
fn from(err: serde_json::error::Error) -> GetComplianceDetailsByResourceError {
GetComplianceDetailsByResourceError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetComplianceDetailsByResourceError {
fn from(err: CredentialsError) -> GetComplianceDetailsByResourceError {
GetComplianceDetailsByResourceError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetComplianceDetailsByResourceError {
fn from(err: HttpDispatchError) -> GetComplianceDetailsByResourceError {
GetComplianceDetailsByResourceError::HttpDispatch(err)
}
}
impl From<io::Error> for GetComplianceDetailsByResourceError {
fn from(err: io::Error) -> GetComplianceDetailsByResourceError {
GetComplianceDetailsByResourceError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetComplianceDetailsByResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetComplianceDetailsByResourceError {
fn description(&self) -> &str {
match *self {
GetComplianceDetailsByResourceError::InvalidParameterValue(ref cause) => cause,
GetComplianceDetailsByResourceError::Validation(ref cause) => cause,
GetComplianceDetailsByResourceError::Credentials(ref err) => err.description(),
GetComplianceDetailsByResourceError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetComplianceDetailsByResourceError::ParseError(ref cause) => cause,
GetComplianceDetailsByResourceError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetComplianceSummaryByConfigRuleError {
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetComplianceSummaryByConfigRuleError {
pub fn from_response(res: BufferedHttpResponse) -> GetComplianceSummaryByConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"ValidationException" => {
return GetComplianceSummaryByConfigRuleError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetComplianceSummaryByConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetComplianceSummaryByConfigRuleError {
fn from(err: serde_json::error::Error) -> GetComplianceSummaryByConfigRuleError {
GetComplianceSummaryByConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetComplianceSummaryByConfigRuleError {
fn from(err: CredentialsError) -> GetComplianceSummaryByConfigRuleError {
GetComplianceSummaryByConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetComplianceSummaryByConfigRuleError {
fn from(err: HttpDispatchError) -> GetComplianceSummaryByConfigRuleError {
GetComplianceSummaryByConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for GetComplianceSummaryByConfigRuleError {
fn from(err: io::Error) -> GetComplianceSummaryByConfigRuleError {
GetComplianceSummaryByConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetComplianceSummaryByConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetComplianceSummaryByConfigRuleError {
fn description(&self) -> &str {
match *self {
GetComplianceSummaryByConfigRuleError::Validation(ref cause) => cause,
GetComplianceSummaryByConfigRuleError::Credentials(ref err) => err.description(),
GetComplianceSummaryByConfigRuleError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetComplianceSummaryByConfigRuleError::ParseError(ref cause) => cause,
GetComplianceSummaryByConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetComplianceSummaryByResourceTypeError {
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetComplianceSummaryByResourceTypeError {
pub fn from_response(res: BufferedHttpResponse) -> GetComplianceSummaryByResourceTypeError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return GetComplianceSummaryByResourceTypeError::InvalidParameterValue(
String::from(error_message),
);
}
"ValidationException" => {
return GetComplianceSummaryByResourceTypeError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return GetComplianceSummaryByResourceTypeError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetComplianceSummaryByResourceTypeError {
fn from(err: serde_json::error::Error) -> GetComplianceSummaryByResourceTypeError {
GetComplianceSummaryByResourceTypeError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetComplianceSummaryByResourceTypeError {
fn from(err: CredentialsError) -> GetComplianceSummaryByResourceTypeError {
GetComplianceSummaryByResourceTypeError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetComplianceSummaryByResourceTypeError {
fn from(err: HttpDispatchError) -> GetComplianceSummaryByResourceTypeError {
GetComplianceSummaryByResourceTypeError::HttpDispatch(err)
}
}
impl From<io::Error> for GetComplianceSummaryByResourceTypeError {
fn from(err: io::Error) -> GetComplianceSummaryByResourceTypeError {
GetComplianceSummaryByResourceTypeError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetComplianceSummaryByResourceTypeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetComplianceSummaryByResourceTypeError {
fn description(&self) -> &str {
match *self {
GetComplianceSummaryByResourceTypeError::InvalidParameterValue(ref cause) => cause,
GetComplianceSummaryByResourceTypeError::Validation(ref cause) => cause,
GetComplianceSummaryByResourceTypeError::Credentials(ref err) => err.description(),
GetComplianceSummaryByResourceTypeError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetComplianceSummaryByResourceTypeError::ParseError(ref cause) => cause,
GetComplianceSummaryByResourceTypeError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetDiscoveredResourceCountsError {
InvalidLimit(String),
InvalidNextToken(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetDiscoveredResourceCountsError {
pub fn from_response(res: BufferedHttpResponse) -> GetDiscoveredResourceCountsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return GetDiscoveredResourceCountsError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return GetDiscoveredResourceCountsError::InvalidNextToken(String::from(
error_message,
));
}
"ValidationException" => {
return GetDiscoveredResourceCountsError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetDiscoveredResourceCountsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetDiscoveredResourceCountsError {
fn from(err: serde_json::error::Error) -> GetDiscoveredResourceCountsError {
GetDiscoveredResourceCountsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetDiscoveredResourceCountsError {
fn from(err: CredentialsError) -> GetDiscoveredResourceCountsError {
GetDiscoveredResourceCountsError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetDiscoveredResourceCountsError {
fn from(err: HttpDispatchError) -> GetDiscoveredResourceCountsError {
GetDiscoveredResourceCountsError::HttpDispatch(err)
}
}
impl From<io::Error> for GetDiscoveredResourceCountsError {
fn from(err: io::Error) -> GetDiscoveredResourceCountsError {
GetDiscoveredResourceCountsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetDiscoveredResourceCountsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetDiscoveredResourceCountsError {
fn description(&self) -> &str {
match *self {
GetDiscoveredResourceCountsError::InvalidLimit(ref cause) => cause,
GetDiscoveredResourceCountsError::InvalidNextToken(ref cause) => cause,
GetDiscoveredResourceCountsError::Validation(ref cause) => cause,
GetDiscoveredResourceCountsError::Credentials(ref err) => err.description(),
GetDiscoveredResourceCountsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetDiscoveredResourceCountsError::ParseError(ref cause) => cause,
GetDiscoveredResourceCountsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetResourceConfigHistoryError {
InvalidLimit(String),
InvalidNextToken(String),
InvalidTimeRange(String),
NoAvailableConfigurationRecorder(String),
ResourceNotDiscovered(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl GetResourceConfigHistoryError {
pub fn from_response(res: BufferedHttpResponse) -> GetResourceConfigHistoryError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return GetResourceConfigHistoryError::InvalidLimit(String::from(error_message));
}
"InvalidNextTokenException" => {
return GetResourceConfigHistoryError::InvalidNextToken(String::from(
error_message,
));
}
"InvalidTimeRangeException" => {
return GetResourceConfigHistoryError::InvalidTimeRange(String::from(
error_message,
));
}
"NoAvailableConfigurationRecorderException" => {
return GetResourceConfigHistoryError::NoAvailableConfigurationRecorder(
String::from(error_message),
);
}
"ResourceNotDiscoveredException" => {
return GetResourceConfigHistoryError::ResourceNotDiscovered(String::from(
error_message,
));
}
"ValidationException" => {
return GetResourceConfigHistoryError::Validation(error_message.to_string());
}
_ => {}
}
}
return GetResourceConfigHistoryError::Unknown(res);
}
}
impl From<serde_json::error::Error> for GetResourceConfigHistoryError {
fn from(err: serde_json::error::Error) -> GetResourceConfigHistoryError {
GetResourceConfigHistoryError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for GetResourceConfigHistoryError {
fn from(err: CredentialsError) -> GetResourceConfigHistoryError {
GetResourceConfigHistoryError::Credentials(err)
}
}
impl From<HttpDispatchError> for GetResourceConfigHistoryError {
fn from(err: HttpDispatchError) -> GetResourceConfigHistoryError {
GetResourceConfigHistoryError::HttpDispatch(err)
}
}
impl From<io::Error> for GetResourceConfigHistoryError {
fn from(err: io::Error) -> GetResourceConfigHistoryError {
GetResourceConfigHistoryError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for GetResourceConfigHistoryError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetResourceConfigHistoryError {
fn description(&self) -> &str {
match *self {
GetResourceConfigHistoryError::InvalidLimit(ref cause) => cause,
GetResourceConfigHistoryError::InvalidNextToken(ref cause) => cause,
GetResourceConfigHistoryError::InvalidTimeRange(ref cause) => cause,
GetResourceConfigHistoryError::NoAvailableConfigurationRecorder(ref cause) => cause,
GetResourceConfigHistoryError::ResourceNotDiscovered(ref cause) => cause,
GetResourceConfigHistoryError::Validation(ref cause) => cause,
GetResourceConfigHistoryError::Credentials(ref err) => err.description(),
GetResourceConfigHistoryError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
GetResourceConfigHistoryError::ParseError(ref cause) => cause,
GetResourceConfigHistoryError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListAggregateDiscoveredResourcesError {
InvalidLimit(String),
InvalidNextToken(String),
NoSuchConfigurationAggregator(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListAggregateDiscoveredResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> ListAggregateDiscoveredResourcesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return ListAggregateDiscoveredResourcesError::InvalidLimit(String::from(
error_message,
));
}
"InvalidNextTokenException" => {
return ListAggregateDiscoveredResourcesError::InvalidNextToken(String::from(
error_message,
));
}
"NoSuchConfigurationAggregatorException" => {
return ListAggregateDiscoveredResourcesError::NoSuchConfigurationAggregator(
String::from(error_message),
);
}
"ValidationException" => {
return ListAggregateDiscoveredResourcesError::Validation(
error_message.to_string(),
);
}
_ => {}
}
}
return ListAggregateDiscoveredResourcesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListAggregateDiscoveredResourcesError {
fn from(err: serde_json::error::Error) -> ListAggregateDiscoveredResourcesError {
ListAggregateDiscoveredResourcesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListAggregateDiscoveredResourcesError {
fn from(err: CredentialsError) -> ListAggregateDiscoveredResourcesError {
ListAggregateDiscoveredResourcesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListAggregateDiscoveredResourcesError {
fn from(err: HttpDispatchError) -> ListAggregateDiscoveredResourcesError {
ListAggregateDiscoveredResourcesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListAggregateDiscoveredResourcesError {
fn from(err: io::Error) -> ListAggregateDiscoveredResourcesError {
ListAggregateDiscoveredResourcesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListAggregateDiscoveredResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListAggregateDiscoveredResourcesError {
fn description(&self) -> &str {
match *self {
ListAggregateDiscoveredResourcesError::InvalidLimit(ref cause) => cause,
ListAggregateDiscoveredResourcesError::InvalidNextToken(ref cause) => cause,
ListAggregateDiscoveredResourcesError::NoSuchConfigurationAggregator(ref cause) => {
cause
}
ListAggregateDiscoveredResourcesError::Validation(ref cause) => cause,
ListAggregateDiscoveredResourcesError::Credentials(ref err) => err.description(),
ListAggregateDiscoveredResourcesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListAggregateDiscoveredResourcesError::ParseError(ref cause) => cause,
ListAggregateDiscoveredResourcesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListDiscoveredResourcesError {
InvalidLimit(String),
InvalidNextToken(String),
NoAvailableConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListDiscoveredResourcesError {
pub fn from_response(res: BufferedHttpResponse) -> ListDiscoveredResourcesError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidLimitException" => {
return ListDiscoveredResourcesError::InvalidLimit(String::from(error_message));
}
"InvalidNextTokenException" => {
return ListDiscoveredResourcesError::InvalidNextToken(String::from(
error_message,
));
}
"NoAvailableConfigurationRecorderException" => {
return ListDiscoveredResourcesError::NoAvailableConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return ListDiscoveredResourcesError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListDiscoveredResourcesError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListDiscoveredResourcesError {
fn from(err: serde_json::error::Error) -> ListDiscoveredResourcesError {
ListDiscoveredResourcesError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListDiscoveredResourcesError {
fn from(err: CredentialsError) -> ListDiscoveredResourcesError {
ListDiscoveredResourcesError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListDiscoveredResourcesError {
fn from(err: HttpDispatchError) -> ListDiscoveredResourcesError {
ListDiscoveredResourcesError::HttpDispatch(err)
}
}
impl From<io::Error> for ListDiscoveredResourcesError {
fn from(err: io::Error) -> ListDiscoveredResourcesError {
ListDiscoveredResourcesError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListDiscoveredResourcesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListDiscoveredResourcesError {
fn description(&self) -> &str {
match *self {
ListDiscoveredResourcesError::InvalidLimit(ref cause) => cause,
ListDiscoveredResourcesError::InvalidNextToken(ref cause) => cause,
ListDiscoveredResourcesError::NoAvailableConfigurationRecorder(ref cause) => cause,
ListDiscoveredResourcesError::Validation(ref cause) => cause,
ListDiscoveredResourcesError::Credentials(ref err) => err.description(),
ListDiscoveredResourcesError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListDiscoveredResourcesError::ParseError(ref cause) => cause,
ListDiscoveredResourcesError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutAggregationAuthorizationError {
InvalidParameterValue(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutAggregationAuthorizationError {
pub fn from_response(res: BufferedHttpResponse) -> PutAggregationAuthorizationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return PutAggregationAuthorizationError::InvalidParameterValue(String::from(
error_message,
));
}
"ValidationException" => {
return PutAggregationAuthorizationError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutAggregationAuthorizationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutAggregationAuthorizationError {
fn from(err: serde_json::error::Error) -> PutAggregationAuthorizationError {
PutAggregationAuthorizationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutAggregationAuthorizationError {
fn from(err: CredentialsError) -> PutAggregationAuthorizationError {
PutAggregationAuthorizationError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutAggregationAuthorizationError {
fn from(err: HttpDispatchError) -> PutAggregationAuthorizationError {
PutAggregationAuthorizationError::HttpDispatch(err)
}
}
impl From<io::Error> for PutAggregationAuthorizationError {
fn from(err: io::Error) -> PutAggregationAuthorizationError {
PutAggregationAuthorizationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutAggregationAuthorizationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutAggregationAuthorizationError {
fn description(&self) -> &str {
match *self {
PutAggregationAuthorizationError::InvalidParameterValue(ref cause) => cause,
PutAggregationAuthorizationError::Validation(ref cause) => cause,
PutAggregationAuthorizationError::Credentials(ref err) => err.description(),
PutAggregationAuthorizationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutAggregationAuthorizationError::ParseError(ref cause) => cause,
PutAggregationAuthorizationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutConfigRuleError {
InsufficientPermissions(String),
InvalidParameterValue(String),
MaxNumberOfConfigRulesExceeded(String),
NoAvailableConfigurationRecorder(String),
ResourceInUse(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutConfigRuleError {
pub fn from_response(res: BufferedHttpResponse) -> PutConfigRuleError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InsufficientPermissionsException" => {
return PutConfigRuleError::InsufficientPermissions(String::from(error_message));
}
"InvalidParameterValueException" => {
return PutConfigRuleError::InvalidParameterValue(String::from(error_message));
}
"MaxNumberOfConfigRulesExceededException" => {
return PutConfigRuleError::MaxNumberOfConfigRulesExceeded(String::from(
error_message,
));
}
"NoAvailableConfigurationRecorderException" => {
return PutConfigRuleError::NoAvailableConfigurationRecorder(String::from(
error_message,
));
}
"ResourceInUseException" => {
return PutConfigRuleError::ResourceInUse(String::from(error_message));
}
"ValidationException" => {
return PutConfigRuleError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutConfigRuleError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutConfigRuleError {
fn from(err: serde_json::error::Error) -> PutConfigRuleError {
PutConfigRuleError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutConfigRuleError {
fn from(err: CredentialsError) -> PutConfigRuleError {
PutConfigRuleError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutConfigRuleError {
fn from(err: HttpDispatchError) -> PutConfigRuleError {
PutConfigRuleError::HttpDispatch(err)
}
}
impl From<io::Error> for PutConfigRuleError {
fn from(err: io::Error) -> PutConfigRuleError {
PutConfigRuleError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutConfigRuleError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutConfigRuleError {
fn description(&self) -> &str {
match *self {
PutConfigRuleError::InsufficientPermissions(ref cause) => cause,
PutConfigRuleError::InvalidParameterValue(ref cause) => cause,
PutConfigRuleError::MaxNumberOfConfigRulesExceeded(ref cause) => cause,
PutConfigRuleError::NoAvailableConfigurationRecorder(ref cause) => cause,
PutConfigRuleError::ResourceInUse(ref cause) => cause,
PutConfigRuleError::Validation(ref cause) => cause,
PutConfigRuleError::Credentials(ref err) => err.description(),
PutConfigRuleError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
PutConfigRuleError::ParseError(ref cause) => cause,
PutConfigRuleError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutConfigurationAggregatorError {
InvalidParameterValue(String),
InvalidRole(String),
LimitExceeded(String),
NoAvailableOrganization(String),
OrganizationAccessDenied(String),
OrganizationAllFeaturesNotEnabled(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutConfigurationAggregatorError {
pub fn from_response(res: BufferedHttpResponse) -> PutConfigurationAggregatorError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return PutConfigurationAggregatorError::InvalidParameterValue(String::from(
error_message,
));
}
"InvalidRoleException" => {
return PutConfigurationAggregatorError::InvalidRole(String::from(error_message));
}
"LimitExceededException" => {
return PutConfigurationAggregatorError::LimitExceeded(String::from(
error_message,
));
}
"NoAvailableOrganizationException" => {
return PutConfigurationAggregatorError::NoAvailableOrganization(String::from(
error_message,
));
}
"OrganizationAccessDeniedException" => {
return PutConfigurationAggregatorError::OrganizationAccessDenied(String::from(
error_message,
));
}
"OrganizationAllFeaturesNotEnabledException" => {
return PutConfigurationAggregatorError::OrganizationAllFeaturesNotEnabled(
String::from(error_message),
);
}
"ValidationException" => {
return PutConfigurationAggregatorError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutConfigurationAggregatorError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutConfigurationAggregatorError {
fn from(err: serde_json::error::Error) -> PutConfigurationAggregatorError {
PutConfigurationAggregatorError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutConfigurationAggregatorError {
fn from(err: CredentialsError) -> PutConfigurationAggregatorError {
PutConfigurationAggregatorError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutConfigurationAggregatorError {
fn from(err: HttpDispatchError) -> PutConfigurationAggregatorError {
PutConfigurationAggregatorError::HttpDispatch(err)
}
}
impl From<io::Error> for PutConfigurationAggregatorError {
fn from(err: io::Error) -> PutConfigurationAggregatorError {
PutConfigurationAggregatorError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutConfigurationAggregatorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutConfigurationAggregatorError {
fn description(&self) -> &str {
match *self {
PutConfigurationAggregatorError::InvalidParameterValue(ref cause) => cause,
PutConfigurationAggregatorError::InvalidRole(ref cause) => cause,
PutConfigurationAggregatorError::LimitExceeded(ref cause) => cause,
PutConfigurationAggregatorError::NoAvailableOrganization(ref cause) => cause,
PutConfigurationAggregatorError::OrganizationAccessDenied(ref cause) => cause,
PutConfigurationAggregatorError::OrganizationAllFeaturesNotEnabled(ref cause) => cause,
PutConfigurationAggregatorError::Validation(ref cause) => cause,
PutConfigurationAggregatorError::Credentials(ref err) => err.description(),
PutConfigurationAggregatorError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutConfigurationAggregatorError::ParseError(ref cause) => cause,
PutConfigurationAggregatorError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutConfigurationRecorderError {
InvalidConfigurationRecorderName(String),
InvalidRecordingGroup(String),
InvalidRole(String),
MaxNumberOfConfigurationRecordersExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutConfigurationRecorderError {
pub fn from_response(res: BufferedHttpResponse) -> PutConfigurationRecorderError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidConfigurationRecorderNameException" => {
return PutConfigurationRecorderError::InvalidConfigurationRecorderName(
String::from(error_message),
);
}
"InvalidRecordingGroupException" => {
return PutConfigurationRecorderError::InvalidRecordingGroup(String::from(
error_message,
));
}
"InvalidRoleException" => {
return PutConfigurationRecorderError::InvalidRole(String::from(error_message));
}
"MaxNumberOfConfigurationRecordersExceededException" => {
return PutConfigurationRecorderError::MaxNumberOfConfigurationRecordersExceeded(
String::from(error_message),
);
}
"ValidationException" => {
return PutConfigurationRecorderError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutConfigurationRecorderError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutConfigurationRecorderError {
fn from(err: serde_json::error::Error) -> PutConfigurationRecorderError {
PutConfigurationRecorderError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutConfigurationRecorderError {
fn from(err: CredentialsError) -> PutConfigurationRecorderError {
PutConfigurationRecorderError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutConfigurationRecorderError {
fn from(err: HttpDispatchError) -> PutConfigurationRecorderError {
PutConfigurationRecorderError::HttpDispatch(err)
}
}
impl From<io::Error> for PutConfigurationRecorderError {
fn from(err: io::Error) -> PutConfigurationRecorderError {
PutConfigurationRecorderError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutConfigurationRecorderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutConfigurationRecorderError {
fn description(&self) -> &str {
match *self {
PutConfigurationRecorderError::InvalidConfigurationRecorderName(ref cause) => cause,
PutConfigurationRecorderError::InvalidRecordingGroup(ref cause) => cause,
PutConfigurationRecorderError::InvalidRole(ref cause) => cause,
PutConfigurationRecorderError::MaxNumberOfConfigurationRecordersExceeded(ref cause) => {
cause
}
PutConfigurationRecorderError::Validation(ref cause) => cause,
PutConfigurationRecorderError::Credentials(ref err) => err.description(),
PutConfigurationRecorderError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutConfigurationRecorderError::ParseError(ref cause) => cause,
PutConfigurationRecorderError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutDeliveryChannelError {
InsufficientDeliveryPolicy(String),
InvalidDeliveryChannelName(String),
InvalidS3KeyPrefix(String),
InvalidSNSTopicARN(String),
MaxNumberOfDeliveryChannelsExceeded(String),
NoAvailableConfigurationRecorder(String),
NoSuchBucket(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutDeliveryChannelError {
pub fn from_response(res: BufferedHttpResponse) -> PutDeliveryChannelError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InsufficientDeliveryPolicyException" => {
return PutDeliveryChannelError::InsufficientDeliveryPolicy(String::from(
error_message,
));
}
"InvalidDeliveryChannelNameException" => {
return PutDeliveryChannelError::InvalidDeliveryChannelName(String::from(
error_message,
));
}
"InvalidS3KeyPrefixException" => {
return PutDeliveryChannelError::InvalidS3KeyPrefix(String::from(error_message));
}
"InvalidSNSTopicARNException" => {
return PutDeliveryChannelError::InvalidSNSTopicARN(String::from(error_message));
}
"MaxNumberOfDeliveryChannelsExceededException" => {
return PutDeliveryChannelError::MaxNumberOfDeliveryChannelsExceeded(
String::from(error_message),
);
}
"NoAvailableConfigurationRecorderException" => {
return PutDeliveryChannelError::NoAvailableConfigurationRecorder(String::from(
error_message,
));
}
"NoSuchBucketException" => {
return PutDeliveryChannelError::NoSuchBucket(String::from(error_message));
}
"ValidationException" => {
return PutDeliveryChannelError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutDeliveryChannelError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutDeliveryChannelError {
fn from(err: serde_json::error::Error) -> PutDeliveryChannelError {
PutDeliveryChannelError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutDeliveryChannelError {
fn from(err: CredentialsError) -> PutDeliveryChannelError {
PutDeliveryChannelError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutDeliveryChannelError {
fn from(err: HttpDispatchError) -> PutDeliveryChannelError {
PutDeliveryChannelError::HttpDispatch(err)
}
}
impl From<io::Error> for PutDeliveryChannelError {
fn from(err: io::Error) -> PutDeliveryChannelError {
PutDeliveryChannelError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutDeliveryChannelError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutDeliveryChannelError {
fn description(&self) -> &str {
match *self {
PutDeliveryChannelError::InsufficientDeliveryPolicy(ref cause) => cause,
PutDeliveryChannelError::InvalidDeliveryChannelName(ref cause) => cause,
PutDeliveryChannelError::InvalidS3KeyPrefix(ref cause) => cause,
PutDeliveryChannelError::InvalidSNSTopicARN(ref cause) => cause,
PutDeliveryChannelError::MaxNumberOfDeliveryChannelsExceeded(ref cause) => cause,
PutDeliveryChannelError::NoAvailableConfigurationRecorder(ref cause) => cause,
PutDeliveryChannelError::NoSuchBucket(ref cause) => cause,
PutDeliveryChannelError::Validation(ref cause) => cause,
PutDeliveryChannelError::Credentials(ref err) => err.description(),
PutDeliveryChannelError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutDeliveryChannelError::ParseError(ref cause) => cause,
PutDeliveryChannelError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutEvaluationsError {
InvalidParameterValue(String),
InvalidResultToken(String),
NoSuchConfigRule(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutEvaluationsError {
pub fn from_response(res: BufferedHttpResponse) -> PutEvaluationsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return PutEvaluationsError::InvalidParameterValue(String::from(error_message));
}
"InvalidResultTokenException" => {
return PutEvaluationsError::InvalidResultToken(String::from(error_message));
}
"NoSuchConfigRuleException" => {
return PutEvaluationsError::NoSuchConfigRule(String::from(error_message));
}
"ValidationException" => {
return PutEvaluationsError::Validation(error_message.to_string());
}
_ => {}
}
}
return PutEvaluationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutEvaluationsError {
fn from(err: serde_json::error::Error) -> PutEvaluationsError {
PutEvaluationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutEvaluationsError {
fn from(err: CredentialsError) -> PutEvaluationsError {
PutEvaluationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutEvaluationsError {
fn from(err: HttpDispatchError) -> PutEvaluationsError {
PutEvaluationsError::HttpDispatch(err)
}
}
impl From<io::Error> for PutEvaluationsError {
fn from(err: io::Error) -> PutEvaluationsError {
PutEvaluationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutEvaluationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutEvaluationsError {
fn description(&self) -> &str {
match *self {
PutEvaluationsError::InvalidParameterValue(ref cause) => cause,
PutEvaluationsError::InvalidResultToken(ref cause) => cause,
PutEvaluationsError::NoSuchConfigRule(ref cause) => cause,
PutEvaluationsError::Validation(ref cause) => cause,
PutEvaluationsError::Credentials(ref err) => err.description(),
PutEvaluationsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
PutEvaluationsError::ParseError(ref cause) => cause,
PutEvaluationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum PutRetentionConfigurationError {
InvalidParameterValue(String),
MaxNumberOfRetentionConfigurationsExceeded(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl PutRetentionConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> PutRetentionConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => return PutRetentionConfigurationError::InvalidParameterValue(String::from(error_message)),
"MaxNumberOfRetentionConfigurationsExceededException" => return PutRetentionConfigurationError::MaxNumberOfRetentionConfigurationsExceeded(String::from(error_message)),
"ValidationException" => return PutRetentionConfigurationError::Validation(error_message.to_string()),
_ => {}
}
}
return PutRetentionConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for PutRetentionConfigurationError {
fn from(err: serde_json::error::Error) -> PutRetentionConfigurationError {
PutRetentionConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for PutRetentionConfigurationError {
fn from(err: CredentialsError) -> PutRetentionConfigurationError {
PutRetentionConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for PutRetentionConfigurationError {
fn from(err: HttpDispatchError) -> PutRetentionConfigurationError {
PutRetentionConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for PutRetentionConfigurationError {
fn from(err: io::Error) -> PutRetentionConfigurationError {
PutRetentionConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for PutRetentionConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for PutRetentionConfigurationError {
fn description(&self) -> &str {
match *self {
PutRetentionConfigurationError::InvalidParameterValue(ref cause) => cause,
PutRetentionConfigurationError::MaxNumberOfRetentionConfigurationsExceeded(
ref cause,
) => cause,
PutRetentionConfigurationError::Validation(ref cause) => cause,
PutRetentionConfigurationError::Credentials(ref err) => err.description(),
PutRetentionConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
PutRetentionConfigurationError::ParseError(ref cause) => cause,
PutRetentionConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartConfigRulesEvaluationError {
InvalidParameterValue(String),
LimitExceeded(String),
NoSuchConfigRule(String),
ResourceInUse(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartConfigRulesEvaluationError {
pub fn from_response(res: BufferedHttpResponse) -> StartConfigRulesEvaluationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"InvalidParameterValueException" => {
return StartConfigRulesEvaluationError::InvalidParameterValue(String::from(
error_message,
));
}
"LimitExceededException" => {
return StartConfigRulesEvaluationError::LimitExceeded(String::from(
error_message,
));
}
"NoSuchConfigRuleException" => {
return StartConfigRulesEvaluationError::NoSuchConfigRule(String::from(
error_message,
));
}
"ResourceInUseException" => {
return StartConfigRulesEvaluationError::ResourceInUse(String::from(
error_message,
));
}
"ValidationException" => {
return StartConfigRulesEvaluationError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartConfigRulesEvaluationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartConfigRulesEvaluationError {
fn from(err: serde_json::error::Error) -> StartConfigRulesEvaluationError {
StartConfigRulesEvaluationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartConfigRulesEvaluationError {
fn from(err: CredentialsError) -> StartConfigRulesEvaluationError {
StartConfigRulesEvaluationError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartConfigRulesEvaluationError {
fn from(err: HttpDispatchError) -> StartConfigRulesEvaluationError {
StartConfigRulesEvaluationError::HttpDispatch(err)
}
}
impl From<io::Error> for StartConfigRulesEvaluationError {
fn from(err: io::Error) -> StartConfigRulesEvaluationError {
StartConfigRulesEvaluationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartConfigRulesEvaluationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartConfigRulesEvaluationError {
fn description(&self) -> &str {
match *self {
StartConfigRulesEvaluationError::InvalidParameterValue(ref cause) => cause,
StartConfigRulesEvaluationError::LimitExceeded(ref cause) => cause,
StartConfigRulesEvaluationError::NoSuchConfigRule(ref cause) => cause,
StartConfigRulesEvaluationError::ResourceInUse(ref cause) => cause,
StartConfigRulesEvaluationError::Validation(ref cause) => cause,
StartConfigRulesEvaluationError::Credentials(ref err) => err.description(),
StartConfigRulesEvaluationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StartConfigRulesEvaluationError::ParseError(ref cause) => cause,
StartConfigRulesEvaluationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StartConfigurationRecorderError {
NoAvailableDeliveryChannel(String),
NoSuchConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StartConfigurationRecorderError {
pub fn from_response(res: BufferedHttpResponse) -> StartConfigurationRecorderError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoAvailableDeliveryChannelException" => {
return StartConfigurationRecorderError::NoAvailableDeliveryChannel(
String::from(error_message),
);
}
"NoSuchConfigurationRecorderException" => {
return StartConfigurationRecorderError::NoSuchConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return StartConfigurationRecorderError::Validation(error_message.to_string());
}
_ => {}
}
}
return StartConfigurationRecorderError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StartConfigurationRecorderError {
fn from(err: serde_json::error::Error) -> StartConfigurationRecorderError {
StartConfigurationRecorderError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StartConfigurationRecorderError {
fn from(err: CredentialsError) -> StartConfigurationRecorderError {
StartConfigurationRecorderError::Credentials(err)
}
}
impl From<HttpDispatchError> for StartConfigurationRecorderError {
fn from(err: HttpDispatchError) -> StartConfigurationRecorderError {
StartConfigurationRecorderError::HttpDispatch(err)
}
}
impl From<io::Error> for StartConfigurationRecorderError {
fn from(err: io::Error) -> StartConfigurationRecorderError {
StartConfigurationRecorderError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StartConfigurationRecorderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StartConfigurationRecorderError {
fn description(&self) -> &str {
match *self {
StartConfigurationRecorderError::NoAvailableDeliveryChannel(ref cause) => cause,
StartConfigurationRecorderError::NoSuchConfigurationRecorder(ref cause) => cause,
StartConfigurationRecorderError::Validation(ref cause) => cause,
StartConfigurationRecorderError::Credentials(ref err) => err.description(),
StartConfigurationRecorderError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StartConfigurationRecorderError::ParseError(ref cause) => cause,
StartConfigurationRecorderError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum StopConfigurationRecorderError {
NoSuchConfigurationRecorder(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl StopConfigurationRecorderError {
pub fn from_response(res: BufferedHttpResponse) -> StopConfigurationRecorderError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let raw_error_type = json
.get("__type")
.and_then(|e| e.as_str())
.unwrap_or("Unknown");
let error_message = json.get("message").and_then(|m| m.as_str()).unwrap_or("");
let pieces: Vec<&str> = raw_error_type.split("#").collect();
let error_type = pieces.last().expect("Expected error type");
match *error_type {
"NoSuchConfigurationRecorderException" => {
return StopConfigurationRecorderError::NoSuchConfigurationRecorder(
String::from(error_message),
);
}
"ValidationException" => {
return StopConfigurationRecorderError::Validation(error_message.to_string());
}
_ => {}
}
}
return StopConfigurationRecorderError::Unknown(res);
}
}
impl From<serde_json::error::Error> for StopConfigurationRecorderError {
fn from(err: serde_json::error::Error) -> StopConfigurationRecorderError {
StopConfigurationRecorderError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for StopConfigurationRecorderError {
fn from(err: CredentialsError) -> StopConfigurationRecorderError {
StopConfigurationRecorderError::Credentials(err)
}
}
impl From<HttpDispatchError> for StopConfigurationRecorderError {
fn from(err: HttpDispatchError) -> StopConfigurationRecorderError {
StopConfigurationRecorderError::HttpDispatch(err)
}
}
impl From<io::Error> for StopConfigurationRecorderError {
fn from(err: io::Error) -> StopConfigurationRecorderError {
StopConfigurationRecorderError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for StopConfigurationRecorderError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for StopConfigurationRecorderError {
fn description(&self) -> &str {
match *self {
StopConfigurationRecorderError::NoSuchConfigurationRecorder(ref cause) => cause,
StopConfigurationRecorderError::Validation(ref cause) => cause,
StopConfigurationRecorderError::Credentials(ref err) => err.description(),
StopConfigurationRecorderError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
StopConfigurationRecorderError::ParseError(ref cause) => cause,
StopConfigurationRecorderError::Unknown(_) => "unknown error",
}
}
}
pub trait ConfigService {
fn batch_get_aggregate_resource_config(
&self,
input: BatchGetAggregateResourceConfigRequest,
) -> RusotoFuture<BatchGetAggregateResourceConfigResponse, BatchGetAggregateResourceConfigError>;
fn batch_get_resource_config(
&self,
input: BatchGetResourceConfigRequest,
) -> RusotoFuture<BatchGetResourceConfigResponse, BatchGetResourceConfigError>;
fn delete_aggregation_authorization(
&self,
input: DeleteAggregationAuthorizationRequest,
) -> RusotoFuture<(), DeleteAggregationAuthorizationError>;
fn delete_config_rule(
&self,
input: DeleteConfigRuleRequest,
) -> RusotoFuture<(), DeleteConfigRuleError>;
fn delete_configuration_aggregator(
&self,
input: DeleteConfigurationAggregatorRequest,
) -> RusotoFuture<(), DeleteConfigurationAggregatorError>;
fn delete_configuration_recorder(
&self,
input: DeleteConfigurationRecorderRequest,
) -> RusotoFuture<(), DeleteConfigurationRecorderError>;
fn delete_delivery_channel(
&self,
input: DeleteDeliveryChannelRequest,
) -> RusotoFuture<(), DeleteDeliveryChannelError>;
fn delete_evaluation_results(
&self,
input: DeleteEvaluationResultsRequest,
) -> RusotoFuture<DeleteEvaluationResultsResponse, DeleteEvaluationResultsError>;
fn delete_pending_aggregation_request(
&self,
input: DeletePendingAggregationRequestRequest,
) -> RusotoFuture<(), DeletePendingAggregationRequestError>;
fn delete_retention_configuration(
&self,
input: DeleteRetentionConfigurationRequest,
) -> RusotoFuture<(), DeleteRetentionConfigurationError>;
fn deliver_config_snapshot(
&self,
input: DeliverConfigSnapshotRequest,
) -> RusotoFuture<DeliverConfigSnapshotResponse, DeliverConfigSnapshotError>;
fn describe_aggregate_compliance_by_config_rules(
&self,
input: DescribeAggregateComplianceByConfigRulesRequest,
) -> RusotoFuture<
DescribeAggregateComplianceByConfigRulesResponse,
DescribeAggregateComplianceByConfigRulesError,
>;
fn describe_aggregation_authorizations(
&self,
input: DescribeAggregationAuthorizationsRequest,
) -> RusotoFuture<
DescribeAggregationAuthorizationsResponse,
DescribeAggregationAuthorizationsError,
>;
fn describe_compliance_by_config_rule(
&self,
input: DescribeComplianceByConfigRuleRequest,
) -> RusotoFuture<DescribeComplianceByConfigRuleResponse, DescribeComplianceByConfigRuleError>;
fn describe_compliance_by_resource(
&self,
input: DescribeComplianceByResourceRequest,
) -> RusotoFuture<DescribeComplianceByResourceResponse, DescribeComplianceByResourceError>;
fn describe_config_rule_evaluation_status(
&self,
input: DescribeConfigRuleEvaluationStatusRequest,
) -> RusotoFuture<
DescribeConfigRuleEvaluationStatusResponse,
DescribeConfigRuleEvaluationStatusError,
>;
fn describe_config_rules(
&self,
input: DescribeConfigRulesRequest,
) -> RusotoFuture<DescribeConfigRulesResponse, DescribeConfigRulesError>;
fn describe_configuration_aggregator_sources_status(
&self,
input: DescribeConfigurationAggregatorSourcesStatusRequest,
) -> RusotoFuture<
DescribeConfigurationAggregatorSourcesStatusResponse,
DescribeConfigurationAggregatorSourcesStatusError,
>;
fn describe_configuration_aggregators(
&self,
input: DescribeConfigurationAggregatorsRequest,
) -> RusotoFuture<DescribeConfigurationAggregatorsResponse, DescribeConfigurationAggregatorsError>;
fn describe_configuration_recorder_status(
&self,
input: DescribeConfigurationRecorderStatusRequest,
) -> RusotoFuture<
DescribeConfigurationRecorderStatusResponse,
DescribeConfigurationRecorderStatusError,
>;
fn describe_configuration_recorders(
&self,
input: DescribeConfigurationRecordersRequest,
) -> RusotoFuture<DescribeConfigurationRecordersResponse, DescribeConfigurationRecordersError>;
fn describe_delivery_channel_status(
&self,
input: DescribeDeliveryChannelStatusRequest,
) -> RusotoFuture<DescribeDeliveryChannelStatusResponse, DescribeDeliveryChannelStatusError>;
fn describe_delivery_channels(
&self,
input: DescribeDeliveryChannelsRequest,
) -> RusotoFuture<DescribeDeliveryChannelsResponse, DescribeDeliveryChannelsError>;
fn describe_pending_aggregation_requests(
&self,
input: DescribePendingAggregationRequestsRequest,
) -> RusotoFuture<
DescribePendingAggregationRequestsResponse,
DescribePendingAggregationRequestsError,
>;
fn describe_retention_configurations(
&self,
input: DescribeRetentionConfigurationsRequest,
) -> RusotoFuture<DescribeRetentionConfigurationsResponse, DescribeRetentionConfigurationsError>;
fn get_aggregate_compliance_details_by_config_rule(
&self,
input: GetAggregateComplianceDetailsByConfigRuleRequest,
) -> RusotoFuture<
GetAggregateComplianceDetailsByConfigRuleResponse,
GetAggregateComplianceDetailsByConfigRuleError,
>;
fn get_aggregate_config_rule_compliance_summary(
&self,
input: GetAggregateConfigRuleComplianceSummaryRequest,
) -> RusotoFuture<
GetAggregateConfigRuleComplianceSummaryResponse,
GetAggregateConfigRuleComplianceSummaryError,
>;
fn get_aggregate_discovered_resource_counts(
&self,
input: GetAggregateDiscoveredResourceCountsRequest,
) -> RusotoFuture<
GetAggregateDiscoveredResourceCountsResponse,
GetAggregateDiscoveredResourceCountsError,
>;
fn get_aggregate_resource_config(
&self,
input: GetAggregateResourceConfigRequest,
) -> RusotoFuture<GetAggregateResourceConfigResponse, GetAggregateResourceConfigError>;
fn get_compliance_details_by_config_rule(
&self,
input: GetComplianceDetailsByConfigRuleRequest,
) -> RusotoFuture<GetComplianceDetailsByConfigRuleResponse, GetComplianceDetailsByConfigRuleError>;
fn get_compliance_details_by_resource(
&self,
input: GetComplianceDetailsByResourceRequest,
) -> RusotoFuture<GetComplianceDetailsByResourceResponse, GetComplianceDetailsByResourceError>;
fn get_compliance_summary_by_config_rule(
&self,
) -> RusotoFuture<GetComplianceSummaryByConfigRuleResponse, GetComplianceSummaryByConfigRuleError>;
fn get_compliance_summary_by_resource_type(
&self,
input: GetComplianceSummaryByResourceTypeRequest,
) -> RusotoFuture<
GetComplianceSummaryByResourceTypeResponse,
GetComplianceSummaryByResourceTypeError,
>;
fn get_discovered_resource_counts(
&self,
input: GetDiscoveredResourceCountsRequest,
) -> RusotoFuture<GetDiscoveredResourceCountsResponse, GetDiscoveredResourceCountsError>;
fn get_resource_config_history(
&self,
input: GetResourceConfigHistoryRequest,
) -> RusotoFuture<GetResourceConfigHistoryResponse, GetResourceConfigHistoryError>;
fn list_aggregate_discovered_resources(
&self,
input: ListAggregateDiscoveredResourcesRequest,
) -> RusotoFuture<ListAggregateDiscoveredResourcesResponse, ListAggregateDiscoveredResourcesError>;
fn list_discovered_resources(
&self,
input: ListDiscoveredResourcesRequest,
) -> RusotoFuture<ListDiscoveredResourcesResponse, ListDiscoveredResourcesError>;
fn put_aggregation_authorization(
&self,
input: PutAggregationAuthorizationRequest,
) -> RusotoFuture<PutAggregationAuthorizationResponse, PutAggregationAuthorizationError>;
fn put_config_rule(&self, input: PutConfigRuleRequest) -> RusotoFuture<(), PutConfigRuleError>;
fn put_configuration_aggregator(
&self,
input: PutConfigurationAggregatorRequest,
) -> RusotoFuture<PutConfigurationAggregatorResponse, PutConfigurationAggregatorError>;
fn put_configuration_recorder(
&self,
input: PutConfigurationRecorderRequest,
) -> RusotoFuture<(), PutConfigurationRecorderError>;
fn put_delivery_channel(
&self,
input: PutDeliveryChannelRequest,
) -> RusotoFuture<(), PutDeliveryChannelError>;
fn put_evaluations(
&self,
input: PutEvaluationsRequest,
) -> RusotoFuture<PutEvaluationsResponse, PutEvaluationsError>;
fn put_retention_configuration(
&self,
input: PutRetentionConfigurationRequest,
) -> RusotoFuture<PutRetentionConfigurationResponse, PutRetentionConfigurationError>;
fn start_config_rules_evaluation(
&self,
input: StartConfigRulesEvaluationRequest,
) -> RusotoFuture<StartConfigRulesEvaluationResponse, StartConfigRulesEvaluationError>;
fn start_configuration_recorder(
&self,
input: StartConfigurationRecorderRequest,
) -> RusotoFuture<(), StartConfigurationRecorderError>;
fn stop_configuration_recorder(
&self,
input: StopConfigurationRecorderRequest,
) -> RusotoFuture<(), StopConfigurationRecorderError>;
}
#[derive(Clone)]
pub struct ConfigServiceClient {
client: Client,
region: region::Region,
}
impl ConfigServiceClient {
pub fn new(region: region::Region) -> ConfigServiceClient {
ConfigServiceClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ConfigServiceClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
ConfigServiceClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl ConfigService for ConfigServiceClient {
fn batch_get_aggregate_resource_config(
&self,
input: BatchGetAggregateResourceConfigRequest,
) -> RusotoFuture<BatchGetAggregateResourceConfigResponse, BatchGetAggregateResourceConfigError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.BatchGetAggregateResourceConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<BatchGetAggregateResourceConfigResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(BatchGetAggregateResourceConfigError::from_response(
response,
))
}))
}
})
}
fn batch_get_resource_config(
&self,
input: BatchGetResourceConfigRequest,
) -> RusotoFuture<BatchGetResourceConfigResponse, BatchGetResourceConfigError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.BatchGetResourceConfig");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<BatchGetResourceConfigResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(BatchGetResourceConfigError::from_response(response))
}),
)
}
})
}
fn delete_aggregation_authorization(
&self,
input: DeleteAggregationAuthorizationRequest,
) -> RusotoFuture<(), DeleteAggregationAuthorizationError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeleteAggregationAuthorization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteAggregationAuthorizationError::from_response(response))
}))
}
})
}
fn delete_config_rule(
&self,
input: DeleteConfigRuleRequest,
) -> RusotoFuture<(), DeleteConfigRuleError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.DeleteConfigRule");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteConfigRuleError::from_response(response))),
)
}
})
}
fn delete_configuration_aggregator(
&self,
input: DeleteConfigurationAggregatorRequest,
) -> RusotoFuture<(), DeleteConfigurationAggregatorError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeleteConfigurationAggregator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteConfigurationAggregatorError::from_response(response))
}))
}
})
}
fn delete_configuration_recorder(
&self,
input: DeleteConfigurationRecorderRequest,
) -> RusotoFuture<(), DeleteConfigurationRecorderError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeleteConfigurationRecorder",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteConfigurationRecorderError::from_response(response))
}))
}
})
}
fn delete_delivery_channel(
&self,
input: DeleteDeliveryChannelRequest,
) -> RusotoFuture<(), DeleteDeliveryChannelError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.DeleteDeliveryChannel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteDeliveryChannelError::from_response(response))
}),
)
}
})
}
fn delete_evaluation_results(
&self,
input: DeleteEvaluationResultsRequest,
) -> RusotoFuture<DeleteEvaluationResultsResponse, DeleteEvaluationResultsError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeleteEvaluationResults",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DeleteEvaluationResultsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DeleteEvaluationResultsError::from_response(response))
}))
}
})
}
fn delete_pending_aggregation_request(
&self,
input: DeletePendingAggregationRequestRequest,
) -> RusotoFuture<(), DeletePendingAggregationRequestError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeletePendingAggregationRequest",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeletePendingAggregationRequestError::from_response(
response,
))
}))
}
})
}
fn delete_retention_configuration(
&self,
input: DeleteRetentionConfigurationRequest,
) -> RusotoFuture<(), DeleteRetentionConfigurationError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DeleteRetentionConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(DeleteRetentionConfigurationError::from_response(response))
}))
}
})
}
fn deliver_config_snapshot(
&self,
input: DeliverConfigSnapshotRequest,
) -> RusotoFuture<DeliverConfigSnapshotResponse, DeliverConfigSnapshotError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.DeliverConfigSnapshot");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DeliverConfigSnapshotResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeliverConfigSnapshotError::from_response(response))
}),
)
}
})
}
fn describe_aggregate_compliance_by_config_rules(
&self,
input: DescribeAggregateComplianceByConfigRulesRequest,
) -> RusotoFuture<
DescribeAggregateComplianceByConfigRulesResponse,
DescribeAggregateComplianceByConfigRulesError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeAggregateComplianceByConfigRules",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeAggregateComplianceByConfigRulesResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAggregateComplianceByConfigRulesError::from_response(response))
}))
}
})
}
fn describe_aggregation_authorizations(
&self,
input: DescribeAggregationAuthorizationsRequest,
) -> RusotoFuture<
DescribeAggregationAuthorizationsResponse,
DescribeAggregationAuthorizationsError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeAggregationAuthorizations",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeAggregationAuthorizationsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeAggregationAuthorizationsError::from_response(
response,
))
}))
}
})
}
fn describe_compliance_by_config_rule(
&self,
input: DescribeComplianceByConfigRuleRequest,
) -> RusotoFuture<DescribeComplianceByConfigRuleResponse, DescribeComplianceByConfigRuleError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeComplianceByConfigRule",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeComplianceByConfigRuleResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeComplianceByConfigRuleError::from_response(response))
}))
}
})
}
fn describe_compliance_by_resource(
&self,
input: DescribeComplianceByResourceRequest,
) -> RusotoFuture<DescribeComplianceByResourceResponse, DescribeComplianceByResourceError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeComplianceByResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeComplianceByResourceResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeComplianceByResourceError::from_response(response))
}))
}
})
}
fn describe_config_rule_evaluation_status(
&self,
input: DescribeConfigRuleEvaluationStatusRequest,
) -> RusotoFuture<
DescribeConfigRuleEvaluationStatusResponse,
DescribeConfigRuleEvaluationStatusError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeConfigRuleEvaluationStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigRuleEvaluationStatusResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigRuleEvaluationStatusError::from_response(
response,
))
}))
}
})
}
fn describe_config_rules(
&self,
input: DescribeConfigRulesRequest,
) -> RusotoFuture<DescribeConfigRulesResponse, DescribeConfigRulesError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.DescribeConfigRules");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigRulesResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeConfigRulesError::from_response(response))
}),
)
}
})
}
fn describe_configuration_aggregator_sources_status(
&self,
input: DescribeConfigurationAggregatorSourcesStatusRequest,
) -> RusotoFuture<
DescribeConfigurationAggregatorSourcesStatusResponse,
DescribeConfigurationAggregatorSourcesStatusError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeConfigurationAggregatorSourcesStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigurationAggregatorSourcesStatusResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationAggregatorSourcesStatusError::from_response(response))
}))
}
})
}
fn describe_configuration_aggregators(
&self,
input: DescribeConfigurationAggregatorsRequest,
) -> RusotoFuture<DescribeConfigurationAggregatorsResponse, DescribeConfigurationAggregatorsError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeConfigurationAggregators",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigurationAggregatorsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationAggregatorsError::from_response(
response,
))
}))
}
})
}
fn describe_configuration_recorder_status(
&self,
input: DescribeConfigurationRecorderStatusRequest,
) -> RusotoFuture<
DescribeConfigurationRecorderStatusResponse,
DescribeConfigurationRecorderStatusError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeConfigurationRecorderStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigurationRecorderStatusResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationRecorderStatusError::from_response(
response,
))
}))
}
})
}
fn describe_configuration_recorders(
&self,
input: DescribeConfigurationRecordersRequest,
) -> RusotoFuture<DescribeConfigurationRecordersResponse, DescribeConfigurationRecordersError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeConfigurationRecorders",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeConfigurationRecordersResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationRecordersError::from_response(response))
}))
}
})
}
fn describe_delivery_channel_status(
&self,
input: DescribeDeliveryChannelStatusRequest,
) -> RusotoFuture<DescribeDeliveryChannelStatusResponse, DescribeDeliveryChannelStatusError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeDeliveryChannelStatus",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeDeliveryChannelStatusResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDeliveryChannelStatusError::from_response(response))
}))
}
})
}
fn describe_delivery_channels(
&self,
input: DescribeDeliveryChannelsRequest,
) -> RusotoFuture<DescribeDeliveryChannelsResponse, DescribeDeliveryChannelsError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeDeliveryChannels",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeDeliveryChannelsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDeliveryChannelsError::from_response(response))
}))
}
})
}
fn describe_pending_aggregation_requests(
&self,
input: DescribePendingAggregationRequestsRequest,
) -> RusotoFuture<
DescribePendingAggregationRequestsResponse,
DescribePendingAggregationRequestsError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribePendingAggregationRequests",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribePendingAggregationRequestsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribePendingAggregationRequestsError::from_response(
response,
))
}))
}
})
}
fn describe_retention_configurations(
&self,
input: DescribeRetentionConfigurationsRequest,
) -> RusotoFuture<DescribeRetentionConfigurationsResponse, DescribeRetentionConfigurationsError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.DescribeRetentionConfigurations",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<DescribeRetentionConfigurationsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeRetentionConfigurationsError::from_response(
response,
))
}))
}
})
}
fn get_aggregate_compliance_details_by_config_rule(
&self,
input: GetAggregateComplianceDetailsByConfigRuleRequest,
) -> RusotoFuture<
GetAggregateComplianceDetailsByConfigRuleResponse,
GetAggregateComplianceDetailsByConfigRuleError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetAggregateComplianceDetailsByConfigRule",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetAggregateComplianceDetailsByConfigRuleResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetAggregateComplianceDetailsByConfigRuleError::from_response(response))
}))
}
})
}
fn get_aggregate_config_rule_compliance_summary(
&self,
input: GetAggregateConfigRuleComplianceSummaryRequest,
) -> RusotoFuture<
GetAggregateConfigRuleComplianceSummaryResponse,
GetAggregateConfigRuleComplianceSummaryError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetAggregateConfigRuleComplianceSummary",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetAggregateConfigRuleComplianceSummaryResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetAggregateConfigRuleComplianceSummaryError::from_response(
response,
))
}))
}
})
}
fn get_aggregate_discovered_resource_counts(
&self,
input: GetAggregateDiscoveredResourceCountsRequest,
) -> RusotoFuture<
GetAggregateDiscoveredResourceCountsResponse,
GetAggregateDiscoveredResourceCountsError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetAggregateDiscoveredResourceCounts",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetAggregateDiscoveredResourceCountsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetAggregateDiscoveredResourceCountsError::from_response(
response,
))
}))
}
})
}
fn get_aggregate_resource_config(
&self,
input: GetAggregateResourceConfigRequest,
) -> RusotoFuture<GetAggregateResourceConfigResponse, GetAggregateResourceConfigError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetAggregateResourceConfig",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetAggregateResourceConfigResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetAggregateResourceConfigError::from_response(response))
}))
}
})
}
fn get_compliance_details_by_config_rule(
&self,
input: GetComplianceDetailsByConfigRuleRequest,
) -> RusotoFuture<GetComplianceDetailsByConfigRuleResponse, GetComplianceDetailsByConfigRuleError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetComplianceDetailsByConfigRule",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetComplianceDetailsByConfigRuleResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetComplianceDetailsByConfigRuleError::from_response(
response,
))
}))
}
})
}
fn get_compliance_details_by_resource(
&self,
input: GetComplianceDetailsByResourceRequest,
) -> RusotoFuture<GetComplianceDetailsByResourceResponse, GetComplianceDetailsByResourceError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetComplianceDetailsByResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetComplianceDetailsByResourceResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetComplianceDetailsByResourceError::from_response(response))
}))
}
})
}
fn get_compliance_summary_by_config_rule(
&self,
) -> RusotoFuture<GetComplianceSummaryByConfigRuleResponse, GetComplianceSummaryByConfigRuleError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetComplianceSummaryByConfigRule",
);
request.set_payload(Some(b"{}".to_vec()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetComplianceSummaryByConfigRuleResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetComplianceSummaryByConfigRuleError::from_response(
response,
))
}))
}
})
}
fn get_compliance_summary_by_resource_type(
&self,
input: GetComplianceSummaryByResourceTypeRequest,
) -> RusotoFuture<
GetComplianceSummaryByResourceTypeResponse,
GetComplianceSummaryByResourceTypeError,
> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetComplianceSummaryByResourceType",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetComplianceSummaryByResourceTypeResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetComplianceSummaryByResourceTypeError::from_response(
response,
))
}))
}
})
}
fn get_discovered_resource_counts(
&self,
input: GetDiscoveredResourceCountsRequest,
) -> RusotoFuture<GetDiscoveredResourceCountsResponse, GetDiscoveredResourceCountsError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetDiscoveredResourceCounts",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetDiscoveredResourceCountsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetDiscoveredResourceCountsError::from_response(response))
}))
}
})
}
fn get_resource_config_history(
&self,
input: GetResourceConfigHistoryRequest,
) -> RusotoFuture<GetResourceConfigHistoryResponse, GetResourceConfigHistoryError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.GetResourceConfigHistory",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<GetResourceConfigHistoryResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(GetResourceConfigHistoryError::from_response(response))
}))
}
})
}
fn list_aggregate_discovered_resources(
&self,
input: ListAggregateDiscoveredResourcesRequest,
) -> RusotoFuture<ListAggregateDiscoveredResourcesResponse, ListAggregateDiscoveredResourcesError>
{
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.ListAggregateDiscoveredResources",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListAggregateDiscoveredResourcesResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListAggregateDiscoveredResourcesError::from_response(
response,
))
}))
}
})
}
fn list_discovered_resources(
&self,
input: ListDiscoveredResourcesRequest,
) -> RusotoFuture<ListDiscoveredResourcesResponse, ListDiscoveredResourcesError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.ListDiscoveredResources",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<ListDiscoveredResourcesResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListDiscoveredResourcesError::from_response(response))
}))
}
})
}
fn put_aggregation_authorization(
&self,
input: PutAggregationAuthorizationRequest,
) -> RusotoFuture<PutAggregationAuthorizationResponse, PutAggregationAuthorizationError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.PutAggregationAuthorization",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<PutAggregationAuthorizationResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(PutAggregationAuthorizationError::from_response(response))
}))
}
})
}
fn put_config_rule(&self, input: PutConfigRuleRequest) -> RusotoFuture<(), PutConfigRuleError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.PutConfigRule");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(PutConfigRuleError::from_response(response))),
)
}
})
}
fn put_configuration_aggregator(
&self,
input: PutConfigurationAggregatorRequest,
) -> RusotoFuture<PutConfigurationAggregatorResponse, PutConfigurationAggregatorError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.PutConfigurationAggregator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<PutConfigurationAggregatorResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(PutConfigurationAggregatorError::from_response(response))
}))
}
})
}
fn put_configuration_recorder(
&self,
input: PutConfigurationRecorderRequest,
) -> RusotoFuture<(), PutConfigurationRecorderError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.PutConfigurationRecorder",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(PutConfigurationRecorderError::from_response(response))
}))
}
})
}
fn put_delivery_channel(
&self,
input: PutDeliveryChannelRequest,
) -> RusotoFuture<(), PutDeliveryChannelError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.PutDeliveryChannel");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(PutDeliveryChannelError::from_response(response))),
)
}
})
}
fn put_evaluations(
&self,
input: PutEvaluationsRequest,
) -> RusotoFuture<PutEvaluationsResponse, PutEvaluationsError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "StarlingDoveService.PutEvaluations");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<PutEvaluationsResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(PutEvaluationsError::from_response(response))),
)
}
})
}
fn put_retention_configuration(
&self,
input: PutRetentionConfigurationRequest,
) -> RusotoFuture<PutRetentionConfigurationResponse, PutRetentionConfigurationError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.PutRetentionConfiguration",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<PutRetentionConfigurationResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(PutRetentionConfigurationError::from_response(response))
}))
}
})
}
fn start_config_rules_evaluation(
&self,
input: StartConfigRulesEvaluationRequest,
) -> RusotoFuture<StartConfigRulesEvaluationResponse, StartConfigRulesEvaluationError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.StartConfigRulesEvaluation",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body.is_empty() || body == b"null" {
body = b"{}".to_vec();
}
serde_json::from_str::<StartConfigRulesEvaluationResponse>(
String::from_utf8_lossy(body.as_ref()).as_ref(),
)
.unwrap()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(StartConfigRulesEvaluationError::from_response(response))
}))
}
})
}
fn start_configuration_recorder(
&self,
input: StartConfigurationRecorderRequest,
) -> RusotoFuture<(), StartConfigurationRecorderError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.StartConfigurationRecorder",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(StartConfigurationRecorderError::from_response(response))
}))
}
})
}
fn stop_configuration_recorder(
&self,
input: StopConfigurationRecorderRequest,
) -> RusotoFuture<(), StopConfigurationRecorderError> {
let mut request = SignedRequest::new("POST", "config", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header(
"x-amz-target",
"StarlingDoveService.StopConfigurationRecorder",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded.into_bytes()));
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(StopConfigurationRecorderError::from_response(response))
}))
}
})
}
}
#[cfg(test)]
mod protocol_tests {}