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 GlobalAcceleratorClient {
fn new_signed_request(&self, http_method: &str, request_uri: &str) -> SignedRequest {
let mut request =
SignedRequest::new(http_method, "globalaccelerator", &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, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Accelerator {
#[serde(rename = "AcceleratorArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_arn: Option<String>,
#[serde(rename = "CreatedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created_time: Option<f64>,
#[serde(rename = "DnsName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub dns_name: Option<String>,
#[serde(rename = "Enabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "IpAddressType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address_type: Option<String>,
#[serde(rename = "IpSets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_sets: Option<Vec<IpSet>>,
#[serde(rename = "LastModifiedTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified_time: Option<f64>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AcceleratorAttributes {
#[serde(rename = "FlowLogsEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_enabled: Option<bool>,
#[serde(rename = "FlowLogsS3Bucket")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_s3_bucket: Option<String>,
#[serde(rename = "FlowLogsS3Prefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_s3_prefix: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct AdvertiseByoipCidrRequest {
#[serde(rename = "Cidr")]
pub cidr: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct AdvertiseByoipCidrResponse {
#[serde(rename = "ByoipCidr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub byoip_cidr: Option<ByoipCidr>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ByoipCidr {
#[serde(rename = "Cidr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cidr: Option<String>,
#[serde(rename = "Events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<ByoipCidrEvent>>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ByoipCidrEvent {
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "Timestamp")]
#[serde(skip_serializing_if = "Option::is_none")]
pub timestamp: Option<f64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CidrAuthorizationContext {
#[serde(rename = "Message")]
pub message: String,
#[serde(rename = "Signature")]
pub signature: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateAcceleratorRequest {
#[serde(rename = "Enabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "IpAddressType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address_type: Option<String>,
#[serde(rename = "IpAddresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_addresses: Option<Vec<String>>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateAcceleratorResponse {
#[serde(rename = "Accelerator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator: Option<Accelerator>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateEndpointGroupRequest {
#[serde(rename = "EndpointConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_configurations: Option<Vec<EndpointConfiguration>>,
#[serde(rename = "EndpointGroupRegion")]
pub endpoint_group_region: String,
#[serde(rename = "HealthCheckIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_interval_seconds: Option<i64>,
#[serde(rename = "HealthCheckPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_path: Option<String>,
#[serde(rename = "HealthCheckPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_port: Option<i64>,
#[serde(rename = "HealthCheckProtocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_protocol: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "ListenerArn")]
pub listener_arn: String,
#[serde(rename = "ThresholdCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold_count: Option<i64>,
#[serde(rename = "TrafficDialPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub traffic_dial_percentage: Option<f32>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateEndpointGroupResponse {
#[serde(rename = "EndpointGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_group: Option<EndpointGroup>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct CreateListenerRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
#[serde(rename = "ClientAffinity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_affinity: Option<String>,
#[serde(rename = "IdempotencyToken")]
pub idempotency_token: String,
#[serde(rename = "PortRanges")]
pub port_ranges: Vec<PortRange>,
#[serde(rename = "Protocol")]
pub protocol: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct CreateListenerResponse {
#[serde(rename = "Listener")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listener: Option<Listener>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteAcceleratorRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteEndpointGroupRequest {
#[serde(rename = "EndpointGroupArn")]
pub endpoint_group_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeleteListenerRequest {
#[serde(rename = "ListenerArn")]
pub listener_arn: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DeprovisionByoipCidrRequest {
#[serde(rename = "Cidr")]
pub cidr: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DeprovisionByoipCidrResponse {
#[serde(rename = "ByoipCidr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub byoip_cidr: Option<ByoipCidr>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAcceleratorAttributesRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAcceleratorAttributesResponse {
#[serde(rename = "AcceleratorAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_attributes: Option<AcceleratorAttributes>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeAcceleratorRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeAcceleratorResponse {
#[serde(rename = "Accelerator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator: Option<Accelerator>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeEndpointGroupRequest {
#[serde(rename = "EndpointGroupArn")]
pub endpoint_group_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeEndpointGroupResponse {
#[serde(rename = "EndpointGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_group: Option<EndpointGroup>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct DescribeListenerRequest {
#[serde(rename = "ListenerArn")]
pub listener_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct DescribeListenerResponse {
#[serde(rename = "Listener")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listener: Option<Listener>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct EndpointConfiguration {
#[serde(rename = "ClientIPPreservationEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_ip_preservation_enabled: Option<bool>,
#[serde(rename = "EndpointId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_id: Option<String>,
#[serde(rename = "Weight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub weight: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EndpointDescription {
#[serde(rename = "ClientIPPreservationEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_ip_preservation_enabled: Option<bool>,
#[serde(rename = "EndpointId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_id: Option<String>,
#[serde(rename = "HealthReason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_reason: Option<String>,
#[serde(rename = "HealthState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_state: Option<String>,
#[serde(rename = "Weight")]
#[serde(skip_serializing_if = "Option::is_none")]
pub weight: Option<i64>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct EndpointGroup {
#[serde(rename = "EndpointDescriptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_descriptions: Option<Vec<EndpointDescription>>,
#[serde(rename = "EndpointGroupArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_group_arn: Option<String>,
#[serde(rename = "EndpointGroupRegion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_group_region: Option<String>,
#[serde(rename = "HealthCheckIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_interval_seconds: Option<i64>,
#[serde(rename = "HealthCheckPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_path: Option<String>,
#[serde(rename = "HealthCheckPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_port: Option<i64>,
#[serde(rename = "HealthCheckProtocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_protocol: Option<String>,
#[serde(rename = "ThresholdCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold_count: Option<i64>,
#[serde(rename = "TrafficDialPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub traffic_dial_percentage: Option<f32>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct IpSet {
#[serde(rename = "IpAddresses")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_addresses: Option<Vec<String>>,
#[serde(rename = "IpFamily")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_family: Option<String>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ListAcceleratorsRequest {
#[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 ListAcceleratorsResponse {
#[serde(rename = "Accelerators")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerators: Option<Vec<Accelerator>>,
#[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 ListByoipCidrsRequest {
#[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 ListByoipCidrsResponse {
#[serde(rename = "ByoipCidrs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub byoip_cidrs: Option<Vec<ByoipCidr>>,
#[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 ListEndpointGroupsRequest {
#[serde(rename = "ListenerArn")]
pub listener_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListEndpointGroupsResponse {
#[serde(rename = "EndpointGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_groups: Option<Vec<EndpointGroup>>,
#[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 ListListenersRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListListenersResponse {
#[serde(rename = "Listeners")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listeners: Option<Vec<Listener>>,
#[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 ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct Listener {
#[serde(rename = "ClientAffinity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_affinity: Option<String>,
#[serde(rename = "ListenerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listener_arn: Option<String>,
#[serde(rename = "PortRanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_ranges: Option<Vec<PortRange>>,
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct PortRange {
#[serde(rename = "FromPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub from_port: Option<i64>,
#[serde(rename = "ToPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub to_port: Option<i64>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct ProvisionByoipCidrRequest {
#[serde(rename = "Cidr")]
pub cidr: String,
#[serde(rename = "CidrAuthorizationContext")]
pub cidr_authorization_context: CidrAuthorizationContext,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct ProvisionByoipCidrResponse {
#[serde(rename = "ByoipCidr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub byoip_cidr: Option<ByoipCidr>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
pub struct Tag {
#[serde(rename = "Key")]
pub key: String,
#[serde(rename = "Value")]
pub value: String,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct TagResourceResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UntagResourceResponse {}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateAcceleratorAttributesRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
#[serde(rename = "FlowLogsEnabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_enabled: Option<bool>,
#[serde(rename = "FlowLogsS3Bucket")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_s3_bucket: Option<String>,
#[serde(rename = "FlowLogsS3Prefix")]
#[serde(skip_serializing_if = "Option::is_none")]
pub flow_logs_s3_prefix: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateAcceleratorAttributesResponse {
#[serde(rename = "AcceleratorAttributes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator_attributes: Option<AcceleratorAttributes>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateAcceleratorRequest {
#[serde(rename = "AcceleratorArn")]
pub accelerator_arn: String,
#[serde(rename = "Enabled")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(rename = "IpAddressType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address_type: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateAcceleratorResponse {
#[serde(rename = "Accelerator")]
#[serde(skip_serializing_if = "Option::is_none")]
pub accelerator: Option<Accelerator>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateEndpointGroupRequest {
#[serde(rename = "EndpointConfigurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_configurations: Option<Vec<EndpointConfiguration>>,
#[serde(rename = "EndpointGroupArn")]
pub endpoint_group_arn: String,
#[serde(rename = "HealthCheckIntervalSeconds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_interval_seconds: Option<i64>,
#[serde(rename = "HealthCheckPath")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_path: Option<String>,
#[serde(rename = "HealthCheckPort")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_port: Option<i64>,
#[serde(rename = "HealthCheckProtocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub health_check_protocol: Option<String>,
#[serde(rename = "ThresholdCount")]
#[serde(skip_serializing_if = "Option::is_none")]
pub threshold_count: Option<i64>,
#[serde(rename = "TrafficDialPercentage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub traffic_dial_percentage: Option<f32>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateEndpointGroupResponse {
#[serde(rename = "EndpointGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint_group: Option<EndpointGroup>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct UpdateListenerRequest {
#[serde(rename = "ClientAffinity")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_affinity: Option<String>,
#[serde(rename = "ListenerArn")]
pub listener_arn: String,
#[serde(rename = "PortRanges")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port_ranges: Option<Vec<PortRange>>,
#[serde(rename = "Protocol")]
#[serde(skip_serializing_if = "Option::is_none")]
pub protocol: Option<String>,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct UpdateListenerResponse {
#[serde(rename = "Listener")]
#[serde(skip_serializing_if = "Option::is_none")]
pub listener: Option<Listener>,
}
#[derive(Clone, Debug, Default, PartialEq, Serialize)]
#[cfg_attr(feature = "deserialize_structs", derive(Deserialize))]
pub struct WithdrawByoipCidrRequest {
#[serde(rename = "Cidr")]
pub cidr: String,
}
#[derive(Clone, Debug, Default, Deserialize, PartialEq)]
#[cfg_attr(any(test, feature = "serialize_structs"), derive(Serialize))]
pub struct WithdrawByoipCidrResponse {
#[serde(rename = "ByoipCidr")]
#[serde(skip_serializing_if = "Option::is_none")]
pub byoip_cidr: Option<ByoipCidr>,
}
#[derive(Debug, PartialEq)]
pub enum AdvertiseByoipCidrError {
AccessDenied(String),
ByoipCidrNotFound(String),
IncorrectCidrState(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl AdvertiseByoipCidrError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<AdvertiseByoipCidrError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(AdvertiseByoipCidrError::AccessDenied(err.msg))
}
"ByoipCidrNotFoundException" => {
return RusotoError::Service(AdvertiseByoipCidrError::ByoipCidrNotFound(
err.msg,
))
}
"IncorrectCidrStateException" => {
return RusotoError::Service(AdvertiseByoipCidrError::IncorrectCidrState(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(AdvertiseByoipCidrError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(AdvertiseByoipCidrError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for AdvertiseByoipCidrError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
AdvertiseByoipCidrError::AccessDenied(ref cause) => write!(f, "{}", cause),
AdvertiseByoipCidrError::ByoipCidrNotFound(ref cause) => write!(f, "{}", cause),
AdvertiseByoipCidrError::IncorrectCidrState(ref cause) => write!(f, "{}", cause),
AdvertiseByoipCidrError::InternalServiceError(ref cause) => write!(f, "{}", cause),
AdvertiseByoipCidrError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for AdvertiseByoipCidrError {}
#[derive(Debug, PartialEq)]
pub enum CreateAcceleratorError {
InternalServiceError(String),
InvalidArgument(String),
LimitExceeded(String),
}
impl CreateAcceleratorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateAcceleratorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceErrorException" => {
return RusotoError::Service(CreateAcceleratorError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(CreateAcceleratorError::InvalidArgument(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateAcceleratorError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateAcceleratorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateAcceleratorError::InternalServiceError(ref cause) => write!(f, "{}", cause),
CreateAcceleratorError::InvalidArgument(ref cause) => write!(f, "{}", cause),
CreateAcceleratorError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateAcceleratorError {}
#[derive(Debug, PartialEq)]
pub enum CreateEndpointGroupError {
AcceleratorNotFound(String),
AccessDenied(String),
EndpointGroupAlreadyExists(String),
InternalServiceError(String),
InvalidArgument(String),
LimitExceeded(String),
ListenerNotFound(String),
}
impl CreateEndpointGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateEndpointGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(CreateEndpointGroupError::AcceleratorNotFound(
err.msg,
))
}
"AccessDeniedException" => {
return RusotoError::Service(CreateEndpointGroupError::AccessDenied(err.msg))
}
"EndpointGroupAlreadyExistsException" => {
return RusotoError::Service(
CreateEndpointGroupError::EndpointGroupAlreadyExists(err.msg),
)
}
"InternalServiceErrorException" => {
return RusotoError::Service(CreateEndpointGroupError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(CreateEndpointGroupError::InvalidArgument(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateEndpointGroupError::LimitExceeded(err.msg))
}
"ListenerNotFoundException" => {
return RusotoError::Service(CreateEndpointGroupError::ListenerNotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateEndpointGroupError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateEndpointGroupError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
CreateEndpointGroupError::AccessDenied(ref cause) => write!(f, "{}", cause),
CreateEndpointGroupError::EndpointGroupAlreadyExists(ref cause) => {
write!(f, "{}", cause)
}
CreateEndpointGroupError::InternalServiceError(ref cause) => write!(f, "{}", cause),
CreateEndpointGroupError::InvalidArgument(ref cause) => write!(f, "{}", cause),
CreateEndpointGroupError::LimitExceeded(ref cause) => write!(f, "{}", cause),
CreateEndpointGroupError::ListenerNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateEndpointGroupError {}
#[derive(Debug, PartialEq)]
pub enum CreateListenerError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
InvalidPortRange(String),
LimitExceeded(String),
}
impl CreateListenerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateListenerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(CreateListenerError::AcceleratorNotFound(err.msg))
}
"InternalServiceErrorException" => {
return RusotoError::Service(CreateListenerError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(CreateListenerError::InvalidArgument(err.msg))
}
"InvalidPortRangeException" => {
return RusotoError::Service(CreateListenerError::InvalidPortRange(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(CreateListenerError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for CreateListenerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
CreateListenerError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
CreateListenerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
CreateListenerError::InvalidArgument(ref cause) => write!(f, "{}", cause),
CreateListenerError::InvalidPortRange(ref cause) => write!(f, "{}", cause),
CreateListenerError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for CreateListenerError {}
#[derive(Debug, PartialEq)]
pub enum DeleteAcceleratorError {
AcceleratorNotDisabled(String),
AcceleratorNotFound(String),
AssociatedListenerFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DeleteAcceleratorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteAcceleratorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotDisabledException" => {
return RusotoError::Service(DeleteAcceleratorError::AcceleratorNotDisabled(
err.msg,
))
}
"AcceleratorNotFoundException" => {
return RusotoError::Service(DeleteAcceleratorError::AcceleratorNotFound(
err.msg,
))
}
"AssociatedListenerFoundException" => {
return RusotoError::Service(DeleteAcceleratorError::AssociatedListenerFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DeleteAcceleratorError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeleteAcceleratorError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteAcceleratorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteAcceleratorError::AcceleratorNotDisabled(ref cause) => write!(f, "{}", cause),
DeleteAcceleratorError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
DeleteAcceleratorError::AssociatedListenerFound(ref cause) => write!(f, "{}", cause),
DeleteAcceleratorError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DeleteAcceleratorError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteAcceleratorError {}
#[derive(Debug, PartialEq)]
pub enum DeleteEndpointGroupError {
EndpointGroupNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DeleteEndpointGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteEndpointGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EndpointGroupNotFoundException" => {
return RusotoError::Service(DeleteEndpointGroupError::EndpointGroupNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DeleteEndpointGroupError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeleteEndpointGroupError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteEndpointGroupError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteEndpointGroupError::EndpointGroupNotFound(ref cause) => write!(f, "{}", cause),
DeleteEndpointGroupError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DeleteEndpointGroupError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteEndpointGroupError {}
#[derive(Debug, PartialEq)]
pub enum DeleteListenerError {
AssociatedEndpointGroupFound(String),
InternalServiceError(String),
InvalidArgument(String),
ListenerNotFound(String),
}
impl DeleteListenerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteListenerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AssociatedEndpointGroupFoundException" => {
return RusotoError::Service(DeleteListenerError::AssociatedEndpointGroupFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DeleteListenerError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeleteListenerError::InvalidArgument(err.msg))
}
"ListenerNotFoundException" => {
return RusotoError::Service(DeleteListenerError::ListenerNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeleteListenerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeleteListenerError::AssociatedEndpointGroupFound(ref cause) => write!(f, "{}", cause),
DeleteListenerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DeleteListenerError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DeleteListenerError::ListenerNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeleteListenerError {}
#[derive(Debug, PartialEq)]
pub enum DeprovisionByoipCidrError {
AccessDenied(String),
ByoipCidrNotFound(String),
IncorrectCidrState(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DeprovisionByoipCidrError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeprovisionByoipCidrError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(DeprovisionByoipCidrError::AccessDenied(err.msg))
}
"ByoipCidrNotFoundException" => {
return RusotoError::Service(DeprovisionByoipCidrError::ByoipCidrNotFound(
err.msg,
))
}
"IncorrectCidrStateException" => {
return RusotoError::Service(DeprovisionByoipCidrError::IncorrectCidrState(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DeprovisionByoipCidrError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DeprovisionByoipCidrError::InvalidArgument(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DeprovisionByoipCidrError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DeprovisionByoipCidrError::AccessDenied(ref cause) => write!(f, "{}", cause),
DeprovisionByoipCidrError::ByoipCidrNotFound(ref cause) => write!(f, "{}", cause),
DeprovisionByoipCidrError::IncorrectCidrState(ref cause) => write!(f, "{}", cause),
DeprovisionByoipCidrError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DeprovisionByoipCidrError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DeprovisionByoipCidrError {}
#[derive(Debug, PartialEq)]
pub enum DescribeAcceleratorError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DescribeAcceleratorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeAcceleratorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(DescribeAcceleratorError::AcceleratorNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DescribeAcceleratorError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeAcceleratorError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAcceleratorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAcceleratorError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
DescribeAcceleratorError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DescribeAcceleratorError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeAcceleratorError {}
#[derive(Debug, PartialEq)]
pub enum DescribeAcceleratorAttributesError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DescribeAcceleratorAttributesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeAcceleratorAttributesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(
DescribeAcceleratorAttributesError::AcceleratorNotFound(err.msg),
)
}
"InternalServiceErrorException" => {
return RusotoError::Service(
DescribeAcceleratorAttributesError::InternalServiceError(err.msg),
)
}
"InvalidArgumentException" => {
return RusotoError::Service(
DescribeAcceleratorAttributesError::InvalidArgument(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeAcceleratorAttributesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeAcceleratorAttributesError::AcceleratorNotFound(ref cause) => {
write!(f, "{}", cause)
}
DescribeAcceleratorAttributesError::InternalServiceError(ref cause) => {
write!(f, "{}", cause)
}
DescribeAcceleratorAttributesError::InvalidArgument(ref cause) => {
write!(f, "{}", cause)
}
}
}
}
impl Error for DescribeAcceleratorAttributesError {}
#[derive(Debug, PartialEq)]
pub enum DescribeEndpointGroupError {
EndpointGroupNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl DescribeEndpointGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEndpointGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"EndpointGroupNotFoundException" => {
return RusotoError::Service(DescribeEndpointGroupError::EndpointGroupNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(DescribeEndpointGroupError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeEndpointGroupError::InvalidArgument(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeEndpointGroupError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeEndpointGroupError::EndpointGroupNotFound(ref cause) => write!(f, "{}", cause),
DescribeEndpointGroupError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DescribeEndpointGroupError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeEndpointGroupError {}
#[derive(Debug, PartialEq)]
pub enum DescribeListenerError {
InternalServiceError(String),
InvalidArgument(String),
ListenerNotFound(String),
}
impl DescribeListenerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeListenerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceErrorException" => {
return RusotoError::Service(DescribeListenerError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(DescribeListenerError::InvalidArgument(err.msg))
}
"ListenerNotFoundException" => {
return RusotoError::Service(DescribeListenerError::ListenerNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for DescribeListenerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
DescribeListenerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
DescribeListenerError::InvalidArgument(ref cause) => write!(f, "{}", cause),
DescribeListenerError::ListenerNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for DescribeListenerError {}
#[derive(Debug, PartialEq)]
pub enum ListAcceleratorsError {
InternalServiceError(String),
InvalidArgument(String),
InvalidNextToken(String),
}
impl ListAcceleratorsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListAcceleratorsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceErrorException" => {
return RusotoError::Service(ListAcceleratorsError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListAcceleratorsError::InvalidArgument(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListAcceleratorsError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListAcceleratorsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListAcceleratorsError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ListAcceleratorsError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListAcceleratorsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListAcceleratorsError {}
#[derive(Debug, PartialEq)]
pub enum ListByoipCidrsError {
AccessDenied(String),
InternalServiceError(String),
InvalidArgument(String),
InvalidNextToken(String),
}
impl ListByoipCidrsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListByoipCidrsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ListByoipCidrsError::AccessDenied(err.msg))
}
"InternalServiceErrorException" => {
return RusotoError::Service(ListByoipCidrsError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListByoipCidrsError::InvalidArgument(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListByoipCidrsError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListByoipCidrsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListByoipCidrsError::AccessDenied(ref cause) => write!(f, "{}", cause),
ListByoipCidrsError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ListByoipCidrsError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListByoipCidrsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListByoipCidrsError {}
#[derive(Debug, PartialEq)]
pub enum ListEndpointGroupsError {
InternalServiceError(String),
InvalidArgument(String),
InvalidNextToken(String),
ListenerNotFound(String),
}
impl ListEndpointGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListEndpointGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceErrorException" => {
return RusotoError::Service(ListEndpointGroupsError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListEndpointGroupsError::InvalidArgument(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListEndpointGroupsError::InvalidNextToken(err.msg))
}
"ListenerNotFoundException" => {
return RusotoError::Service(ListEndpointGroupsError::ListenerNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListEndpointGroupsError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListEndpointGroupsError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ListEndpointGroupsError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListEndpointGroupsError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
ListEndpointGroupsError::ListenerNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListEndpointGroupsError {}
#[derive(Debug, PartialEq)]
pub enum ListListenersError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
InvalidNextToken(String),
}
impl ListListenersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListListenersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(ListListenersError::AcceleratorNotFound(err.msg))
}
"InternalServiceErrorException" => {
return RusotoError::Service(ListListenersError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListListenersError::InvalidArgument(err.msg))
}
"InvalidNextTokenException" => {
return RusotoError::Service(ListListenersError::InvalidNextToken(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListListenersError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListListenersError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
ListListenersError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ListListenersError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ListListenersError::InvalidNextToken(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListListenersError {}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::AcceleratorNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(ListTagsForResourceError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ListTagsForResourceError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ListTagsForResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ListTagsForResourceError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ListTagsForResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ListTagsForResourceError {}
#[derive(Debug, PartialEq)]
pub enum ProvisionByoipCidrError {
AccessDenied(String),
IncorrectCidrState(String),
InternalServiceError(String),
InvalidArgument(String),
LimitExceeded(String),
}
impl ProvisionByoipCidrError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ProvisionByoipCidrError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(ProvisionByoipCidrError::AccessDenied(err.msg))
}
"IncorrectCidrStateException" => {
return RusotoError::Service(ProvisionByoipCidrError::IncorrectCidrState(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(ProvisionByoipCidrError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(ProvisionByoipCidrError::InvalidArgument(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(ProvisionByoipCidrError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for ProvisionByoipCidrError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
ProvisionByoipCidrError::AccessDenied(ref cause) => write!(f, "{}", cause),
ProvisionByoipCidrError::IncorrectCidrState(ref cause) => write!(f, "{}", cause),
ProvisionByoipCidrError::InternalServiceError(ref cause) => write!(f, "{}", cause),
ProvisionByoipCidrError::InvalidArgument(ref cause) => write!(f, "{}", cause),
ProvisionByoipCidrError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for ProvisionByoipCidrError {}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(TagResourceError::AcceleratorNotFound(err.msg))
}
"InternalServiceErrorException" => {
return RusotoError::Service(TagResourceError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(TagResourceError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for TagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
TagResourceError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
TagResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
TagResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for TagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(UntagResourceError::AcceleratorNotFound(err.msg))
}
"InternalServiceErrorException" => {
return RusotoError::Service(UntagResourceError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UntagResourceError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UntagResourceError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UntagResourceError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
UntagResourceError::InternalServiceError(ref cause) => write!(f, "{}", cause),
UntagResourceError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UntagResourceError {}
#[derive(Debug, PartialEq)]
pub enum UpdateAcceleratorError {
AcceleratorNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl UpdateAcceleratorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateAcceleratorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(UpdateAcceleratorError::AcceleratorNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(UpdateAcceleratorError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateAcceleratorError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateAcceleratorError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateAcceleratorError::AcceleratorNotFound(ref cause) => write!(f, "{}", cause),
UpdateAcceleratorError::InternalServiceError(ref cause) => write!(f, "{}", cause),
UpdateAcceleratorError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateAcceleratorError {}
#[derive(Debug, PartialEq)]
pub enum UpdateAcceleratorAttributesError {
AcceleratorNotFound(String),
AccessDenied(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl UpdateAcceleratorAttributesError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateAcceleratorAttributesError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AcceleratorNotFoundException" => {
return RusotoError::Service(
UpdateAcceleratorAttributesError::AcceleratorNotFound(err.msg),
)
}
"AccessDeniedException" => {
return RusotoError::Service(UpdateAcceleratorAttributesError::AccessDenied(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(
UpdateAcceleratorAttributesError::InternalServiceError(err.msg),
)
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateAcceleratorAttributesError::InvalidArgument(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateAcceleratorAttributesError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateAcceleratorAttributesError::AcceleratorNotFound(ref cause) => {
write!(f, "{}", cause)
}
UpdateAcceleratorAttributesError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateAcceleratorAttributesError::InternalServiceError(ref cause) => {
write!(f, "{}", cause)
}
UpdateAcceleratorAttributesError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateAcceleratorAttributesError {}
#[derive(Debug, PartialEq)]
pub enum UpdateEndpointGroupError {
AccessDenied(String),
EndpointGroupNotFound(String),
InternalServiceError(String),
InvalidArgument(String),
LimitExceeded(String),
}
impl UpdateEndpointGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateEndpointGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(UpdateEndpointGroupError::AccessDenied(err.msg))
}
"EndpointGroupNotFoundException" => {
return RusotoError::Service(UpdateEndpointGroupError::EndpointGroupNotFound(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(UpdateEndpointGroupError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateEndpointGroupError::InvalidArgument(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateEndpointGroupError::LimitExceeded(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateEndpointGroupError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateEndpointGroupError::AccessDenied(ref cause) => write!(f, "{}", cause),
UpdateEndpointGroupError::EndpointGroupNotFound(ref cause) => write!(f, "{}", cause),
UpdateEndpointGroupError::InternalServiceError(ref cause) => write!(f, "{}", cause),
UpdateEndpointGroupError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UpdateEndpointGroupError::LimitExceeded(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateEndpointGroupError {}
#[derive(Debug, PartialEq)]
pub enum UpdateListenerError {
InternalServiceError(String),
InvalidArgument(String),
InvalidPortRange(String),
LimitExceeded(String),
ListenerNotFound(String),
}
impl UpdateListenerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateListenerError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InternalServiceErrorException" => {
return RusotoError::Service(UpdateListenerError::InternalServiceError(err.msg))
}
"InvalidArgumentException" => {
return RusotoError::Service(UpdateListenerError::InvalidArgument(err.msg))
}
"InvalidPortRangeException" => {
return RusotoError::Service(UpdateListenerError::InvalidPortRange(err.msg))
}
"LimitExceededException" => {
return RusotoError::Service(UpdateListenerError::LimitExceeded(err.msg))
}
"ListenerNotFoundException" => {
return RusotoError::Service(UpdateListenerError::ListenerNotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for UpdateListenerError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
UpdateListenerError::InternalServiceError(ref cause) => write!(f, "{}", cause),
UpdateListenerError::InvalidArgument(ref cause) => write!(f, "{}", cause),
UpdateListenerError::InvalidPortRange(ref cause) => write!(f, "{}", cause),
UpdateListenerError::LimitExceeded(ref cause) => write!(f, "{}", cause),
UpdateListenerError::ListenerNotFound(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for UpdateListenerError {}
#[derive(Debug, PartialEq)]
pub enum WithdrawByoipCidrError {
AccessDenied(String),
ByoipCidrNotFound(String),
IncorrectCidrState(String),
InternalServiceError(String),
InvalidArgument(String),
}
impl WithdrawByoipCidrError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<WithdrawByoipCidrError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"AccessDeniedException" => {
return RusotoError::Service(WithdrawByoipCidrError::AccessDenied(err.msg))
}
"ByoipCidrNotFoundException" => {
return RusotoError::Service(WithdrawByoipCidrError::ByoipCidrNotFound(err.msg))
}
"IncorrectCidrStateException" => {
return RusotoError::Service(WithdrawByoipCidrError::IncorrectCidrState(
err.msg,
))
}
"InternalServiceErrorException" => {
return RusotoError::Service(WithdrawByoipCidrError::InternalServiceError(
err.msg,
))
}
"InvalidArgumentException" => {
return RusotoError::Service(WithdrawByoipCidrError::InvalidArgument(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
RusotoError::Unknown(res)
}
}
impl fmt::Display for WithdrawByoipCidrError {
#[allow(unused_variables)]
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match *self {
WithdrawByoipCidrError::AccessDenied(ref cause) => write!(f, "{}", cause),
WithdrawByoipCidrError::ByoipCidrNotFound(ref cause) => write!(f, "{}", cause),
WithdrawByoipCidrError::IncorrectCidrState(ref cause) => write!(f, "{}", cause),
WithdrawByoipCidrError::InternalServiceError(ref cause) => write!(f, "{}", cause),
WithdrawByoipCidrError::InvalidArgument(ref cause) => write!(f, "{}", cause),
}
}
}
impl Error for WithdrawByoipCidrError {}
#[async_trait]
pub trait GlobalAccelerator {
async fn advertise_byoip_cidr(
&self,
input: AdvertiseByoipCidrRequest,
) -> Result<AdvertiseByoipCidrResponse, RusotoError<AdvertiseByoipCidrError>>;
async fn create_accelerator(
&self,
input: CreateAcceleratorRequest,
) -> Result<CreateAcceleratorResponse, RusotoError<CreateAcceleratorError>>;
async fn create_endpoint_group(
&self,
input: CreateEndpointGroupRequest,
) -> Result<CreateEndpointGroupResponse, RusotoError<CreateEndpointGroupError>>;
async fn create_listener(
&self,
input: CreateListenerRequest,
) -> Result<CreateListenerResponse, RusotoError<CreateListenerError>>;
async fn delete_accelerator(
&self,
input: DeleteAcceleratorRequest,
) -> Result<(), RusotoError<DeleteAcceleratorError>>;
async fn delete_endpoint_group(
&self,
input: DeleteEndpointGroupRequest,
) -> Result<(), RusotoError<DeleteEndpointGroupError>>;
async fn delete_listener(
&self,
input: DeleteListenerRequest,
) -> Result<(), RusotoError<DeleteListenerError>>;
async fn deprovision_byoip_cidr(
&self,
input: DeprovisionByoipCidrRequest,
) -> Result<DeprovisionByoipCidrResponse, RusotoError<DeprovisionByoipCidrError>>;
async fn describe_accelerator(
&self,
input: DescribeAcceleratorRequest,
) -> Result<DescribeAcceleratorResponse, RusotoError<DescribeAcceleratorError>>;
async fn describe_accelerator_attributes(
&self,
input: DescribeAcceleratorAttributesRequest,
) -> Result<
DescribeAcceleratorAttributesResponse,
RusotoError<DescribeAcceleratorAttributesError>,
>;
async fn describe_endpoint_group(
&self,
input: DescribeEndpointGroupRequest,
) -> Result<DescribeEndpointGroupResponse, RusotoError<DescribeEndpointGroupError>>;
async fn describe_listener(
&self,
input: DescribeListenerRequest,
) -> Result<DescribeListenerResponse, RusotoError<DescribeListenerError>>;
async fn list_accelerators(
&self,
input: ListAcceleratorsRequest,
) -> Result<ListAcceleratorsResponse, RusotoError<ListAcceleratorsError>>;
async fn list_byoip_cidrs(
&self,
input: ListByoipCidrsRequest,
) -> Result<ListByoipCidrsResponse, RusotoError<ListByoipCidrsError>>;
async fn list_endpoint_groups(
&self,
input: ListEndpointGroupsRequest,
) -> Result<ListEndpointGroupsResponse, RusotoError<ListEndpointGroupsError>>;
async fn list_listeners(
&self,
input: ListListenersRequest,
) -> Result<ListListenersResponse, RusotoError<ListListenersError>>;
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>>;
async fn provision_byoip_cidr(
&self,
input: ProvisionByoipCidrRequest,
) -> Result<ProvisionByoipCidrResponse, RusotoError<ProvisionByoipCidrError>>;
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>>;
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>>;
async fn update_accelerator(
&self,
input: UpdateAcceleratorRequest,
) -> Result<UpdateAcceleratorResponse, RusotoError<UpdateAcceleratorError>>;
async fn update_accelerator_attributes(
&self,
input: UpdateAcceleratorAttributesRequest,
) -> Result<UpdateAcceleratorAttributesResponse, RusotoError<UpdateAcceleratorAttributesError>>;
async fn update_endpoint_group(
&self,
input: UpdateEndpointGroupRequest,
) -> Result<UpdateEndpointGroupResponse, RusotoError<UpdateEndpointGroupError>>;
async fn update_listener(
&self,
input: UpdateListenerRequest,
) -> Result<UpdateListenerResponse, RusotoError<UpdateListenerError>>;
async fn withdraw_byoip_cidr(
&self,
input: WithdrawByoipCidrRequest,
) -> Result<WithdrawByoipCidrResponse, RusotoError<WithdrawByoipCidrError>>;
}
#[derive(Clone)]
pub struct GlobalAcceleratorClient {
client: Client,
region: region::Region,
}
impl GlobalAcceleratorClient {
pub fn new(region: region::Region) -> GlobalAcceleratorClient {
GlobalAcceleratorClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> GlobalAcceleratorClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
D: DispatchSignedRequest + Send + Sync + 'static,
{
GlobalAcceleratorClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
pub fn new_with_client(client: Client, region: region::Region) -> GlobalAcceleratorClient {
GlobalAcceleratorClient { client, region }
}
}
#[async_trait]
impl GlobalAccelerator for GlobalAcceleratorClient {
async fn advertise_byoip_cidr(
&self,
input: AdvertiseByoipCidrRequest,
) -> Result<AdvertiseByoipCidrResponse, RusotoError<AdvertiseByoipCidrError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.AdvertiseByoipCidr",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, AdvertiseByoipCidrError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<AdvertiseByoipCidrResponse, _>()
}
async fn create_accelerator(
&self,
input: CreateAcceleratorRequest,
) -> Result<CreateAcceleratorResponse, RusotoError<CreateAcceleratorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.CreateAccelerator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateAcceleratorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateAcceleratorResponse, _>()
}
async fn create_endpoint_group(
&self,
input: CreateEndpointGroupRequest,
) -> Result<CreateEndpointGroupResponse, RusotoError<CreateEndpointGroupError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.CreateEndpointGroup",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateEndpointGroupError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateEndpointGroupResponse, _>()
}
async fn create_listener(
&self,
input: CreateListenerRequest,
) -> Result<CreateListenerResponse, RusotoError<CreateListenerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.CreateListener");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, CreateListenerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<CreateListenerResponse, _>()
}
async fn delete_accelerator(
&self,
input: DeleteAcceleratorRequest,
) -> Result<(), RusotoError<DeleteAcceleratorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DeleteAccelerator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteAcceleratorError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn delete_endpoint_group(
&self,
input: DeleteEndpointGroupRequest,
) -> Result<(), RusotoError<DeleteEndpointGroupError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DeleteEndpointGroup",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteEndpointGroupError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn delete_listener(
&self,
input: DeleteListenerRequest,
) -> Result<(), RusotoError<DeleteListenerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.DeleteListener");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeleteListenerError::from_response)
.await?;
std::mem::drop(response);
Ok(())
}
async fn deprovision_byoip_cidr(
&self,
input: DeprovisionByoipCidrRequest,
) -> Result<DeprovisionByoipCidrResponse, RusotoError<DeprovisionByoipCidrError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DeprovisionByoipCidr",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DeprovisionByoipCidrError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DeprovisionByoipCidrResponse, _>()
}
async fn describe_accelerator(
&self,
input: DescribeAcceleratorRequest,
) -> Result<DescribeAcceleratorResponse, RusotoError<DescribeAcceleratorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DescribeAccelerator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeAcceleratorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeAcceleratorResponse, _>()
}
async fn describe_accelerator_attributes(
&self,
input: DescribeAcceleratorAttributesRequest,
) -> Result<
DescribeAcceleratorAttributesResponse,
RusotoError<DescribeAcceleratorAttributesError>,
> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DescribeAcceleratorAttributes",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeAcceleratorAttributesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeAcceleratorAttributesResponse, _>()
}
async fn describe_endpoint_group(
&self,
input: DescribeEndpointGroupRequest,
) -> Result<DescribeEndpointGroupResponse, RusotoError<DescribeEndpointGroupError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DescribeEndpointGroup",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeEndpointGroupError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEndpointGroupResponse, _>()
}
async fn describe_listener(
&self,
input: DescribeListenerRequest,
) -> Result<DescribeListenerResponse, RusotoError<DescribeListenerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.DescribeListener",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, DescribeListenerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<DescribeListenerResponse, _>()
}
async fn list_accelerators(
&self,
input: ListAcceleratorsRequest,
) -> Result<ListAcceleratorsResponse, RusotoError<ListAcceleratorsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.ListAccelerators",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListAcceleratorsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListAcceleratorsResponse, _>()
}
async fn list_byoip_cidrs(
&self,
input: ListByoipCidrsRequest,
) -> Result<ListByoipCidrsResponse, RusotoError<ListByoipCidrsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.ListByoipCidrs");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListByoipCidrsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListByoipCidrsResponse, _>()
}
async fn list_endpoint_groups(
&self,
input: ListEndpointGroupsRequest,
) -> Result<ListEndpointGroupsResponse, RusotoError<ListEndpointGroupsError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.ListEndpointGroups",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListEndpointGroupsError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListEndpointGroupsResponse, _>()
}
async fn list_listeners(
&self,
input: ListListenersRequest,
) -> Result<ListListenersResponse, RusotoError<ListListenersError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.ListListeners");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListListenersError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListListenersResponse, _>()
}
async fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> Result<ListTagsForResourceResponse, RusotoError<ListTagsForResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.ListTagsForResource",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ListTagsForResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ListTagsForResourceResponse, _>()
}
async fn provision_byoip_cidr(
&self,
input: ProvisionByoipCidrRequest,
) -> Result<ProvisionByoipCidrResponse, RusotoError<ProvisionByoipCidrError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.ProvisionByoipCidr",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, ProvisionByoipCidrError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<ProvisionByoipCidrResponse, _>()
}
async fn tag_resource(
&self,
input: TagResourceRequest,
) -> Result<TagResourceResponse, RusotoError<TagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, TagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<TagResourceResponse, _>()
}
async fn untag_resource(
&self,
input: UntagResourceRequest,
) -> Result<UntagResourceResponse, RusotoError<UntagResourceError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UntagResourceError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UntagResourceResponse, _>()
}
async fn update_accelerator(
&self,
input: UpdateAcceleratorRequest,
) -> Result<UpdateAcceleratorResponse, RusotoError<UpdateAcceleratorError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.UpdateAccelerator",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateAcceleratorError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateAcceleratorResponse, _>()
}
async fn update_accelerator_attributes(
&self,
input: UpdateAcceleratorAttributesRequest,
) -> Result<UpdateAcceleratorAttributesResponse, RusotoError<UpdateAcceleratorAttributesError>>
{
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.UpdateAcceleratorAttributes",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateAcceleratorAttributesError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateAcceleratorAttributesResponse, _>()
}
async fn update_endpoint_group(
&self,
input: UpdateEndpointGroupRequest,
) -> Result<UpdateEndpointGroupResponse, RusotoError<UpdateEndpointGroupError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.UpdateEndpointGroup",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateEndpointGroupError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateEndpointGroupResponse, _>()
}
async fn update_listener(
&self,
input: UpdateListenerRequest,
) -> Result<UpdateListenerResponse, RusotoError<UpdateListenerError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header("x-amz-target", "GlobalAccelerator_V20180706.UpdateListener");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, UpdateListenerError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<UpdateListenerResponse, _>()
}
async fn withdraw_byoip_cidr(
&self,
input: WithdrawByoipCidrRequest,
) -> Result<WithdrawByoipCidrResponse, RusotoError<WithdrawByoipCidrError>> {
let mut request = self.new_signed_request("POST", "/");
request.add_header(
"x-amz-target",
"GlobalAccelerator_V20180706.WithdrawByoipCidr",
);
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
let response = self
.sign_and_dispatch(request, WithdrawByoipCidrError::from_response)
.await?;
let mut response = response;
let response = response.buffer().await.map_err(RusotoError::HttpDispatch)?;
proto::json::ResponsePayload::new(&response).deserialize::<WithdrawByoipCidrResponse, _>()
}
}