use std::error::Error;
use std::fmt;
use std::io;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoFuture};
use rusoto_core::credential::{CredentialsError, ProvideAwsCredentials};
use rusoto_core::request::HttpDispatchError;
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::signature::SignedRequest;
use serde_json;
use serde_json::from_slice;
use serde_json::Value as SerdeJsonValue;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BrokerInstance {
#[serde(rename = "ConsoleURL")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_url: Option<String>,
#[serde(rename = "Endpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoints: Option<Vec<String>>,
#[serde(rename = "IpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ip_address: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BrokerSummary {
#[serde(rename = "BrokerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_arn: Option<String>,
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
#[serde(rename = "BrokerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_name: Option<String>,
#[serde(rename = "BrokerState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_state: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "DeploymentMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deployment_mode: Option<String>,
#[serde(rename = "HostInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_instance_type: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Configuration {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "LatestRevision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_revision: Option<ConfigurationRevision>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigurationId {
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "Revision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigurationRevision {
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Revision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revision: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Configurations {
#[serde(rename = "Current")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current: Option<ConfigurationId>,
#[serde(rename = "History")]
#[serde(skip_serializing_if = "Option::is_none")]
pub history: Option<Vec<ConfigurationId>>,
#[serde(rename = "Pending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending: Option<ConfigurationId>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateBrokerInput {
pub auto_minor_version_upgrade: Option<bool>,
pub broker_name: Option<String>,
pub configuration: Option<ConfigurationId>,
pub creator_request_id: Option<String>,
pub deployment_mode: Option<String>,
pub engine_type: Option<String>,
pub engine_version: Option<String>,
pub host_instance_type: Option<String>,
pub logs: Option<Logs>,
pub maintenance_window_start_time: Option<WeeklyStartTime>,
pub publicly_accessible: Option<bool>,
pub security_groups: Option<Vec<String>>,
pub subnet_ids: Option<Vec<String>>,
pub tags: Option<::std::collections::HashMap<String, String>>,
pub users: Option<Vec<User>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateBrokerOutput {
pub broker_arn: Option<String>,
pub broker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateBrokerRequest {
#[serde(rename = "AutoMinorVersionUpgrade")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_minor_version_upgrade: Option<bool>,
#[serde(rename = "BrokerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_name: Option<String>,
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<ConfigurationId>,
#[serde(rename = "CreatorRequestId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creator_request_id: Option<String>,
#[serde(rename = "DeploymentMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deployment_mode: Option<String>,
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "HostInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_instance_type: Option<String>,
#[serde(rename = "Logs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logs: Option<Logs>,
#[serde(rename = "MaintenanceWindowStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maintenance_window_start_time: Option<WeeklyStartTime>,
#[serde(rename = "PubliclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<String>>,
#[serde(rename = "SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_ids: Option<Vec<String>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Users")]
#[serde(skip_serializing_if = "Option::is_none")]
pub users: Option<Vec<User>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateBrokerResponse {
#[serde(rename = "BrokerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_arn: Option<String>,
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateConfigurationInput {
pub engine_type: Option<String>,
pub engine_version: Option<String>,
pub name: Option<String>,
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateConfigurationOutput {
pub arn: Option<String>,
pub created: Option<f64>,
pub id: Option<String>,
pub latest_revision: Option<ConfigurationRevision>,
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateConfigurationRequest {
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateConfigurationResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "LatestRevision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_revision: Option<ConfigurationRevision>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateTagsRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct CreateUserInput {
pub console_access: Option<bool>,
pub groups: Option<Vec<String>>,
pub password: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateUserRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
#[serde(rename = "ConsoleAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_access: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "Password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct CreateUserResponse {}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DeleteBrokerOutput {
pub broker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteBrokerRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteBrokerResponse {
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteTagsRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DeleteUserRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteUserResponse {}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeBrokerOutput {
pub auto_minor_version_upgrade: Option<bool>,
pub broker_arn: Option<String>,
pub broker_id: Option<String>,
pub broker_instances: Option<Vec<BrokerInstance>>,
pub broker_name: Option<String>,
pub broker_state: Option<String>,
pub configurations: Option<Configurations>,
pub created: Option<f64>,
pub deployment_mode: Option<String>,
pub engine_type: Option<String>,
pub engine_version: Option<String>,
pub host_instance_type: Option<String>,
pub logs: Option<LogsSummary>,
pub maintenance_window_start_time: Option<WeeklyStartTime>,
pub pending_engine_version: Option<String>,
pub publicly_accessible: Option<bool>,
pub security_groups: Option<Vec<String>>,
pub subnet_ids: Option<Vec<String>>,
pub tags: Option<::std::collections::HashMap<String, String>>,
pub users: Option<Vec<UserSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeBrokerRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeBrokerResponse {
#[serde(rename = "AutoMinorVersionUpgrade")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_minor_version_upgrade: Option<bool>,
#[serde(rename = "BrokerArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_arn: Option<String>,
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
#[serde(rename = "BrokerInstances")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_instances: Option<Vec<BrokerInstance>>,
#[serde(rename = "BrokerName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_name: Option<String>,
#[serde(rename = "BrokerState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_state: Option<String>,
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Configurations>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "DeploymentMode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub deployment_mode: Option<String>,
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "HostInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_instance_type: Option<String>,
#[serde(rename = "Logs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logs: Option<LogsSummary>,
#[serde(rename = "MaintenanceWindowStartTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub maintenance_window_start_time: Option<WeeklyStartTime>,
#[serde(rename = "PendingEngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_engine_version: Option<String>,
#[serde(rename = "PubliclyAccessible")]
#[serde(skip_serializing_if = "Option::is_none")]
pub publicly_accessible: Option<bool>,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<String>>,
#[serde(rename = "SubnetIds")]
#[serde(skip_serializing_if = "Option::is_none")]
pub subnet_ids: Option<Vec<String>>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "Users")]
#[serde(skip_serializing_if = "Option::is_none")]
pub users: Option<Vec<UserSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationRequest {
#[serde(rename = "ConfigurationId")]
pub configuration_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "LatestRevision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_revision: Option<ConfigurationRevision>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeConfigurationRevisionOutput {
pub configuration_id: Option<String>,
pub created: Option<f64>,
pub data: Option<String>,
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationRevisionRequest {
#[serde(rename = "ConfigurationId")]
pub configuration_id: String,
#[serde(rename = "ConfigurationRevision")]
pub configuration_revision: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationRevisionResponse {
#[serde(rename = "ConfigurationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_id: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Data")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct DescribeUserOutput {
pub broker_id: Option<String>,
pub console_access: Option<bool>,
pub groups: Option<Vec<String>>,
pub pending: Option<UserPendingChanges>,
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeUserRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeUserResponse {
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
#[serde(rename = "ConsoleAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_access: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "Pending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending: Option<UserPendingChanges>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct MQError {
pub error_attribute: Option<String>,
pub message: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListBrokersOutput {
pub broker_summaries: Option<Vec<BrokerSummary>>,
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListBrokersRequest {
#[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 ListBrokersResponse {
#[serde(rename = "BrokerSummaries")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_summaries: Option<Vec<BrokerSummary>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListConfigurationRevisionsOutput {
pub configuration_id: Option<String>,
pub max_results: Option<i64>,
pub next_token: Option<String>,
pub revisions: Option<Vec<ConfigurationRevision>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListConfigurationRevisionsRequest {
#[serde(rename = "ConfigurationId")]
pub configuration_id: 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 ListConfigurationRevisionsResponse {
#[serde(rename = "ConfigurationId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Revisions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub revisions: Option<Vec<ConfigurationRevision>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListConfigurationsOutput {
pub configurations: Option<Vec<Configuration>>,
pub max_results: Option<i64>,
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListConfigurationsRequest {
#[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 ListConfigurationsResponse {
#[serde(rename = "Configurations")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configurations: Option<Vec<Configuration>>,
#[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, Serialize)]
pub struct ListTagsRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsResponse {
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct ListUsersOutput {
pub broker_id: Option<String>,
pub max_results: Option<i64>,
pub next_token: Option<String>,
pub users: Option<Vec<UserSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListUsersRequest {
#[serde(rename = "BrokerId")]
pub broker_id: 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 ListUsersResponse {
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "Users")]
#[serde(skip_serializing_if = "Option::is_none")]
pub users: Option<Vec<UserSummary>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Logs {
#[serde(rename = "Audit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit: Option<bool>,
#[serde(rename = "General")]
#[serde(skip_serializing_if = "Option::is_none")]
pub general: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct LogsSummary {
#[serde(rename = "Audit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit: Option<bool>,
#[serde(rename = "AuditLogGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit_log_group: Option<String>,
#[serde(rename = "General")]
#[serde(skip_serializing_if = "Option::is_none")]
pub general: Option<bool>,
#[serde(rename = "GeneralLogGroup")]
#[serde(skip_serializing_if = "Option::is_none")]
pub general_log_group: Option<String>,
#[serde(rename = "Pending")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending: Option<PendingLogs>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct PendingLogs {
#[serde(rename = "Audit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub audit: Option<bool>,
#[serde(rename = "General")]
#[serde(skip_serializing_if = "Option::is_none")]
pub general: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct RebootBrokerRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct RebootBrokerResponse {}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct SanitizationWarning {
#[serde(rename = "AttributeName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attribute_name: Option<String>,
#[serde(rename = "ElementName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub element_name: Option<String>,
#[serde(rename = "Reason")]
#[serde(skip_serializing_if = "Option::is_none")]
pub reason: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct Tags {
pub tags: Option<::std::collections::HashMap<String, String>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateBrokerInput {
pub auto_minor_version_upgrade: Option<bool>,
pub configuration: Option<ConfigurationId>,
pub engine_version: Option<String>,
pub logs: Option<Logs>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateBrokerOutput {
pub auto_minor_version_upgrade: Option<bool>,
pub broker_id: Option<String>,
pub configuration: Option<ConfigurationId>,
pub engine_version: Option<String>,
pub logs: Option<Logs>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateBrokerRequest {
#[serde(rename = "AutoMinorVersionUpgrade")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_minor_version_upgrade: Option<bool>,
#[serde(rename = "BrokerId")]
pub broker_id: String,
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<ConfigurationId>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Logs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logs: Option<Logs>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateBrokerResponse {
#[serde(rename = "AutoMinorVersionUpgrade")]
#[serde(skip_serializing_if = "Option::is_none")]
pub auto_minor_version_upgrade: Option<bool>,
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<String>,
#[serde(rename = "Configuration")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration: Option<ConfigurationId>,
#[serde(rename = "EngineVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_version: Option<String>,
#[serde(rename = "Logs")]
#[serde(skip_serializing_if = "Option::is_none")]
pub logs: Option<Logs>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateConfigurationInput {
pub data: Option<String>,
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateConfigurationOutput {
pub arn: Option<String>,
pub created: Option<f64>,
pub id: Option<String>,
pub latest_revision: Option<ConfigurationRevision>,
pub name: Option<String>,
pub warnings: Option<Vec<SanitizationWarning>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateConfigurationRequest {
#[serde(rename = "ConfigurationId")]
pub configuration_id: String,
#[serde(rename = "Data")]
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<String>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateConfigurationResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "Created")]
#[serde(skip_serializing_if = "Option::is_none")]
pub created: Option<f64>,
#[serde(rename = "Id")]
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "LatestRevision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub latest_revision: Option<ConfigurationRevision>,
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(rename = "Warnings")]
#[serde(skip_serializing_if = "Option::is_none")]
pub warnings: Option<Vec<SanitizationWarning>>,
}
#[derive(Default, Debug, Clone, PartialEq)]
pub struct UpdateUserInput {
pub console_access: Option<bool>,
pub groups: Option<Vec<String>>,
pub password: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateUserRequest {
#[serde(rename = "BrokerId")]
pub broker_id: String,
#[serde(rename = "ConsoleAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_access: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "Password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "Username")]
pub username: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateUserResponse {}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct User {
#[serde(rename = "ConsoleAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_access: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "Password")]
#[serde(skip_serializing_if = "Option::is_none")]
pub password: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserPendingChanges {
#[serde(rename = "ConsoleAccess")]
#[serde(skip_serializing_if = "Option::is_none")]
pub console_access: Option<bool>,
#[serde(rename = "Groups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub groups: Option<Vec<String>>,
#[serde(rename = "PendingChange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_change: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UserSummary {
#[serde(rename = "PendingChange")]
#[serde(skip_serializing_if = "Option::is_none")]
pub pending_change: Option<String>,
#[serde(rename = "Username")]
#[serde(skip_serializing_if = "Option::is_none")]
pub username: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct WeeklyStartTime {
#[serde(rename = "DayOfWeek")]
#[serde(skip_serializing_if = "Option::is_none")]
pub day_of_week: Option<String>,
#[serde(rename = "TimeOfDay")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_of_day: Option<String>,
#[serde(rename = "TimeZone")]
#[serde(skip_serializing_if = "Option::is_none")]
pub time_zone: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum CreateBrokerError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
Unauthorized(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> CreateBrokerError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return CreateBrokerError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return CreateBrokerError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return CreateBrokerError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return CreateBrokerError::InternalServerError(String::from(error_message));
}
"UnauthorizedException" => {
return CreateBrokerError::Unauthorized(String::from(error_message));
}
"ValidationException" => {
return CreateBrokerError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateBrokerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateBrokerError {
fn from(err: serde_json::error::Error) -> CreateBrokerError {
CreateBrokerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateBrokerError {
fn from(err: CredentialsError) -> CreateBrokerError {
CreateBrokerError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateBrokerError {
fn from(err: HttpDispatchError) -> CreateBrokerError {
CreateBrokerError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateBrokerError {
fn from(err: io::Error) -> CreateBrokerError {
CreateBrokerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateBrokerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateBrokerError {
fn description(&self) -> &str {
match *self {
CreateBrokerError::BadRequest(ref cause) => cause,
CreateBrokerError::Conflict(ref cause) => cause,
CreateBrokerError::Forbidden(ref cause) => cause,
CreateBrokerError::InternalServerError(ref cause) => cause,
CreateBrokerError::Unauthorized(ref cause) => cause,
CreateBrokerError::Validation(ref cause) => cause,
CreateBrokerError::Credentials(ref err) => err.description(),
CreateBrokerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateBrokerError::ParseError(ref cause) => cause,
CreateBrokerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateConfigurationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> CreateConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return CreateConfigurationError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return CreateConfigurationError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return CreateConfigurationError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return CreateConfigurationError::InternalServerError(String::from(
error_message,
));
}
"ValidationException" => {
return CreateConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateConfigurationError {
fn from(err: serde_json::error::Error) -> CreateConfigurationError {
CreateConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateConfigurationError {
fn from(err: CredentialsError) -> CreateConfigurationError {
CreateConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateConfigurationError {
fn from(err: HttpDispatchError) -> CreateConfigurationError {
CreateConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateConfigurationError {
fn from(err: io::Error) -> CreateConfigurationError {
CreateConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateConfigurationError {
fn description(&self) -> &str {
match *self {
CreateConfigurationError::BadRequest(ref cause) => cause,
CreateConfigurationError::Conflict(ref cause) => cause,
CreateConfigurationError::Forbidden(ref cause) => cause,
CreateConfigurationError::InternalServerError(ref cause) => cause,
CreateConfigurationError::Validation(ref cause) => cause,
CreateConfigurationError::Credentials(ref err) => err.description(),
CreateConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
CreateConfigurationError::ParseError(ref cause) => cause,
CreateConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateTagsError {
pub fn from_response(res: BufferedHttpResponse) -> CreateTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return CreateTagsError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return CreateTagsError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return CreateTagsError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return CreateTagsError::NotFound(String::from(error_message));
}
"ValidationException" => {
return CreateTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateTagsError {
fn from(err: serde_json::error::Error) -> CreateTagsError {
CreateTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateTagsError {
fn from(err: CredentialsError) -> CreateTagsError {
CreateTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateTagsError {
fn from(err: HttpDispatchError) -> CreateTagsError {
CreateTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateTagsError {
fn from(err: io::Error) -> CreateTagsError {
CreateTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateTagsError {
fn description(&self) -> &str {
match *self {
CreateTagsError::BadRequest(ref cause) => cause,
CreateTagsError::Forbidden(ref cause) => cause,
CreateTagsError::InternalServerError(ref cause) => cause,
CreateTagsError::NotFound(ref cause) => cause,
CreateTagsError::Validation(ref cause) => cause,
CreateTagsError::Credentials(ref err) => err.description(),
CreateTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateTagsError::ParseError(ref cause) => cause,
CreateTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUserError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl CreateUserError {
pub fn from_response(res: BufferedHttpResponse) -> CreateUserError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return CreateUserError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return CreateUserError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return CreateUserError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return CreateUserError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return CreateUserError::NotFound(String::from(error_message));
}
"ValidationException" => {
return CreateUserError::Validation(error_message.to_string());
}
_ => {}
}
}
return CreateUserError::Unknown(res);
}
}
impl From<serde_json::error::Error> for CreateUserError {
fn from(err: serde_json::error::Error) -> CreateUserError {
CreateUserError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for CreateUserError {
fn from(err: CredentialsError) -> CreateUserError {
CreateUserError::Credentials(err)
}
}
impl From<HttpDispatchError> for CreateUserError {
fn from(err: HttpDispatchError) -> CreateUserError {
CreateUserError::HttpDispatch(err)
}
}
impl From<io::Error> for CreateUserError {
fn from(err: io::Error) -> CreateUserError {
CreateUserError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for CreateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateUserError {
fn description(&self) -> &str {
match *self {
CreateUserError::BadRequest(ref cause) => cause,
CreateUserError::Conflict(ref cause) => cause,
CreateUserError::Forbidden(ref cause) => cause,
CreateUserError::InternalServerError(ref cause) => cause,
CreateUserError::NotFound(ref cause) => cause,
CreateUserError::Validation(ref cause) => cause,
CreateUserError::Credentials(ref err) => err.description(),
CreateUserError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
CreateUserError::ParseError(ref cause) => cause,
CreateUserError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteBrokerError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DeleteBrokerError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DeleteBrokerError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DeleteBrokerError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return DeleteBrokerError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DeleteBrokerError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteBrokerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteBrokerError {
fn from(err: serde_json::error::Error) -> DeleteBrokerError {
DeleteBrokerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteBrokerError {
fn from(err: CredentialsError) -> DeleteBrokerError {
DeleteBrokerError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteBrokerError {
fn from(err: HttpDispatchError) -> DeleteBrokerError {
DeleteBrokerError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteBrokerError {
fn from(err: io::Error) -> DeleteBrokerError {
DeleteBrokerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteBrokerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteBrokerError {
fn description(&self) -> &str {
match *self {
DeleteBrokerError::BadRequest(ref cause) => cause,
DeleteBrokerError::Forbidden(ref cause) => cause,
DeleteBrokerError::InternalServerError(ref cause) => cause,
DeleteBrokerError::NotFound(ref cause) => cause,
DeleteBrokerError::Validation(ref cause) => cause,
DeleteBrokerError::Credentials(ref err) => err.description(),
DeleteBrokerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteBrokerError::ParseError(ref cause) => cause,
DeleteBrokerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteTagsError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DeleteTagsError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DeleteTagsError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DeleteTagsError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return DeleteTagsError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DeleteTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteTagsError {
fn from(err: serde_json::error::Error) -> DeleteTagsError {
DeleteTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteTagsError {
fn from(err: CredentialsError) -> DeleteTagsError {
DeleteTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteTagsError {
fn from(err: HttpDispatchError) -> DeleteTagsError {
DeleteTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteTagsError {
fn from(err: io::Error) -> DeleteTagsError {
DeleteTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteTagsError {
fn description(&self) -> &str {
match *self {
DeleteTagsError::BadRequest(ref cause) => cause,
DeleteTagsError::Forbidden(ref cause) => cause,
DeleteTagsError::InternalServerError(ref cause) => cause,
DeleteTagsError::NotFound(ref cause) => cause,
DeleteTagsError::Validation(ref cause) => cause,
DeleteTagsError::Credentials(ref err) => err.description(),
DeleteTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteTagsError::ParseError(ref cause) => cause,
DeleteTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DeleteUserError {
pub fn from_response(res: BufferedHttpResponse) -> DeleteUserError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DeleteUserError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DeleteUserError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DeleteUserError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return DeleteUserError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DeleteUserError::Validation(error_message.to_string());
}
_ => {}
}
}
return DeleteUserError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DeleteUserError {
fn from(err: serde_json::error::Error) -> DeleteUserError {
DeleteUserError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DeleteUserError {
fn from(err: CredentialsError) -> DeleteUserError {
DeleteUserError::Credentials(err)
}
}
impl From<HttpDispatchError> for DeleteUserError {
fn from(err: HttpDispatchError) -> DeleteUserError {
DeleteUserError::HttpDispatch(err)
}
}
impl From<io::Error> for DeleteUserError {
fn from(err: io::Error) -> DeleteUserError {
DeleteUserError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DeleteUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteUserError {
fn description(&self) -> &str {
match *self {
DeleteUserError::BadRequest(ref cause) => cause,
DeleteUserError::Forbidden(ref cause) => cause,
DeleteUserError::InternalServerError(ref cause) => cause,
DeleteUserError::NotFound(ref cause) => cause,
DeleteUserError::Validation(ref cause) => cause,
DeleteUserError::Credentials(ref err) => err.description(),
DeleteUserError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DeleteUserError::ParseError(ref cause) => cause,
DeleteUserError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeBrokerError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DescribeBrokerError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DescribeBrokerError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DescribeBrokerError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return DescribeBrokerError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeBrokerError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeBrokerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeBrokerError {
fn from(err: serde_json::error::Error) -> DescribeBrokerError {
DescribeBrokerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeBrokerError {
fn from(err: CredentialsError) -> DescribeBrokerError {
DescribeBrokerError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeBrokerError {
fn from(err: HttpDispatchError) -> DescribeBrokerError {
DescribeBrokerError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeBrokerError {
fn from(err: io::Error) -> DescribeBrokerError {
DescribeBrokerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeBrokerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeBrokerError {
fn description(&self) -> &str {
match *self {
DescribeBrokerError::BadRequest(ref cause) => cause,
DescribeBrokerError::Forbidden(ref cause) => cause,
DescribeBrokerError::InternalServerError(ref cause) => cause,
DescribeBrokerError::NotFound(ref cause) => cause,
DescribeBrokerError::Validation(ref cause) => cause,
DescribeBrokerError::Credentials(ref err) => err.description(),
DescribeBrokerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeBrokerError::ParseError(ref cause) => cause,
DescribeBrokerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DescribeConfigurationError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DescribeConfigurationError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DescribeConfigurationError::InternalServerError(String::from(
error_message,
));
}
"NotFoundException" => {
return DescribeConfigurationError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationError {
DescribeConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationError {
fn from(err: CredentialsError) -> DescribeConfigurationError {
DescribeConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationError {
fn from(err: HttpDispatchError) -> DescribeConfigurationError {
DescribeConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationError {
fn from(err: io::Error) -> DescribeConfigurationError {
DescribeConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationError::BadRequest(ref cause) => cause,
DescribeConfigurationError::Forbidden(ref cause) => cause,
DescribeConfigurationError::InternalServerError(ref cause) => cause,
DescribeConfigurationError::NotFound(ref cause) => cause,
DescribeConfigurationError::Validation(ref cause) => cause,
DescribeConfigurationError::Credentials(ref err) => err.description(),
DescribeConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationError::ParseError(ref cause) => cause,
DescribeConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationRevisionError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeConfigurationRevisionError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeConfigurationRevisionError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DescribeConfigurationRevisionError::BadRequest(String::from(
error_message,
));
}
"ForbiddenException" => {
return DescribeConfigurationRevisionError::Forbidden(String::from(
error_message,
));
}
"InternalServerErrorException" => {
return DescribeConfigurationRevisionError::InternalServerError(String::from(
error_message,
));
}
"NotFoundException" => {
return DescribeConfigurationRevisionError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeConfigurationRevisionError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeConfigurationRevisionError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeConfigurationRevisionError {
fn from(err: serde_json::error::Error) -> DescribeConfigurationRevisionError {
DescribeConfigurationRevisionError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeConfigurationRevisionError {
fn from(err: CredentialsError) -> DescribeConfigurationRevisionError {
DescribeConfigurationRevisionError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeConfigurationRevisionError {
fn from(err: HttpDispatchError) -> DescribeConfigurationRevisionError {
DescribeConfigurationRevisionError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeConfigurationRevisionError {
fn from(err: io::Error) -> DescribeConfigurationRevisionError {
DescribeConfigurationRevisionError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeConfigurationRevisionError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeConfigurationRevisionError {
fn description(&self) -> &str {
match *self {
DescribeConfigurationRevisionError::BadRequest(ref cause) => cause,
DescribeConfigurationRevisionError::Forbidden(ref cause) => cause,
DescribeConfigurationRevisionError::InternalServerError(ref cause) => cause,
DescribeConfigurationRevisionError::NotFound(ref cause) => cause,
DescribeConfigurationRevisionError::Validation(ref cause) => cause,
DescribeConfigurationRevisionError::Credentials(ref err) => err.description(),
DescribeConfigurationRevisionError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
DescribeConfigurationRevisionError::ParseError(ref cause) => cause,
DescribeConfigurationRevisionError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl DescribeUserError {
pub fn from_response(res: BufferedHttpResponse) -> DescribeUserError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return DescribeUserError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return DescribeUserError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return DescribeUserError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return DescribeUserError::NotFound(String::from(error_message));
}
"ValidationException" => {
return DescribeUserError::Validation(error_message.to_string());
}
_ => {}
}
}
return DescribeUserError::Unknown(res);
}
}
impl From<serde_json::error::Error> for DescribeUserError {
fn from(err: serde_json::error::Error) -> DescribeUserError {
DescribeUserError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for DescribeUserError {
fn from(err: CredentialsError) -> DescribeUserError {
DescribeUserError::Credentials(err)
}
}
impl From<HttpDispatchError> for DescribeUserError {
fn from(err: HttpDispatchError) -> DescribeUserError {
DescribeUserError::HttpDispatch(err)
}
}
impl From<io::Error> for DescribeUserError {
fn from(err: io::Error) -> DescribeUserError {
DescribeUserError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for DescribeUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeUserError {
fn description(&self) -> &str {
match *self {
DescribeUserError::BadRequest(ref cause) => cause,
DescribeUserError::Forbidden(ref cause) => cause,
DescribeUserError::InternalServerError(ref cause) => cause,
DescribeUserError::NotFound(ref cause) => cause,
DescribeUserError::Validation(ref cause) => cause,
DescribeUserError::Credentials(ref err) => err.description(),
DescribeUserError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
DescribeUserError::ParseError(ref cause) => cause,
DescribeUserError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListBrokersError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListBrokersError {
pub fn from_response(res: BufferedHttpResponse) -> ListBrokersError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return ListBrokersError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return ListBrokersError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return ListBrokersError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return ListBrokersError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListBrokersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListBrokersError {
fn from(err: serde_json::error::Error) -> ListBrokersError {
ListBrokersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListBrokersError {
fn from(err: CredentialsError) -> ListBrokersError {
ListBrokersError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListBrokersError {
fn from(err: HttpDispatchError) -> ListBrokersError {
ListBrokersError::HttpDispatch(err)
}
}
impl From<io::Error> for ListBrokersError {
fn from(err: io::Error) -> ListBrokersError {
ListBrokersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListBrokersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListBrokersError {
fn description(&self) -> &str {
match *self {
ListBrokersError::BadRequest(ref cause) => cause,
ListBrokersError::Forbidden(ref cause) => cause,
ListBrokersError::InternalServerError(ref cause) => cause,
ListBrokersError::Validation(ref cause) => cause,
ListBrokersError::Credentials(ref err) => err.description(),
ListBrokersError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListBrokersError::ParseError(ref cause) => cause,
ListBrokersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationRevisionsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListConfigurationRevisionsError {
pub fn from_response(res: BufferedHttpResponse) -> ListConfigurationRevisionsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return ListConfigurationRevisionsError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return ListConfigurationRevisionsError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return ListConfigurationRevisionsError::InternalServerError(String::from(
error_message,
));
}
"NotFoundException" => {
return ListConfigurationRevisionsError::NotFound(String::from(error_message));
}
"ValidationException" => {
return ListConfigurationRevisionsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListConfigurationRevisionsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListConfigurationRevisionsError {
fn from(err: serde_json::error::Error) -> ListConfigurationRevisionsError {
ListConfigurationRevisionsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListConfigurationRevisionsError {
fn from(err: CredentialsError) -> ListConfigurationRevisionsError {
ListConfigurationRevisionsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListConfigurationRevisionsError {
fn from(err: HttpDispatchError) -> ListConfigurationRevisionsError {
ListConfigurationRevisionsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListConfigurationRevisionsError {
fn from(err: io::Error) -> ListConfigurationRevisionsError {
ListConfigurationRevisionsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListConfigurationRevisionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListConfigurationRevisionsError {
fn description(&self) -> &str {
match *self {
ListConfigurationRevisionsError::BadRequest(ref cause) => cause,
ListConfigurationRevisionsError::Forbidden(ref cause) => cause,
ListConfigurationRevisionsError::InternalServerError(ref cause) => cause,
ListConfigurationRevisionsError::NotFound(ref cause) => cause,
ListConfigurationRevisionsError::Validation(ref cause) => cause,
ListConfigurationRevisionsError::Credentials(ref err) => err.description(),
ListConfigurationRevisionsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListConfigurationRevisionsError::ParseError(ref cause) => cause,
ListConfigurationRevisionsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> ListConfigurationsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return ListConfigurationsError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return ListConfigurationsError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return ListConfigurationsError::InternalServerError(String::from(error_message));
}
"ValidationException" => {
return ListConfigurationsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListConfigurationsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListConfigurationsError {
fn from(err: serde_json::error::Error) -> ListConfigurationsError {
ListConfigurationsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListConfigurationsError {
fn from(err: CredentialsError) -> ListConfigurationsError {
ListConfigurationsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListConfigurationsError {
fn from(err: HttpDispatchError) -> ListConfigurationsError {
ListConfigurationsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListConfigurationsError {
fn from(err: io::Error) -> ListConfigurationsError {
ListConfigurationsError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListConfigurationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListConfigurationsError {
fn description(&self) -> &str {
match *self {
ListConfigurationsError::BadRequest(ref cause) => cause,
ListConfigurationsError::Forbidden(ref cause) => cause,
ListConfigurationsError::InternalServerError(ref cause) => cause,
ListConfigurationsError::Validation(ref cause) => cause,
ListConfigurationsError::Credentials(ref err) => err.description(),
ListConfigurationsError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
ListConfigurationsError::ParseError(ref cause) => cause,
ListConfigurationsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> ListTagsError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return ListTagsError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return ListTagsError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return ListTagsError::InternalServerError(String::from(error_message));
}
"NotFoundException" => return ListTagsError::NotFound(String::from(error_message)),
"ValidationException" => {
return ListTagsError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListTagsError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListTagsError {
fn from(err: serde_json::error::Error) -> ListTagsError {
ListTagsError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListTagsError {
fn from(err: CredentialsError) -> ListTagsError {
ListTagsError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListTagsError {
fn from(err: HttpDispatchError) -> ListTagsError {
ListTagsError::HttpDispatch(err)
}
}
impl From<io::Error> for ListTagsError {
fn from(err: io::Error) -> ListTagsError {
ListTagsError::HttpDispatch(HttpDispatchError::from(err))
}
}
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::BadRequest(ref cause) => cause,
ListTagsError::Forbidden(ref cause) => cause,
ListTagsError::InternalServerError(ref cause) => cause,
ListTagsError::NotFound(ref cause) => cause,
ListTagsError::Validation(ref cause) => cause,
ListTagsError::Credentials(ref err) => err.description(),
ListTagsError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListTagsError::ParseError(ref cause) => cause,
ListTagsError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUsersError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl ListUsersError {
pub fn from_response(res: BufferedHttpResponse) -> ListUsersError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return ListUsersError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return ListUsersError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return ListUsersError::InternalServerError(String::from(error_message));
}
"NotFoundException" => return ListUsersError::NotFound(String::from(error_message)),
"ValidationException" => {
return ListUsersError::Validation(error_message.to_string());
}
_ => {}
}
}
return ListUsersError::Unknown(res);
}
}
impl From<serde_json::error::Error> for ListUsersError {
fn from(err: serde_json::error::Error) -> ListUsersError {
ListUsersError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for ListUsersError {
fn from(err: CredentialsError) -> ListUsersError {
ListUsersError::Credentials(err)
}
}
impl From<HttpDispatchError> for ListUsersError {
fn from(err: HttpDispatchError) -> ListUsersError {
ListUsersError::HttpDispatch(err)
}
}
impl From<io::Error> for ListUsersError {
fn from(err: io::Error) -> ListUsersError {
ListUsersError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for ListUsersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListUsersError {
fn description(&self) -> &str {
match *self {
ListUsersError::BadRequest(ref cause) => cause,
ListUsersError::Forbidden(ref cause) => cause,
ListUsersError::InternalServerError(ref cause) => cause,
ListUsersError::NotFound(ref cause) => cause,
ListUsersError::Validation(ref cause) => cause,
ListUsersError::Credentials(ref err) => err.description(),
ListUsersError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
ListUsersError::ParseError(ref cause) => cause,
ListUsersError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl RebootBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RebootBrokerError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return RebootBrokerError::BadRequest(String::from(error_message));
}
"ForbiddenException" => {
return RebootBrokerError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return RebootBrokerError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return RebootBrokerError::NotFound(String::from(error_message));
}
"ValidationException" => {
return RebootBrokerError::Validation(error_message.to_string());
}
_ => {}
}
}
return RebootBrokerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for RebootBrokerError {
fn from(err: serde_json::error::Error) -> RebootBrokerError {
RebootBrokerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for RebootBrokerError {
fn from(err: CredentialsError) -> RebootBrokerError {
RebootBrokerError::Credentials(err)
}
}
impl From<HttpDispatchError> for RebootBrokerError {
fn from(err: HttpDispatchError) -> RebootBrokerError {
RebootBrokerError::HttpDispatch(err)
}
}
impl From<io::Error> for RebootBrokerError {
fn from(err: io::Error) -> RebootBrokerError {
RebootBrokerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for RebootBrokerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for RebootBrokerError {
fn description(&self) -> &str {
match *self {
RebootBrokerError::BadRequest(ref cause) => cause,
RebootBrokerError::Forbidden(ref cause) => cause,
RebootBrokerError::InternalServerError(ref cause) => cause,
RebootBrokerError::NotFound(ref cause) => cause,
RebootBrokerError::Validation(ref cause) => cause,
RebootBrokerError::Credentials(ref err) => err.description(),
RebootBrokerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
RebootBrokerError::ParseError(ref cause) => cause,
RebootBrokerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateBrokerError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateBrokerError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return UpdateBrokerError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return UpdateBrokerError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return UpdateBrokerError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return UpdateBrokerError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return UpdateBrokerError::NotFound(String::from(error_message));
}
"ValidationException" => {
return UpdateBrokerError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateBrokerError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateBrokerError {
fn from(err: serde_json::error::Error) -> UpdateBrokerError {
UpdateBrokerError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateBrokerError {
fn from(err: CredentialsError) -> UpdateBrokerError {
UpdateBrokerError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateBrokerError {
fn from(err: HttpDispatchError) -> UpdateBrokerError {
UpdateBrokerError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateBrokerError {
fn from(err: io::Error) -> UpdateBrokerError {
UpdateBrokerError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateBrokerError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateBrokerError {
fn description(&self) -> &str {
match *self {
UpdateBrokerError::BadRequest(ref cause) => cause,
UpdateBrokerError::Conflict(ref cause) => cause,
UpdateBrokerError::Forbidden(ref cause) => cause,
UpdateBrokerError::InternalServerError(ref cause) => cause,
UpdateBrokerError::NotFound(ref cause) => cause,
UpdateBrokerError::Validation(ref cause) => cause,
UpdateBrokerError::Credentials(ref err) => err.description(),
UpdateBrokerError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateBrokerError::ParseError(ref cause) => cause,
UpdateBrokerError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateConfigurationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateConfigurationError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return UpdateConfigurationError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return UpdateConfigurationError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return UpdateConfigurationError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return UpdateConfigurationError::InternalServerError(String::from(
error_message,
));
}
"NotFoundException" => {
return UpdateConfigurationError::NotFound(String::from(error_message));
}
"ValidationException" => {
return UpdateConfigurationError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateConfigurationError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateConfigurationError {
fn from(err: serde_json::error::Error) -> UpdateConfigurationError {
UpdateConfigurationError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateConfigurationError {
fn from(err: CredentialsError) -> UpdateConfigurationError {
UpdateConfigurationError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateConfigurationError {
fn from(err: HttpDispatchError) -> UpdateConfigurationError {
UpdateConfigurationError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateConfigurationError {
fn from(err: io::Error) -> UpdateConfigurationError {
UpdateConfigurationError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateConfigurationError {
fn description(&self) -> &str {
match *self {
UpdateConfigurationError::BadRequest(ref cause) => cause,
UpdateConfigurationError::Conflict(ref cause) => cause,
UpdateConfigurationError::Forbidden(ref cause) => cause,
UpdateConfigurationError::InternalServerError(ref cause) => cause,
UpdateConfigurationError::NotFound(ref cause) => cause,
UpdateConfigurationError::Validation(ref cause) => cause,
UpdateConfigurationError::Credentials(ref err) => err.description(),
UpdateConfigurationError::HttpDispatch(ref dispatch_error) => {
dispatch_error.description()
}
UpdateConfigurationError::ParseError(ref cause) => cause,
UpdateConfigurationError::Unknown(_) => "unknown error",
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
HttpDispatch(HttpDispatchError),
Credentials(CredentialsError),
Validation(String),
ParseError(String),
Unknown(BufferedHttpResponse),
}
impl UpdateUserError {
pub fn from_response(res: BufferedHttpResponse) -> UpdateUserError {
if let Ok(json) = from_slice::<SerdeJsonValue>(&res.body) {
let error_type = match res.headers.get("x-amzn-errortype") {
Some(raw_error_type) => raw_error_type
.split(':')
.next()
.unwrap_or_else(|| "Unknown"),
_ => json
.get("code")
.or_else(|| json.get("Code"))
.and_then(|c| c.as_str())
.unwrap_or_else(|| "Unknown"),
};
let error_message = json
.get("message")
.or_else(|| json.get("Message"))
.and_then(|m| m.as_str())
.unwrap_or("");
match error_type {
"BadRequestException" => {
return UpdateUserError::BadRequest(String::from(error_message));
}
"ConflictException" => {
return UpdateUserError::Conflict(String::from(error_message));
}
"ForbiddenException" => {
return UpdateUserError::Forbidden(String::from(error_message));
}
"InternalServerErrorException" => {
return UpdateUserError::InternalServerError(String::from(error_message));
}
"NotFoundException" => {
return UpdateUserError::NotFound(String::from(error_message));
}
"ValidationException" => {
return UpdateUserError::Validation(error_message.to_string());
}
_ => {}
}
}
return UpdateUserError::Unknown(res);
}
}
impl From<serde_json::error::Error> for UpdateUserError {
fn from(err: serde_json::error::Error) -> UpdateUserError {
UpdateUserError::ParseError(err.description().to_string())
}
}
impl From<CredentialsError> for UpdateUserError {
fn from(err: CredentialsError) -> UpdateUserError {
UpdateUserError::Credentials(err)
}
}
impl From<HttpDispatchError> for UpdateUserError {
fn from(err: HttpDispatchError) -> UpdateUserError {
UpdateUserError::HttpDispatch(err)
}
}
impl From<io::Error> for UpdateUserError {
fn from(err: io::Error) -> UpdateUserError {
UpdateUserError::HttpDispatch(HttpDispatchError::from(err))
}
}
impl fmt::Display for UpdateUserError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateUserError {
fn description(&self) -> &str {
match *self {
UpdateUserError::BadRequest(ref cause) => cause,
UpdateUserError::Conflict(ref cause) => cause,
UpdateUserError::Forbidden(ref cause) => cause,
UpdateUserError::InternalServerError(ref cause) => cause,
UpdateUserError::NotFound(ref cause) => cause,
UpdateUserError::Validation(ref cause) => cause,
UpdateUserError::Credentials(ref err) => err.description(),
UpdateUserError::HttpDispatch(ref dispatch_error) => dispatch_error.description(),
UpdateUserError::ParseError(ref cause) => cause,
UpdateUserError::Unknown(_) => "unknown error",
}
}
}
pub trait MQ {
fn create_broker(
&self,
input: CreateBrokerRequest,
) -> RusotoFuture<CreateBrokerResponse, CreateBrokerError>;
fn create_configuration(
&self,
input: CreateConfigurationRequest,
) -> RusotoFuture<CreateConfigurationResponse, CreateConfigurationError>;
fn create_tags(&self, input: CreateTagsRequest) -> RusotoFuture<(), CreateTagsError>;
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError>;
fn delete_broker(
&self,
input: DeleteBrokerRequest,
) -> RusotoFuture<DeleteBrokerResponse, DeleteBrokerError>;
fn delete_tags(&self, input: DeleteTagsRequest) -> RusotoFuture<(), DeleteTagsError>;
fn delete_user(
&self,
input: DeleteUserRequest,
) -> RusotoFuture<DeleteUserResponse, DeleteUserError>;
fn describe_broker(
&self,
input: DescribeBrokerRequest,
) -> RusotoFuture<DescribeBrokerResponse, DescribeBrokerError>;
fn describe_configuration(
&self,
input: DescribeConfigurationRequest,
) -> RusotoFuture<DescribeConfigurationResponse, DescribeConfigurationError>;
fn describe_configuration_revision(
&self,
input: DescribeConfigurationRevisionRequest,
) -> RusotoFuture<DescribeConfigurationRevisionResponse, DescribeConfigurationRevisionError>;
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError>;
fn list_brokers(
&self,
input: ListBrokersRequest,
) -> RusotoFuture<ListBrokersResponse, ListBrokersError>;
fn list_configuration_revisions(
&self,
input: ListConfigurationRevisionsRequest,
) -> RusotoFuture<ListConfigurationRevisionsResponse, ListConfigurationRevisionsError>;
fn list_configurations(
&self,
input: ListConfigurationsRequest,
) -> RusotoFuture<ListConfigurationsResponse, ListConfigurationsError>;
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError>;
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError>;
fn reboot_broker(
&self,
input: RebootBrokerRequest,
) -> RusotoFuture<RebootBrokerResponse, RebootBrokerError>;
fn update_broker(
&self,
input: UpdateBrokerRequest,
) -> RusotoFuture<UpdateBrokerResponse, UpdateBrokerError>;
fn update_configuration(
&self,
input: UpdateConfigurationRequest,
) -> RusotoFuture<UpdateConfigurationResponse, UpdateConfigurationError>;
fn update_user(
&self,
input: UpdateUserRequest,
) -> RusotoFuture<UpdateUserResponse, UpdateUserError>;
}
#[derive(Clone)]
pub struct MQClient {
client: Client,
region: region::Region,
}
impl MQClient {
pub fn new(region: region::Region) -> MQClient {
MQClient {
client: Client::shared(),
region: region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> MQClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
MQClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region: region,
}
}
}
impl MQ for MQClient {
fn create_broker(
&self,
input: CreateBrokerRequest,
) -> RusotoFuture<CreateBrokerResponse, CreateBrokerError> {
let request_uri = "/v1/brokers";
let mut request = SignedRequest::new("POST", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<CreateBrokerResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateBrokerError::from_response(response))),
)
}
})
}
fn create_configuration(
&self,
input: CreateConfigurationRequest,
) -> RusotoFuture<CreateConfigurationResponse, CreateConfigurationError> {
let request_uri = "/v1/configurations";
let mut request = SignedRequest::new("POST", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<CreateConfigurationResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(CreateConfigurationError::from_response(response))
}),
)
}
})
}
fn create_tags(&self, input: CreateTagsRequest) -> RusotoFuture<(), CreateTagsError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("POST", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().map(|response| {
let result = ::std::mem::drop(response);
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateTagsError::from_response(response))),
)
}
})
}
fn create_user(
&self,
input: CreateUserRequest,
) -> RusotoFuture<CreateUserResponse, CreateUserError> {
let request_uri = format!(
"/v1/brokers/{broker_id}/users/{username}",
broker_id = input.broker_id,
username = input.username
);
let mut request = SignedRequest::new("POST", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<CreateUserResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateUserError::from_response(response))),
)
}
})
}
fn delete_broker(
&self,
input: DeleteBrokerRequest,
) -> RusotoFuture<DeleteBrokerResponse, DeleteBrokerError> {
let request_uri = format!("/v1/brokers/{broker_id}", broker_id = input.broker_id);
let mut request = SignedRequest::new("DELETE", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<DeleteBrokerResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteBrokerError::from_response(response))),
)
}
})
}
fn delete_tags(&self, input: DeleteTagsRequest) -> RusotoFuture<(), DeleteTagsError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("DELETE", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
for item in input.tag_keys.iter() {
params.put("tagKeys", item);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 204 {
Box::new(response.buffer().from_err().map(|response| {
let result = ::std::mem::drop(response);
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteTagsError::from_response(response))),
)
}
})
}
fn delete_user(
&self,
input: DeleteUserRequest,
) -> RusotoFuture<DeleteUserResponse, DeleteUserError> {
let request_uri = format!(
"/v1/brokers/{broker_id}/users/{username}",
broker_id = input.broker_id,
username = input.username
);
let mut request = SignedRequest::new("DELETE", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<DeleteUserResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteUserError::from_response(response))),
)
}
})
}
fn describe_broker(
&self,
input: DescribeBrokerRequest,
) -> RusotoFuture<DescribeBrokerResponse, DescribeBrokerError> {
let request_uri = format!("/v1/brokers/{broker_id}", broker_id = input.broker_id);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<DescribeBrokerResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeBrokerError::from_response(response))),
)
}
})
}
fn describe_configuration(
&self,
input: DescribeConfigurationRequest,
) -> RusotoFuture<DescribeConfigurationResponse, DescribeConfigurationError> {
let request_uri = format!(
"/v1/configurations/{configuration_id}",
configuration_id = input.configuration_id
);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<DescribeConfigurationResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationError::from_response(response))
}),
)
}
})
}
fn describe_configuration_revision(
&self,
input: DescribeConfigurationRevisionRequest,
) -> RusotoFuture<DescribeConfigurationRevisionResponse, DescribeConfigurationRevisionError>
{
let request_uri = format!(
"/v1/configurations/{configuration_id}/revisions/{configuration_revision}",
configuration_id = input.configuration_id,
configuration_revision = input.configuration_revision
);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<DescribeConfigurationRevisionResponse>(&body)
.unwrap();
result
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeConfigurationRevisionError::from_response(response))
}))
}
})
}
fn describe_user(
&self,
input: DescribeUserRequest,
) -> RusotoFuture<DescribeUserResponse, DescribeUserError> {
let request_uri = format!(
"/v1/brokers/{broker_id}/users/{username}",
broker_id = input.broker_id,
username = input.username
);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<DescribeUserResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeUserError::from_response(response))),
)
}
})
}
fn list_brokers(
&self,
input: ListBrokersRequest,
) -> RusotoFuture<ListBrokersResponse, ListBrokersError> {
let request_uri = "/v1/brokers";
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<ListBrokersResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListBrokersError::from_response(response))),
)
}
})
}
fn list_configuration_revisions(
&self,
input: ListConfigurationRevisionsRequest,
) -> RusotoFuture<ListConfigurationRevisionsResponse, ListConfigurationRevisionsError> {
let request_uri = format!(
"/v1/configurations/{configuration_id}/revisions",
configuration_id = input.configuration_id
);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<ListConfigurationRevisionsResponse>(&body)
.unwrap();
result
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(ListConfigurationRevisionsError::from_response(response))
}))
}
})
}
fn list_configurations(
&self,
input: ListConfigurationsRequest,
) -> RusotoFuture<ListConfigurationsResponse, ListConfigurationsError> {
let request_uri = "/v1/configurations";
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<ListConfigurationsResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListConfigurationsError::from_response(response))),
)
}
})
}
fn list_tags(&self, input: ListTagsRequest) -> RusotoFuture<ListTagsResponse, ListTagsError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<ListTagsResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListTagsError::from_response(response))),
)
}
})
}
fn list_users(
&self,
input: ListUsersRequest,
) -> RusotoFuture<ListUsersResponse, ListUsersError> {
let request_uri = format!("/v1/brokers/{broker_id}/users", broker_id = input.broker_id);
let mut request = SignedRequest::new("GET", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let mut params = Params::new();
if let Some(ref x) = input.max_results {
params.put("maxResults", x);
}
if let Some(ref x) = input.next_token {
params.put("nextToken", x);
}
request.set_params(params);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<ListUsersResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListUsersError::from_response(response))),
)
}
})
}
fn reboot_broker(
&self,
input: RebootBrokerRequest,
) -> RusotoFuture<RebootBrokerResponse, RebootBrokerError> {
let request_uri = format!(
"/v1/brokers/{broker_id}/reboot",
broker_id = input.broker_id
);
let mut request = SignedRequest::new("POST", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<RebootBrokerResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(RebootBrokerError::from_response(response))),
)
}
})
}
fn update_broker(
&self,
input: UpdateBrokerRequest,
) -> RusotoFuture<UpdateBrokerResponse, UpdateBrokerError> {
let request_uri = format!("/v1/brokers/{broker_id}", broker_id = input.broker_id);
let mut request = SignedRequest::new("PUT", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<UpdateBrokerResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateBrokerError::from_response(response))),
)
}
})
}
fn update_configuration(
&self,
input: UpdateConfigurationRequest,
) -> RusotoFuture<UpdateConfigurationResponse, UpdateConfigurationError> {
let request_uri = format!(
"/v1/configurations/{configuration_id}",
configuration_id = input.configuration_id
);
let mut request = SignedRequest::new("PUT", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result =
serde_json::from_slice::<UpdateConfigurationResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateConfigurationError::from_response(response))
}),
)
}
})
}
fn update_user(
&self,
input: UpdateUserRequest,
) -> RusotoFuture<UpdateUserResponse, UpdateUserError> {
let request_uri = format!(
"/v1/brokers/{broker_id}/users/{username}",
broker_id = input.broker_id,
username = input.username
);
let mut request = SignedRequest::new("PUT", "mq", &self.region, &request_uri);
request.set_content_type("application/x-amz-json-1.1".to_owned());
let encoded = Some(serde_json::to_vec(&input).unwrap());
request.set_payload(encoded);
self.client.sign_and_dispatch(request, |response| {
if response.status.as_u16() == 200 {
Box::new(response.buffer().from_err().map(|response| {
let mut body = response.body;
if body == b"null" || body.is_empty() {
body = b"{}".to_vec();
}
debug!("Response body: {:?}", body);
debug!("Response status: {}", response.status);
let result = serde_json::from_slice::<UpdateUserResponse>(&body).unwrap();
result
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateUserError::from_response(response))),
)
}
})
}
}
#[cfg(test)]
mod protocol_tests {}