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, Serialize, Deserialize)]
pub struct BrokerEBSVolumeInfo {
#[serde(rename = "KafkaBrokerNodeId")]
pub kafka_broker_node_id: String,
#[serde(rename = "VolumeSizeGB")]
pub volume_size_gb: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BrokerNodeGroupInfo {
#[serde(rename = "BrokerAZDistribution")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_az_distribution: Option<String>,
#[serde(rename = "ClientSubnets")]
pub client_subnets: Vec<String>,
#[serde(rename = "InstanceType")]
pub instance_type: String,
#[serde(rename = "SecurityGroups")]
#[serde(skip_serializing_if = "Option::is_none")]
pub security_groups: Option<Vec<String>>,
#[serde(rename = "StorageInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub storage_info: Option<StorageInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BrokerNodeInfo {
#[serde(rename = "AttachedENIId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attached_eni_id: Option<String>,
#[serde(rename = "BrokerId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_id: Option<f64>,
#[serde(rename = "ClientSubnet")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_subnet: Option<String>,
#[serde(rename = "ClientVpcIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_vpc_ip_address: Option<String>,
#[serde(rename = "CurrentBrokerSoftwareInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_broker_software_info: Option<BrokerSoftwareInfo>,
#[serde(rename = "Endpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoints: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct BrokerSoftwareInfo {
#[serde(rename = "ConfigurationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_arn: Option<String>,
#[serde(rename = "ConfigurationRevision")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_revision: Option<i64>,
#[serde(rename = "KafkaVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kafka_version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ClientAuthentication {
#[serde(rename = "Tls")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tls: Option<Tls>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterInfo {
#[serde(rename = "ActiveOperationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub active_operation_arn: Option<String>,
#[serde(rename = "BrokerNodeGroupInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_node_group_info: Option<BrokerNodeGroupInfo>,
#[serde(rename = "ClientAuthentication")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_authentication: Option<ClientAuthentication>,
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "ClusterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_name: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "CurrentBrokerSoftwareInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_broker_software_info: Option<BrokerSoftwareInfo>,
#[serde(rename = "CurrentVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_version: Option<String>,
#[serde(rename = "EncryptionInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_info: Option<EncryptionInfo>,
#[serde(rename = "EnhancedMonitoring")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enhanced_monitoring: Option<String>,
#[serde(rename = "NumberOfBrokerNodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_broker_nodes: Option<i64>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
#[serde(rename = "Tags")]
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<::std::collections::HashMap<String, String>>,
#[serde(rename = "ZookeeperConnectString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub zookeeper_connect_string: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ClusterOperationInfo {
#[serde(rename = "ClientRequestId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_request_id: Option<String>,
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "EndTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub end_time: Option<f64>,
#[serde(rename = "ErrorInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_info: Option<ErrorInfo>,
#[serde(rename = "OperationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation_arn: Option<String>,
#[serde(rename = "OperationState")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation_state: Option<String>,
#[serde(rename = "OperationType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub operation_type: Option<String>,
#[serde(rename = "SourceClusterInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub source_cluster_info: Option<MutableClusterInfo>,
#[serde(rename = "TargetClusterInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub target_cluster_info: Option<MutableClusterInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct Configuration {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "Description")]
pub description: String,
#[serde(rename = "KafkaVersions")]
pub kafka_versions: Vec<String>,
#[serde(rename = "LatestRevision")]
pub latest_revision: ConfigurationRevision,
#[serde(rename = "Name")]
pub name: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct ConfigurationInfo {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "Revision")]
pub revision: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ConfigurationRevision {
#[serde(rename = "CreationTime")]
pub creation_time: f64,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "Revision")]
pub revision: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateClusterRequest {
#[serde(rename = "BrokerNodeGroupInfo")]
pub broker_node_group_info: BrokerNodeGroupInfo,
#[serde(rename = "ClientAuthentication")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_authentication: Option<ClientAuthentication>,
#[serde(rename = "ClusterName")]
pub cluster_name: String,
#[serde(rename = "ConfigurationInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_info: Option<ConfigurationInfo>,
#[serde(rename = "EncryptionInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_info: Option<EncryptionInfo>,
#[serde(rename = "EnhancedMonitoring")]
#[serde(skip_serializing_if = "Option::is_none")]
pub enhanced_monitoring: Option<String>,
#[serde(rename = "KafkaVersion")]
pub kafka_version: String,
#[serde(rename = "NumberOfBrokerNodes")]
pub number_of_broker_nodes: i64,
#[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 CreateClusterResponse {
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "ClusterName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_name: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct CreateConfigurationRequest {
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "KafkaVersions")]
pub kafka_versions: Vec<String>,
#[serde(rename = "Name")]
pub name: String,
#[serde(rename = "ServerProperties")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
pub server_properties: bytes::Bytes,
}
#[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 = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[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 DeleteClusterRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
#[serde(rename = "CurrentVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub current_version: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DeleteClusterResponse {
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "State")]
#[serde(skip_serializing_if = "Option::is_none")]
pub state: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeClusterOperationRequest {
#[serde(rename = "ClusterOperationArn")]
pub cluster_operation_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeClusterOperationResponse {
#[serde(rename = "ClusterOperationInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_operation_info: Option<ClusterOperationInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeClusterRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeClusterResponse {
#[serde(rename = "ClusterInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_info: Option<ClusterInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct DescribeConfigurationRequest {
#[serde(rename = "Arn")]
pub arn: 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 = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: Option<f64>,
#[serde(rename = "Description")]
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(rename = "KafkaVersions")]
#[serde(skip_serializing_if = "Option::is_none")]
pub kafka_versions: Option<Vec<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 DescribeConfigurationRevisionRequest {
#[serde(rename = "Arn")]
pub arn: String,
#[serde(rename = "Revision")]
pub revision: i64,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct DescribeConfigurationRevisionResponse {
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
#[serde(rename = "CreationTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub creation_time: 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>,
#[serde(rename = "ServerProperties")]
#[serde(
deserialize_with = "::rusoto_core::serialization::SerdeBlob::deserialize_blob",
serialize_with = "::rusoto_core::serialization::SerdeBlob::serialize_blob",
default
)]
#[serde(skip_serializing_if = "Option::is_none")]
pub server_properties: Option<bytes::Bytes>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EBSStorageInfo {
#[serde(rename = "VolumeSize")]
#[serde(skip_serializing_if = "Option::is_none")]
pub volume_size: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EncryptionAtRest {
#[serde(rename = "DataVolumeKMSKeyId")]
pub data_volume_kms_key_id: String,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EncryptionInTransit {
#[serde(rename = "ClientBroker")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_broker: Option<String>,
#[serde(rename = "InCluster")]
#[serde(skip_serializing_if = "Option::is_none")]
pub in_cluster: Option<bool>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct EncryptionInfo {
#[serde(rename = "EncryptionAtRest")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_at_rest: Option<EncryptionAtRest>,
#[serde(rename = "EncryptionInTransit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub encryption_in_transit: Option<EncryptionInTransit>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ErrorInfo {
#[serde(rename = "ErrorCode")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_code: Option<String>,
#[serde(rename = "ErrorString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub error_string: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct GetBootstrapBrokersRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct GetBootstrapBrokersResponse {
#[serde(rename = "BootstrapBrokerString")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_broker_string: Option<String>,
#[serde(rename = "BootstrapBrokerStringTls")]
#[serde(skip_serializing_if = "Option::is_none")]
pub bootstrap_broker_string_tls: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListClusterOperationsRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListClusterOperationsResponse {
#[serde(rename = "ClusterOperationInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_operation_info_list: Option<Vec<ClusterOperationInfo>>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListClustersRequest {
#[serde(rename = "ClusterNameFilter")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_name_filter: 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 ListClustersResponse {
#[serde(rename = "ClusterInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_info_list: Option<Vec<ClusterInfo>>,
#[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 = "Arn")]
pub arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListConfigurationRevisionsResponse {
#[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 = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListNodesRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
#[serde(rename = "MaxResults")]
#[serde(skip_serializing_if = "Option::is_none")]
pub max_results: Option<i64>,
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListNodesResponse {
#[serde(rename = "NextToken")]
#[serde(skip_serializing_if = "Option::is_none")]
pub next_token: Option<String>,
#[serde(rename = "NodeInfoList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_info_list: Option<Vec<NodeInfo>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct ListTagsForResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ListTagsForResourceResponse {
#[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 MutableClusterInfo {
#[serde(rename = "BrokerEBSVolumeInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_ebs_volume_info: Option<Vec<BrokerEBSVolumeInfo>>,
#[serde(rename = "ConfigurationInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub configuration_info: Option<ConfigurationInfo>,
#[serde(rename = "NumberOfBrokerNodes")]
#[serde(skip_serializing_if = "Option::is_none")]
pub number_of_broker_nodes: Option<i64>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct NodeInfo {
#[serde(rename = "AddedToClusterTime")]
#[serde(skip_serializing_if = "Option::is_none")]
pub added_to_cluster_time: Option<String>,
#[serde(rename = "BrokerNodeInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub broker_node_info: Option<BrokerNodeInfo>,
#[serde(rename = "InstanceType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub instance_type: Option<String>,
#[serde(rename = "NodeARN")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_arn: Option<String>,
#[serde(rename = "NodeType")]
#[serde(skip_serializing_if = "Option::is_none")]
pub node_type: Option<String>,
#[serde(rename = "ZookeeperNodeInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub zookeeper_node_info: Option<ZookeeperNodeInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct StorageInfo {
#[serde(rename = "EbsStorageInfo")]
#[serde(skip_serializing_if = "Option::is_none")]
pub ebs_storage_info: Option<EBSStorageInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct TagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "Tags")]
pub tags: ::std::collections::HashMap<String, String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Tls {
#[serde(rename = "CertificateAuthorityArnList")]
#[serde(skip_serializing_if = "Option::is_none")]
pub certificate_authority_arn_list: Option<Vec<String>>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UntagResourceRequest {
#[serde(rename = "ResourceArn")]
pub resource_arn: String,
#[serde(rename = "TagKeys")]
pub tag_keys: Vec<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateBrokerStorageRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
#[serde(rename = "CurrentVersion")]
pub current_version: String,
#[serde(rename = "TargetBrokerEBSVolumeInfo")]
pub target_broker_ebs_volume_info: Vec<BrokerEBSVolumeInfo>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateBrokerStorageResponse {
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "ClusterOperationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_operation_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Serialize)]
pub struct UpdateClusterConfigurationRequest {
#[serde(rename = "ClusterArn")]
pub cluster_arn: String,
#[serde(rename = "ConfigurationInfo")]
pub configuration_info: ConfigurationInfo,
#[serde(rename = "CurrentVersion")]
pub current_version: String,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct UpdateClusterConfigurationResponse {
#[serde(rename = "ClusterArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_arn: Option<String>,
#[serde(rename = "ClusterOperationArn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub cluster_operation_arn: Option<String>,
}
#[derive(Default, Debug, Clone, PartialEq, Deserialize)]
#[cfg_attr(test, derive(Serialize))]
pub struct ZookeeperNodeInfo {
#[serde(rename = "AttachedENIId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attached_eni_id: Option<String>,
#[serde(rename = "ClientVpcIpAddress")]
#[serde(skip_serializing_if = "Option::is_none")]
pub client_vpc_ip_address: Option<String>,
#[serde(rename = "Endpoints")]
#[serde(skip_serializing_if = "Option::is_none")]
pub endpoints: Option<Vec<String>>,
#[serde(rename = "ZookeeperId")]
#[serde(skip_serializing_if = "Option::is_none")]
pub zookeeper_id: Option<f64>,
#[serde(rename = "ZookeeperVersion")]
#[serde(skip_serializing_if = "Option::is_none")]
pub zookeeper_version: Option<String>,
}
#[derive(Debug, PartialEq)]
pub enum CreateClusterError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
ServiceUnavailable(String),
TooManyRequests(String),
Unauthorized(String),
}
impl CreateClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<CreateClusterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(CreateClusterError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(CreateClusterError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(CreateClusterError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(CreateClusterError::InternalServerError(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateClusterError::ServiceUnavailable(err.msg))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateClusterError::TooManyRequests(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateClusterError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for CreateClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for CreateClusterError {
fn description(&self) -> &str {
match *self {
CreateClusterError::BadRequest(ref cause) => cause,
CreateClusterError::Conflict(ref cause) => cause,
CreateClusterError::Forbidden(ref cause) => cause,
CreateClusterError::InternalServerError(ref cause) => cause,
CreateClusterError::ServiceUnavailable(ref cause) => cause,
CreateClusterError::TooManyRequests(ref cause) => cause,
CreateClusterError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum CreateConfigurationError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
ServiceUnavailable(String),
TooManyRequests(String),
Unauthorized(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,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(CreateConfigurationError::ServiceUnavailable(
err.msg,
))
}
"TooManyRequestsException" => {
return RusotoError::Service(CreateConfigurationError::TooManyRequests(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(CreateConfigurationError::Unauthorized(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,
CreateConfigurationError::ServiceUnavailable(ref cause) => cause,
CreateConfigurationError::TooManyRequests(ref cause) => cause,
CreateConfigurationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DeleteClusterError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl DeleteClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DeleteClusterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DeleteClusterError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DeleteClusterError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DeleteClusterError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DeleteClusterError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DeleteClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DeleteClusterError {
fn description(&self) -> &str {
match *self {
DeleteClusterError::BadRequest(ref cause) => cause,
DeleteClusterError::Forbidden(ref cause) => cause,
DeleteClusterError::InternalServerError(ref cause) => cause,
DeleteClusterError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeClusterError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
Unauthorized(String),
}
impl DescribeClusterError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeClusterError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeClusterError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeClusterError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(DescribeClusterError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(DescribeClusterError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DescribeClusterError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeClusterError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeClusterError {
fn description(&self) -> &str {
match *self {
DescribeClusterError::BadRequest(ref cause) => cause,
DescribeClusterError::Forbidden(ref cause) => cause,
DescribeClusterError::InternalServerError(ref cause) => cause,
DescribeClusterError::NotFound(ref cause) => cause,
DescribeClusterError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeClusterOperationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
Unauthorized(String),
}
impl DescribeClusterOperationError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<DescribeClusterOperationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(DescribeClusterOperationError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(DescribeClusterOperationError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(
DescribeClusterOperationError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(DescribeClusterOperationError::NotFound(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(DescribeClusterOperationError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for DescribeClusterOperationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for DescribeClusterOperationError {
fn description(&self) -> &str {
match *self {
DescribeClusterOperationError::BadRequest(ref cause) => cause,
DescribeClusterOperationError::Forbidden(ref cause) => cause,
DescribeClusterOperationError::InternalServerError(ref cause) => cause,
DescribeClusterOperationError::NotFound(ref cause) => cause,
DescribeClusterOperationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
Unauthorized(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))
}
"ServiceUnavailableException" => {
return RusotoError::Service(DescribeConfigurationError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(DescribeConfigurationError::Unauthorized(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,
DescribeConfigurationError::ServiceUnavailable(ref cause) => cause,
DescribeConfigurationError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum DescribeConfigurationRevisionError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
Unauthorized(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,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
DescribeConfigurationRevisionError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedException" => {
return RusotoError::Service(DescribeConfigurationRevisionError::Unauthorized(
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,
DescribeConfigurationRevisionError::ServiceUnavailable(ref cause) => cause,
DescribeConfigurationRevisionError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum GetBootstrapBrokersError {
BadRequest(String),
Conflict(String),
Forbidden(String),
InternalServerError(String),
Unauthorized(String),
}
impl GetBootstrapBrokersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<GetBootstrapBrokersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(GetBootstrapBrokersError::BadRequest(err.msg))
}
"ConflictException" => {
return RusotoError::Service(GetBootstrapBrokersError::Conflict(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(GetBootstrapBrokersError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(GetBootstrapBrokersError::InternalServerError(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(GetBootstrapBrokersError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for GetBootstrapBrokersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for GetBootstrapBrokersError {
fn description(&self) -> &str {
match *self {
GetBootstrapBrokersError::BadRequest(ref cause) => cause,
GetBootstrapBrokersError::Conflict(ref cause) => cause,
GetBootstrapBrokersError::Forbidden(ref cause) => cause,
GetBootstrapBrokersError::InternalServerError(ref cause) => cause,
GetBootstrapBrokersError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListClusterOperationsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
Unauthorized(String),
}
impl ListClusterOperationsError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListClusterOperationsError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListClusterOperationsError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListClusterOperationsError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListClusterOperationsError::InternalServerError(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(ListClusterOperationsError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListClusterOperationsError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListClusterOperationsError {
fn description(&self) -> &str {
match *self {
ListClusterOperationsError::BadRequest(ref cause) => cause,
ListClusterOperationsError::Forbidden(ref cause) => cause,
ListClusterOperationsError::InternalServerError(ref cause) => cause,
ListClusterOperationsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListClustersError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
Unauthorized(String),
}
impl ListClustersError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListClustersError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListClustersError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListClustersError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListClustersError::InternalServerError(err.msg))
}
"UnauthorizedException" => {
return RusotoError::Service(ListClustersError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListClustersError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListClustersError {
fn description(&self) -> &str {
match *self {
ListClustersError::BadRequest(ref cause) => cause,
ListClustersError::Forbidden(ref cause) => cause,
ListClustersError::InternalServerError(ref cause) => cause,
ListClustersError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationRevisionsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
Unauthorized(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))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
ListConfigurationRevisionsError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedException" => {
return RusotoError::Service(ListConfigurationRevisionsError::Unauthorized(
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,
ListConfigurationRevisionsError::ServiceUnavailable(ref cause) => cause,
ListConfigurationRevisionsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListConfigurationsError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
ServiceUnavailable(String),
Unauthorized(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,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(ListConfigurationsError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(ListConfigurationsError::Unauthorized(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,
ListConfigurationsError::ServiceUnavailable(ref cause) => cause,
ListConfigurationsError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListNodesError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
}
impl ListNodesError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListNodesError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListNodesError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(ListNodesError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListNodesError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(ListNodesError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListNodesError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListNodesError {
fn description(&self) -> &str {
match *self {
ListNodesError::BadRequest(ref cause) => cause,
ListNodesError::Forbidden(ref cause) => cause,
ListNodesError::InternalServerError(ref cause) => cause,
ListNodesError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum ListTagsForResourceError {
BadRequest(String),
InternalServerError(String),
NotFound(String),
}
impl ListTagsForResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<ListTagsForResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(ListTagsForResourceError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(ListTagsForResourceError::InternalServerError(
err.msg,
))
}
"NotFoundException" => {
return RusotoError::Service(ListTagsForResourceError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for ListTagsForResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for ListTagsForResourceError {
fn description(&self) -> &str {
match *self {
ListTagsForResourceError::BadRequest(ref cause) => cause,
ListTagsForResourceError::InternalServerError(ref cause) => cause,
ListTagsForResourceError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum TagResourceError {
BadRequest(String),
InternalServerError(String),
NotFound(String),
}
impl TagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<TagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(TagResourceError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(TagResourceError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(TagResourceError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for TagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for TagResourceError {
fn description(&self) -> &str {
match *self {
TagResourceError::BadRequest(ref cause) => cause,
TagResourceError::InternalServerError(ref cause) => cause,
TagResourceError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UntagResourceError {
BadRequest(String),
InternalServerError(String),
NotFound(String),
}
impl UntagResourceError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UntagResourceError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UntagResourceError::BadRequest(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UntagResourceError::InternalServerError(err.msg))
}
"NotFoundException" => {
return RusotoError::Service(UntagResourceError::NotFound(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UntagResourceError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UntagResourceError {
fn description(&self) -> &str {
match *self {
UntagResourceError::BadRequest(ref cause) => cause,
UntagResourceError::InternalServerError(ref cause) => cause,
UntagResourceError::NotFound(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateBrokerStorageError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
ServiceUnavailable(String),
Unauthorized(String),
}
impl UpdateBrokerStorageError {
pub fn from_response(res: BufferedHttpResponse) -> RusotoError<UpdateBrokerStorageError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateBrokerStorageError::BadRequest(err.msg))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateBrokerStorageError::Forbidden(err.msg))
}
"InternalServerErrorException" => {
return RusotoError::Service(UpdateBrokerStorageError::InternalServerError(
err.msg,
))
}
"ServiceUnavailableException" => {
return RusotoError::Service(UpdateBrokerStorageError::ServiceUnavailable(
err.msg,
))
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateBrokerStorageError::Unauthorized(err.msg))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateBrokerStorageError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateBrokerStorageError {
fn description(&self) -> &str {
match *self {
UpdateBrokerStorageError::BadRequest(ref cause) => cause,
UpdateBrokerStorageError::Forbidden(ref cause) => cause,
UpdateBrokerStorageError::InternalServerError(ref cause) => cause,
UpdateBrokerStorageError::ServiceUnavailable(ref cause) => cause,
UpdateBrokerStorageError::Unauthorized(ref cause) => cause,
}
}
}
#[derive(Debug, PartialEq)]
pub enum UpdateClusterConfigurationError {
BadRequest(String),
Forbidden(String),
InternalServerError(String),
NotFound(String),
ServiceUnavailable(String),
Unauthorized(String),
}
impl UpdateClusterConfigurationError {
pub fn from_response(
res: BufferedHttpResponse,
) -> RusotoError<UpdateClusterConfigurationError> {
if let Some(err) = proto::json::Error::parse_rest(&res) {
match err.typ.as_str() {
"BadRequestException" => {
return RusotoError::Service(UpdateClusterConfigurationError::BadRequest(
err.msg,
))
}
"ForbiddenException" => {
return RusotoError::Service(UpdateClusterConfigurationError::Forbidden(
err.msg,
))
}
"InternalServerErrorException" => {
return RusotoError::Service(
UpdateClusterConfigurationError::InternalServerError(err.msg),
)
}
"NotFoundException" => {
return RusotoError::Service(UpdateClusterConfigurationError::NotFound(err.msg))
}
"ServiceUnavailableException" => {
return RusotoError::Service(
UpdateClusterConfigurationError::ServiceUnavailable(err.msg),
)
}
"UnauthorizedException" => {
return RusotoError::Service(UpdateClusterConfigurationError::Unauthorized(
err.msg,
))
}
"ValidationException" => return RusotoError::Validation(err.msg),
_ => {}
}
}
return RusotoError::Unknown(res);
}
}
impl fmt::Display for UpdateClusterConfigurationError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "{}", self.description())
}
}
impl Error for UpdateClusterConfigurationError {
fn description(&self) -> &str {
match *self {
UpdateClusterConfigurationError::BadRequest(ref cause) => cause,
UpdateClusterConfigurationError::Forbidden(ref cause) => cause,
UpdateClusterConfigurationError::InternalServerError(ref cause) => cause,
UpdateClusterConfigurationError::NotFound(ref cause) => cause,
UpdateClusterConfigurationError::ServiceUnavailable(ref cause) => cause,
UpdateClusterConfigurationError::Unauthorized(ref cause) => cause,
}
}
}
pub trait Kafka {
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResponse, CreateClusterError>;
fn create_configuration(
&self,
input: CreateConfigurationRequest,
) -> RusotoFuture<CreateConfigurationResponse, CreateConfigurationError>;
fn delete_cluster(
&self,
input: DeleteClusterRequest,
) -> RusotoFuture<DeleteClusterResponse, DeleteClusterError>;
fn describe_cluster(
&self,
input: DescribeClusterRequest,
) -> RusotoFuture<DescribeClusterResponse, DescribeClusterError>;
fn describe_cluster_operation(
&self,
input: DescribeClusterOperationRequest,
) -> RusotoFuture<DescribeClusterOperationResponse, DescribeClusterOperationError>;
fn describe_configuration(
&self,
input: DescribeConfigurationRequest,
) -> RusotoFuture<DescribeConfigurationResponse, DescribeConfigurationError>;
fn describe_configuration_revision(
&self,
input: DescribeConfigurationRevisionRequest,
) -> RusotoFuture<DescribeConfigurationRevisionResponse, DescribeConfigurationRevisionError>;
fn get_bootstrap_brokers(
&self,
input: GetBootstrapBrokersRequest,
) -> RusotoFuture<GetBootstrapBrokersResponse, GetBootstrapBrokersError>;
fn list_cluster_operations(
&self,
input: ListClusterOperationsRequest,
) -> RusotoFuture<ListClusterOperationsResponse, ListClusterOperationsError>;
fn list_clusters(
&self,
input: ListClustersRequest,
) -> RusotoFuture<ListClustersResponse, ListClustersError>;
fn list_configuration_revisions(
&self,
input: ListConfigurationRevisionsRequest,
) -> RusotoFuture<ListConfigurationRevisionsResponse, ListConfigurationRevisionsError>;
fn list_configurations(
&self,
input: ListConfigurationsRequest,
) -> RusotoFuture<ListConfigurationsResponse, ListConfigurationsError>;
fn list_nodes(
&self,
input: ListNodesRequest,
) -> RusotoFuture<ListNodesResponse, ListNodesError>;
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError>;
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError>;
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError>;
fn update_broker_storage(
&self,
input: UpdateBrokerStorageRequest,
) -> RusotoFuture<UpdateBrokerStorageResponse, UpdateBrokerStorageError>;
fn update_cluster_configuration(
&self,
input: UpdateClusterConfigurationRequest,
) -> RusotoFuture<UpdateClusterConfigurationResponse, UpdateClusterConfigurationError>;
}
#[derive(Clone)]
pub struct KafkaClient {
client: Client,
region: region::Region,
}
impl KafkaClient {
pub fn new(region: region::Region) -> KafkaClient {
KafkaClient {
client: Client::shared(),
region,
}
}
pub fn new_with<P, D>(
request_dispatcher: D,
credentials_provider: P,
region: region::Region,
) -> KafkaClient
where
P: ProvideAwsCredentials + Send + Sync + 'static,
P::Future: Send,
D: DispatchSignedRequest + Send + Sync + 'static,
D::Future: Send,
{
KafkaClient {
client: Client::new_with(credentials_provider, request_dispatcher),
region,
}
}
}
impl Kafka for KafkaClient {
fn create_cluster(
&self,
input: CreateClusterRequest,
) -> RusotoFuture<CreateClusterResponse, CreateClusterError> {
let request_uri = "/v1/clusters";
let mut request = SignedRequest::new("POST", "kafka", &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::<CreateClusterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(CreateClusterError::from_response(response))),
)
}
})
}
fn create_configuration(
&self,
input: CreateConfigurationRequest,
) -> RusotoFuture<CreateConfigurationResponse, CreateConfigurationError> {
let request_uri = "/v1/configurations";
let mut request = SignedRequest::new("POST", "kafka", &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 delete_cluster(
&self,
input: DeleteClusterRequest,
) -> RusotoFuture<DeleteClusterResponse, DeleteClusterError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("DELETE", "kafka", &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.current_version {
params.put("currentVersion", 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::<DeleteClusterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DeleteClusterError::from_response(response))),
)
}
})
}
fn describe_cluster(
&self,
input: DescribeClusterRequest,
) -> RusotoFuture<DescribeClusterResponse, DescribeClusterError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("GET", "kafka", &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::<DescribeClusterResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(DescribeClusterError::from_response(response))),
)
}
})
}
fn describe_cluster_operation(
&self,
input: DescribeClusterOperationRequest,
) -> RusotoFuture<DescribeClusterOperationResponse, DescribeClusterOperationError> {
let request_uri = format!(
"/v1/operations/{cluster_operation_arn}",
cluster_operation_arn = input.cluster_operation_arn
);
let mut request = SignedRequest::new("GET", "kafka", &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::<DescribeClusterOperationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(DescribeClusterOperationError::from_response(response))
}))
}
})
}
fn describe_configuration(
&self,
input: DescribeConfigurationRequest,
) -> RusotoFuture<DescribeConfigurationResponse, DescribeConfigurationError> {
let request_uri = format!("/v1/configurations/{arn}", arn = input.arn);
let mut request = SignedRequest::new("GET", "kafka", &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/{arn}/revisions/{revision}",
arn = input.arn,
revision = input.revision
);
let mut request = SignedRequest::new("GET", "kafka", &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 get_bootstrap_brokers(
&self,
input: GetBootstrapBrokersRequest,
) -> RusotoFuture<GetBootstrapBrokersResponse, GetBootstrapBrokersError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}/bootstrap-brokers",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("GET", "kafka", &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::<GetBootstrapBrokersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(GetBootstrapBrokersError::from_response(response))
}),
)
}
})
}
fn list_cluster_operations(
&self,
input: ListClusterOperationsRequest,
) -> RusotoFuture<ListClusterOperationsResponse, ListClusterOperationsError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}/operations",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("GET", "kafka", &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::<ListClusterOperationsResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListClusterOperationsError::from_response(response))
}),
)
}
})
}
fn list_clusters(
&self,
input: ListClustersRequest,
) -> RusotoFuture<ListClustersResponse, ListClustersError> {
let request_uri = "/v1/clusters";
let mut request = SignedRequest::new("GET", "kafka", &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.cluster_name_filter {
params.put("clusterNameFilter", 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::<ListClustersResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListClustersError::from_response(response))),
)
}
})
}
fn list_configuration_revisions(
&self,
input: ListConfigurationRevisionsRequest,
) -> RusotoFuture<ListConfigurationRevisionsResponse, ListConfigurationRevisionsError> {
let request_uri = format!("/v1/configurations/{arn}/revisions", arn = input.arn);
let mut request = SignedRequest::new("GET", "kafka", &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", "kafka", &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_nodes(
&self,
input: ListNodesRequest,
) -> RusotoFuture<ListNodesResponse, ListNodesError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}/nodes",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("GET", "kafka", &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::<ListNodesResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response
.buffer()
.from_err()
.and_then(|response| Err(ListNodesError::from_response(response))),
)
}
})
}
fn list_tags_for_resource(
&self,
input: ListTagsForResourceRequest,
) -> RusotoFuture<ListTagsForResourceResponse, ListTagsForResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("GET", "kafka", &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::<ListTagsForResourceResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(ListTagsForResourceError::from_response(response))
}),
)
}
})
}
fn tag_resource(&self, input: TagResourceRequest) -> RusotoFuture<(), TagResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("POST", "kafka", &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(TagResourceError::from_response(response))),
)
}
})
}
fn untag_resource(&self, input: UntagResourceRequest) -> RusotoFuture<(), UntagResourceError> {
let request_uri = format!("/v1/tags/{resource_arn}", resource_arn = input.resource_arn);
let mut request = SignedRequest::new("DELETE", "kafka", &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(UntagResourceError::from_response(response))),
)
}
})
}
fn update_broker_storage(
&self,
input: UpdateBrokerStorageRequest,
) -> RusotoFuture<UpdateBrokerStorageResponse, UpdateBrokerStorageError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}/nodes/storage",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("PUT", "kafka", &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::<UpdateBrokerStorageResponse, _>()?;
Ok(result)
}))
} else {
Box::new(
response.buffer().from_err().and_then(|response| {
Err(UpdateBrokerStorageError::from_response(response))
}),
)
}
})
}
fn update_cluster_configuration(
&self,
input: UpdateClusterConfigurationRequest,
) -> RusotoFuture<UpdateClusterConfigurationResponse, UpdateClusterConfigurationError> {
let request_uri = format!(
"/v1/clusters/{cluster_arn}/configuration",
cluster_arn = input.cluster_arn
);
let mut request = SignedRequest::new("PUT", "kafka", &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::<UpdateClusterConfigurationResponse, _>()?;
Ok(result)
}))
} else {
Box::new(response.buffer().from_err().and_then(|response| {
Err(UpdateClusterConfigurationError::from_response(response))
}))
}
})
}
}