use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Cluster {
#[serde(rename = "ActiveNodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active_nodes: Option<i64>,
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "ClusterDiscoveryEndpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_discovery_endpoint: Option<Endpoint>,
#[serde(rename = "ClusterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_name: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IamRoleArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub iam_role_arn: Option<String>,
#[serde(rename = "NodeIdsToRemove")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_ids_to_remove: Option<Vec<String>>,
#[serde(rename = "NodeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type: Option<String>,
#[serde(rename = "Nodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub nodes: Option<Vec<Node>>,
#[serde(rename = "NotificationConfiguration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_configuration: Option<NotificationConfiguration>,
#[serde(rename = "ParameterGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group: Option<ParameterGroupStatus>,
#[serde(rename = "PreferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "SSEDescription")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sse_description: Option<SSEDescription>,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<SecurityGroupMembership>>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
#[serde(rename = "SubnetGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group: Option<String>,
#[serde(rename = "TotalNodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub total_nodes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateClusterRequest {
#[serde(rename = "AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<String>>,
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IamRoleArn")]
pub iam_role_arn: String,
#[serde(rename = "NodeType")]
pub node_type: String,
#[serde(rename = "NotificationTopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_topic_arn: Option<String>,
#[serde(rename = "ParameterGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_name: Option<String>,
#[serde(rename = "PreferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "ReplicationFactor")]
pub replication_factor: i64,
#[serde(rename = "SSESpecification")]
#[serde(skip_serializing_if = "Option::is_none")]
pub sse_specification: Option<SSESpecification>,
#[serde(rename = "SecurityGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_ids: Option<Vec<String>>,
#[serde(rename = "SubnetGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group_name: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateClusterResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateParameterGroupRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ParameterGroupName")]
pub parameter_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateParameterGroupResponse {
#[serde(rename = "ParameterGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group: Option<ParameterGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateSubnetGroupRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "SubnetGroupName")]
pub subnet_group_name: String,
#[serde(rename = "SubnetIds")]
pub subnet_ids: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateSubnetGroupResponse {
#[serde(rename = "SubnetGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group: Option<SubnetGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DecreaseReplicationFactorRequest {
#[serde(rename = "AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<String>>,
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "NewReplicationFactor")]
pub new_replication_factor: i64,
#[serde(rename = "NodeIdsToRemove")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_ids_to_remove: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DecreaseReplicationFactorResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteClusterRequest {
#[serde(rename = "ClusterName")]
pub cluster_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteClusterResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteParameterGroupRequest {
#[serde(rename = "ParameterGroupName")]
pub parameter_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteParameterGroupResponse {
#[serde(rename = "DeletionMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deletion_message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteSubnetGroupRequest {
#[serde(rename = "SubnetGroupName")]
pub subnet_group_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteSubnetGroupResponse {
#[serde(rename = "DeletionMessage")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deletion_message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeClustersRequest {
#[serde(rename = "ClusterNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_names: Option<Vec<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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeClustersResponse {
#[serde(rename = "Clusters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub clusters: Option<Vec<Cluster>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeDefaultParametersRequest {
#[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(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeDefaultParametersResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Parameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<Vec<Parameter>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeEventsRequest {
#[serde(rename = "Duration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub duration: Option<i64>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[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 = "SourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_name: Option<String>,
#[serde(rename = "SourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_type: Option<String>,
#[serde(rename = "StartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub start_time: Option<f64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeEventsResponse {
#[serde(rename = "Events")]
#[serde(skip_serializing_if = "Option::is_none")]
pub events: Option<Vec<Event>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeParameterGroupsRequest {
#[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 = "ParameterGroupNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeParameterGroupsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ParameterGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_groups: Option<Vec<ParameterGroup>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeParametersRequest {
#[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 = "ParameterGroupName")]
pub parameter_group_name: String,
#[serde(rename = "Source")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeParametersResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Parameters")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameters: Option<Vec<Parameter>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeSubnetGroupsRequest {
#[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 = "SubnetGroupNames")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group_names: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeSubnetGroupsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "SubnetGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_groups: Option<Vec<SubnetGroup>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Endpoint {
#[serde(rename = "Address")]
#[serde(skip_serializing_if = "Option::is_none")]
pub address: Option<String>,
#[serde(rename = "Port")]
#[serde(skip_serializing_if = "Option::is_none")]
pub port: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Event {
#[serde(rename = "Date")]
#[serde(skip_serializing_if = "Option::is_none")]
pub date: Option<f64>,
#[serde(rename = "Message")]
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<String>,
#[serde(rename = "SourceName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_name: Option<String>,
#[serde(rename = "SourceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct IncreaseReplicationFactorRequest {
#[serde(rename = "AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<String>>,
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "NewReplicationFactor")]
pub new_replication_factor: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct IncreaseReplicationFactorResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsRequest {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "ResourceName")]
pub resource_name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Node {
#[serde(rename = "AvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zone: Option<String>,
#[serde(rename = "Endpoint")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoint: Option<Endpoint>,
#[serde(rename = "NodeCreateTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_create_time: Option<f64>,
#[serde(rename = "NodeId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_id: Option<String>,
#[serde(rename = "NodeStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_status: Option<String>,
#[serde(rename = "ParameterGroupStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NodeTypeSpecificValue {
#[serde(rename = "NodeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NotificationConfiguration {
#[serde(rename = "TopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub topic_arn: Option<String>,
#[serde(rename = "TopicStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub topic_status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Parameter {
#[serde(rename = "AllowedValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub allowed_values: Option<String>,
#[serde(rename = "ChangeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub change_type: Option<String>,
#[serde(rename = "DataType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data_type: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "IsModifiable")]
#[serde(skip_serializing_if = "Option::is_none")]
pub is_modifiable: Option<String>,
#[serde(rename = "NodeTypeSpecificValues")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type_specific_values: Option<Vec<NodeTypeSpecificValue>>,
#[serde(rename = "ParameterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_name: Option<String>,
#[serde(rename = "ParameterType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_type: Option<String>,
#[serde(rename = "ParameterValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_value: Option<String>,
#[serde(rename = "Source")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ParameterGroup {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "ParameterGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ParameterGroupStatus {
#[serde(rename = "NodeIdsToReboot")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_ids_to_reboot: Option<Vec<String>>,
#[serde(rename = "ParameterApplyStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_apply_status: Option<String>,
#[serde(rename = "ParameterGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ParameterNameValue {
#[serde(rename = "ParameterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_name: Option<String>,
#[serde(rename = "ParameterValue")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RebootNodeRequest {
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "NodeId")]
pub node_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RebootNodeResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SSEDescription {
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct SSESpecification {
#[serde(rename = "Enabled")]
pub enabled: bool,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SecurityGroupMembership {
#[serde(rename = "SecurityGroupIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_identifier: Option<String>,
#[serde(rename = "Status")]
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Subnet {
#[serde(rename = "SubnetAvailabilityZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_availability_zone: Option<String>,
#[serde(rename = "SubnetIdentifier")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_identifier: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SubnetGroup {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "SubnetGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group_name: Option<String>,
#[serde(rename = "Subnets")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnets: Option<Vec<Subnet>>,
#[serde(rename = "VpcId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub vpc_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tag {
#[serde(rename = "Key")]
#[serde(skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
#[serde(rename = "Value")]
#[serde(skip_serializing_if = "Option::is_none")]
pub value: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "ResourceName")]
pub resource_name: String,
#[serde(rename = "Tags")]
pub tags: Vec<Tag>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct TagResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceName")]
pub resource_name: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UntagResourceResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<Tag>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateClusterRequest {
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "NotificationTopicArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_topic_arn: Option<String>,
#[serde(rename = "NotificationTopicStatus")]
#[serde(skip_serializing_if = "Option::is_none")]
pub notification_topic_status: Option<String>,
#[serde(rename = "ParameterGroupName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group_name: Option<String>,
#[serde(rename = "PreferredMaintenanceWindow")]
#[serde(skip_serializing_if = "Option::is_none")]
pub preferred_maintenance_window: Option<String>,
#[serde(rename = "SecurityGroupIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_group_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateClusterResponse {
#[serde(rename = "Cluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster: Option<Cluster>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateParameterGroupRequest {
#[serde(rename = "ParameterGroupName")]
pub parameter_group_name: String,
#[serde(rename = "ParameterNameValues")]
pub parameter_name_values: Vec<ParameterNameValue>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateParameterGroupResponse {
#[serde(rename = "ParameterGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub parameter_group: Option<ParameterGroup>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateSubnetGroupRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "SubnetGroupName")]
pub subnet_group_name: String,
#[serde(rename = "SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_ids: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateSubnetGroupResponse {
#[serde(rename = "SubnetGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_group: Option<SubnetGroup>,
}
#[derive(Debug, PartialEq)]
pub enum CreateClusterError {
ClusterAlreadyExistsFault(String),
ClusterQuotaForCustomerExceededFault(String),
InsufficientClusterCapacityFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterGroupStateFault(String),
InvalidParameterValue(String),
InvalidVPCNetworkStateFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
SubnetGroupNotFoundFault(String),
TagQuotaPerResourceExceeded(String),
}
impl CreateClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterAlreadyExistsFault" => {
return RusotoError::Service(CreateClusterError::ClusterAlreadyExistsFault(
err.msg,
))
}
"ClusterQuotaForCustomerExceededFault" => {
return RusotoError::Service(
CreateClusterError::ClusterQuotaForCustomerExceededFault(err.msg),
)
}
"InsufficientClusterCapacityFault" => {
return RusotoError::Service(
CreateClusterError::InsufficientClusterCapacityFault(err.msg),
)
}
"InvalidClusterStateFault" => {
return RusotoError::Service(CreateClusterError::InvalidClusterStateFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(CreateClusterError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterGroupStateFault" => {
return RusotoError::Service(
CreateClusterError::InvalidParameterGroupStateFault(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(CreateClusterError::InvalidParameterValue(err.msg))
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(CreateClusterError::InvalidVPCNetworkStateFault(
err.msg,
))
}
"NodeQuotaForClusterExceededFault" => {
return RusotoError::Service(
CreateClusterError::NodeQuotaForClusterExceededFault(err.msg),
)
}
"NodeQuotaForCustomerExceededFault" => {
return RusotoError::Service(
CreateClusterError::NodeQuotaForCustomerExceededFault(err.msg),
)
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(CreateClusterError::ParameterGroupNotFoundFault(
err.msg,
))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
CreateClusterError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"SubnetGroupNotFoundFault" => {
return RusotoError::Service(CreateClusterError::SubnetGroupNotFoundFault(
err.msg,
))
}
"TagQuotaPerResourceExceeded" => {
return RusotoError::Service(CreateClusterError::TagQuotaPerResourceExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateClusterError {
fn description(&self) -> &str {
match *self {
CreateClusterError::ClusterAlreadyExistsFault(ref cause) => cause,
CreateClusterError::ClusterQuotaForCustomerExceededFault(ref cause) => cause,
CreateClusterError::InsufficientClusterCapacityFault(ref cause) => cause,
CreateClusterError::InvalidClusterStateFault(ref cause) => cause,
CreateClusterError::InvalidParameterCombination(ref cause) => cause,
CreateClusterError::InvalidParameterGroupStateFault(ref cause) => cause,
CreateClusterError::InvalidParameterValue(ref cause) => cause,
CreateClusterError::InvalidVPCNetworkStateFault(ref cause) => cause,
CreateClusterError::NodeQuotaForClusterExceededFault(ref cause) => cause,
CreateClusterError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
CreateClusterError::ParameterGroupNotFoundFault(ref cause) => cause,
CreateClusterError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
CreateClusterError::SubnetGroupNotFoundFault(ref cause) => cause,
CreateClusterError::TagQuotaPerResourceExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateParameterGroupError {
InvalidParameterCombination(String),
InvalidParameterGroupStateFault(String),
InvalidParameterValue(String),
ParameterGroupAlreadyExistsFault(String),
ParameterGroupQuotaExceededFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl CreateParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateParameterGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
CreateParameterGroupError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterGroupStateFault" => {
return RusotoError::Service(
CreateParameterGroupError::InvalidParameterGroupStateFault(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(CreateParameterGroupError::InvalidParameterValue(
err.msg,
))
}
"ParameterGroupAlreadyExistsFault" => {
return RusotoError::Service(
CreateParameterGroupError::ParameterGroupAlreadyExistsFault(err.msg),
)
}
"ParameterGroupQuotaExceededFault" => {
return RusotoError::Service(
CreateParameterGroupError::ParameterGroupQuotaExceededFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
CreateParameterGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateParameterGroupError {
fn description(&self) -> &str {
match *self {
CreateParameterGroupError::InvalidParameterCombination(ref cause) => cause,
CreateParameterGroupError::InvalidParameterGroupStateFault(ref cause) => cause,
CreateParameterGroupError::InvalidParameterValue(ref cause) => cause,
CreateParameterGroupError::ParameterGroupAlreadyExistsFault(ref cause) => cause,
CreateParameterGroupError::ParameterGroupQuotaExceededFault(ref cause) => cause,
CreateParameterGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateSubnetGroupError {
InvalidSubnet(String),
ServiceLinkedRoleNotFoundFault(String),
SubnetGroupAlreadyExistsFault(String),
SubnetGroupQuotaExceededFault(String),
SubnetQuotaExceededFault(String),
}
impl CreateSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateSubnetGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidSubnet" => {
return RusotoError::Service(CreateSubnetGroupError::InvalidSubnet(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
CreateSubnetGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"SubnetGroupAlreadyExistsFault" => {
return RusotoError::Service(
CreateSubnetGroupError::SubnetGroupAlreadyExistsFault(err.msg),
)
}
"SubnetGroupQuotaExceededFault" => {
return RusotoError::Service(
CreateSubnetGroupError::SubnetGroupQuotaExceededFault(err.msg),
)
}
"SubnetQuotaExceededFault" => {
return RusotoError::Service(CreateSubnetGroupError::SubnetQuotaExceededFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateSubnetGroupError {
fn description(&self) -> &str {
match *self {
CreateSubnetGroupError::InvalidSubnet(ref cause) => cause,
CreateSubnetGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
CreateSubnetGroupError::SubnetGroupAlreadyExistsFault(ref cause) => cause,
CreateSubnetGroupError::SubnetGroupQuotaExceededFault(ref cause) => cause,
CreateSubnetGroupError::SubnetQuotaExceededFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DecreaseReplicationFactorError {
ClusterNotFoundFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
NodeNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DecreaseReplicationFactorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DecreaseReplicationFactorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(
DecreaseReplicationFactorError::ClusterNotFoundFault(err.msg),
)
}
"InvalidClusterStateFault" => {
return RusotoError::Service(
DecreaseReplicationFactorError::InvalidClusterStateFault(err.msg),
)
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DecreaseReplicationFactorError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
DecreaseReplicationFactorError::InvalidParameterValue(err.msg),
)
}
"NodeNotFoundFault" => {
return RusotoError::Service(DecreaseReplicationFactorError::NodeNotFoundFault(
err.msg,
))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DecreaseReplicationFactorError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DecreaseReplicationFactorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DecreaseReplicationFactorError {
fn description(&self) -> &str {
match *self {
DecreaseReplicationFactorError::ClusterNotFoundFault(ref cause) => cause,
DecreaseReplicationFactorError::InvalidClusterStateFault(ref cause) => cause,
DecreaseReplicationFactorError::InvalidParameterCombination(ref cause) => cause,
DecreaseReplicationFactorError::InvalidParameterValue(ref cause) => cause,
DecreaseReplicationFactorError::NodeNotFoundFault(ref cause) => cause,
DecreaseReplicationFactorError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteClusterError {
ClusterNotFoundFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DeleteClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(DeleteClusterError::ClusterNotFoundFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(DeleteClusterError::InvalidClusterStateFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(DeleteClusterError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(DeleteClusterError::InvalidParameterValue(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DeleteClusterError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteClusterError {
fn description(&self) -> &str {
match *self {
DeleteClusterError::ClusterNotFoundFault(ref cause) => cause,
DeleteClusterError::InvalidClusterStateFault(ref cause) => cause,
DeleteClusterError::InvalidParameterCombination(ref cause) => cause,
DeleteClusterError::InvalidParameterValue(ref cause) => cause,
DeleteClusterError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteParameterGroupError {
InvalidParameterCombination(String),
InvalidParameterGroupStateFault(String),
InvalidParameterValue(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DeleteParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteParameterGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DeleteParameterGroupError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterGroupStateFault" => {
return RusotoError::Service(
DeleteParameterGroupError::InvalidParameterGroupStateFault(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(DeleteParameterGroupError::InvalidParameterValue(
err.msg,
))
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(
DeleteParameterGroupError::ParameterGroupNotFoundFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DeleteParameterGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteParameterGroupError {
fn description(&self) -> &str {
match *self {
DeleteParameterGroupError::InvalidParameterCombination(ref cause) => cause,
DeleteParameterGroupError::InvalidParameterGroupStateFault(ref cause) => cause,
DeleteParameterGroupError::InvalidParameterValue(ref cause) => cause,
DeleteParameterGroupError::ParameterGroupNotFoundFault(ref cause) => cause,
DeleteParameterGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteSubnetGroupError {
ServiceLinkedRoleNotFoundFault(String),
SubnetGroupInUseFault(String),
SubnetGroupNotFoundFault(String),
}
impl DeleteSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteSubnetGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DeleteSubnetGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"SubnetGroupInUseFault" => {
return RusotoError::Service(DeleteSubnetGroupError::SubnetGroupInUseFault(
err.msg,
))
}
"SubnetGroupNotFoundFault" => {
return RusotoError::Service(DeleteSubnetGroupError::SubnetGroupNotFoundFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteSubnetGroupError {
fn description(&self) -> &str {
match *self {
DeleteSubnetGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
DeleteSubnetGroupError::SubnetGroupInUseFault(ref cause) => cause,
DeleteSubnetGroupError::SubnetGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeClustersError {
ClusterNotFoundFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DescribeClustersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeClustersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(DescribeClustersError::ClusterNotFoundFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DescribeClustersError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(DescribeClustersError::InvalidParameterValue(
err.msg,
))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeClustersError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeClustersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeClustersError {
fn description(&self) -> &str {
match *self {
DescribeClustersError::ClusterNotFoundFault(ref cause) => cause,
DescribeClustersError::InvalidParameterCombination(ref cause) => cause,
DescribeClustersError::InvalidParameterValue(ref cause) => cause,
DescribeClustersError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeDefaultParametersError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DescribeDefaultParametersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeDefaultParametersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DescribeDefaultParametersError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
DescribeDefaultParametersError::InvalidParameterValue(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeDefaultParametersError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeDefaultParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeDefaultParametersError {
fn description(&self) -> &str {
match *self {
DescribeDefaultParametersError::InvalidParameterCombination(ref cause) => cause,
DescribeDefaultParametersError::InvalidParameterValue(ref cause) => cause,
DescribeDefaultParametersError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeEventsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DescribeEventsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeEventsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(DescribeEventsError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(DescribeEventsError::InvalidParameterValue(
err.msg,
))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeEventsError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeEventsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeEventsError {
fn description(&self) -> &str {
match *self {
DescribeEventsError::InvalidParameterCombination(ref cause) => cause,
DescribeEventsError::InvalidParameterValue(ref cause) => cause,
DescribeEventsError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeParameterGroupsError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DescribeParameterGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeParameterGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DescribeParameterGroupsError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
DescribeParameterGroupsError::InvalidParameterValue(err.msg),
)
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(
DescribeParameterGroupsError::ParameterGroupNotFoundFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeParameterGroupsError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeParameterGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeParameterGroupsError {
fn description(&self) -> &str {
match *self {
DescribeParameterGroupsError::InvalidParameterCombination(ref cause) => cause,
DescribeParameterGroupsError::InvalidParameterValue(ref cause) => cause,
DescribeParameterGroupsError::ParameterGroupNotFoundFault(ref cause) => cause,
DescribeParameterGroupsError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeParametersError {
InvalidParameterCombination(String),
InvalidParameterValue(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl DescribeParametersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeParametersError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
DescribeParametersError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(DescribeParametersError::InvalidParameterValue(
err.msg,
))
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(
DescribeParametersError::ParameterGroupNotFoundFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeParametersError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeParametersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeParametersError {
fn description(&self) -> &str {
match *self {
DescribeParametersError::InvalidParameterCombination(ref cause) => cause,
DescribeParametersError::InvalidParameterValue(ref cause) => cause,
DescribeParametersError::ParameterGroupNotFoundFault(ref cause) => cause,
DescribeParametersError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeSubnetGroupsError {
ServiceLinkedRoleNotFoundFault(String),
SubnetGroupNotFoundFault(String),
}
impl DescribeSubnetGroupsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeSubnetGroupsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
DescribeSubnetGroupsError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"SubnetGroupNotFoundFault" => {
return RusotoError::Service(
DescribeSubnetGroupsError::SubnetGroupNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeSubnetGroupsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeSubnetGroupsError {
fn description(&self) -> &str {
match *self {
DescribeSubnetGroupsError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
DescribeSubnetGroupsError::SubnetGroupNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum IncreaseReplicationFactorError {
ClusterNotFoundFault(String),
InsufficientClusterCapacityFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
InvalidVPCNetworkStateFault(String),
NodeQuotaForClusterExceededFault(String),
NodeQuotaForCustomerExceededFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl IncreaseReplicationFactorError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<IncreaseReplicationFactorError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::ClusterNotFoundFault(err.msg),
)
}
"InsufficientClusterCapacityFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::InsufficientClusterCapacityFault(err.msg),
)
}
"InvalidClusterStateFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::InvalidClusterStateFault(err.msg),
)
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(
IncreaseReplicationFactorError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(
IncreaseReplicationFactorError::InvalidParameterValue(err.msg),
)
}
"InvalidVPCNetworkStateFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::InvalidVPCNetworkStateFault(err.msg),
)
}
"NodeQuotaForClusterExceededFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::NodeQuotaForClusterExceededFault(err.msg),
)
}
"NodeQuotaForCustomerExceededFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::NodeQuotaForCustomerExceededFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
IncreaseReplicationFactorError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for IncreaseReplicationFactorError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for IncreaseReplicationFactorError {
fn description(&self) -> &str {
match *self {
IncreaseReplicationFactorError::ClusterNotFoundFault(ref cause) => cause,
IncreaseReplicationFactorError::InsufficientClusterCapacityFault(ref cause) => cause,
IncreaseReplicationFactorError::InvalidClusterStateFault(ref cause) => cause,
IncreaseReplicationFactorError::InvalidParameterCombination(ref cause) => cause,
IncreaseReplicationFactorError::InvalidParameterValue(ref cause) => cause,
IncreaseReplicationFactorError::InvalidVPCNetworkStateFault(ref cause) => cause,
IncreaseReplicationFactorError::NodeQuotaForClusterExceededFault(ref cause) => cause,
IncreaseReplicationFactorError::NodeQuotaForCustomerExceededFault(ref cause) => cause,
IncreaseReplicationFactorError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
ClusterNotFoundFault(String),
InvalidARNFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(ListTagsError::ClusterNotFoundFault(err.msg))
}
"InvalidARNFault" => {
return RusotoError::Service(ListTagsError::InvalidARNFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(ListTagsError::InvalidClusterStateFault(err.msg))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(ListTagsError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(ListTagsError::InvalidParameterValue(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(ListTagsError::ServiceLinkedRoleNotFoundFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsError {
fn description(&self) -> &str {
match *self {
ListTagsError::ClusterNotFoundFault(ref cause) => cause,
ListTagsError::InvalidARNFault(ref cause) => cause,
ListTagsError::InvalidClusterStateFault(ref cause) => cause,
ListTagsError::InvalidParameterCombination(ref cause) => cause,
ListTagsError::InvalidParameterValue(ref cause) => cause,
ListTagsError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootNodeError {
ClusterNotFoundFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
NodeNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl RebootNodeError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RebootNodeError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(RebootNodeError::ClusterNotFoundFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(RebootNodeError::InvalidClusterStateFault(err.msg))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(RebootNodeError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(RebootNodeError::InvalidParameterValue(err.msg))
}
"NodeNotFoundFault" => {
return RusotoError::Service(RebootNodeError::NodeNotFoundFault(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(RebootNodeError::ServiceLinkedRoleNotFoundFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for RebootNodeError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RebootNodeError {
fn description(&self) -> &str {
match *self {
RebootNodeError::ClusterNotFoundFault(ref cause) => cause,
RebootNodeError::InvalidClusterStateFault(ref cause) => cause,
RebootNodeError::InvalidParameterCombination(ref cause) => cause,
RebootNodeError::InvalidParameterValue(ref cause) => cause,
RebootNodeError::NodeNotFoundFault(ref cause) => cause,
RebootNodeError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
ClusterNotFoundFault(String),
InvalidARNFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
TagQuotaPerResourceExceeded(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() {
"ClusterNotFoundFault" => {
return RusotoError::Service(TagResourceError::ClusterNotFoundFault(err.msg))
}
"InvalidARNFault" => {
return RusotoError::Service(TagResourceError::InvalidARNFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(TagResourceError::InvalidClusterStateFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(TagResourceError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(TagResourceError::InvalidParameterValue(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(TagResourceError::ServiceLinkedRoleNotFoundFault(
err.msg,
))
}
"TagQuotaPerResourceExceeded" => {
return RusotoError::Service(TagResourceError::TagQuotaPerResourceExceeded(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::ClusterNotFoundFault(ref cause) => cause,
TagResourceError::InvalidARNFault(ref cause) => cause,
TagResourceError::InvalidClusterStateFault(ref cause) => cause,
TagResourceError::InvalidParameterCombination(ref cause) => cause,
TagResourceError::InvalidParameterValue(ref cause) => cause,
TagResourceError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
TagResourceError::TagQuotaPerResourceExceeded(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
ClusterNotFoundFault(String),
InvalidARNFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterValue(String),
ServiceLinkedRoleNotFoundFault(String),
TagNotFoundFault(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() {
"ClusterNotFoundFault" => {
return RusotoError::Service(UntagResourceError::ClusterNotFoundFault(err.msg))
}
"InvalidARNFault" => {
return RusotoError::Service(UntagResourceError::InvalidARNFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(UntagResourceError::InvalidClusterStateFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(UntagResourceError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterValueException" => {
return RusotoError::Service(UntagResourceError::InvalidParameterValue(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
UntagResourceError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"TagNotFoundFault" => {
return RusotoError::Service(UntagResourceError::TagNotFoundFault(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::ClusterNotFoundFault(ref cause) => cause,
UntagResourceError::InvalidARNFault(ref cause) => cause,
UntagResourceError::InvalidClusterStateFault(ref cause) => cause,
UntagResourceError::InvalidParameterCombination(ref cause) => cause,
UntagResourceError::InvalidParameterValue(ref cause) => cause,
UntagResourceError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
UntagResourceError::TagNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateClusterError {
ClusterNotFoundFault(String),
InvalidClusterStateFault(String),
InvalidParameterCombination(String),
InvalidParameterGroupStateFault(String),
InvalidParameterValue(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl UpdateClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateClusterError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"ClusterNotFoundFault" => {
return RusotoError::Service(UpdateClusterError::ClusterNotFoundFault(err.msg))
}
"InvalidClusterStateFault" => {
return RusotoError::Service(UpdateClusterError::InvalidClusterStateFault(
err.msg,
))
}
"InvalidParameterCombinationException" => {
return RusotoError::Service(UpdateClusterError::InvalidParameterCombination(
err.msg,
))
}
"InvalidParameterGroupStateFault" => {
return RusotoError::Service(
UpdateClusterError::InvalidParameterGroupStateFault(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(UpdateClusterError::InvalidParameterValue(err.msg))
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(UpdateClusterError::ParameterGroupNotFoundFault(
err.msg,
))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
UpdateClusterError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateClusterError {
fn description(&self) -> &str {
match *self {
UpdateClusterError::ClusterNotFoundFault(ref cause) => cause,
UpdateClusterError::InvalidClusterStateFault(ref cause) => cause,
UpdateClusterError::InvalidParameterCombination(ref cause) => cause,
UpdateClusterError::InvalidParameterGroupStateFault(ref cause) => cause,
UpdateClusterError::InvalidParameterValue(ref cause) => cause,
UpdateClusterError::ParameterGroupNotFoundFault(ref cause) => cause,
UpdateClusterError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateParameterGroupError {
InvalidParameterCombination(String),
InvalidParameterGroupStateFault(String),
InvalidParameterValue(String),
ParameterGroupNotFoundFault(String),
ServiceLinkedRoleNotFoundFault(String),
}
impl UpdateParameterGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateParameterGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidParameterCombinationException" => {
return RusotoError::Service(
UpdateParameterGroupError::InvalidParameterCombination(err.msg),
)
}
"InvalidParameterGroupStateFault" => {
return RusotoError::Service(
UpdateParameterGroupError::InvalidParameterGroupStateFault(err.msg),
)
}
"InvalidParameterValueException" => {
return RusotoError::Service(UpdateParameterGroupError::InvalidParameterValue(
err.msg,
))
}
"ParameterGroupNotFoundFault" => {
return RusotoError::Service(
UpdateParameterGroupError::ParameterGroupNotFoundFault(err.msg),
)
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
UpdateParameterGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateParameterGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateParameterGroupError {
fn description(&self) -> &str {
match *self {
UpdateParameterGroupError::InvalidParameterCombination(ref cause) => cause,
UpdateParameterGroupError::InvalidParameterGroupStateFault(ref cause) => cause,
UpdateParameterGroupError::InvalidParameterValue(ref cause) => cause,
UpdateParameterGroupError::ParameterGroupNotFoundFault(ref cause) => cause,
UpdateParameterGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateSubnetGroupError {
InvalidSubnet(String),
ServiceLinkedRoleNotFoundFault(String),
SubnetGroupNotFoundFault(String),
SubnetInUse(String),
SubnetQuotaExceededFault(String),
}
impl UpdateSubnetGroupError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateSubnetGroupError> {
if let Some(err) = proto::json::Error::parse(&res) {
match err.typ.as_str() {
"InvalidSubnet" => {
return RusotoError::Service(UpdateSubnetGroupError::InvalidSubnet(err.msg))
}
"ServiceLinkedRoleNotFoundFault" => {
return RusotoError::Service(
UpdateSubnetGroupError::ServiceLinkedRoleNotFoundFault(err.msg),
)
}
"SubnetGroupNotFoundFault" => {
return RusotoError::Service(UpdateSubnetGroupError::SubnetGroupNotFoundFault(
err.msg,
))
}
"SubnetInUse" => {
return RusotoError::Service(UpdateSubnetGroupError::SubnetInUse(err.msg))
}
"SubnetQuotaExceededFault" => {
return RusotoError::Service(UpdateSubnetGroupError::SubnetQuotaExceededFault(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateSubnetGroupError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateSubnetGroupError {
fn description(&self) -> &str {
match *self {
UpdateSubnetGroupError::InvalidSubnet(ref cause) => cause,
UpdateSubnetGroupError::ServiceLinkedRoleNotFoundFault(ref cause) => cause,
UpdateSubnetGroupError::SubnetGroupNotFoundFault(ref cause) => cause,
UpdateSubnetGroupError::SubnetInUse(ref cause) => cause,
UpdateSubnetGroupError::SubnetQuotaExceededFault(ref cause) => cause,
}
}
}
pub trait DynamodbAccelerator {
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResponse, CreateClusterError>;
fn create_parameter_group(
&self,
input: CreateParameterGroupRequest,
) -> RusotoFuture<CreateParameterGroupResponse, CreateParameterGroupError>;
fn create_subnet_group(
&self,
input: CreateSubnetGroupRequest,
) -> RusotoFuture<CreateSubnetGroupResponse, CreateSubnetGroupError>;
fn decrease_replication_factor(
&self,
input: DecreaseReplicationFactorRequest,
) -> RusotoFuture<DecreaseReplicationFactorResponse, DecreaseReplicationFactorError>;
fn delete_cluster(
&self,
input: DeleteClusterRequest,
) -> RusotoFuture<DeleteClusterResponse, DeleteClusterError>;
fn delete_parameter_group(
&self,
input: DeleteParameterGroupRequest,
) -> RusotoFuture<DeleteParameterGroupResponse, DeleteParameterGroupError>;
fn delete_subnet_group(
&self,
input: DeleteSubnetGroupRequest,
) -> RusotoFuture<DeleteSubnetGroupResponse, DeleteSubnetGroupError>;
fn describe_clusters(
&self,
input: DescribeClustersRequest,
) -> RusotoFuture<DescribeClustersResponse, DescribeClustersError>;
fn describe_default_parameters(
&self,
input: DescribeDefaultParametersRequest,
) -> RusotoFuture<DescribeDefaultParametersResponse, DescribeDefaultParametersError>;
fn describe_events(
&self,
input: DescribeEventsRequest,
) -> RusotoFuture<DescribeEventsResponse, DescribeEventsError>;
fn describe_parameter_groups(
&self,
input: DescribeParameterGroupsRequest,
) -> RusotoFuture<DescribeParameterGroupsResponse, DescribeParameterGroupsError>;
fn describe_parameters(
&self,
input: DescribeParametersRequest,
) -> RusotoFuture<DescribeParametersResponse, DescribeParametersError>;
fn describe_subnet_groups(
&self,
input: DescribeSubnetGroupsRequest,
) -> RusotoFuture<DescribeSubnetGroupsResponse, DescribeSubnetGroupsError>;
fn increase_replication_factor(
&self,
input: IncreaseReplicationFactorRequest,
) -> RusotoFuture<IncreaseReplicationFactorResponse, IncreaseReplicationFactorError>;
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError>;
fn reboot_node(
&self,
input: RebootNodeRequest,
) -> RusotoFuture<RebootNodeResponse, RebootNodeError>;
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError>;
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError>;
fn update_cluster(
&self,
input: UpdateClusterRequest,
) -> RusotoFuture<UpdateClusterResponse, UpdateClusterError>;
fn update_parameter_group(
&self,
input: UpdateParameterGroupRequest,
) -> RusotoFuture<UpdateParameterGroupResponse, UpdateParameterGroupError>;
fn update_subnet_group(
&self,
input: UpdateSubnetGroupRequest,
) -> RusotoFuture<UpdateSubnetGroupResponse, UpdateSubnetGroupError>;
}
#[derive(Clone)]
pub struct DynamodbAcceleratorClient {
client: Client,
region: region::Region,
}
impl DynamodbAcceleratorClient {
pub fn new(region: region::Region) -> DynamodbAcceleratorClient {
DynamodbAcceleratorClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> DynamodbAcceleratorClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
DynamodbAcceleratorClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl DynamodbAccelerator for DynamodbAcceleratorClient {
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResponse, CreateClusterError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.CreateCluster");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateClusterResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateClusterError::from_response(response))),
)
}
})
}
fn create_parameter_group(
&self,
input: CreateParameterGroupRequest,
) -> RusotoFuture<CreateParameterGroupResponse, CreateParameterGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.CreateParameterGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateParameterGroupResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateParameterGroupError::from_response(response))
}),
)
}
})
}
fn create_subnet_group(
&self,
input: CreateSubnetGroupRequest,
) -> RusotoFuture<CreateSubnetGroupResponse, CreateSubnetGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.CreateSubnetGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<CreateSubnetGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateSubnetGroupError::from_response(response))),
)
}
})
}
fn decrease_replication_factor(
&self,
input: DecreaseReplicationFactorRequest,
) -> RusotoFuture<DecreaseReplicationFactorResponse, DecreaseReplicationFactorError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DecreaseReplicationFactor");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DecreaseReplicationFactorResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DecreaseReplicationFactorError::from_response(response))
}))
}
})
}
fn delete_cluster(
&self,
input: DeleteClusterRequest,
) -> RusotoFuture<DeleteClusterResponse, DeleteClusterError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DeleteCluster");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteClusterResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteClusterError::from_response(response))),
)
}
})
}
fn delete_parameter_group(
&self,
input: DeleteParameterGroupRequest,
) -> RusotoFuture<DeleteParameterGroupResponse, DeleteParameterGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DeleteParameterGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteParameterGroupResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DeleteParameterGroupError::from_response(response))
}),
)
}
})
}
fn delete_subnet_group(
&self,
input: DeleteSubnetGroupRequest,
) -> RusotoFuture<DeleteSubnetGroupResponse, DeleteSubnetGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DeleteSubnetGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteSubnetGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteSubnetGroupError::from_response(response))),
)
}
})
}
fn describe_clusters(
&self,
input: DescribeClustersRequest,
) -> RusotoFuture<DescribeClustersResponse, DescribeClustersError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeClusters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeClustersResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeClustersError::from_response(response))),
)
}
})
}
fn describe_default_parameters(
&self,
input: DescribeDefaultParametersRequest,
) -> RusotoFuture<DescribeDefaultParametersResponse, DescribeDefaultParametersError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeDefaultParameters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeDefaultParametersResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeDefaultParametersError::from_response(response))
}))
}
})
}
fn describe_events(
&self,
input: DescribeEventsRequest,
) -> RusotoFuture<DescribeEventsResponse, DescribeEventsError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeEvents");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeEventsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeEventsError::from_response(response))),
)
}
})
}
fn describe_parameter_groups(
&self,
input: DescribeParameterGroupsRequest,
) -> RusotoFuture<DescribeParameterGroupsResponse, DescribeParameterGroupsError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeParameterGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeParameterGroupsResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeParameterGroupsError::from_response(response))
}))
}
})
}
fn describe_parameters(
&self,
input: DescribeParametersRequest,
) -> RusotoFuture<DescribeParametersResponse, DescribeParametersError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeParameters");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeParametersResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeParametersError::from_response(response))),
)
}
})
}
fn describe_subnet_groups(
&self,
input: DescribeSubnetGroupsRequest,
) -> RusotoFuture<DescribeSubnetGroupsResponse, DescribeSubnetGroupsError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.DescribeSubnetGroups");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeSubnetGroupsResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeSubnetGroupsError::from_response(response))
}),
)
}
})
}
fn increase_replication_factor(
&self,
input: IncreaseReplicationFactorRequest,
) -> RusotoFuture<IncreaseReplicationFactorResponse, IncreaseReplicationFactorError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.IncreaseReplicationFactor");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<IncreaseReplicationFactorResponse, _>()
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(IncreaseReplicationFactorError::from_response(response))
}))
}
})
}
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.ListTags");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsError::from_response(response))),
)
}
})
}
fn reboot_node(
&self,
input: RebootNodeRequest,
) -> RusotoFuture<RebootNodeResponse, RebootNodeError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.RebootNode");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<RebootNodeResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RebootNodeError::from_response(response))),
)
}
})
}
fn tag_resource(
&self,
input: TagResourceRequest,
) -> RusotoFuture<TagResourceResponse, TagResourceError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.TagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<TagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(
&self,
input: UntagResourceRequest,
) -> RusotoFuture<UntagResourceResponse, UntagResourceError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.UntagResource");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UntagResourceResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UntagResourceError::from_response(response))),
)
}
})
}
fn update_cluster(
&self,
input: UpdateClusterRequest,
) -> RusotoFuture<UpdateClusterResponse, UpdateClusterError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.UpdateCluster");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateClusterResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateClusterError::from_response(response))),
)
}
})
}
fn update_parameter_group(
&self,
input: UpdateParameterGroupRequest,
) -> RusotoFuture<UpdateParameterGroupResponse, UpdateParameterGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.UpdateParameterGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateParameterGroupResponse, _>()
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateParameterGroupError::from_response(response))
}),
)
}
})
}
fn update_subnet_group(
&self,
input: UpdateSubnetGroupRequest,
) -> RusotoFuture<UpdateSubnetGroupResponse, UpdateSubnetGroupError> {
let mut request = SignedRequest::new("POST", "dax", &self.region, "/");
request.set_content_type("application/x-amz-json-1.1".to_owned());
request.add_header("x-amz-target", "AmazonDAXV3.UpdateSubnetGroup");
let encoded = serde_json::to_string(&input).unwrap();
request.set_payload(Some(encoded));
self.client.sign_and_dispatch(request, |response| {
if response.status.is_success() {
Box::new(response.buffer().from_err().and_then(|response| {
proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateSubnetGroupResponse, _>()
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateSubnetGroupError::from_response(response))),
)
}
})
}
}