use std::error::Error;
use std::fmt;
#[allow(warnings)]
use futures::future;
use futures::Future;
use rusoto_core::credential::ProvideAwsCredentials;
use rusoto_core::region;
use rusoto_core::request::{BufferedHttpResponse, DispatchSignedRequest};
use rusoto_core::{Client, RusotoError, RusotoFuture};
use rusoto_core::param::{Params, ServiceParams};
use rusoto_core::proto;
use rusoto_core::signature::SignedRequest;
use serde_json;
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct AvailabilityZone {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BrokerEngineType {
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "EngineVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_versions: Option<Vec<EngineVersion>>,
}
#[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 BrokerInstanceOption {
#[serde(rename = "AvailabilityZones")]
#[serde(skip_serializing_if = "Option::is_none")]
pub availability_zones: Option<Vec<AvailabilityZone>>,
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "HostInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_instance_type: Option<String>,
#[serde(rename = "SupportedEngineVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub supported_engine_versions: Option<Vec<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, 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, 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, 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, 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, Serialize)]
pub struct DescribeBrokerEngineTypesRequest {
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: 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>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeBrokerEngineTypesResponse {
#[serde(rename = "BrokerEngineTypes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_engine_types: Option<Vec<BrokerEngineType>>,
#[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 DescribeBrokerInstanceOptionsRequest {
#[serde(rename = "EngineType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub engine_type: Option<String>,
#[serde(rename = "HostInstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub host_instance_type: 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>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeBrokerInstanceOptionsResponse {
#[serde(rename = "BrokerInstanceOptions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_instance_options: Option<Vec<BrokerInstanceOption>>,
#[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 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, 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, 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, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct EngineVersion {
#[serde(rename = "Name")]
#[serde(skip_serializing_if = "Option::is_none")]
pub name: 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, 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, 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, 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, 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, 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, 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),
}
impl CreateBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateBrokerError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateBrokerError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateBrokerError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateBrokerError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateBrokerError::InternalServerError(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateBrokerError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateConfigurationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
}
impl CreateConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateConfigurationError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateConfigurationError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateConfigurationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateConfigurationError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl CreateTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateTagsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateTagsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateTagsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateTagsError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateTagsError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateUserError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl CreateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateUserError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateUserError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateUserError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateUserError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(CreateUserError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DeleteBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteBrokerError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteBrokerError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DeleteBrokerError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteBrokerError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteBrokerError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DeleteTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteTagsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteTagsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DeleteTagsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteTagsError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteTagsError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteUserError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DeleteUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteUserError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DeleteUserError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteUserError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteUserError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DescribeBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeBrokerError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeBrokerError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeBrokerError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeBrokerError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DescribeBrokerError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeBrokerEngineTypesError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
}
impl DescribeBrokerEngineTypesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeBrokerEngineTypesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeBrokerEngineTypesError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeBrokerEngineTypesError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(
DescribeBrokerEngineTypesError::InternalServerError(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeBrokerEngineTypesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeBrokerEngineTypesError {
fn description(&self) -> &str {
match *self {
DescribeBrokerEngineTypesError::BadRequest(ref cause) => cause,
DescribeBrokerEngineTypesError::Forbidden(ref cause) => cause,
DescribeBrokerEngineTypesError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeBrokerInstanceOptionsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
}
impl DescribeBrokerInstanceOptionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeBrokerInstanceOptionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeBrokerInstanceOptionsError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeBrokerInstanceOptionsError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
DescribeBrokerInstanceOptionsError::InternalServerError(err.msg),
)
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeBrokerInstanceOptionsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeBrokerInstanceOptionsError {
fn description(&self) -> &str {
match *self {
DescribeBrokerInstanceOptionsError::BadRequest(ref cause) => cause,
DescribeBrokerInstanceOptionsError::Forbidden(ref cause) => cause,
DescribeBrokerInstanceOptionsError::InternalServerError(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DescribeConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeConfigurationError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeConfigurationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeConfigurationError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(DescribeConfigurationError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationRevisionError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DescribeConfigurationRevisionError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<DescribeConfigurationRevisionError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeConfigurationRevisionError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeConfigurationRevisionError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
DescribeConfigurationRevisionError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(DescribeConfigurationRevisionError::NotFound(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeUserError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DescribeUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeUserError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeUserError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeUserError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DescribeUserError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListBrokersError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
}
impl ListBrokersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListBrokersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListBrokersError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListBrokersError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListBrokersError::InternalServerError(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationRevisionsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl ListConfigurationRevisionsError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<ListConfigurationRevisionsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListConfigurationRevisionsError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(ListConfigurationRevisionsError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
ListConfigurationRevisionsError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(ListConfigurationRevisionsError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
}
impl ListConfigurationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListConfigurationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListConfigurationsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListConfigurationsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListConfigurationsError::InternalServerError(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl ListTagsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListTagsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListTagsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListTagsError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListTagsError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsError {
fn description(&self) -> &str {
match *self {
ListTagsError::BadRequest(ref cause) => cause,
ListTagsError::Forbidden(ref cause) => cause,
ListTagsError::InternalServerError(ref cause) => cause,
ListTagsError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListUsersError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl ListUsersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListUsersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListUsersError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListUsersError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListUsersError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListUsersError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum RebootBrokerError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl RebootBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<RebootBrokerError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(RebootBrokerError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(RebootBrokerError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(RebootBrokerError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(RebootBrokerError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateBrokerError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl UpdateBrokerError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateBrokerError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateBrokerError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateBrokerError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateBrokerError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateBrokerError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateBrokerError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateConfigurationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl UpdateConfigurationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateConfigurationError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateConfigurationError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateConfigurationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateConfigurationError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(UpdateConfigurationError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateUserError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl UpdateUserError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateUserError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateUserError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(UpdateUserError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateUserError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateUserError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UpdateUserError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
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,
}
}
}
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_broker_engine_types(
&self,
input: DescribeBrokerEngineTypesRequest,
) -> RusotoFuture<DescribeBrokerEngineTypesResponse, DescribeBrokerEngineTypesError>;
fn describe_broker_instance_options(
&self,
input: DescribeBrokerInstanceOptionsRequest,
) -> RusotoFuture<DescribeBrokerInstanceOptionsResponse, DescribeBrokerInstanceOptionsError>;
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,
}
}
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,
}
}
}
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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateBrokerResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateConfigurationResponse, _>()?;
Ok(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().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<CreateUserResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteBrokerResponse, _>()?;
Ok(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().and_then(|response| {
let result = ::std::mem::drop(response);
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DeleteUserResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeBrokerResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeBrokerError::from_response(response))),
)
}
})
}
fn describe_broker_engine_types(
&self,
input: DescribeBrokerEngineTypesRequest,
) -> RusotoFuture<DescribeBrokerEngineTypesResponse, DescribeBrokerEngineTypesError> {
let request_uri = "/v1/broker-engine-types";
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.engine_type {
params.put("engineType", x);
}
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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeBrokerEngineTypesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeBrokerEngineTypesError::from_response(response))
}))
}
})
}
fn describe_broker_instance_options(
&self,
input: DescribeBrokerInstanceOptionsRequest,
) -> RusotoFuture<DescribeBrokerInstanceOptionsResponse, DescribeBrokerInstanceOptionsError>
{
let request_uri = "/v1/broker-instance-options";
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.engine_type {
params.put("engineType", x);
}
if let Some(ref x) = input.host_instance_type {
params.put("hostInstanceType", x);
}
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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeBrokerInstanceOptionsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeBrokerInstanceOptionsError::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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeConfigurationResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeConfigurationRevisionResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<DescribeUserResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListBrokersResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListConfigurationRevisionsResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListConfigurationsResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListTagsResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<ListUsersResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<RebootBrokerResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateBrokerResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateConfigurationResponse, _>()?;
Ok(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().and_then(|response| {
let result = proto::json::ResponsePayload::new(&response)
.deserialize::<UpdateUserResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(UpdateUserError::from_response(response))),
)
}
})
}
}