use std::error::Error;
use std::fmt;
use async_trait::async_trait;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError};
use rusoto_core::proto;
use rusoto_core::request::HttpResponse;
use rusoto_core::signature::SignedRequest;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};
impl ShieldClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request = SignedRequest::new(http_method, "shield", &self.region, request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
request
}
async fn sign_and_dispatch<E>(
&self,
request: SignedRequest,
from_response: fn(BufferedHttpResponse) -> RusotoError<E>,
) -> Result<HttpResponse, RusotoError<E>> {
let mut response = self.client.sign_and_dispatch(request).await?;
if !response.status.is_success() {
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
return Err(from_response(response));
}
Ok(response)
}
}
use serde_json;
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AssociateDRTLogBucketRequest {
#[serde(rename = "LogBucket")]
pub log_bucket: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssociateDRTLogBucketResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AssociateDRTRoleRequest {
#[serde(rename = "RoleArn")]
pub role_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssociateDRTRoleResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AssociateHealthCheckRequest {
#[serde(rename = "HealthCheckArn")]
pub health_check_arn: String,
#[serde(rename = "ProtectionId")]
pub protection_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssociateHealthCheckResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AssociateProactiveEngagementDetailsRequest {
#[serde(rename = "EmergencyContactList")]
pub emergency_contact_list: Vec<EmergencyContact>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AssociateProactiveEngagementDetailsResponse {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AttackDetail {
#[serde(rename = "AttackCounters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_counters: Option<Vec<SummarizedCounter>>,
#[serde(rename = "AttackId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_id: Option<String>,
#[serde(rename = "AttackProperties")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_properties: Option<Vec<AttackProperty>>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "Mitigations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mitigations: Option<Vec<Mitigation>>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
#[serde(rename = "SubResources")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sub_resources: Option<Vec<SubResourceSummary>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AttackProperty {
#[serde(rename = "AttackLayer")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_layer: Option<String>,
#[serde(rename = "AttackPropertyIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_property_identifier: Option<String>,
#[serde(rename = "TopContributors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub top_contributors: Option<Vec<Contributor>>,
#[serde(rename = "Total")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total: Option<i64>,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AttackSummary {
#[serde(rename = "AttackId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_id: Option<String>,
#[serde(rename = "AttackVectors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_vectors: Option<Vec<AttackVectorDescription>>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AttackVectorDescription {
#[serde(rename = "VectorType")]
pub vector_type: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Contributor {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<i64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateProtectionRequest {
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateProtectionResponse {
#[serde(rename = "ProtectionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protection_id: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateSubscriptionRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateSubscriptionResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteProtectionRequest {
#[serde(rename = "ProtectionId")]
pub protection_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteProtectionResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteSubscriptionRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeleteSubscriptionResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAttackRequest {
#[serde(rename = "AttackId")]
pub attack_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAttackResponse {
#[serde(rename = "Attack")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack: Option<AttackDetail>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeDRTAccessRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeDRTAccessResponse {
#[serde(rename = "LogBucketList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub log_bucket_list: Option<Vec<String>>,
#[serde(rename = "RoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub role_arn: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEmergencyContactSettingsRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEmergencyContactSettingsResponse {
#[serde(rename = "EmergencyContactList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emergency_contact_list: Option<Vec<EmergencyContact>>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeProtectionRequest {
#[serde(rename = "ProtectionId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protection_id: Option<String>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeProtectionResponse {
#[serde(rename = "Protection")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protection: Option<Protection>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeSubscriptionRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeSubscriptionResponse {
#[serde(rename = "Subscription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subscription: Option<Subscription>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DisableProactiveEngagementRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DisableProactiveEngagementResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DisassociateDRTLogBucketRequest {
#[serde(rename = "LogBucket")]
pub log_bucket: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DisassociateDRTLogBucketResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DisassociateDRTRoleRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DisassociateDRTRoleResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DisassociateHealthCheckRequest {
#[serde(rename = "HealthCheckArn")]
pub health_check_arn: String,
#[serde(rename = "ProtectionId")]
pub protection_id: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DisassociateHealthCheckResponse {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct EmergencyContact {
#[serde(rename = "ContactNotes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub contact_notes: Option<String>,
#[serde(rename = "EmailAddress")]
pub email_address: String,
#[serde(rename = "PhoneNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub phone_number: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EnableProactiveEngagementRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EnableProactiveEngagementResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct GetSubscriptionStateRequest {}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct GetSubscriptionStateResponse {
#[serde(rename = "SubscriptionState")]
pub subscription_state: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Limit {
#[serde(rename = "Max")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<i64>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListAttacksRequest {
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<TimeRange>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceArns")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arns: Option<Vec<String>>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<TimeRange>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListAttacksResponse {
#[serde(rename = "AttackSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_summaries: Option<Vec<AttackSummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListProtectionsRequest {
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListProtectionsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Protections")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protections: Option<Vec<Protection>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Mitigation {
#[serde(rename = "MitigationName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub mitigation_name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Protection {
#[serde(rename = "HealthCheckIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_ids: Option<Vec<String>>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "ResourceArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub resource_arn: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SubResourceSummary {
#[serde(rename = "AttackVectors")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attack_vectors: Option<Vec<SummarizedAttackVector>>,
#[serde(rename = "Counters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub counters: Option<Vec<SummarizedCounter>>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Type")]
#[serde(skip_serializing_if = "Option::is_none")]
pub type_: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Subscription {
#[serde(rename = "AutoRenew")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_renew: Option<String>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "Limits")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limits: Option<Vec<Limit>>,
#[serde(rename = "ProactiveEngagementStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub proactive_engagement_status: Option<String>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
#[serde(rename = "TimeCommitmentInSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_commitment_in_seconds: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SummarizedAttackVector {
#[serde(rename = "VectorCounters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vector_counters: Option<Vec<SummarizedCounter>>,
#[serde(rename = "VectorType")]
pub vector_type: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct SummarizedCounter {
#[serde(rename = "Average")]
#[serde(skip_serializing_if = "Option::is_none")]
pub average: Option<f64>,
#[serde(rename = "Max")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max: Option<f64>,
#[serde(rename = "N")]
#[serde(skip_serializing_if = "Option::is_none")]
pub n: Option<i64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Sum")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sum: Option<f64>,
#[serde(rename = "Unit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub unit: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TimeRange {
#[serde(rename = "FromInclusive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_inclusive: Option<f64>,
#[serde(rename = "ToExclusive")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to_exclusive: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateEmergencyContactSettingsRequest {
#[serde(rename = "EmergencyContactList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub emergency_contact_list: Option<Vec<EmergencyContact>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateEmergencyContactSettingsResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateSubscriptionRequest {
#[serde(rename = "AutoRenew")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_renew: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateSubscriptionResponse {}
#[derive(Debug, PartialEq)]
pub enum AssociateDRTLogBucketError {
AccessDeniedForDependency(String),
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
LimitsExceeded(String),
NoAssociatedRole(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl AssociateDRTLogBucketError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateDRTLogBucketError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedForDependencyException" => {
return RusotoError::Service(
AssociateDRTLogBucketError::AccessDeniedForDependency(err.msg),
)
}
"InternalErrorException" => {
return RusotoError::Service(AssociateDRTLogBucketError::InternalError(err.msg))
}
"InvalidOperationException" => {
return RusotoError::Service(AssociateDRTLogBucketError::InvalidOperation(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(AssociateDRTLogBucketError::InvalidParameter(
err.msg,
))
}
"LimitsExceededException" => {
return RusotoError::Service(AssociateDRTLogBucketError::LimitsExceeded(
err.msg,
))
}
"NoAssociatedRoleException" => {
return RusotoError::Service(AssociateDRTLogBucketError::NoAssociatedRole(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(AssociateDRTLogBucketError::OptimisticLock(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AssociateDRTLogBucketError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AssociateDRTLogBucketError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AssociateDRTLogBucketError::AccessDeniedForDependency(ref cause) => {
write!(f, "{}", cause)
}
AssociateDRTLogBucketError::InternalError(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::InvalidOperation(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::InvalidParameter(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::LimitsExceeded(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::NoAssociatedRole(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::OptimisticLock(ref cause) => write!(f, "{}", cause),
AssociateDRTLogBucketError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for AssociateDRTLogBucketError {}
#[derive(Debug, PartialEq)]
pub enum AssociateDRTRoleError {
AccessDeniedForDependency(String),
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl AssociateDRTRoleError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateDRTRoleError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedForDependencyException" => {
return RusotoError::Service(AssociateDRTRoleError::AccessDeniedForDependency(
err.msg,
))
}
"InternalErrorException" => {
return RusotoError::Service(AssociateDRTRoleError::InternalError(err.msg))
}
"InvalidOperationException" => {
return RusotoError::Service(AssociateDRTRoleError::InvalidOperation(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(AssociateDRTRoleError::InvalidParameter(err.msg))
}
"OptimisticLockException" => {
return RusotoError::Service(AssociateDRTRoleError::OptimisticLock(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AssociateDRTRoleError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AssociateDRTRoleError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AssociateDRTRoleError::AccessDeniedForDependency(ref cause) => write!(f, "{}", cause),
AssociateDRTRoleError::InternalError(ref cause) => write!(f, "{}", cause),
AssociateDRTRoleError::InvalidOperation(ref cause) => write!(f, "{}", cause),
AssociateDRTRoleError::InvalidParameter(ref cause) => write!(f, "{}", cause),
AssociateDRTRoleError::OptimisticLock(ref cause) => write!(f, "{}", cause),
AssociateDRTRoleError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for AssociateDRTRoleError {}
#[derive(Debug, PartialEq)]
pub enum AssociateHealthCheckError {
InternalError(String),
InvalidParameter(String),
LimitsExceeded(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl AssociateHealthCheckError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AssociateHealthCheckError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(AssociateHealthCheckError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(AssociateHealthCheckError::InvalidParameter(
err.msg,
))
}
"LimitsExceededException" => {
return RusotoError::Service(AssociateHealthCheckError::LimitsExceeded(err.msg))
}
"OptimisticLockException" => {
return RusotoError::Service(AssociateHealthCheckError::OptimisticLock(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(AssociateHealthCheckError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AssociateHealthCheckError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AssociateHealthCheckError::InternalError(ref cause) => write!(f, "{}", cause),
AssociateHealthCheckError::InvalidParameter(ref cause) => write!(f, "{}", cause),
AssociateHealthCheckError::LimitsExceeded(ref cause) => write!(f, "{}", cause),
AssociateHealthCheckError::OptimisticLock(ref cause) => write!(f, "{}", cause),
AssociateHealthCheckError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for AssociateHealthCheckError {}
#[derive(Debug, PartialEq)]
pub enum AssociateProactiveEngagementDetailsError {
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl AssociateProactiveEngagementDetailsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<AssociateProactiveEngagementDetailsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(
AssociateProactiveEngagementDetailsError::InternalError(err.msg),
)
}
"InvalidOperationException" => {
return RusotoError::Service(
AssociateProactiveEngagementDetailsError::InvalidOperation(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(
AssociateProactiveEngagementDetailsError::InvalidParameter(err.msg),
)
}
"OptimisticLockException" => {
return RusotoError::Service(
AssociateProactiveEngagementDetailsError::OptimisticLock(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
AssociateProactiveEngagementDetailsError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AssociateProactiveEngagementDetailsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AssociateProactiveEngagementDetailsError::InternalError(ref cause) => {
write!(f, "{}", cause)
}
AssociateProactiveEngagementDetailsError::InvalidOperation(ref cause) => {
write!(f, "{}", cause)
}
AssociateProactiveEngagementDetailsError::InvalidParameter(ref cause) => {
write!(f, "{}", cause)
}
AssociateProactiveEngagementDetailsError::OptimisticLock(ref cause) => {
write!(f, "{}", cause)
}
AssociateProactiveEngagementDetailsError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for AssociateProactiveEngagementDetailsError {}
#[derive(Debug, PartialEq)]
pub enum CreateProtectionError {
InternalError(String),
InvalidOperation(String),
InvalidResource(String),
LimitsExceeded(String),
OptimisticLock(String),
ResourceAlreadyExists(String),
ResourceNotFound(String),
}
impl CreateProtectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateProtectionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(CreateProtectionError::InternalError(err.msg))
}
"InvalidOperationException" => {
return RusotoError::Service(CreateProtectionError::InvalidOperation(err.msg))
}
"InvalidResourceException" => {
return RusotoError::Service(CreateProtectionError::InvalidResource(err.msg))
}
"LimitsExceededException" => {
return RusotoError::Service(CreateProtectionError::LimitsExceeded(err.msg))
}
"OptimisticLockException" => {
return RusotoError::Service(CreateProtectionError::OptimisticLock(err.msg))
}
"ResourceAlreadyExistsException" => {
return RusotoError::Service(CreateProtectionError::ResourceAlreadyExists(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(CreateProtectionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateProtectionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateProtectionError::InternalError(ref cause) => write!(f, "{}", cause),
CreateProtectionError::InvalidOperation(ref cause) => write!(f, "{}", cause),
CreateProtectionError::InvalidResource(ref cause) => write!(f, "{}", cause),
CreateProtectionError::LimitsExceeded(ref cause) => write!(f, "{}", cause),
CreateProtectionError::OptimisticLock(ref cause) => write!(f, "{}", cause),
CreateProtectionError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
CreateProtectionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateProtectionError {}
#[derive(Debug, PartialEq)]
pub enum CreateSubscriptionError {
InternalError(String),
ResourceAlreadyExists(String),
}
impl CreateSubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(CreateSubscriptionError::InternalError(err.msg))
}
"ResourceAlreadyExistsException" => {
return RusotoError::Service(CreateSubscriptionError::ResourceAlreadyExists(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateSubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateSubscriptionError::InternalError(ref cause) => write!(f, "{}", cause),
CreateSubscriptionError::ResourceAlreadyExists(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateSubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteProtectionError {
InternalError(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl DeleteProtectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteProtectionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DeleteProtectionError::InternalError(err.msg))
}
"OptimisticLockException" => {
return RusotoError::Service(DeleteProtectionError::OptimisticLock(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteProtectionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteProtectionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteProtectionError::InternalError(ref cause) => write!(f, "{}", cause),
DeleteProtectionError::OptimisticLock(ref cause) => write!(f, "{}", cause),
DeleteProtectionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteProtectionError {}
#[derive(Debug, PartialEq)]
pub enum DeleteSubscriptionError {
InternalError(String),
LockedSubscription(String),
ResourceNotFound(String),
}
impl DeleteSubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DeleteSubscriptionError::InternalError(err.msg))
}
"LockedSubscriptionException" => {
return RusotoError::Service(DeleteSubscriptionError::LockedSubscription(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DeleteSubscriptionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteSubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteSubscriptionError::InternalError(ref cause) => write!(f, "{}", cause),
DeleteSubscriptionError::LockedSubscription(ref cause) => write!(f, "{}", cause),
DeleteSubscriptionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteSubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum DescribeAttackError {
AccessDenied(String),
InternalError(String),
}
impl DescribeAttackError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAttackError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DescribeAttackError::AccessDenied(err.msg))
}
"InternalErrorException" => {
return RusotoError::Service(DescribeAttackError::InternalError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAttackError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAttackError::AccessDenied(ref cause) => write!(f, "{}", cause),
DescribeAttackError::InternalError(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeAttackError {}
#[derive(Debug, PartialEq)]
pub enum DescribeDRTAccessError {
InternalError(String),
ResourceNotFound(String),
}
impl DescribeDRTAccessError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDRTAccessError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DescribeDRTAccessError::InternalError(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeDRTAccessError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeDRTAccessError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeDRTAccessError::InternalError(ref cause) => write!(f, "{}", cause),
DescribeDRTAccessError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeDRTAccessError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEmergencyContactSettingsError {
InternalError(String),
ResourceNotFound(String),
}
impl DescribeEmergencyContactSettingsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeEmergencyContactSettingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(
DescribeEmergencyContactSettingsError::InternalError(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
DescribeEmergencyContactSettingsError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEmergencyContactSettingsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEmergencyContactSettingsError::InternalError(ref cause) => {
write!(f, "{}", cause)
}
DescribeEmergencyContactSettingsError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeEmergencyContactSettingsError {}
#[derive(Debug, PartialEq)]
pub enum DescribeProtectionError {
InternalError(String),
InvalidParameter(String),
ResourceNotFound(String),
}
impl DescribeProtectionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeProtectionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DescribeProtectionError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(DescribeProtectionError::InvalidParameter(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeProtectionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeProtectionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeProtectionError::InternalError(ref cause) => write!(f, "{}", cause),
DescribeProtectionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DescribeProtectionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeProtectionError {}
#[derive(Debug, PartialEq)]
pub enum DescribeSubscriptionError {
InternalError(String),
ResourceNotFound(String),
}
impl DescribeSubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeSubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DescribeSubscriptionError::InternalError(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DescribeSubscriptionError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeSubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeSubscriptionError::InternalError(ref cause) => write!(f, "{}", cause),
DescribeSubscriptionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeSubscriptionError {}
#[derive(Debug, PartialEq)]
pub enum DisableProactiveEngagementError {
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl DisableProactiveEngagementError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DisableProactiveEngagementError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DisableProactiveEngagementError::InternalError(
err.msg,
))
}
"InvalidOperationException" => {
return RusotoError::Service(DisableProactiveEngagementError::InvalidOperation(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(DisableProactiveEngagementError::InvalidParameter(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(DisableProactiveEngagementError::OptimisticLock(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DisableProactiveEngagementError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisableProactiveEngagementError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisableProactiveEngagementError::InternalError(ref cause) => write!(f, "{}", cause),
DisableProactiveEngagementError::InvalidOperation(ref cause) => write!(f, "{}", cause),
DisableProactiveEngagementError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DisableProactiveEngagementError::OptimisticLock(ref cause) => write!(f, "{}", cause),
DisableProactiveEngagementError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DisableProactiveEngagementError {}
#[derive(Debug, PartialEq)]
pub enum DisassociateDRTLogBucketError {
AccessDeniedForDependency(String),
InternalError(String),
InvalidOperation(String),
NoAssociatedRole(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl DisassociateDRTLogBucketError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateDRTLogBucketError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedForDependencyException" => {
return RusotoError::Service(
DisassociateDRTLogBucketError::AccessDeniedForDependency(err.msg),
)
}
"InternalErrorException" => {
return RusotoError::Service(DisassociateDRTLogBucketError::InternalError(
err.msg,
))
}
"InvalidOperationException" => {
return RusotoError::Service(DisassociateDRTLogBucketError::InvalidOperation(
err.msg,
))
}
"NoAssociatedRoleException" => {
return RusotoError::Service(DisassociateDRTLogBucketError::NoAssociatedRole(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(DisassociateDRTLogBucketError::OptimisticLock(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DisassociateDRTLogBucketError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisassociateDRTLogBucketError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisassociateDRTLogBucketError::AccessDeniedForDependency(ref cause) => {
write!(f, "{}", cause)
}
DisassociateDRTLogBucketError::InternalError(ref cause) => write!(f, "{}", cause),
DisassociateDRTLogBucketError::InvalidOperation(ref cause) => write!(f, "{}", cause),
DisassociateDRTLogBucketError::NoAssociatedRole(ref cause) => write!(f, "{}", cause),
DisassociateDRTLogBucketError::OptimisticLock(ref cause) => write!(f, "{}", cause),
DisassociateDRTLogBucketError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DisassociateDRTLogBucketError {}
#[derive(Debug, PartialEq)]
pub enum DisassociateDRTRoleError {
InternalError(String),
InvalidOperation(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl DisassociateDRTRoleError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateDRTRoleError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DisassociateDRTRoleError::InternalError(err.msg))
}
"InvalidOperationException" => {
return RusotoError::Service(DisassociateDRTRoleError::InvalidOperation(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(DisassociateDRTRoleError::OptimisticLock(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DisassociateDRTRoleError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisassociateDRTRoleError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisassociateDRTRoleError::InternalError(ref cause) => write!(f, "{}", cause),
DisassociateDRTRoleError::InvalidOperation(ref cause) => write!(f, "{}", cause),
DisassociateDRTRoleError::OptimisticLock(ref cause) => write!(f, "{}", cause),
DisassociateDRTRoleError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DisassociateDRTRoleError {}
#[derive(Debug, PartialEq)]
pub enum DisassociateHealthCheckError {
InternalError(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl DisassociateHealthCheckError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DisassociateHealthCheckError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(DisassociateHealthCheckError::InternalError(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(DisassociateHealthCheckError::InvalidParameter(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(DisassociateHealthCheckError::OptimisticLock(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(DisassociateHealthCheckError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DisassociateHealthCheckError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DisassociateHealthCheckError::InternalError(ref cause) => write!(f, "{}", cause),
DisassociateHealthCheckError::InvalidParameter(ref cause) => write!(f, "{}", cause),
DisassociateHealthCheckError::OptimisticLock(ref cause) => write!(f, "{}", cause),
DisassociateHealthCheckError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DisassociateHealthCheckError {}
#[derive(Debug, PartialEq)]
pub enum EnableProactiveEngagementError {
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl EnableProactiveEngagementError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<EnableProactiveEngagementError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(EnableProactiveEngagementError::InternalError(
err.msg,
))
}
"InvalidOperationException" => {
return RusotoError::Service(EnableProactiveEngagementError::InvalidOperation(
err.msg,
))
}
"InvalidParameterException" => {
return RusotoError::Service(EnableProactiveEngagementError::InvalidParameter(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(EnableProactiveEngagementError::OptimisticLock(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(EnableProactiveEngagementError::ResourceNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for EnableProactiveEngagementError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
EnableProactiveEngagementError::InternalError(ref cause) => write!(f, "{}", cause),
EnableProactiveEngagementError::InvalidOperation(ref cause) => write!(f, "{}", cause),
EnableProactiveEngagementError::InvalidParameter(ref cause) => write!(f, "{}", cause),
EnableProactiveEngagementError::OptimisticLock(ref cause) => write!(f, "{}", cause),
EnableProactiveEngagementError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for EnableProactiveEngagementError {}
#[derive(Debug, PartialEq)]
pub enum GetSubscriptionStateError {
InternalError(String),
}
impl GetSubscriptionStateError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetSubscriptionStateError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(GetSubscriptionStateError::InternalError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for GetSubscriptionStateError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
GetSubscriptionStateError::InternalError(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for GetSubscriptionStateError {}
#[derive(Debug, PartialEq)]
pub enum ListAttacksError {
InternalError(String),
InvalidOperation(String),
InvalidParameter(String),
}
impl ListAttacksError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAttacksError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(ListAttacksError::InternalError(err.msg))
}
"InvalidOperationException" => {
return RusotoError::Service(ListAttacksError::InvalidOperation(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(ListAttacksError::InvalidParameter(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListAttacksError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListAttacksError::InternalError(ref cause) => write!(f, "{}", cause),
ListAttacksError::InvalidOperation(ref cause) => write!(f, "{}", cause),
ListAttacksError::InvalidParameter(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListAttacksError {}
#[derive(Debug, PartialEq)]
pub enum ListProtectionsError {
InternalError(String),
InvalidPaginationToken(String),
ResourceNotFound(String),
}
impl ListProtectionsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListProtectionsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(ListProtectionsError::InternalError(err.msg))
}
"InvalidPaginationTokenException" => {
return RusotoError::Service(ListProtectionsError::InvalidPaginationToken(
err.msg,
))
}
"ResourceNotFoundException" => {
return RusotoError::Service(ListProtectionsError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListProtectionsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListProtectionsError::InternalError(ref cause) => write!(f, "{}", cause),
ListProtectionsError::InvalidPaginationToken(ref cause) => write!(f, "{}", cause),
ListProtectionsError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListProtectionsError {}
#[derive(Debug, PartialEq)]
pub enum UpdateEmergencyContactSettingsError {
InternalError(String),
InvalidParameter(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl UpdateEmergencyContactSettingsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateEmergencyContactSettingsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(
UpdateEmergencyContactSettingsError::InternalError(err.msg),
)
}
"InvalidParameterException" => {
return RusotoError::Service(
UpdateEmergencyContactSettingsError::InvalidParameter(err.msg),
)
}
"OptimisticLockException" => {
return RusotoError::Service(
UpdateEmergencyContactSettingsError::OptimisticLock(err.msg),
)
}
"ResourceNotFoundException" => {
return RusotoError::Service(
UpdateEmergencyContactSettingsError::ResourceNotFound(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateEmergencyContactSettingsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateEmergencyContactSettingsError::InternalError(ref cause) => write!(f, "{}", cause),
UpdateEmergencyContactSettingsError::InvalidParameter(ref cause) => {
write!(f, "{}", cause)
}
UpdateEmergencyContactSettingsError::OptimisticLock(ref cause) => {
write!(f, "{}", cause)
}
UpdateEmergencyContactSettingsError::ResourceNotFound(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for UpdateEmergencyContactSettingsError {}
#[derive(Debug, PartialEq)]
pub enum UpdateSubscriptionError {
InternalError(String),
InvalidParameter(String),
LockedSubscription(String),
OptimisticLock(String),
ResourceNotFound(String),
}
impl UpdateSubscriptionError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateSubscriptionError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalErrorException" => {
return RusotoError::Service(UpdateSubscriptionError::InternalError(err.msg))
}
"InvalidParameterException" => {
return RusotoError::Service(UpdateSubscriptionError::InvalidParameter(err.msg))
}
"LockedSubscriptionException" => {
return RusotoError::Service(UpdateSubscriptionError::LockedSubscription(
err.msg,
))
}
"OptimisticLockException" => {
return RusotoError::Service(UpdateSubscriptionError::OptimisticLock(err.msg))
}
"ResourceNotFoundException" => {
return RusotoError::Service(UpdateSubscriptionError::ResourceNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateSubscriptionError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateSubscriptionError::InternalError(ref cause) => write!(f, "{}", cause),
UpdateSubscriptionError::InvalidParameter(ref cause) => write!(f, "{}", cause),
UpdateSubscriptionError::LockedSubscription(ref cause) => write!(f, "{}", cause),
UpdateSubscriptionError::OptimisticLock(ref cause) => write!(f, "{}", cause),
UpdateSubscriptionError::ResourceNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateSubscriptionError {}
#[async_trait]
pub trait Shield {
async fn associate_drt_log_bucket(
&self,
input: AssociateDRTLogBucketRequest,
) -> Result<AssociateDRTLogBucketResponse, RusotoError<AssociateDRTLogBucketError>>;
async fn associate_drt_role(
&self,
input: AssociateDRTRoleRequest,
) -> Result<AssociateDRTRoleResponse, RusotoError<AssociateDRTRoleError>>;
async fn associate_health_check(
&self,
input: AssociateHealthCheckRequest,
) -> Result<AssociateHealthCheckResponse, RusotoError<AssociateHealthCheckError>>;
async fn associate_proactive_engagement_details(
&self,
input: AssociateProactiveEngagementDetailsRequest,
) -> Result<
AssociateProactiveEngagementDetailsResponse,
RusotoError<AssociateProactiveEngagementDetailsError>,
>;
async fn create_protection(
&self,
input: CreateProtectionRequest,
) -> Result<CreateProtectionResponse, RusotoError<CreateProtectionError>>;
async fn create_subscription(
&self,
) -> Result<CreateSubscriptionResponse, RusotoError<CreateSubscriptionError>>;
async fn delete_protection(
&self,
input: DeleteProtectionRequest,
) -> Result<DeleteProtectionResponse, RusotoError<DeleteProtectionError>>;
async fn delete_subscription(
&self,
) -> Result<DeleteSubscriptionResponse, RusotoError<DeleteSubscriptionError>>;
async fn describe_attack(
&self,
input: DescribeAttackRequest,
) -> Result<DescribeAttackResponse, RusotoError<DescribeAttackError>>;
async fn describe_drt_access(
&self,
) -> Result<DescribeDRTAccessResponse, RusotoError<DescribeDRTAccessError>>;
async fn describe_emergency_contact_settings(
&self,
) -> Result<
DescribeEmergencyContactSettingsResponse,
RusotoError<DescribeEmergencyContactSettingsError>,
>;
async fn describe_protection(
&self,
input: DescribeProtectionRequest,
) -> Result<DescribeProtectionResponse, RusotoError<DescribeProtectionError>>;
async fn describe_subscription(
&self,
) -> Result<DescribeSubscriptionResponse, RusotoError<DescribeSubscriptionError>>;
async fn disable_proactive_engagement(
&self,
) -> Result<DisableProactiveEngagementResponse, RusotoError<DisableProactiveEngagementError>>;
async fn disassociate_drt_log_bucket(
&self,
input: DisassociateDRTLogBucketRequest,
) -> Result<DisassociateDRTLogBucketResponse, RusotoError<DisassociateDRTLogBucketError>>;
async fn disassociate_drt_role(
&self,
) -> Result<DisassociateDRTRoleResponse, RusotoError<DisassociateDRTRoleError>>;
async fn disassociate_health_check(
&self,
input: DisassociateHealthCheckRequest,
) -> Result<DisassociateHealthCheckResponse, RusotoError<DisassociateHealthCheckError>>;
async fn enable_proactive_engagement(
&self,
) -> Result<EnableProactiveEngagementResponse, RusotoError<EnableProactiveEngagementError>>;
async fn get_subscription_state(
&self,
) -> Result<GetSubscriptionStateResponse, RusotoError<GetSubscriptionStateError>>;
async fn list_attacks(
&self,
input: ListAttacksRequest,
) -> Result<ListAttacksResponse, RusotoError<ListAttacksError>>;
async fn list_protections(
&self,
input: ListProtectionsRequest,
) -> Result<ListProtectionsResponse, RusotoError<ListProtectionsError>>;
async fn update_emergency_contact_settings(
&self,
input: UpdateEmergencyContactSettingsRequest,
) -> Result<
UpdateEmergencyContactSettingsResponse,
RusotoError<UpdateEmergencyContactSettingsError>,
>;
async fn update_subscription(
&self,
input: UpdateSubscriptionRequest,
) -> Result<UpdateSubscriptionResponse, RusotoError<UpdateSubscriptionError>>;
}
#[derive(Clone)]
pub struct ShieldClient {
client: Client,
region: region::Region,
}
impl ShieldClient {
pub fn new(region: region::Region) -> ShieldClient {
ShieldClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> ShieldClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
ShieldClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> ShieldClient {
ShieldClient { client, region }
}
}
#[async_trait]
impl Shield for ShieldClient {
async fn associate_drt_log_bucket(
&self,
input: AssociateDRTLogBucketRequest,
) -> Result<AssociateDRTLogBucketResponse, RusotoError<AssociateDRTLogBucketError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.AssociateDRTLogBucket");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, AssociateDRTLogBucketError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateDRTLogBucketResponse, _>()
}
async fn associate_drt_role(
&self,
input: AssociateDRTRoleRequest,
) -> Result<AssociateDRTRoleResponse, RusotoError<AssociateDRTRoleError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.AssociateDRTRole");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, AssociateDRTRoleError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<AssociateDRTRoleResponse, _>()
}
async fn associate_health_check(
&self,
input: AssociateHealthCheckRequest,
) -> Result<AssociateHealthCheckResponse, RusotoError<AssociateHealthCheckError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.AssociateHealthCheck");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, AssociateHealthCheckError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateHealthCheckResponse, _>()
}
async fn associate_proactive_engagement_details(
&self,
input: AssociateProactiveEngagementDetailsRequest,
) -> Result<
AssociateProactiveEngagementDetailsResponse,
RusotoError<AssociateProactiveEngagementDetailsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.AssociateProactiveEngagementDetails",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(
request,
AssociateProactiveEngagementDetailsError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<AssociateProactiveEngagementDetailsResponse, _>()
}
async fn create_protection(
&self,
input: CreateProtectionRequest,
) -> Result<CreateProtectionResponse, RusotoError<CreateProtectionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.CreateProtection");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateProtectionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateProtectionResponse, _>()
}
async fn create_subscription(
&self,
) -> Result<CreateSubscriptionResponse, RusotoError<CreateSubscriptionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.CreateSubscription");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, CreateSubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateSubscriptionResponse, _>()
}
async fn delete_protection(
&self,
input: DeleteProtectionRequest,
) -> Result<DeleteProtectionResponse, RusotoError<DeleteProtectionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DeleteProtection");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteProtectionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteProtectionResponse, _>()
}
async fn delete_subscription(
&self,
) -> Result<DeleteSubscriptionResponse, RusotoError<DeleteSubscriptionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DeleteSubscription");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, DeleteSubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DeleteSubscriptionResponse, _>()
}
async fn describe_attack(
&self,
input: DescribeAttackRequest,
) -> Result<DescribeAttackResponse, RusotoError<DescribeAttackError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DescribeAttack");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeAttackError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeAttackResponse, _>()
}
async fn describe_drt_access(
&self,
) -> Result<DescribeDRTAccessResponse, RusotoError<DescribeDRTAccessError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DescribeDRTAccess");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, DescribeDRTAccessError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeDRTAccessResponse, _>()
}
async fn describe_emergency_contact_settings(
&self,
) -> Result<
DescribeEmergencyContactSettingsResponse,
RusotoError<DescribeEmergencyContactSettingsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.DescribeEmergencyContactSettings",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(
request,
DescribeEmergencyContactSettingsError::from_response,
)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEmergencyContactSettingsResponse, _>()
}
async fn describe_protection(
&self,
input: DescribeProtectionRequest,
) -> Result<DescribeProtectionResponse, RusotoError<DescribeProtectionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DescribeProtection");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeProtectionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeProtectionResponse, _>()
}
async fn describe_subscription(
&self,
) -> Result<DescribeSubscriptionResponse, RusotoError<DescribeSubscriptionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DescribeSubscription");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, DescribeSubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSubscriptionResponse, _>()
}
async fn disable_proactive_engagement(
&self,
) -> Result<DisableProactiveEngagementResponse, RusotoError<DisableProactiveEngagementError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.DisableProactiveEngagement",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, DisableProactiveEngagementError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DisableProactiveEngagementResponse, _>()
}
async fn disassociate_drt_log_bucket(
&self,
input: DisassociateDRTLogBucketRequest,
) -> Result<DisassociateDRTLogBucketResponse, RusotoError<DisassociateDRTLogBucketError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.DisassociateDRTLogBucket",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DisassociateDRTLogBucketError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateDRTLogBucketResponse, _>()
}
async fn disassociate_drt_role(
&self,
) -> Result<DisassociateDRTRoleResponse, RusotoError<DisassociateDRTRoleError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DisassociateDRTRole");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, DisassociateDRTRoleError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DisassociateDRTRoleResponse, _>()
}
async fn disassociate_health_check(
&self,
input: DisassociateHealthCheckRequest,
) -> Result<DisassociateHealthCheckResponse, RusotoError<DisassociateHealthCheckError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.DisassociateHealthCheck");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DisassociateHealthCheckError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DisassociateHealthCheckResponse, _>()
}
async fn enable_proactive_engagement(
&self,
) -> Result<EnableProactiveEngagementResponse, RusotoError<EnableProactiveEngagementError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.EnableProactiveEngagement",
);
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, EnableProactiveEngagementError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<EnableProactiveEngagementResponse, _>()
}
async fn get_subscription_state(
&self,
) -> Result<GetSubscriptionStateResponse, RusotoError<GetSubscriptionStateError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.GetSubscriptionState");
request.set_payload(Some(bytes::Bytes::from_static(b"{}")));
let response = self
.sign_and_dispatch(request, GetSubscriptionStateError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<GetSubscriptionStateResponse, _>()
}
async fn list_attacks(
&self,
input: ListAttacksRequest,
) -> Result<ListAttacksResponse, RusotoError<ListAttacksError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.ListAttacks");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListAttacksError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListAttacksResponse, _>()
}
async fn list_protections(
&self,
input: ListProtectionsRequest,
) -> Result<ListProtectionsResponse, RusotoError<ListProtectionsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.ListProtections");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListProtectionsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListProtectionsResponse, _>()
}
async fn update_emergency_contact_settings(
&self,
input: UpdateEmergencyContactSettingsRequest,
) -> Result<
UpdateEmergencyContactSettingsResponse,
RusotoError<UpdateEmergencyContactSettingsError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"AWSShield_20160616.UpdateEmergencyContactSettings",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateEmergencyContactSettingsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateEmergencyContactSettingsResponse, _>()
}
async fn update_subscription(
&self,
input: UpdateSubscriptionRequest,
) -> Result<UpdateSubscriptionResponse, RusotoError<UpdateSubscriptionError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "AWSShield_20160616.UpdateSubscription");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateSubscriptionError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateSubscriptionResponse, _>()
}
}