use std::fmt::Write;
pub mod batch_associate_scram_secret_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) secret_arn_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn secret_arn_list(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.secret_arn_list.unwrap_or_default();
v.push(input.into());
self.secret_arn_list = Some(v);
self
}
pub fn set_secret_arn_list(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.secret_arn_list = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchAssociateScramSecretInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchAssociateScramSecretInput {
cluster_arn: self.cluster_arn,
secret_arn_list: self.secret_arn_list,
})
}
}
}
impl BatchAssociateScramSecretInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::BatchAssociateScramSecret,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::BatchAssociateScramSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.cluster_arn;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/scram-secrets",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchAssociateScramSecretInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_associate_scram_secret(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::BatchAssociateScramSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchAssociateScramSecret",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_associate_scram_secret_input::Builder {
crate::input::batch_associate_scram_secret_input::Builder::default()
}
}
pub mod batch_disassociate_scram_secret_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) secret_arn_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn secret_arn_list(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.secret_arn_list.unwrap_or_default();
v.push(input.into());
self.secret_arn_list = Some(v);
self
}
pub fn set_secret_arn_list(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.secret_arn_list = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchDisassociateScramSecretInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchDisassociateScramSecretInput {
cluster_arn: self.cluster_arn,
secret_arn_list: self.secret_arn_list,
})
}
}
}
impl BatchDisassociateScramSecretInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::BatchDisassociateScramSecret,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::BatchDisassociateScramSecretInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.cluster_arn;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/scram-secrets",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchDisassociateScramSecretInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_disassociate_scram_secret(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::BatchDisassociateScramSecret::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchDisassociateScramSecret",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_disassociate_scram_secret_input::Builder {
crate::input::batch_disassociate_scram_secret_input::Builder::default()
}
}
pub mod create_cluster_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) broker_node_group_info: std::option::Option<crate::model::BrokerNodeGroupInfo>,
pub(crate) client_authentication: std::option::Option<crate::model::ClientAuthentication>,
pub(crate) cluster_name: std::option::Option<std::string::String>,
pub(crate) configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
pub(crate) encryption_info: std::option::Option<crate::model::EncryptionInfo>,
pub(crate) enhanced_monitoring: std::option::Option<crate::model::EnhancedMonitoring>,
pub(crate) open_monitoring: std::option::Option<crate::model::OpenMonitoringInfo>,
pub(crate) kafka_version: std::option::Option<std::string::String>,
pub(crate) logging_info: std::option::Option<crate::model::LoggingInfo>,
pub(crate) number_of_broker_nodes: std::option::Option<i32>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) storage_mode: std::option::Option<crate::model::StorageMode>,
}
impl Builder {
pub fn broker_node_group_info(mut self, input: crate::model::BrokerNodeGroupInfo) -> Self {
self.broker_node_group_info = Some(input);
self
}
pub fn set_broker_node_group_info(
mut self,
input: std::option::Option<crate::model::BrokerNodeGroupInfo>,
) -> Self {
self.broker_node_group_info = input;
self
}
pub fn client_authentication(mut self, input: crate::model::ClientAuthentication) -> Self {
self.client_authentication = Some(input);
self
}
pub fn set_client_authentication(
mut self,
input: std::option::Option<crate::model::ClientAuthentication>,
) -> Self {
self.client_authentication = input;
self
}
pub fn cluster_name(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_name = Some(input.into());
self
}
pub fn set_cluster_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_name = input;
self
}
pub fn configuration_info(mut self, input: crate::model::ConfigurationInfo) -> Self {
self.configuration_info = Some(input);
self
}
pub fn set_configuration_info(
mut self,
input: std::option::Option<crate::model::ConfigurationInfo>,
) -> Self {
self.configuration_info = input;
self
}
pub fn encryption_info(mut self, input: crate::model::EncryptionInfo) -> Self {
self.encryption_info = Some(input);
self
}
pub fn set_encryption_info(
mut self,
input: std::option::Option<crate::model::EncryptionInfo>,
) -> Self {
self.encryption_info = input;
self
}
pub fn enhanced_monitoring(mut self, input: crate::model::EnhancedMonitoring) -> Self {
self.enhanced_monitoring = Some(input);
self
}
pub fn set_enhanced_monitoring(
mut self,
input: std::option::Option<crate::model::EnhancedMonitoring>,
) -> Self {
self.enhanced_monitoring = input;
self
}
pub fn open_monitoring(mut self, input: crate::model::OpenMonitoringInfo) -> Self {
self.open_monitoring = Some(input);
self
}
pub fn set_open_monitoring(
mut self,
input: std::option::Option<crate::model::OpenMonitoringInfo>,
) -> Self {
self.open_monitoring = input;
self
}
pub fn kafka_version(mut self, input: impl Into<std::string::String>) -> Self {
self.kafka_version = Some(input.into());
self
}
pub fn set_kafka_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.kafka_version = input;
self
}
#[allow(missing_docs)] pub fn logging_info(mut self, input: crate::model::LoggingInfo) -> Self {
self.logging_info = Some(input);
self
}
#[allow(missing_docs)] pub fn set_logging_info(
mut self,
input: std::option::Option<crate::model::LoggingInfo>,
) -> Self {
self.logging_info = input;
self
}
pub fn number_of_broker_nodes(mut self, input: i32) -> Self {
self.number_of_broker_nodes = Some(input);
self
}
pub fn set_number_of_broker_nodes(mut self, input: std::option::Option<i32>) -> Self {
self.number_of_broker_nodes = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn storage_mode(mut self, input: crate::model::StorageMode) -> Self {
self.storage_mode = Some(input);
self
}
pub fn set_storage_mode(
mut self,
input: std::option::Option<crate::model::StorageMode>,
) -> Self {
self.storage_mode = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateClusterInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateClusterInput {
broker_node_group_info: self.broker_node_group_info,
client_authentication: self.client_authentication,
cluster_name: self.cluster_name,
configuration_info: self.configuration_info,
encryption_info: self.encryption_info,
enhanced_monitoring: self.enhanced_monitoring,
open_monitoring: self.open_monitoring,
kafka_version: self.kafka_version,
logging_info: self.logging_info,
number_of_broker_nodes: self.number_of_broker_nodes.unwrap_or_default(),
tags: self.tags,
storage_mode: self.storage_mode,
})
}
}
}
impl CreateClusterInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateCluster,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateClusterInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/clusters").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateClusterInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_cluster(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateCluster::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateCluster",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_cluster_input::Builder {
crate::input::create_cluster_input::Builder::default()
}
}
pub mod create_cluster_v2_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_name: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) provisioned: std::option::Option<crate::model::ProvisionedRequest>,
pub(crate) serverless: std::option::Option<crate::model::ServerlessRequest>,
}
impl Builder {
pub fn cluster_name(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_name = Some(input.into());
self
}
pub fn set_cluster_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_name = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn provisioned(mut self, input: crate::model::ProvisionedRequest) -> Self {
self.provisioned = Some(input);
self
}
pub fn set_provisioned(
mut self,
input: std::option::Option<crate::model::ProvisionedRequest>,
) -> Self {
self.provisioned = input;
self
}
pub fn serverless(mut self, input: crate::model::ServerlessRequest) -> Self {
self.serverless = Some(input);
self
}
pub fn set_serverless(
mut self,
input: std::option::Option<crate::model::ServerlessRequest>,
) -> Self {
self.serverless = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateClusterV2Input, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateClusterV2Input {
cluster_name: self.cluster_name,
tags: self.tags,
provisioned: self.provisioned,
serverless: self.serverless,
})
}
}
}
impl CreateClusterV2Input {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateClusterV2,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateClusterV2Input,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/api/v2/clusters").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateClusterV2Input,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_cluster_v2(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateClusterV2::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateClusterV2",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_cluster_v2_input::Builder {
crate::input::create_cluster_v2_input::Builder::default()
}
}
pub mod create_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) kafka_versions: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) server_properties: std::option::Option<aws_smithy_types::Blob>,
}
impl Builder {
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn kafka_versions(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.kafka_versions.unwrap_or_default();
v.push(input.into());
self.kafka_versions = Some(v);
self
}
pub fn set_kafka_versions(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.kafka_versions = input;
self
}
pub fn name(mut self, input: impl Into<std::string::String>) -> Self {
self.name = Some(input.into());
self
}
pub fn set_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.name = input;
self
}
pub fn server_properties(mut self, input: aws_smithy_types::Blob) -> Self {
self.server_properties = Some(input);
self
}
pub fn set_server_properties(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.server_properties = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateConfigurationInput {
description: self.description,
kafka_versions: self.kafka_versions,
name: self.name,
server_properties: self.server_properties,
})
}
}
}
impl CreateConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::CreateConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/configurations").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_configuration(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::CreateConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateConfiguration",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_configuration_input::Builder {
crate::input::create_configuration_input::Builder::default()
}
}
pub mod delete_cluster_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteClusterInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteClusterInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
})
}
}
}
impl DeleteClusterInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteCluster,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteClusterInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.cluster_arn;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteClusterInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_4) = &_input.current_version {
{
query.push_kv(
"currentVersion",
&aws_smithy_http::query::fmt_string(&inner_4),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteClusterInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteCluster::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteCluster",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_cluster_input::Builder {
crate::input::delete_cluster_input::Builder::default()
}
}
pub mod delete_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteConfigurationInput { arn: self.arn })
}
}
}
impl DeleteConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DeleteConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DeleteConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.arn;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
let arn = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/configurations/{Arn}", Arn = arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteConfiguration",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_configuration_input::Builder {
crate::input::delete_configuration_input::Builder::default()
}
}
pub mod describe_cluster_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DescribeClusterInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeClusterInput {
cluster_arn: self.cluster_arn,
})
}
}
}
impl DescribeClusterInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeCluster,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeClusterInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.cluster_arn;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeClusterInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeCluster::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeCluster",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_cluster_input::Builder {
crate::input::describe_cluster_input::Builder::default()
}
}
pub mod describe_cluster_operation_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_operation_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_operation_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_operation_arn = Some(input.into());
self
}
pub fn set_cluster_operation_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cluster_operation_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeClusterOperationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeClusterOperationInput {
cluster_operation_arn: self.cluster_operation_arn,
})
}
}
}
impl DescribeClusterOperationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeClusterOperation,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeClusterOperationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.cluster_operation_arn;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_operation_arn",
"cannot be empty or unset",
)
})?;
let cluster_operation_arn = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_operation_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_operation_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/operations/{ClusterOperationArn}",
ClusterOperationArn = cluster_operation_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeClusterOperationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeClusterOperation::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeClusterOperation",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_cluster_operation_input::Builder {
crate::input::describe_cluster_operation_input::Builder::default()
}
}
pub mod describe_cluster_v2_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeClusterV2Input,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeClusterV2Input {
cluster_arn: self.cluster_arn,
})
}
}
}
impl DescribeClusterV2Input {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeClusterV2,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeClusterV2Input,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.cluster_arn;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/api/v2/clusters/{ClusterArn}",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeClusterV2Input,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeClusterV2::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeClusterV2",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_cluster_v2_input::Builder {
crate::input::describe_cluster_v2_input::Builder::default()
}
}
pub mod describe_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeConfigurationInput { arn: self.arn })
}
}
}
impl DescribeConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.arn;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
let arn = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/configurations/{Arn}", Arn = arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeConfiguration",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_configuration_input::Builder {
crate::input::describe_configuration_input::Builder::default()
}
}
pub mod describe_configuration_revision_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) revision: std::option::Option<i64>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn revision(mut self, input: i64) -> Self {
self.revision = Some(input);
self
}
pub fn set_revision(mut self, input: std::option::Option<i64>) -> Self {
self.revision = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeConfigurationRevisionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeConfigurationRevisionInput {
arn: self.arn,
revision: self.revision.unwrap_or_default(),
})
}
}
}
impl DescribeConfigurationRevisionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::DescribeConfigurationRevision,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::DescribeConfigurationRevisionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_10 = &_input.arn;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
let arn = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
let input_11 = &_input.revision;
let mut revision_encoder = aws_smithy_types::primitive::Encoder::from(*input_11);
let revision = revision_encoder.encode();
if revision.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"revision",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/configurations/{Arn}/revisions/{Revision}",
Arn = arn,
Revision = revision
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeConfigurationRevisionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeConfigurationRevision::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeConfigurationRevision",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_configuration_revision_input::Builder {
crate::input::describe_configuration_revision_input::Builder::default()
}
}
pub mod get_bootstrap_brokers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetBootstrapBrokersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetBootstrapBrokersInput {
cluster_arn: self.cluster_arn,
})
}
}
}
impl GetBootstrapBrokersInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetBootstrapBrokers,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetBootstrapBrokersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.cluster_arn;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/bootstrap-brokers",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBootstrapBrokersInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetBootstrapBrokers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBootstrapBrokers",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_bootstrap_brokers_input::Builder {
crate::input::get_bootstrap_brokers_input::Builder::default()
}
}
pub mod get_compatible_kafka_versions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCompatibleKafkaVersionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCompatibleKafkaVersionsInput {
cluster_arn: self.cluster_arn,
})
}
}
}
impl GetCompatibleKafkaVersionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::GetCompatibleKafkaVersions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::GetCompatibleKafkaVersionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/compatible-kafka-versions").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetCompatibleKafkaVersionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_13) = &_input.cluster_arn {
{
query.push_kv("clusterArn", &aws_smithy_http::query::fmt_string(&inner_13));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCompatibleKafkaVersionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetCompatibleKafkaVersions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCompatibleKafkaVersions",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_compatible_kafka_versions_input::Builder {
crate::input::get_compatible_kafka_versions_input::Builder::default()
}
}
pub mod list_cluster_operations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListClusterOperationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListClusterOperationsInput {
cluster_arn: self.cluster_arn,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListClusterOperationsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListClusterOperations,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListClusterOperationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.cluster_arn;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/operations",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListClusterOperationsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_15) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_15));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListClusterOperationsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListClusterOperations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListClusterOperations",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_cluster_operations_input::Builder {
crate::input::list_cluster_operations_input::Builder::default()
}
}
pub mod list_clusters_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_name_filter: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_name_filter(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_name_filter = Some(input.into());
self
}
pub fn set_cluster_name_filter(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cluster_name_filter = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListClustersInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListClustersInput {
cluster_name_filter: self.cluster_name_filter,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListClustersInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListClusters,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListClustersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/clusters").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListClustersInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_16) = &_input.cluster_name_filter {
{
query.push_kv(
"clusterNameFilter",
&aws_smithy_http::query::fmt_string(&inner_16),
);
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_17) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_17));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListClustersInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListClusters::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListClusters",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_clusters_input::Builder {
crate::input::list_clusters_input::Builder::default()
}
}
pub mod list_clusters_v2_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_name_filter: std::option::Option<std::string::String>,
pub(crate) cluster_type_filter: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_name_filter(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_name_filter = Some(input.into());
self
}
pub fn set_cluster_name_filter(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cluster_name_filter = input;
self
}
pub fn cluster_type_filter(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_type_filter = Some(input.into());
self
}
pub fn set_cluster_type_filter(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.cluster_type_filter = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListClustersV2Input, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListClustersV2Input {
cluster_name_filter: self.cluster_name_filter,
cluster_type_filter: self.cluster_type_filter,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListClustersV2Input {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListClustersV2,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListClustersV2Input,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/api/v2/clusters").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListClustersV2Input,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_18) = &_input.cluster_name_filter {
{
query.push_kv(
"clusterNameFilter",
&aws_smithy_http::query::fmt_string(&inner_18),
);
}
}
if let Some(inner_19) = &_input.cluster_type_filter {
{
query.push_kv(
"clusterTypeFilter",
&aws_smithy_http::query::fmt_string(&inner_19),
);
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_20) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_20));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListClustersV2Input,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListClustersV2::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListClustersV2",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_clusters_v2_input::Builder {
crate::input::list_clusters_v2_input::Builder::default()
}
}
pub mod list_configuration_revisions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListConfigurationRevisionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListConfigurationRevisionsInput {
arn: self.arn,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListConfigurationRevisionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListConfigurationRevisions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListConfigurationRevisionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.arn;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
let arn = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/configurations/{Arn}/revisions", Arn = arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListConfigurationRevisionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_22) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_22));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListConfigurationRevisionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListConfigurationRevisions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListConfigurationRevisions",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_configuration_revisions_input::Builder {
crate::input::list_configuration_revisions_input::Builder::default()
}
}
pub mod list_configurations_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListConfigurationsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListConfigurationsInput {
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListConfigurationsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListConfigurations,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListConfigurationsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/configurations").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListConfigurationsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_23) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_23));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListConfigurationsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListConfigurations::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListConfigurations",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_configurations_input::Builder {
crate::input::list_configurations_input::Builder::default()
}
}
pub mod list_kafka_versions_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListKafkaVersionsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListKafkaVersionsInput {
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListKafkaVersionsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListKafkaVersions,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListKafkaVersionsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/v1/kafka-versions").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListKafkaVersionsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_24) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_24));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListKafkaVersionsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListKafkaVersions::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListKafkaVersions",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_kafka_versions_input::Builder {
crate::input::list_kafka_versions_input::Builder::default()
}
}
pub mod list_nodes_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListNodesInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListNodesInput {
cluster_arn: self.cluster_arn,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListNodesInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListNodes,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListNodesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_25 = &_input.cluster_arn;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/nodes",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListNodesInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_26) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_26));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListNodesInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op =
aws_smithy_http::operation::Operation::new(request, crate::operation::ListNodes::new())
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListNodes",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_nodes_input::Builder {
crate::input::list_nodes_input::Builder::default()
}
}
pub mod list_scram_secrets_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn max_results(mut self, input: i32) -> Self {
self.max_results = Some(input);
self
}
pub fn set_max_results(mut self, input: std::option::Option<i32>) -> Self {
self.max_results = input;
self
}
pub fn next_token(mut self, input: impl Into<std::string::String>) -> Self {
self.next_token = Some(input.into());
self
}
pub fn set_next_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.next_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListScramSecretsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListScramSecretsInput {
cluster_arn: self.cluster_arn,
max_results: self.max_results.unwrap_or_default(),
next_token: self.next_token,
})
}
}
}
impl ListScramSecretsInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListScramSecrets,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListScramSecretsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.cluster_arn;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/scram-secrets",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListScramSecretsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_28) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_28));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListScramSecretsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListScramSecrets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListScramSecrets",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_scram_secrets_input::Builder {
crate::input::list_scram_secrets_input::Builder::default()
}
}
pub mod list_tags_for_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListTagsForResourceInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListTagsForResourceInput {
resource_arn: self.resource_arn,
})
}
}
}
impl ListTagsForResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ListTagsForResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::ListTagsForResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.resource_arn;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{ResourceArn}", ResourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_tags_for_resource_input::Builder {
crate::input::list_tags_for_resource_input::Builder::default()
}
}
pub mod reboot_broker_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) broker_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) cluster_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn broker_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.broker_ids.unwrap_or_default();
v.push(input.into());
self.broker_ids = Some(v);
self
}
pub fn set_broker_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.broker_ids = input;
self
}
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn build(
self,
) -> Result<crate::input::RebootBrokerInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::RebootBrokerInput {
broker_ids: self.broker_ids,
cluster_arn: self.cluster_arn,
})
}
}
}
impl RebootBrokerInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::RebootBroker,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::RebootBrokerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_30 = &_input.cluster_arn;
let input_30 = input_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_30,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/reboot-broker",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RebootBrokerInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_reboot_broker(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::RebootBroker::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RebootBroker",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::reboot_broker_input::Builder {
crate::input::reboot_broker_input::Builder::default()
}
}
pub mod tag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tags(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.tags.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.tags = Some(hash_map);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.tags = input;
self
}
pub fn build(
self,
) -> Result<crate::input::TagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::TagResourceInput {
resource_arn: self.resource_arn,
tags: self.tags,
})
}
}
}
impl TagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::TagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::TagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_31 = &_input.resource_arn;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{ResourceArn}", ResourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_tag_resource(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::TagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"TagResource",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::tag_resource_input::Builder {
crate::input::tag_resource_input::Builder::default()
}
}
pub mod untag_resource_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) resource_arn: std::option::Option<std::string::String>,
pub(crate) tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl Builder {
pub fn resource_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.resource_arn = Some(input.into());
self
}
pub fn set_resource_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.resource_arn = input;
self
}
pub fn tag_keys(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.tag_keys.unwrap_or_default();
v.push(input.into());
self.tag_keys = Some(v);
self
}
pub fn set_tag_keys(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.tag_keys = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UntagResourceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UntagResourceInput {
resource_arn: self.resource_arn,
tag_keys: self.tag_keys,
})
}
}
}
impl UntagResourceInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UntagResource,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UntagResourceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.resource_arn;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
let resource_arn = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if resource_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/tags/{ResourceArn}", ResourceArn = resource_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::UntagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_33 = &_input.tag_keys;
let inner_33 = inner_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"tag_keys",
"cannot be empty or unset",
)
})?;
for inner_34 in inner_33 {
query.push_kv("tagKeys", &aws_smithy_http::query::fmt_string(&inner_34));
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UntagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::untag_resource_input::Builder {
crate::input::untag_resource_input::Builder::default()
}
}
pub mod update_broker_count_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) target_number_of_broker_nodes: std::option::Option<i32>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn target_number_of_broker_nodes(mut self, input: i32) -> Self {
self.target_number_of_broker_nodes = Some(input);
self
}
pub fn set_target_number_of_broker_nodes(
mut self,
input: std::option::Option<i32>,
) -> Self {
self.target_number_of_broker_nodes = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBrokerCountInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBrokerCountInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
target_number_of_broker_nodes: self
.target_number_of_broker_nodes
.unwrap_or_default(),
})
}
}
}
impl UpdateBrokerCountInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateBrokerCount,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateBrokerCountInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_35 = &_input.cluster_arn;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/nodes/count",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBrokerCountInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_broker_count(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateBrokerCount::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBrokerCount",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_broker_count_input::Builder {
crate::input::update_broker_count_input::Builder::default()
}
}
pub mod update_broker_storage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) target_broker_ebs_volume_info:
std::option::Option<std::vec::Vec<crate::model::BrokerEbsVolumeInfo>>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn target_broker_ebs_volume_info(
mut self,
input: crate::model::BrokerEbsVolumeInfo,
) -> Self {
let mut v = self.target_broker_ebs_volume_info.unwrap_or_default();
v.push(input);
self.target_broker_ebs_volume_info = Some(v);
self
}
pub fn set_target_broker_ebs_volume_info(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::BrokerEbsVolumeInfo>>,
) -> Self {
self.target_broker_ebs_volume_info = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBrokerStorageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBrokerStorageInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
target_broker_ebs_volume_info: self.target_broker_ebs_volume_info,
})
}
}
}
impl UpdateBrokerStorageInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateBrokerStorage,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateBrokerStorageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_36 = &_input.cluster_arn;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/nodes/storage",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBrokerStorageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_broker_storage(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateBrokerStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBrokerStorage",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_broker_storage_input::Builder {
crate::input::update_broker_storage_input::Builder::default()
}
}
pub mod update_broker_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) target_instance_type: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn target_instance_type(mut self, input: impl Into<std::string::String>) -> Self {
self.target_instance_type = Some(input.into());
self
}
pub fn set_target_instance_type(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_instance_type = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateBrokerTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateBrokerTypeInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
target_instance_type: self.target_instance_type,
})
}
}
}
impl UpdateBrokerTypeInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateBrokerType,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateBrokerTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_37 = &_input.cluster_arn;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/nodes/type",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateBrokerTypeInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_broker_type(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateBrokerType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateBrokerType",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_broker_type_input::Builder {
crate::input::update_broker_type_input::Builder::default()
}
}
pub mod update_cluster_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
pub(crate) current_version: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn configuration_info(mut self, input: crate::model::ConfigurationInfo) -> Self {
self.configuration_info = Some(input);
self
}
pub fn set_configuration_info(
mut self,
input: std::option::Option<crate::model::ConfigurationInfo>,
) -> Self {
self.configuration_info = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateClusterConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateClusterConfigurationInput {
cluster_arn: self.cluster_arn,
configuration_info: self.configuration_info,
current_version: self.current_version,
})
}
}
}
impl UpdateClusterConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateClusterConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateClusterConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_38 = &_input.cluster_arn;
let input_38 = input_38.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_38,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/configuration",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateClusterConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_cluster_configuration(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateClusterConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateClusterConfiguration",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_cluster_configuration_input::Builder {
crate::input::update_cluster_configuration_input::Builder::default()
}
}
pub mod update_cluster_kafka_version_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) target_kafka_version: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn configuration_info(mut self, input: crate::model::ConfigurationInfo) -> Self {
self.configuration_info = Some(input);
self
}
pub fn set_configuration_info(
mut self,
input: std::option::Option<crate::model::ConfigurationInfo>,
) -> Self {
self.configuration_info = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn target_kafka_version(mut self, input: impl Into<std::string::String>) -> Self {
self.target_kafka_version = Some(input.into());
self
}
pub fn set_target_kafka_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.target_kafka_version = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateClusterKafkaVersionInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateClusterKafkaVersionInput {
cluster_arn: self.cluster_arn,
configuration_info: self.configuration_info,
current_version: self.current_version,
target_kafka_version: self.target_kafka_version,
})
}
}
}
impl UpdateClusterKafkaVersionInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateClusterKafkaVersion,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateClusterKafkaVersionInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_39 = &_input.cluster_arn;
let input_39 = input_39.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_39,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/version",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateClusterKafkaVersionInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_cluster_kafka_version(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateClusterKafkaVersion::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateClusterKafkaVersion",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_cluster_kafka_version_input::Builder {
crate::input::update_cluster_kafka_version_input::Builder::default()
}
}
pub mod update_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) arn: std::option::Option<std::string::String>,
pub(crate) description: std::option::Option<std::string::String>,
pub(crate) server_properties: std::option::Option<aws_smithy_types::Blob>,
}
impl Builder {
pub fn arn(mut self, input: impl Into<std::string::String>) -> Self {
self.arn = Some(input.into());
self
}
pub fn set_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.arn = input;
self
}
pub fn description(mut self, input: impl Into<std::string::String>) -> Self {
self.description = Some(input.into());
self
}
pub fn set_description(mut self, input: std::option::Option<std::string::String>) -> Self {
self.description = input;
self
}
pub fn server_properties(mut self, input: aws_smithy_types::Blob) -> Self {
self.server_properties = Some(input);
self
}
pub fn set_server_properties(
mut self,
input: std::option::Option<aws_smithy_types::Blob>,
) -> Self {
self.server_properties = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateConfigurationInput {
arn: self.arn,
description: self.description,
server_properties: self.server_properties,
})
}
}
}
impl UpdateConfigurationInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateConfiguration,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_40 = &_input.arn;
let input_40 = input_40.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
)
})?;
let arn = aws_smithy_http::label::fmt_string(
input_40,
aws_smithy_http::label::EncodingStrategy::Default,
);
if arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"arn",
"cannot be empty or unset",
),
);
}
write!(output, "/v1/configurations/{Arn}", Arn = arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_configuration(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateConfiguration",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_configuration_input::Builder {
crate::input::update_configuration_input::Builder::default()
}
}
pub mod update_connectivity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) connectivity_info: std::option::Option<crate::model::ConnectivityInfo>,
pub(crate) current_version: std::option::Option<std::string::String>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn connectivity_info(mut self, input: crate::model::ConnectivityInfo) -> Self {
self.connectivity_info = Some(input);
self
}
pub fn set_connectivity_info(
mut self,
input: std::option::Option<crate::model::ConnectivityInfo>,
) -> Self {
self.connectivity_info = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateConnectivityInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateConnectivityInput {
cluster_arn: self.cluster_arn,
connectivity_info: self.connectivity_info,
current_version: self.current_version,
})
}
}
}
impl UpdateConnectivityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateConnectivity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateConnectivityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_41 = &_input.cluster_arn;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/connectivity",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateConnectivityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_connectivity(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateConnectivity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateConnectivity",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_connectivity_input::Builder {
crate::input::update_connectivity_input::Builder::default()
}
}
pub mod update_monitoring_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) enhanced_monitoring: std::option::Option<crate::model::EnhancedMonitoring>,
pub(crate) open_monitoring: std::option::Option<crate::model::OpenMonitoringInfo>,
pub(crate) logging_info: std::option::Option<crate::model::LoggingInfo>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn enhanced_monitoring(mut self, input: crate::model::EnhancedMonitoring) -> Self {
self.enhanced_monitoring = Some(input);
self
}
pub fn set_enhanced_monitoring(
mut self,
input: std::option::Option<crate::model::EnhancedMonitoring>,
) -> Self {
self.enhanced_monitoring = input;
self
}
pub fn open_monitoring(mut self, input: crate::model::OpenMonitoringInfo) -> Self {
self.open_monitoring = Some(input);
self
}
pub fn set_open_monitoring(
mut self,
input: std::option::Option<crate::model::OpenMonitoringInfo>,
) -> Self {
self.open_monitoring = input;
self
}
#[allow(missing_docs)] pub fn logging_info(mut self, input: crate::model::LoggingInfo) -> Self {
self.logging_info = Some(input);
self
}
#[allow(missing_docs)] pub fn set_logging_info(
mut self,
input: std::option::Option<crate::model::LoggingInfo>,
) -> Self {
self.logging_info = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateMonitoringInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateMonitoringInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
enhanced_monitoring: self.enhanced_monitoring,
open_monitoring: self.open_monitoring,
logging_info: self.logging_info,
})
}
}
}
impl UpdateMonitoringInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateMonitoring,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateMonitoringInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_42 = &_input.cluster_arn;
let input_42 = input_42.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_42,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/monitoring",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateMonitoringInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_monitoring(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateMonitoring::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateMonitoring",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_monitoring_input::Builder {
crate::input::update_monitoring_input::Builder::default()
}
}
pub mod update_security_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) client_authentication: std::option::Option<crate::model::ClientAuthentication>,
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) encryption_info: std::option::Option<crate::model::EncryptionInfo>,
}
impl Builder {
pub fn client_authentication(mut self, input: crate::model::ClientAuthentication) -> Self {
self.client_authentication = Some(input);
self
}
pub fn set_client_authentication(
mut self,
input: std::option::Option<crate::model::ClientAuthentication>,
) -> Self {
self.client_authentication = input;
self
}
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn encryption_info(mut self, input: crate::model::EncryptionInfo) -> Self {
self.encryption_info = Some(input);
self
}
pub fn set_encryption_info(
mut self,
input: std::option::Option<crate::model::EncryptionInfo>,
) -> Self {
self.encryption_info = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateSecurityInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateSecurityInput {
client_authentication: self.client_authentication,
cluster_arn: self.cluster_arn,
current_version: self.current_version,
encryption_info: self.encryption_info,
})
}
}
}
impl UpdateSecurityInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateSecurity,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateSecurityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.cluster_arn;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/security",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateSecurityInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PATCH").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_security(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateSecurity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateSecurity",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_security_input::Builder {
crate::input::update_security_input::Builder::default()
}
}
pub mod update_storage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) cluster_arn: std::option::Option<std::string::String>,
pub(crate) current_version: std::option::Option<std::string::String>,
pub(crate) provisioned_throughput: std::option::Option<crate::model::ProvisionedThroughput>,
pub(crate) storage_mode: std::option::Option<crate::model::StorageMode>,
pub(crate) volume_size_gb: std::option::Option<i32>,
}
impl Builder {
pub fn cluster_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.cluster_arn = Some(input.into());
self
}
pub fn set_cluster_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.cluster_arn = input;
self
}
pub fn current_version(mut self, input: impl Into<std::string::String>) -> Self {
self.current_version = Some(input.into());
self
}
pub fn set_current_version(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.current_version = input;
self
}
pub fn provisioned_throughput(
mut self,
input: crate::model::ProvisionedThroughput,
) -> Self {
self.provisioned_throughput = Some(input);
self
}
pub fn set_provisioned_throughput(
mut self,
input: std::option::Option<crate::model::ProvisionedThroughput>,
) -> Self {
self.provisioned_throughput = input;
self
}
pub fn storage_mode(mut self, input: crate::model::StorageMode) -> Self {
self.storage_mode = Some(input);
self
}
pub fn set_storage_mode(
mut self,
input: std::option::Option<crate::model::StorageMode>,
) -> Self {
self.storage_mode = input;
self
}
pub fn volume_size_gb(mut self, input: i32) -> Self {
self.volume_size_gb = Some(input);
self
}
pub fn set_volume_size_gb(mut self, input: std::option::Option<i32>) -> Self {
self.volume_size_gb = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateStorageInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateStorageInput {
cluster_arn: self.cluster_arn,
current_version: self.current_version,
provisioned_throughput: self.provisioned_throughput,
storage_mode: self.storage_mode,
volume_size_gb: self.volume_size_gb.unwrap_or_default(),
})
}
}
}
impl UpdateStorageInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
&self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::UpdateStorage,
aws_http::retry::AwsResponseRetryClassifier,
>,
aws_smithy_http::operation::error::BuildError,
> {
let params_result = crate::endpoint::Params::builder()
.set_region(_config.region.as_ref().map(|r| r.as_ref().to_owned()))
.set_use_dual_stack(_config.use_dual_stack)
.set_use_fips(_config.use_fips)
.set_endpoint(_config.endpoint_url.clone())
.build()
.map_err(|err| {
aws_smithy_http::endpoint::ResolveEndpointError::from_source(
"could not construct endpoint parameters",
err,
)
});
let (endpoint_result, params) = match params_result {
Ok(params) => (
_config.endpoint_resolver.resolve_endpoint(¶ms),
Some(params),
),
Err(e) => (Err(e), None),
};
let mut request = {
fn uri_base(
_input: &crate::input::UpdateStorageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_44 = &_input.cluster_arn;
let input_44 = input_44.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
)
})?;
let cluster_arn = aws_smithy_http::label::fmt_string(
input_44,
aws_smithy_http::label::EncodingStrategy::Default,
);
if cluster_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"cluster_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/v1/clusters/{ClusterArn}/storage",
ClusterArn = cluster_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateStorageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("PUT").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_storage(&self)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UpdateStorage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateStorage",
"kafka",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_storage_input::Builder {
crate::input::update_storage_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateStorageInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub provisioned_throughput: std::option::Option<crate::model::ProvisionedThroughput>,
#[doc(hidden)]
pub storage_mode: std::option::Option<crate::model::StorageMode>,
#[doc(hidden)]
pub volume_size_gb: i32,
}
impl UpdateStorageInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn provisioned_throughput(
&self,
) -> std::option::Option<&crate::model::ProvisionedThroughput> {
self.provisioned_throughput.as_ref()
}
pub fn storage_mode(&self) -> std::option::Option<&crate::model::StorageMode> {
self.storage_mode.as_ref()
}
pub fn volume_size_gb(&self) -> i32 {
self.volume_size_gb
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateSecurityInput {
#[doc(hidden)]
pub client_authentication: std::option::Option<crate::model::ClientAuthentication>,
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
}
impl UpdateSecurityInput {
pub fn client_authentication(
&self,
) -> std::option::Option<&crate::model::ClientAuthentication> {
self.client_authentication.as_ref()
}
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn encryption_info(&self) -> std::option::Option<&crate::model::EncryptionInfo> {
self.encryption_info.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateMonitoringInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enhanced_monitoring: std::option::Option<crate::model::EnhancedMonitoring>,
#[doc(hidden)]
pub open_monitoring: std::option::Option<crate::model::OpenMonitoringInfo>,
#[allow(missing_docs)] #[doc(hidden)]
pub logging_info: std::option::Option<crate::model::LoggingInfo>,
}
impl UpdateMonitoringInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn enhanced_monitoring(&self) -> std::option::Option<&crate::model::EnhancedMonitoring> {
self.enhanced_monitoring.as_ref()
}
pub fn open_monitoring(&self) -> std::option::Option<&crate::model::OpenMonitoringInfo> {
self.open_monitoring.as_ref()
}
#[allow(missing_docs)] pub fn logging_info(&self) -> std::option::Option<&crate::model::LoggingInfo> {
self.logging_info.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateConnectivityInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub connectivity_info: std::option::Option<crate::model::ConnectivityInfo>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
}
impl UpdateConnectivityInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn connectivity_info(&self) -> std::option::Option<&crate::model::ConnectivityInfo> {
self.connectivity_info.as_ref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateConfigurationInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub server_properties: std::option::Option<aws_smithy_types::Blob>,
}
impl UpdateConfigurationInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn server_properties(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.server_properties.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateClusterKafkaVersionInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_kafka_version: std::option::Option<std::string::String>,
}
impl UpdateClusterKafkaVersionInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn configuration_info(&self) -> std::option::Option<&crate::model::ConfigurationInfo> {
self.configuration_info.as_ref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn target_kafka_version(&self) -> std::option::Option<&str> {
self.target_kafka_version.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateClusterConfigurationInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
}
impl UpdateClusterConfigurationInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn configuration_info(&self) -> std::option::Option<&crate::model::ConfigurationInfo> {
self.configuration_info.as_ref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBrokerTypeInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_instance_type: std::option::Option<std::string::String>,
}
impl UpdateBrokerTypeInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn target_instance_type(&self) -> std::option::Option<&str> {
self.target_instance_type.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBrokerStorageInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_broker_ebs_volume_info:
std::option::Option<std::vec::Vec<crate::model::BrokerEbsVolumeInfo>>,
}
impl UpdateBrokerStorageInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn target_broker_ebs_volume_info(
&self,
) -> std::option::Option<&[crate::model::BrokerEbsVolumeInfo]> {
self.target_broker_ebs_volume_info.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateBrokerCountInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
#[doc(hidden)]
pub target_number_of_broker_nodes: i32,
}
impl UpdateBrokerCountInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
pub fn target_number_of_broker_nodes(&self) -> i32 {
self.target_number_of_broker_nodes
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UntagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tag_keys: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl UntagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tag_keys(&self) -> std::option::Option<&[std::string::String]> {
self.tag_keys.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct TagResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RebootBrokerInput {
#[doc(hidden)]
pub broker_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
}
impl RebootBrokerInput {
pub fn broker_ids(&self) -> std::option::Option<&[std::string::String]> {
self.broker_ids.as_deref()
}
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListTagsForResourceInput {
#[doc(hidden)]
pub resource_arn: std::option::Option<std::string::String>,
}
impl ListTagsForResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListScramSecretsInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListScramSecretsInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListNodesInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListNodesInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListKafkaVersionsInput {
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListKafkaVersionsInput {
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListConfigurationsInput {
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListConfigurationsInput {
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListConfigurationRevisionsInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListConfigurationRevisionsInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListClustersV2Input {
#[doc(hidden)]
pub cluster_name_filter: std::option::Option<std::string::String>,
#[doc(hidden)]
pub cluster_type_filter: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListClustersV2Input {
pub fn cluster_name_filter(&self) -> std::option::Option<&str> {
self.cluster_name_filter.as_deref()
}
pub fn cluster_type_filter(&self) -> std::option::Option<&str> {
self.cluster_type_filter.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListClustersInput {
#[doc(hidden)]
pub cluster_name_filter: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListClustersInput {
pub fn cluster_name_filter(&self) -> std::option::Option<&str> {
self.cluster_name_filter.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListClusterOperationsInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListClusterOperationsInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCompatibleKafkaVersionsInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
}
impl GetCompatibleKafkaVersionsInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBootstrapBrokersInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
}
impl GetBootstrapBrokersInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeConfigurationRevisionInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub revision: i64,
}
impl DescribeConfigurationRevisionInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
pub fn revision(&self) -> i64 {
self.revision
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeConfigurationInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
}
impl DescribeConfigurationInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeClusterV2Input {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
}
impl DescribeClusterV2Input {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeClusterOperationInput {
#[doc(hidden)]
pub cluster_operation_arn: std::option::Option<std::string::String>,
}
impl DescribeClusterOperationInput {
pub fn cluster_operation_arn(&self) -> std::option::Option<&str> {
self.cluster_operation_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeClusterInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
}
impl DescribeClusterInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteConfigurationInput {
#[doc(hidden)]
pub arn: std::option::Option<std::string::String>,
}
impl DeleteConfigurationInput {
pub fn arn(&self) -> std::option::Option<&str> {
self.arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteClusterInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub current_version: std::option::Option<std::string::String>,
}
impl DeleteClusterInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn current_version(&self) -> std::option::Option<&str> {
self.current_version.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateConfigurationInput {
#[doc(hidden)]
pub description: std::option::Option<std::string::String>,
#[doc(hidden)]
pub kafka_versions: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub server_properties: std::option::Option<aws_smithy_types::Blob>,
}
impl CreateConfigurationInput {
pub fn description(&self) -> std::option::Option<&str> {
self.description.as_deref()
}
pub fn kafka_versions(&self) -> std::option::Option<&[std::string::String]> {
self.kafka_versions.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn server_properties(&self) -> std::option::Option<&aws_smithy_types::Blob> {
self.server_properties.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateClusterV2Input {
#[doc(hidden)]
pub cluster_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub provisioned: std::option::Option<crate::model::ProvisionedRequest>,
#[doc(hidden)]
pub serverless: std::option::Option<crate::model::ServerlessRequest>,
}
impl CreateClusterV2Input {
pub fn cluster_name(&self) -> std::option::Option<&str> {
self.cluster_name.as_deref()
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn provisioned(&self) -> std::option::Option<&crate::model::ProvisionedRequest> {
self.provisioned.as_ref()
}
pub fn serverless(&self) -> std::option::Option<&crate::model::ServerlessRequest> {
self.serverless.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateClusterInput {
#[doc(hidden)]
pub broker_node_group_info: std::option::Option<crate::model::BrokerNodeGroupInfo>,
#[doc(hidden)]
pub client_authentication: std::option::Option<crate::model::ClientAuthentication>,
#[doc(hidden)]
pub cluster_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub configuration_info: std::option::Option<crate::model::ConfigurationInfo>,
#[doc(hidden)]
pub encryption_info: std::option::Option<crate::model::EncryptionInfo>,
#[doc(hidden)]
pub enhanced_monitoring: std::option::Option<crate::model::EnhancedMonitoring>,
#[doc(hidden)]
pub open_monitoring: std::option::Option<crate::model::OpenMonitoringInfo>,
#[doc(hidden)]
pub kafka_version: std::option::Option<std::string::String>,
#[allow(missing_docs)] #[doc(hidden)]
pub logging_info: std::option::Option<crate::model::LoggingInfo>,
#[doc(hidden)]
pub number_of_broker_nodes: i32,
#[doc(hidden)]
pub tags:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub storage_mode: std::option::Option<crate::model::StorageMode>,
}
impl CreateClusterInput {
pub fn broker_node_group_info(
&self,
) -> std::option::Option<&crate::model::BrokerNodeGroupInfo> {
self.broker_node_group_info.as_ref()
}
pub fn client_authentication(
&self,
) -> std::option::Option<&crate::model::ClientAuthentication> {
self.client_authentication.as_ref()
}
pub fn cluster_name(&self) -> std::option::Option<&str> {
self.cluster_name.as_deref()
}
pub fn configuration_info(&self) -> std::option::Option<&crate::model::ConfigurationInfo> {
self.configuration_info.as_ref()
}
pub fn encryption_info(&self) -> std::option::Option<&crate::model::EncryptionInfo> {
self.encryption_info.as_ref()
}
pub fn enhanced_monitoring(&self) -> std::option::Option<&crate::model::EnhancedMonitoring> {
self.enhanced_monitoring.as_ref()
}
pub fn open_monitoring(&self) -> std::option::Option<&crate::model::OpenMonitoringInfo> {
self.open_monitoring.as_ref()
}
pub fn kafka_version(&self) -> std::option::Option<&str> {
self.kafka_version.as_deref()
}
#[allow(missing_docs)] pub fn logging_info(&self) -> std::option::Option<&crate::model::LoggingInfo> {
self.logging_info.as_ref()
}
pub fn number_of_broker_nodes(&self) -> i32 {
self.number_of_broker_nodes
}
pub fn tags(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.tags.as_ref()
}
pub fn storage_mode(&self) -> std::option::Option<&crate::model::StorageMode> {
self.storage_mode.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchDisassociateScramSecretInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub secret_arn_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl BatchDisassociateScramSecretInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn secret_arn_list(&self) -> std::option::Option<&[std::string::String]> {
self.secret_arn_list.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchAssociateScramSecretInput {
#[doc(hidden)]
pub cluster_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub secret_arn_list: std::option::Option<std::vec::Vec<std::string::String>>,
}
impl BatchAssociateScramSecretInput {
pub fn cluster_arn(&self) -> std::option::Option<&str> {
self.cluster_arn.as_deref()
}
pub fn secret_arn_list(&self) -> std::option::Option<&[std::string::String]> {
self.secret_arn_list.as_deref()
}
}