use std::fmt::Write;
pub mod associate_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) channel_flow_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AssociateChannelFlowInput {
channel_arn: self.channel_arn,
channel_flow_arn: self.channel_flow_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl AssociateChannelFlowInput {
#[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::AssociateChannelFlow,
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::AssociateChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.channel_arn;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/channel-flow",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateChannelFlowInput,
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)?;
let builder =
crate::http_serde::add_headers_associate_channel_flow(input, builder)?;
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_associate_channel_flow(
&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::AssociateChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_channel_flow_input::Builder {
crate::input::associate_channel_flow_input::Builder::default()
}
}
pub mod batch_create_channel_membership_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::ChannelMembershipType>,
pub(crate) member_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn r#type(mut self, input: crate::model::ChannelMembershipType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::ChannelMembershipType>,
) -> Self {
self.r#type = input;
self
}
pub fn member_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.member_arns.unwrap_or_default();
v.push(input.into());
self.member_arns = Some(v);
self
}
pub fn set_member_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.member_arns = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::BatchCreateChannelMembershipInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::BatchCreateChannelMembershipInput {
channel_arn: self.channel_arn,
r#type: self.r#type,
member_arns: self.member_arns,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl BatchCreateChannelMembershipInput {
#[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::BatchCreateChannelMembership,
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::BatchCreateChannelMembershipInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.channel_arn;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::BatchCreateChannelMembershipInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("operation", "batch-create");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchCreateChannelMembershipInput,
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)?;
let builder =
crate::http_serde::add_headers_batch_create_channel_membership(input, builder)?;
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_create_channel_membership(&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::BatchCreateChannelMembership::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchCreateChannelMembership",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_create_channel_membership_input::Builder {
crate::input::batch_create_channel_membership_input::Builder::default()
}
}
pub mod channel_flow_callback_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) callback_id: std::option::Option<std::string::String>,
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) delete_resource: std::option::Option<bool>,
pub(crate) channel_message: std::option::Option<crate::model::ChannelMessageCallback>,
}
impl Builder {
pub fn callback_id(mut self, input: impl Into<std::string::String>) -> Self {
self.callback_id = Some(input.into());
self
}
pub fn set_callback_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.callback_id = input;
self
}
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn delete_resource(mut self, input: bool) -> Self {
self.delete_resource = Some(input);
self
}
pub fn set_delete_resource(mut self, input: std::option::Option<bool>) -> Self {
self.delete_resource = input;
self
}
pub fn channel_message(mut self, input: crate::model::ChannelMessageCallback) -> Self {
self.channel_message = Some(input);
self
}
pub fn set_channel_message(
mut self,
input: std::option::Option<crate::model::ChannelMessageCallback>,
) -> Self {
self.channel_message = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ChannelFlowCallbackInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ChannelFlowCallbackInput {
callback_id: self.callback_id,
channel_arn: self.channel_arn,
delete_resource: self.delete_resource.unwrap_or_default(),
channel_message: self.channel_message,
})
}
}
}
impl ChannelFlowCallbackInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::ChannelFlowCallback,
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),
};
if self.callback_id.is_none() {
self.callback_id = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::ChannelFlowCallbackInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_3 = &_input.channel_arn;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ChannelFlowCallbackInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("operation", "channel-flow-callback");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ChannelFlowCallbackInput,
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("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_channel_flow_callback(&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::ChannelFlowCallback::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ChannelFlowCallback",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::channel_flow_callback_input::Builder {
crate::input::channel_flow_callback_input::Builder::default()
}
}
pub mod create_channel_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) mode: std::option::Option<crate::model::ChannelMode>,
pub(crate) privacy: std::option::Option<crate::model::ChannelPrivacy>,
pub(crate) metadata: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) channel_id: std::option::Option<std::string::String>,
pub(crate) member_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) moderator_arns: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) elastic_channel_configuration:
std::option::Option<crate::model::ElasticChannelConfiguration>,
}
impl Builder {
pub fn app_instance_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_arn = Some(input.into());
self
}
pub fn set_app_instance_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_arn = 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 mode(mut self, input: crate::model::ChannelMode) -> Self {
self.mode = Some(input);
self
}
pub fn set_mode(mut self, input: std::option::Option<crate::model::ChannelMode>) -> Self {
self.mode = input;
self
}
pub fn privacy(mut self, input: crate::model::ChannelPrivacy) -> Self {
self.privacy = Some(input);
self
}
pub fn set_privacy(
mut self,
input: std::option::Option<crate::model::ChannelPrivacy>,
) -> Self {
self.privacy = input;
self
}
pub fn metadata(mut self, input: impl Into<std::string::String>) -> Self {
self.metadata = Some(input.into());
self
}
pub fn set_metadata(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metadata = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_id = Some(input.into());
self
}
pub fn set_channel_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_id = input;
self
}
pub fn member_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.member_arns.unwrap_or_default();
v.push(input.into());
self.member_arns = Some(v);
self
}
pub fn set_member_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.member_arns = input;
self
}
pub fn moderator_arns(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.moderator_arns.unwrap_or_default();
v.push(input.into());
self.moderator_arns = Some(v);
self
}
pub fn set_moderator_arns(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.moderator_arns = input;
self
}
pub fn elastic_channel_configuration(
mut self,
input: crate::model::ElasticChannelConfiguration,
) -> Self {
self.elastic_channel_configuration = Some(input);
self
}
pub fn set_elastic_channel_configuration(
mut self,
input: std::option::Option<crate::model::ElasticChannelConfiguration>,
) -> Self {
self.elastic_channel_configuration = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreateChannelInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreateChannelInput {
app_instance_arn: self.app_instance_arn,
name: self.name,
mode: self.mode,
privacy: self.privacy,
metadata: self.metadata,
client_request_token: self.client_request_token,
tags: self.tags,
chime_bearer: self.chime_bearer,
channel_id: self.channel_id,
member_arns: self.member_arns,
moderator_arns: self.moderator_arns,
elastic_channel_configuration: self.elastic_channel_configuration,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("mode", &self.mode);
formatter.field("privacy", &self.privacy);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("channel_id", &"*** Sensitive Data Redacted ***");
formatter.field("member_arns", &self.member_arns);
formatter.field("moderator_arns", &self.moderator_arns);
formatter.field(
"elastic_channel_configuration",
&self.elastic_channel_configuration,
);
formatter.finish()
}
}
}
impl CreateChannelInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::CreateChannel,
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),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateChannelInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateChannelInput,
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)?;
let builder = crate::http_serde::add_headers_create_channel(input, builder)?;
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_channel(&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::CreateChannel::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateChannel",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_channel_input::Builder {
crate::input::create_channel_input::Builder::default()
}
}
pub mod create_channel_ban_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateChannelBanInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateChannelBanInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl CreateChannelBanInput {
#[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::CreateChannelBan,
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::CreateChannelBanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_4 = &_input.channel_arn;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/bans",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateChannelBanInput,
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)?;
let builder = crate::http_serde::add_headers_create_channel_ban(input, builder)?;
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_channel_ban(&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::CreateChannelBan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateChannelBan",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_channel_ban_input::Builder {
crate::input::create_channel_ban_input::Builder::default()
}
}
pub mod create_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_arn: std::option::Option<std::string::String>,
pub(crate) processors: std::option::Option<std::vec::Vec<crate::model::Processor>>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_instance_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_arn = Some(input.into());
self
}
pub fn set_app_instance_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_arn = input;
self
}
pub fn processors(mut self, input: crate::model::Processor) -> Self {
let mut v = self.processors.unwrap_or_default();
v.push(input);
self.processors = Some(v);
self
}
pub fn set_processors(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Processor>>,
) -> Self {
self.processors = 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 tags(mut self, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> Self {
self.tags = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateChannelFlowInput {
app_instance_arn: self.app_instance_arn,
processors: self.processors,
name: self.name,
tags: self.tags,
client_request_token: self.client_request_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("processors", &self.processors);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl CreateChannelFlowInput {
#[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::CreateChannelFlow,
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::CreateChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channel-flows").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateChannelFlowInput,
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_channel_flow(&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::CreateChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_channel_flow_input::Builder {
crate::input::create_channel_flow_input::Builder::default()
}
}
pub mod create_channel_membership_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::ChannelMembershipType>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn r#type(mut self, input: crate::model::ChannelMembershipType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::ChannelMembershipType>,
) -> Self {
self.r#type = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateChannelMembershipInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateChannelMembershipInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
r#type: self.r#type,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl CreateChannelMembershipInput {
#[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::CreateChannelMembership,
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::CreateChannelMembershipInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.channel_arn;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateChannelMembershipInput,
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)?;
let builder =
crate::http_serde::add_headers_create_channel_membership(input, builder)?;
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_channel_membership(
&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::CreateChannelMembership::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateChannelMembership",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_channel_membership_input::Builder {
crate::input::create_channel_membership_input::Builder::default()
}
}
pub mod create_channel_moderator_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) channel_moderator_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn channel_moderator_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_moderator_arn = Some(input.into());
self
}
pub fn set_channel_moderator_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_moderator_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateChannelModeratorInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateChannelModeratorInput {
channel_arn: self.channel_arn,
channel_moderator_arn: self.channel_moderator_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl CreateChannelModeratorInput {
#[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::CreateChannelModerator,
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::CreateChannelModeratorInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_6 = &_input.channel_arn;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/moderators",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateChannelModeratorInput,
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)?;
let builder =
crate::http_serde::add_headers_create_channel_moderator(input, builder)?;
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_channel_moderator(
&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::CreateChannelModerator::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateChannelModerator",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_channel_moderator_input::Builder {
crate::input::create_channel_moderator_input::Builder::default()
}
}
pub mod delete_channel_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteChannelInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteChannelInput {
channel_arn: self.channel_arn,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl DeleteChannelInput {
#[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::DeleteChannel,
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::DeleteChannelInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_7 = &_input.channel_arn;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteChannelInput,
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_8) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_8),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelInput,
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)?;
let builder = crate::http_serde::add_headers_delete_channel(input, builder)?;
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::DeleteChannel::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannel",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_input::Builder {
crate::input::delete_channel_input::Builder::default()
}
}
pub mod delete_channel_ban_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteChannelBanInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteChannelBanInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DeleteChannelBanInput {
#[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::DeleteChannelBan,
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::DeleteChannelBanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.channel_arn;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_10 = &_input.member_arn;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/bans/{MemberArn}",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelBanInput,
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)?;
let builder = crate::http_serde::add_headers_delete_channel_ban(input, builder)?;
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::DeleteChannelBan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannelBan",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_ban_input::Builder {
crate::input::delete_channel_ban_input::Builder::default()
}
}
pub mod delete_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_flow_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteChannelFlowInput {
channel_flow_arn: self.channel_flow_arn,
})
}
}
}
impl DeleteChannelFlowInput {
#[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::DeleteChannelFlow,
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::DeleteChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.channel_flow_arn;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
)
})?;
let channel_flow_arn = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_flow_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channel-flows/{ChannelFlowArn}",
ChannelFlowArn = channel_flow_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelFlowInput,
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::DeleteChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_flow_input::Builder {
crate::input::delete_channel_flow_input::Builder::default()
}
}
pub mod delete_channel_membership_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteChannelMembershipInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteChannelMembershipInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl DeleteChannelMembershipInput {
#[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::DeleteChannelMembership,
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::DeleteChannelMembershipInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.channel_arn;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_13 = &_input.member_arn;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships/{MemberArn}",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteChannelMembershipInput,
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_14) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_14),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelMembershipInput,
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)?;
let builder =
crate::http_serde::add_headers_delete_channel_membership(input, builder)?;
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::DeleteChannelMembership::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannelMembership",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_membership_input::Builder {
crate::input::delete_channel_membership_input::Builder::default()
}
}
pub mod delete_channel_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) message_id: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_id = Some(input.into());
self
}
pub fn set_message_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_id = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteChannelMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteChannelMessageInput {
channel_arn: self.channel_arn,
message_id: self.message_id,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl DeleteChannelMessageInput {
#[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::DeleteChannelMessage,
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::DeleteChannelMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_15 = &_input.channel_arn;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_16 = &_input.message_id;
let input_16 = input_16.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
)
})?;
let message_id = aws_smithy_http::label::fmt_string(
input_16,
aws_smithy_http::label::EncodingStrategy::Default,
);
if message_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages/{MessageId}",
ChannelArn = channel_arn,
MessageId = message_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DeleteChannelMessageInput,
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_17) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_17),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelMessageInput,
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)?;
let builder =
crate::http_serde::add_headers_delete_channel_message(input, builder)?;
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::DeleteChannelMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannelMessage",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_message_input::Builder {
crate::input::delete_channel_message_input::Builder::default()
}
}
pub mod delete_channel_moderator_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) channel_moderator_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn channel_moderator_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_moderator_arn = Some(input.into());
self
}
pub fn set_channel_moderator_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_moderator_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteChannelModeratorInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteChannelModeratorInput {
channel_arn: self.channel_arn,
channel_moderator_arn: self.channel_moderator_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DeleteChannelModeratorInput {
#[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::DeleteChannelModerator,
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::DeleteChannelModeratorInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_18 = &_input.channel_arn;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_19 = &_input.channel_moderator_arn;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_moderator_arn",
"cannot be empty or unset",
)
})?;
let channel_moderator_arn = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_moderator_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_moderator_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/moderators/{ChannelModeratorArn}",
ChannelArn = channel_arn,
ChannelModeratorArn = channel_moderator_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteChannelModeratorInput,
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)?;
let builder =
crate::http_serde::add_headers_delete_channel_moderator(input, builder)?;
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::DeleteChannelModerator::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteChannelModerator",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_channel_moderator_input::Builder {
crate::input::delete_channel_moderator_input::Builder::default()
}
}
pub mod describe_channel_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DescribeChannelInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeChannelInput {
channel_arn: self.channel_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DescribeChannelInput {
#[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::DescribeChannel,
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::DescribeChannelInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_20 = &_input.channel_arn;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelInput,
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)?;
let builder = crate::http_serde::add_headers_describe_channel(input, builder)?;
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::DescribeChannel::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannel",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_input::Builder {
crate::input::describe_channel_input::Builder::default()
}
}
pub mod describe_channel_ban_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelBanInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeChannelBanInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DescribeChannelBanInput {
#[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::DescribeChannelBan,
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::DescribeChannelBanInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_21 = &_input.channel_arn;
let input_21 = input_21.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_21,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_22 = &_input.member_arn;
let input_22 = input_22.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_22,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/bans/{MemberArn}",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelBanInput,
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)?;
let builder = crate::http_serde::add_headers_describe_channel_ban(input, builder)?;
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::DescribeChannelBan::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelBan",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_ban_input::Builder {
crate::input::describe_channel_ban_input::Builder::default()
}
}
pub mod describe_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_flow_arn: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_arn = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeChannelFlowInput {
channel_flow_arn: self.channel_flow_arn,
})
}
}
}
impl DescribeChannelFlowInput {
#[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::DescribeChannelFlow,
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::DescribeChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_23 = &_input.channel_flow_arn;
let input_23 = input_23.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
)
})?;
let channel_flow_arn = aws_smithy_http::label::fmt_string(
input_23,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_flow_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channel-flows/{ChannelFlowArn}",
ChannelFlowArn = channel_flow_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelFlowInput,
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::DescribeChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_flow_input::Builder {
crate::input::describe_channel_flow_input::Builder::default()
}
}
pub mod describe_channel_membership_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelMembershipInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeChannelMembershipInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl DescribeChannelMembershipInput {
#[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::DescribeChannelMembership,
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::DescribeChannelMembershipInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_24 = &_input.channel_arn;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_25 = &_input.member_arn;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships/{MemberArn}",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DescribeChannelMembershipInput,
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_26) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_26),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelMembershipInput,
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)?;
let builder =
crate::http_serde::add_headers_describe_channel_membership(input, builder)?;
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::DescribeChannelMembership::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelMembership",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_membership_input::Builder {
crate::input::describe_channel_membership_input::Builder::default()
}
}
pub mod describe_channel_membership_for_app_instance_user_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) app_instance_user_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn app_instance_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_user_arn = Some(input.into());
self
}
pub fn set_app_instance_user_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_user_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelMembershipForAppInstanceUserInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::DescribeChannelMembershipForAppInstanceUserInput {
channel_arn: self.channel_arn,
app_instance_user_arn: self.app_instance_user_arn,
chime_bearer: self.chime_bearer,
},
)
}
}
}
impl DescribeChannelMembershipForAppInstanceUserInput {
#[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::DescribeChannelMembershipForAppInstanceUser,
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::DescribeChannelMembershipForAppInstanceUserInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.channel_arn;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DescribeChannelMembershipForAppInstanceUserInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "app-instance-user-membership");
let inner_28 = &_input.app_instance_user_arn;
let inner_28 = inner_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_user_arn",
"cannot be empty or unset",
)
})?;
if inner_28.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_user_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"app-instance-user-arn",
&aws_smithy_http::query::fmt_string(&inner_28),
);
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelMembershipForAppInstanceUserInput,
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)?;
let builder = crate::http_serde::add_headers_describe_channel_membership_for_app_instance_user(input, builder)?;
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::DescribeChannelMembershipForAppInstanceUser::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelMembershipForAppInstanceUser",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder(
) -> crate::input::describe_channel_membership_for_app_instance_user_input::Builder {
crate::input::describe_channel_membership_for_app_instance_user_input::Builder::default()
}
}
pub mod describe_channel_moderated_by_app_instance_user_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) app_instance_user_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn app_instance_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_user_arn = Some(input.into());
self
}
pub fn set_app_instance_user_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_user_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelModeratedByAppInstanceUserInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::DescribeChannelModeratedByAppInstanceUserInput {
channel_arn: self.channel_arn,
app_instance_user_arn: self.app_instance_user_arn,
chime_bearer: self.chime_bearer,
},
)
}
}
}
impl DescribeChannelModeratedByAppInstanceUserInput {
#[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::DescribeChannelModeratedByAppInstanceUser,
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::DescribeChannelModeratedByAppInstanceUserInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_29 = &_input.channel_arn;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::DescribeChannelModeratedByAppInstanceUserInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "app-instance-user-moderated-channel");
let inner_30 = &_input.app_instance_user_arn;
let inner_30 = inner_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_user_arn",
"cannot be empty or unset",
)
})?;
if inner_30.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_user_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"app-instance-user-arn",
&aws_smithy_http::query::fmt_string(&inner_30),
);
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelModeratedByAppInstanceUserInput,
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)?;
let builder =
crate::http_serde::add_headers_describe_channel_moderated_by_app_instance_user(
input, builder,
)?;
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::DescribeChannelModeratedByAppInstanceUser::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelModeratedByAppInstanceUser",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_moderated_by_app_instance_user_input::Builder
{
crate::input::describe_channel_moderated_by_app_instance_user_input::Builder::default()
}
}
pub mod describe_channel_moderator_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) channel_moderator_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn channel_moderator_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_moderator_arn = Some(input.into());
self
}
pub fn set_channel_moderator_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_moderator_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeChannelModeratorInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeChannelModeratorInput {
channel_arn: self.channel_arn,
channel_moderator_arn: self.channel_moderator_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DescribeChannelModeratorInput {
#[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::DescribeChannelModerator,
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::DescribeChannelModeratorInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_31 = &_input.channel_arn;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_32 = &_input.channel_moderator_arn;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_moderator_arn",
"cannot be empty or unset",
)
})?;
let channel_moderator_arn = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_moderator_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_moderator_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/moderators/{ChannelModeratorArn}",
ChannelArn = channel_arn,
ChannelModeratorArn = channel_moderator_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeChannelModeratorInput,
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)?;
let builder =
crate::http_serde::add_headers_describe_channel_moderator(input, builder)?;
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::DescribeChannelModerator::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeChannelModerator",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_channel_moderator_input::Builder {
crate::input::describe_channel_moderator_input::Builder::default()
}
}
pub mod disassociate_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) channel_flow_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateChannelFlowInput {
channel_arn: self.channel_arn,
channel_flow_arn: self.channel_flow_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl DisassociateChannelFlowInput {
#[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::DisassociateChannelFlow,
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::DisassociateChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_33 = &_input.channel_arn;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_34 = &_input.channel_flow_arn;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
)
})?;
let channel_flow_arn = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_flow_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/channel-flow/{ChannelFlowArn}",
ChannelArn = channel_arn,
ChannelFlowArn = channel_flow_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateChannelFlowInput,
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)?;
let builder =
crate::http_serde::add_headers_disassociate_channel_flow(input, builder)?;
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::DisassociateChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_channel_flow_input::Builder {
crate::input::disassociate_channel_flow_input::Builder::default()
}
}
pub mod get_channel_membership_preferences_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetChannelMembershipPreferencesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetChannelMembershipPreferencesInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
})
}
}
}
impl GetChannelMembershipPreferencesInput {
#[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::GetChannelMembershipPreferences,
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::GetChannelMembershipPreferencesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_35 = &_input.channel_arn;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_36 = &_input.member_arn;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships/{MemberArn}/preferences",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetChannelMembershipPreferencesInput,
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)?;
let builder = crate::http_serde::add_headers_get_channel_membership_preferences(
input, builder,
)?;
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::GetChannelMembershipPreferences::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetChannelMembershipPreferences",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_channel_membership_preferences_input::Builder {
crate::input::get_channel_membership_preferences_input::Builder::default()
}
}
pub mod get_channel_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) message_id: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_id = Some(input.into());
self
}
pub fn set_message_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_id = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetChannelMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetChannelMessageInput {
channel_arn: self.channel_arn,
message_id: self.message_id,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl GetChannelMessageInput {
#[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::GetChannelMessage,
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::GetChannelMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_37 = &_input.channel_arn;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_38 = &_input.message_id;
let input_38 = input_38.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
)
})?;
let message_id = aws_smithy_http::label::fmt_string(
input_38,
aws_smithy_http::label::EncodingStrategy::Default,
);
if message_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages/{MessageId}",
ChannelArn = channel_arn,
MessageId = message_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetChannelMessageInput,
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_39) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_39),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetChannelMessageInput,
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)?;
let builder = crate::http_serde::add_headers_get_channel_message(input, builder)?;
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::GetChannelMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetChannelMessage",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_channel_message_input::Builder {
crate::input::get_channel_message_input::Builder::default()
}
}
pub mod get_channel_message_status_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) message_id: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_id = Some(input.into());
self
}
pub fn set_message_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_id = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetChannelMessageStatusInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetChannelMessageStatusInput {
channel_arn: self.channel_arn,
message_id: self.message_id,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl GetChannelMessageStatusInput {
#[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::GetChannelMessageStatus,
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::GetChannelMessageStatusInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_40 = &_input.channel_arn;
let input_40 = input_40.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_40,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_41 = &_input.message_id;
let input_41 = input_41.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
)
})?;
let message_id = aws_smithy_http::label::fmt_string(
input_41,
aws_smithy_http::label::EncodingStrategy::Default,
);
if message_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages/{MessageId}",
ChannelArn = channel_arn,
MessageId = message_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::GetChannelMessageStatusInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "message-status");
if let Some(inner_42) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_42),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetChannelMessageStatusInput,
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)?;
let builder =
crate::http_serde::add_headers_get_channel_message_status(input, builder)?;
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::GetChannelMessageStatus::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetChannelMessageStatus",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_channel_message_status_input::Builder {
crate::input::get_channel_message_status_input::Builder::default()
}
}
pub mod get_messaging_session_endpoint_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {}
impl Builder {
pub fn build(
self,
) -> Result<
crate::input::GetMessagingSessionEndpointInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetMessagingSessionEndpointInput {})
}
}
}
impl GetMessagingSessionEndpointInput {
#[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::GetMessagingSessionEndpoint,
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::GetMessagingSessionEndpointInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/endpoints/messaging-session").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetMessagingSessionEndpointInput,
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::GetMessagingSessionEndpoint::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetMessagingSessionEndpoint",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_messaging_session_endpoint_input::Builder {
crate::input::get_messaging_session_endpoint_input::Builder::default()
}
}
pub mod list_channel_bans_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_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>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListChannelBansInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListChannelBansInput {
channel_arn: self.channel_arn,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl ListChannelBansInput {
#[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::ListChannelBans,
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::ListChannelBansInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_43 = &_input.channel_arn;
let input_43 = input_43.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_43,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/bans",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelBansInput,
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_44) = &_input.max_results {
if *inner_44 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_44).encode(),
);
}
}
if let Some(inner_45) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_45));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelBansInput,
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)?;
let builder = crate::http_serde::add_headers_list_channel_bans(input, builder)?;
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::ListChannelBans::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelBans",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_bans_input::Builder {
crate::input::list_channel_bans_input::Builder::default()
}
}
pub mod list_channel_flows_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_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 app_instance_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_arn = Some(input.into());
self
}
pub fn set_app_instance_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_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::ListChannelFlowsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelFlowsInput {
app_instance_arn: self.app_instance_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl ListChannelFlowsInput {
#[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::ListChannelFlows,
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::ListChannelFlowsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channel-flows").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelFlowsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_46 = &_input.app_instance_arn;
let inner_46 = inner_46.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_arn",
"cannot be empty or unset",
)
})?;
if inner_46.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"app-instance-arn",
&aws_smithy_http::query::fmt_string(&inner_46),
);
if let Some(inner_47) = &_input.max_results {
if *inner_47 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_47).encode(),
);
}
}
if let Some(inner_48) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_48));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelFlowsInput,
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::ListChannelFlows::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelFlows",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_flows_input::Builder {
crate::input::list_channel_flows_input::Builder::default()
}
}
pub mod list_channel_memberships_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::ChannelMembershipType>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn r#type(mut self, input: crate::model::ChannelMembershipType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::ChannelMembershipType>,
) -> Self {
self.r#type = 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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListChannelMembershipsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelMembershipsInput {
channel_arn: self.channel_arn,
r#type: self.r#type,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("r#type", &self.r#type);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
}
impl ListChannelMembershipsInput {
#[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::ListChannelMemberships,
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::ListChannelMembershipsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_49 = &_input.channel_arn;
let input_49 = input_49.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_49,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelMembershipsInput,
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_50) = &_input.r#type {
{
query.push_kv("type", &aws_smithy_http::query::fmt_string(&inner_50));
}
}
if let Some(inner_51) = &_input.max_results {
if *inner_51 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_51).encode(),
);
}
}
if let Some(inner_52) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_52));
}
}
if let Some(inner_53) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_53),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelMembershipsInput,
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)?;
let builder =
crate::http_serde::add_headers_list_channel_memberships(input, builder)?;
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::ListChannelMemberships::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelMemberships",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_memberships_input::Builder {
crate::input::list_channel_memberships_input::Builder::default()
}
}
pub mod list_channel_memberships_for_app_instance_user_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_user_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>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_instance_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_user_arn = Some(input.into());
self
}
pub fn set_app_instance_user_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_user_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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListChannelMembershipsForAppInstanceUserInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(
crate::input::ListChannelMembershipsForAppInstanceUserInput {
app_instance_user_arn: self.app_instance_user_arn,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
},
)
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_user_arn", &self.app_instance_user_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl ListChannelMembershipsForAppInstanceUserInput {
#[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::ListChannelMembershipsForAppInstanceUser,
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::ListChannelMembershipsForAppInstanceUserInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelMembershipsForAppInstanceUserInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "app-instance-user-memberships");
if let Some(inner_54) = &_input.app_instance_user_arn {
{
query.push_kv(
"app-instance-user-arn",
&aws_smithy_http::query::fmt_string(&inner_54),
);
}
}
if let Some(inner_55) = &_input.max_results {
if *inner_55 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_55).encode(),
);
}
}
if let Some(inner_56) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_56));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelMembershipsForAppInstanceUserInput,
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)?;
let builder =
crate::http_serde::add_headers_list_channel_memberships_for_app_instance_user(
input, builder,
)?;
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::ListChannelMembershipsForAppInstanceUser::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelMembershipsForAppInstanceUser",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_memberships_for_app_instance_user_input::Builder
{
crate::input::list_channel_memberships_for_app_instance_user_input::Builder::default()
}
}
pub mod list_channel_messages_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) sort_order: std::option::Option<crate::model::SortOrder>,
pub(crate) not_before: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) not_after: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn sort_order(mut self, input: crate::model::SortOrder) -> Self {
self.sort_order = Some(input);
self
}
pub fn set_sort_order(
mut self,
input: std::option::Option<crate::model::SortOrder>,
) -> Self {
self.sort_order = input;
self
}
pub fn not_before(mut self, input: aws_smithy_types::DateTime) -> Self {
self.not_before = Some(input);
self
}
pub fn set_not_before(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.not_before = input;
self
}
pub fn not_after(mut self, input: aws_smithy_types::DateTime) -> Self {
self.not_after = Some(input);
self
}
pub fn set_not_after(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.not_after = 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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListChannelMessagesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelMessagesInput {
channel_arn: self.channel_arn,
sort_order: self.sort_order,
not_before: self.not_before,
not_after: self.not_after,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("sort_order", &self.sort_order);
formatter.field("not_before", &self.not_before);
formatter.field("not_after", &self.not_after);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
}
impl ListChannelMessagesInput {
#[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::ListChannelMessages,
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::ListChannelMessagesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_57 = &_input.channel_arn;
let input_57 = input_57.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_57,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelMessagesInput,
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_58) = &_input.sort_order {
{
query.push_kv("sort-order", &aws_smithy_http::query::fmt_string(&inner_58));
}
}
if let Some(inner_59) = &_input.not_before {
{
query.push_kv(
"not-before",
&aws_smithy_http::query::fmt_timestamp(
inner_59,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_60) = &_input.not_after {
{
query.push_kv(
"not-after",
&aws_smithy_http::query::fmt_timestamp(
inner_60,
aws_smithy_types::date_time::Format::DateTime,
)?,
);
}
}
if let Some(inner_61) = &_input.max_results {
if *inner_61 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_61).encode(),
);
}
}
if let Some(inner_62) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_62));
}
}
if let Some(inner_63) = &_input.sub_channel_id {
{
query.push_kv(
"sub-channel-id",
&aws_smithy_http::query::fmt_string(&inner_63),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelMessagesInput,
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)?;
let builder = crate::http_serde::add_headers_list_channel_messages(input, builder)?;
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::ListChannelMessages::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelMessages",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_messages_input::Builder {
crate::input::list_channel_messages_input::Builder::default()
}
}
pub mod list_channel_moderators_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_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>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListChannelModeratorsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelModeratorsInput {
channel_arn: self.channel_arn,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl ListChannelModeratorsInput {
#[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::ListChannelModerators,
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::ListChannelModeratorsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_64 = &_input.channel_arn;
let input_64 = input_64.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_64,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/moderators",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelModeratorsInput,
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_65) = &_input.max_results {
if *inner_65 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_65).encode(),
);
}
}
if let Some(inner_66) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_66));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelModeratorsInput,
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)?;
let builder =
crate::http_serde::add_headers_list_channel_moderators(input, builder)?;
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::ListChannelModerators::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelModerators",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channel_moderators_input::Builder {
crate::input::list_channel_moderators_input::Builder::default()
}
}
pub mod list_channels_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_arn: std::option::Option<std::string::String>,
pub(crate) privacy: std::option::Option<crate::model::ChannelPrivacy>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_instance_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_arn = Some(input.into());
self
}
pub fn set_app_instance_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_arn = input;
self
}
pub fn privacy(mut self, input: crate::model::ChannelPrivacy) -> Self {
self.privacy = Some(input);
self
}
pub fn set_privacy(
mut self,
input: std::option::Option<crate::model::ChannelPrivacy>,
) -> Self {
self.privacy = 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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListChannelsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListChannelsInput {
app_instance_arn: self.app_instance_arn,
privacy: self.privacy,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("privacy", &self.privacy);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl ListChannelsInput {
#[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::ListChannels,
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::ListChannelsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_67 = &_input.app_instance_arn;
let inner_67 = inner_67.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_arn",
"cannot be empty or unset",
)
})?;
if inner_67.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"app_instance_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"app-instance-arn",
&aws_smithy_http::query::fmt_string(&inner_67),
);
if let Some(inner_68) = &_input.privacy {
{
query.push_kv("privacy", &aws_smithy_http::query::fmt_string(&inner_68));
}
}
if let Some(inner_69) = &_input.max_results {
if *inner_69 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_69).encode(),
);
}
}
if let Some(inner_70) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_70));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelsInput,
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)?;
let builder = crate::http_serde::add_headers_list_channels(input, builder)?;
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::ListChannels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannels",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channels_input::Builder {
crate::input::list_channels_input::Builder::default()
}
}
pub mod list_channels_associated_with_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_flow_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 channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_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::ListChannelsAssociatedWithChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelsAssociatedWithChannelFlowInput {
channel_flow_arn: self.channel_flow_arn,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_flow_arn", &self.channel_flow_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl ListChannelsAssociatedWithChannelFlowInput {
#[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::ListChannelsAssociatedWithChannelFlow,
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::ListChannelsAssociatedWithChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelsAssociatedWithChannelFlowInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "channel-flow-associations");
let inner_71 = &_input.channel_flow_arn;
let inner_71 = inner_71.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
)
})?;
if inner_71.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
),
);
}
query.push_kv(
"channel-flow-arn",
&aws_smithy_http::query::fmt_string(&inner_71),
);
if let Some(inner_72) = &_input.max_results {
if *inner_72 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_72).encode(),
);
}
}
if let Some(inner_73) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_73));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelsAssociatedWithChannelFlowInput,
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::ListChannelsAssociatedWithChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelsAssociatedWithChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channels_associated_with_channel_flow_input::Builder {
crate::input::list_channels_associated_with_channel_flow_input::Builder::default()
}
}
pub mod list_channels_moderated_by_app_instance_user_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) app_instance_user_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>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn app_instance_user_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.app_instance_user_arn = Some(input.into());
self
}
pub fn set_app_instance_user_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.app_instance_user_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 chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ListChannelsModeratedByAppInstanceUserInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListChannelsModeratedByAppInstanceUserInput {
app_instance_user_arn: self.app_instance_user_arn,
max_results: self.max_results,
next_token: self.next_token,
chime_bearer: self.chime_bearer,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("app_instance_user_arn", &self.app_instance_user_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl ListChannelsModeratedByAppInstanceUserInput {
#[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::ListChannelsModeratedByAppInstanceUser,
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::ListChannelsModeratedByAppInstanceUserInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListChannelsModeratedByAppInstanceUserInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("scope", "app-instance-user-moderated-channels");
if let Some(inner_74) = &_input.app_instance_user_arn {
{
query.push_kv(
"app-instance-user-arn",
&aws_smithy_http::query::fmt_string(&inner_74),
);
}
}
if let Some(inner_75) = &_input.max_results {
if *inner_75 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_75).encode(),
);
}
}
if let Some(inner_76) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_76));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListChannelsModeratedByAppInstanceUserInput,
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)?;
let builder =
crate::http_serde::add_headers_list_channels_moderated_by_app_instance_user(
input, builder,
)?;
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::ListChannelsModeratedByAppInstanceUser::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListChannelsModeratedByAppInstanceUser",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_channels_moderated_by_app_instance_user_input::Builder {
crate::input::list_channels_moderated_by_app_instance_user_input::Builder::default()
}
}
pub mod list_sub_channels_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: 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 channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = 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::ListSubChannelsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListSubChannelsInput {
channel_arn: self.channel_arn,
chime_bearer: self.chime_bearer,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl ListSubChannelsInput {
#[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::ListSubChannels,
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::ListSubChannelsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_77 = &_input.channel_arn;
let input_77 = input_77.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_77,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/subchannels",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListSubChannelsInput,
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_78) = &_input.max_results {
if *inner_78 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_78).encode(),
);
}
}
if let Some(inner_79) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_79));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListSubChannelsInput,
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)?;
let builder = crate::http_serde::add_headers_list_sub_channels(input, builder)?;
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::ListSubChannels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListSubChannels",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_sub_channels_input::Builder {
crate::input::list_sub_channels_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> {
write!(output, "/tags").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListTagsForResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
let inner_80 = &_input.resource_arn;
let inner_80 = inner_80.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
)
})?;
if inner_80.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"resource_arn",
"cannot be empty or unset",
),
);
}
query.push_kv("arn", &aws_smithy_http::query::fmt_string(&inner_80));
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)?;
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::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"chimesdkmessaging",
));
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 put_channel_membership_preferences_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) member_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) preferences: std::option::Option<crate::model::ChannelMembershipPreferences>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn member_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.member_arn = Some(input.into());
self
}
pub fn set_member_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.member_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn preferences(mut self, input: crate::model::ChannelMembershipPreferences) -> Self {
self.preferences = Some(input);
self
}
pub fn set_preferences(
mut self,
input: std::option::Option<crate::model::ChannelMembershipPreferences>,
) -> Self {
self.preferences = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutChannelMembershipPreferencesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutChannelMembershipPreferencesInput {
channel_arn: self.channel_arn,
member_arn: self.member_arn,
chime_bearer: self.chime_bearer,
preferences: self.preferences,
})
}
}
}
impl PutChannelMembershipPreferencesInput {
#[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::PutChannelMembershipPreferences,
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::PutChannelMembershipPreferencesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_81 = &_input.channel_arn;
let input_81 = input_81.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_81,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_82 = &_input.member_arn;
let input_82 = input_82.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
)
})?;
let member_arn = aws_smithy_http::label::fmt_string(
input_82,
aws_smithy_http::label::EncodingStrategy::Default,
);
if member_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"member_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/memberships/{MemberArn}/preferences",
ChannelArn = channel_arn,
MemberArn = member_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutChannelMembershipPreferencesInput,
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)?;
let builder = crate::http_serde::add_headers_put_channel_membership_preferences(
input, builder,
)?;
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_put_channel_membership_preferences(&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::PutChannelMembershipPreferences::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutChannelMembershipPreferences",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_channel_membership_preferences_input::Builder {
crate::input::put_channel_membership_preferences_input::Builder::default()
}
}
pub mod redact_channel_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) message_id: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_id = Some(input.into());
self
}
pub fn set_message_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_id = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RedactChannelMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RedactChannelMessageInput {
channel_arn: self.channel_arn,
message_id: self.message_id,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl RedactChannelMessageInput {
#[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::RedactChannelMessage,
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::RedactChannelMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_83 = &_input.channel_arn;
let input_83 = input_83.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_83,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_84 = &_input.message_id;
let input_84 = input_84.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
)
})?;
let message_id = aws_smithy_http::label::fmt_string(
input_84,
aws_smithy_http::label::EncodingStrategy::Default,
);
if message_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages/{MessageId}",
ChannelArn = channel_arn,
MessageId = message_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::RedactChannelMessageInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("operation", "redact");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RedactChannelMessageInput,
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)?;
let builder =
crate::http_serde::add_headers_redact_channel_message(input, builder)?;
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_redact_channel_message(
&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::RedactChannelMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RedactChannelMessage",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::redact_channel_message_input::Builder {
crate::input::redact_channel_message_input::Builder::default()
}
}
pub mod search_channels_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) fields: std::option::Option<std::vec::Vec<crate::model::SearchField>>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) next_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn fields(mut self, input: crate::model::SearchField) -> Self {
let mut v = self.fields.unwrap_or_default();
v.push(input);
self.fields = Some(v);
self
}
pub fn set_fields(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SearchField>>,
) -> Self {
self.fields = 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::SearchChannelsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::SearchChannelsInput {
chime_bearer: self.chime_bearer,
fields: self.fields,
max_results: self.max_results,
next_token: self.next_token,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("fields", &self.fields);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl SearchChannelsInput {
#[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::SearchChannels,
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::SearchChannelsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/channels").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::SearchChannelsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("operation", "search");
if let Some(inner_85) = &_input.max_results {
if *inner_85 != 0 {
query.push_kv(
"max-results",
aws_smithy_types::primitive::Encoder::from(*inner_85).encode(),
);
}
}
if let Some(inner_86) = &_input.next_token {
{
query.push_kv("next-token", &aws_smithy_http::query::fmt_string(&inner_86));
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SearchChannelsInput,
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)?;
let builder = crate::http_serde::add_headers_search_channels(input, builder)?;
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_search_channels(&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::SearchChannels::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SearchChannels",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::search_channels_input::Builder {
crate::input::search_channels_input::Builder::default()
}
}
pub mod send_channel_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) content: std::option::Option<std::string::String>,
pub(crate) r#type: std::option::Option<crate::model::ChannelMessageType>,
pub(crate) persistence: std::option::Option<crate::model::ChannelMessagePersistenceType>,
pub(crate) metadata: std::option::Option<std::string::String>,
pub(crate) client_request_token: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) push_notification:
std::option::Option<crate::model::PushNotificationConfiguration>,
pub(crate) message_attributes: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::MessageAttributeValue>,
>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn r#type(mut self, input: crate::model::ChannelMessageType) -> Self {
self.r#type = Some(input);
self
}
pub fn set_type(
mut self,
input: std::option::Option<crate::model::ChannelMessageType>,
) -> Self {
self.r#type = input;
self
}
pub fn persistence(mut self, input: crate::model::ChannelMessagePersistenceType) -> Self {
self.persistence = Some(input);
self
}
pub fn set_persistence(
mut self,
input: std::option::Option<crate::model::ChannelMessagePersistenceType>,
) -> Self {
self.persistence = input;
self
}
pub fn metadata(mut self, input: impl Into<std::string::String>) -> Self {
self.metadata = Some(input.into());
self
}
pub fn set_metadata(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metadata = input;
self
}
pub fn client_request_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_request_token = Some(input.into());
self
}
pub fn set_client_request_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_request_token = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn push_notification(
mut self,
input: crate::model::PushNotificationConfiguration,
) -> Self {
self.push_notification = Some(input);
self
}
pub fn set_push_notification(
mut self,
input: std::option::Option<crate::model::PushNotificationConfiguration>,
) -> Self {
self.push_notification = input;
self
}
pub fn message_attributes(
mut self,
k: impl Into<std::string::String>,
v: crate::model::MessageAttributeValue,
) -> Self {
let mut hash_map = self.message_attributes.unwrap_or_default();
hash_map.insert(k.into(), v);
self.message_attributes = Some(hash_map);
self
}
pub fn set_message_attributes(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::MessageAttributeValue>,
>,
) -> Self {
self.message_attributes = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SendChannelMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SendChannelMessageInput {
channel_arn: self.channel_arn,
content: self.content,
r#type: self.r#type,
persistence: self.persistence,
metadata: self.metadata,
client_request_token: self.client_request_token,
chime_bearer: self.chime_bearer,
push_notification: self.push_notification,
message_attributes: self.message_attributes,
sub_channel_id: self.sub_channel_id,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("r#type", &self.r#type);
formatter.field("persistence", &self.persistence);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("push_notification", &self.push_notification);
formatter.field("message_attributes", &self.message_attributes);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
}
impl SendChannelMessageInput {
#[allow(unused_mut)]
#[allow(clippy::let_and_return)]
#[allow(clippy::needless_borrow)]
pub async fn make_operation(
mut self,
_config: &crate::config::Config,
) -> std::result::Result<
aws_smithy_http::operation::Operation<
crate::operation::SendChannelMessage,
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),
};
if self.client_request_token.is_none() {
self.client_request_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::SendChannelMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_87 = &_input.channel_arn;
let input_87 = input_87.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_87,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SendChannelMessageInput,
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)?;
let builder = crate::http_serde::add_headers_send_channel_message(input, builder)?;
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_send_channel_message(&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::SendChannelMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SendChannelMessage",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::send_channel_message_input::Builder {
crate::input::send_channel_message_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::vec::Vec<crate::model::Tag>>,
}
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, input: crate::model::Tag) -> Self {
let mut v = self.tags.unwrap_or_default();
v.push(input);
self.tags = Some(v);
self
}
pub fn set_tags(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Tag>>,
) -> 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> {
write!(output, "/tags").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::TagResourceInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
query.push_kv("operation", "tag-resource");
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)?;
uri_query(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",
"chimesdkmessaging",
));
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> {
write!(output, "/tags").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);
query.push_kv("operation", "untag-resource");
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("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_untag_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::UntagResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UntagResource",
"chimesdkmessaging",
));
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_channel_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) name: std::option::Option<std::string::String>,
pub(crate) mode: std::option::Option<crate::model::ChannelMode>,
pub(crate) metadata: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = 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 mode(mut self, input: crate::model::ChannelMode) -> Self {
self.mode = Some(input);
self
}
pub fn set_mode(mut self, input: std::option::Option<crate::model::ChannelMode>) -> Self {
self.mode = input;
self
}
pub fn metadata(mut self, input: impl Into<std::string::String>) -> Self {
self.metadata = Some(input.into());
self
}
pub fn set_metadata(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metadata = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateChannelInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateChannelInput {
channel_arn: self.channel_arn,
name: self.name,
mode: self.mode,
metadata: self.metadata,
chime_bearer: self.chime_bearer,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("mode", &self.mode);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
}
impl UpdateChannelInput {
#[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::UpdateChannel,
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::UpdateChannelInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_88 = &_input.channel_arn;
let input_88 = input_88.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_88,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(output, "/channels/{ChannelArn}", ChannelArn = channel_arn)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateChannelInput,
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)?;
let builder = crate::http_serde::add_headers_update_channel(input, builder)?;
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_channel(&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::UpdateChannel::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateChannel",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_channel_input::Builder {
crate::input::update_channel_input::Builder::default()
}
}
pub mod update_channel_flow_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_flow_arn: std::option::Option<std::string::String>,
pub(crate) processors: std::option::Option<std::vec::Vec<crate::model::Processor>>,
pub(crate) name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_flow_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_flow_arn = Some(input.into());
self
}
pub fn set_channel_flow_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.channel_flow_arn = input;
self
}
pub fn processors(mut self, input: crate::model::Processor) -> Self {
let mut v = self.processors.unwrap_or_default();
v.push(input);
self.processors = Some(v);
self
}
pub fn set_processors(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::Processor>>,
) -> Self {
self.processors = 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 build(
self,
) -> Result<
crate::input::UpdateChannelFlowInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateChannelFlowInput {
channel_flow_arn: self.channel_flow_arn,
processors: self.processors,
name: self.name,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_flow_arn", &self.channel_flow_arn);
formatter.field("processors", &self.processors);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
}
impl UpdateChannelFlowInput {
#[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::UpdateChannelFlow,
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::UpdateChannelFlowInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_89 = &_input.channel_flow_arn;
let input_89 = input_89.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
)
})?;
let channel_flow_arn = aws_smithy_http::label::fmt_string(
input_89,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_flow_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_flow_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channel-flows/{ChannelFlowArn}",
ChannelFlowArn = channel_flow_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateChannelFlowInput,
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_channel_flow(&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::UpdateChannelFlow::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateChannelFlow",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_channel_flow_input::Builder {
crate::input::update_channel_flow_input::Builder::default()
}
}
pub mod update_channel_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) message_id: std::option::Option<std::string::String>,
pub(crate) content: std::option::Option<std::string::String>,
pub(crate) metadata: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn message_id(mut self, input: impl Into<std::string::String>) -> Self {
self.message_id = Some(input.into());
self
}
pub fn set_message_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_id = input;
self
}
pub fn content(mut self, input: impl Into<std::string::String>) -> Self {
self.content = Some(input.into());
self
}
pub fn set_content(mut self, input: std::option::Option<std::string::String>) -> Self {
self.content = input;
self
}
pub fn metadata(mut self, input: impl Into<std::string::String>) -> Self {
self.metadata = Some(input.into());
self
}
pub fn set_metadata(mut self, input: std::option::Option<std::string::String>) -> Self {
self.metadata = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateChannelMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateChannelMessageInput {
channel_arn: self.channel_arn,
message_id: self.message_id,
content: self.content,
metadata: self.metadata,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
impl std::fmt::Debug for Builder {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("Builder");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("message_id", &self.message_id);
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
}
impl UpdateChannelMessageInput {
#[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::UpdateChannelMessage,
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::UpdateChannelMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_90 = &_input.channel_arn;
let input_90 = input_90.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_90,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
let input_91 = &_input.message_id;
let input_91 = input_91.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
)
})?;
let message_id = aws_smithy_http::label::fmt_string(
input_91,
aws_smithy_http::label::EncodingStrategy::Default,
);
if message_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"message_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/messages/{MessageId}",
ChannelArn = channel_arn,
MessageId = message_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateChannelMessageInput,
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)?;
let builder =
crate::http_serde::add_headers_update_channel_message(input, builder)?;
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_channel_message(
&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::UpdateChannelMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateChannelMessage",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_channel_message_input::Builder {
crate::input::update_channel_message_input::Builder::default()
}
}
pub mod update_channel_read_marker_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) channel_arn: std::option::Option<std::string::String>,
pub(crate) chime_bearer: std::option::Option<std::string::String>,
pub(crate) sub_channel_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.channel_arn = Some(input.into());
self
}
pub fn set_channel_arn(mut self, input: std::option::Option<std::string::String>) -> Self {
self.channel_arn = input;
self
}
pub fn chime_bearer(mut self, input: impl Into<std::string::String>) -> Self {
self.chime_bearer = Some(input.into());
self
}
pub fn set_chime_bearer(mut self, input: std::option::Option<std::string::String>) -> Self {
self.chime_bearer = input;
self
}
pub fn sub_channel_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sub_channel_id = Some(input.into());
self
}
pub fn set_sub_channel_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sub_channel_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateChannelReadMarkerInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateChannelReadMarkerInput {
channel_arn: self.channel_arn,
chime_bearer: self.chime_bearer,
sub_channel_id: self.sub_channel_id,
})
}
}
}
impl UpdateChannelReadMarkerInput {
#[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::UpdateChannelReadMarker,
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::UpdateChannelReadMarkerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_92 = &_input.channel_arn;
let input_92 = input_92.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
)
})?;
let channel_arn = aws_smithy_http::label::fmt_string(
input_92,
aws_smithy_http::label::EncodingStrategy::Default,
);
if channel_arn.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"channel_arn",
"cannot be empty or unset",
),
);
}
write!(
output,
"/channels/{ChannelArn}/readMarker",
ChannelArn = channel_arn
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateChannelReadMarkerInput,
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)?;
let builder =
crate::http_serde::add_headers_update_channel_read_marker(input, builder)?;
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_channel_read_marker(
&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::UpdateChannelReadMarker::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateChannelReadMarker",
"chimesdkmessaging",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_channel_read_marker_input::Builder {
crate::input::update_channel_read_marker_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateChannelReadMarkerInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl UpdateChannelReadMarkerInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateChannelMessageInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub metadata: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl UpdateChannelMessageInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn message_id(&self) -> std::option::Option<&str> {
self.message_id.as_deref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
pub fn metadata(&self) -> std::option::Option<&str> {
self.metadata.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
impl std::fmt::Debug for UpdateChannelMessageInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateChannelMessageInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("message_id", &self.message_id);
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateChannelFlowInput {
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub processors: std::option::Option<std::vec::Vec<crate::model::Processor>>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
}
impl UpdateChannelFlowInput {
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
pub fn processors(&self) -> std::option::Option<&[crate::model::Processor]> {
self.processors.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
}
impl std::fmt::Debug for UpdateChannelFlowInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateChannelFlowInput");
formatter.field("channel_flow_arn", &self.channel_flow_arn);
formatter.field("processors", &self.processors);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct UpdateChannelInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub mode: std::option::Option<crate::model::ChannelMode>,
#[doc(hidden)]
pub metadata: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl UpdateChannelInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn mode(&self) -> std::option::Option<&crate::model::ChannelMode> {
self.mode.as_ref()
}
pub fn metadata(&self) -> std::option::Option<&str> {
self.metadata.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for UpdateChannelInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("UpdateChannelInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("mode", &self.mode);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[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::vec::Vec<crate::model::Tag>>,
}
impl TagResourceInput {
pub fn resource_arn(&self) -> std::option::Option<&str> {
self.resource_arn.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SendChannelMessageInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub content: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ChannelMessageType>,
#[doc(hidden)]
pub persistence: std::option::Option<crate::model::ChannelMessagePersistenceType>,
#[doc(hidden)]
pub metadata: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub push_notification: std::option::Option<crate::model::PushNotificationConfiguration>,
#[doc(hidden)]
pub message_attributes: std::option::Option<
std::collections::HashMap<std::string::String, crate::model::MessageAttributeValue>,
>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl SendChannelMessageInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn content(&self) -> std::option::Option<&str> {
self.content.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ChannelMessageType> {
self.r#type.as_ref()
}
pub fn persistence(&self) -> std::option::Option<&crate::model::ChannelMessagePersistenceType> {
self.persistence.as_ref()
}
pub fn metadata(&self) -> std::option::Option<&str> {
self.metadata.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn push_notification(
&self,
) -> std::option::Option<&crate::model::PushNotificationConfiguration> {
self.push_notification.as_ref()
}
pub fn message_attributes(
&self,
) -> std::option::Option<
&std::collections::HashMap<std::string::String, crate::model::MessageAttributeValue>,
> {
self.message_attributes.as_ref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
impl std::fmt::Debug for SendChannelMessageInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SendChannelMessageInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("content", &"*** Sensitive Data Redacted ***");
formatter.field("r#type", &self.r#type);
formatter.field("persistence", &self.persistence);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("push_notification", &self.push_notification);
formatter.field("message_attributes", &self.message_attributes);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct SearchChannelsInput {
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub fields: std::option::Option<std::vec::Vec<crate::model::SearchField>>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl SearchChannelsInput {
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn fields(&self) -> std::option::Option<&[crate::model::SearchField]> {
self.fields.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for SearchChannelsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("SearchChannelsInput");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("fields", &self.fields);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RedactChannelMessageInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl RedactChannelMessageInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn message_id(&self) -> std::option::Option<&str> {
self.message_id.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutChannelMembershipPreferencesInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub preferences: std::option::Option<crate::model::ChannelMembershipPreferences>,
}
impl PutChannelMembershipPreferencesInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn preferences(&self) -> std::option::Option<&crate::model::ChannelMembershipPreferences> {
self.preferences.as_ref()
}
}
#[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)]
pub struct ListSubChannelsInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListSubChannelsInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListSubChannelsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListSubChannelsInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelsModeratedByAppInstanceUserInput {
#[doc(hidden)]
pub app_instance_user_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl ListChannelsModeratedByAppInstanceUserInput {
pub fn app_instance_user_arn(&self) -> std::option::Option<&str> {
self.app_instance_user_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for ListChannelsModeratedByAppInstanceUserInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelsModeratedByAppInstanceUserInput");
formatter.field("app_instance_user_arn", &self.app_instance_user_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelsAssociatedWithChannelFlowInput {
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListChannelsAssociatedWithChannelFlowInput {
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListChannelsAssociatedWithChannelFlowInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelsAssociatedWithChannelFlowInput");
formatter.field("channel_flow_arn", &self.channel_flow_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelsInput {
#[doc(hidden)]
pub app_instance_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub privacy: std::option::Option<crate::model::ChannelPrivacy>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl ListChannelsInput {
pub fn app_instance_arn(&self) -> std::option::Option<&str> {
self.app_instance_arn.as_deref()
}
pub fn privacy(&self) -> std::option::Option<&crate::model::ChannelPrivacy> {
self.privacy.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for ListChannelsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelsInput");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("privacy", &self.privacy);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelModeratorsInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl ListChannelModeratorsInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for ListChannelModeratorsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelModeratorsInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelMessagesInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sort_order: std::option::Option<crate::model::SortOrder>,
#[doc(hidden)]
pub not_before: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub not_after: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl ListChannelMessagesInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn sort_order(&self) -> std::option::Option<&crate::model::SortOrder> {
self.sort_order.as_ref()
}
pub fn not_before(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.not_before.as_ref()
}
pub fn not_after(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.not_after.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
impl std::fmt::Debug for ListChannelMessagesInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelMessagesInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("sort_order", &self.sort_order);
formatter.field("not_before", &self.not_before);
formatter.field("not_after", &self.not_after);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelMembershipsForAppInstanceUserInput {
#[doc(hidden)]
pub app_instance_user_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl ListChannelMembershipsForAppInstanceUserInput {
pub fn app_instance_user_arn(&self) -> std::option::Option<&str> {
self.app_instance_user_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for ListChannelMembershipsForAppInstanceUserInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelMembershipsForAppInstanceUserInput");
formatter.field("app_instance_user_arn", &self.app_instance_user_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelMembershipsInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ChannelMembershipType>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl ListChannelMembershipsInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ChannelMembershipType> {
self.r#type.as_ref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
impl std::fmt::Debug for ListChannelMembershipsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelMembershipsInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("r#type", &self.r#type);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("sub_channel_id", &self.sub_channel_id);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelFlowsInput {
#[doc(hidden)]
pub app_instance_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
}
impl ListChannelFlowsInput {
pub fn app_instance_arn(&self) -> std::option::Option<&str> {
self.app_instance_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
}
impl std::fmt::Debug for ListChannelFlowsInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelFlowsInput");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct ListChannelBansInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl ListChannelBansInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
impl std::fmt::Debug for ListChannelBansInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("ListChannelBansInput");
formatter.field("channel_arn", &self.channel_arn);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &"*** Sensitive Data Redacted ***");
formatter.field("chime_bearer", &self.chime_bearer);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetMessagingSessionEndpointInput {}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetChannelMessageStatusInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl GetChannelMessageStatusInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn message_id(&self) -> std::option::Option<&str> {
self.message_id.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetChannelMessageInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl GetChannelMessageInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn message_id(&self) -> std::option::Option<&str> {
self.message_id.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetChannelMembershipPreferencesInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl GetChannelMembershipPreferencesInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateChannelFlowInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DisassociateChannelFlowInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelModeratorInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_moderator_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DescribeChannelModeratorInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn channel_moderator_arn(&self) -> std::option::Option<&str> {
self.channel_moderator_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelModeratedByAppInstanceUserInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub app_instance_user_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DescribeChannelModeratedByAppInstanceUserInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn app_instance_user_arn(&self) -> std::option::Option<&str> {
self.app_instance_user_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelMembershipForAppInstanceUserInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub app_instance_user_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DescribeChannelMembershipForAppInstanceUserInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn app_instance_user_arn(&self) -> std::option::Option<&str> {
self.app_instance_user_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelMembershipInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl DescribeChannelMembershipInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelFlowInput {
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
}
impl DescribeChannelFlowInput {
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelBanInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DescribeChannelBanInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeChannelInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DescribeChannelInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelModeratorInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_moderator_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DeleteChannelModeratorInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn channel_moderator_arn(&self) -> std::option::Option<&str> {
self.channel_moderator_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelMessageInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl DeleteChannelMessageInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn message_id(&self) -> std::option::Option<&str> {
self.message_id.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelMembershipInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl DeleteChannelMembershipInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelFlowInput {
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
}
impl DeleteChannelFlowInput {
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelBanInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl DeleteChannelBanInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteChannelInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl DeleteChannelInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateChannelModeratorInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_moderator_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl CreateChannelModeratorInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn channel_moderator_arn(&self) -> std::option::Option<&str> {
self.channel_moderator_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateChannelMembershipInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ChannelMembershipType>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl CreateChannelMembershipInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ChannelMembershipType> {
self.r#type.as_ref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateChannelFlowInput {
#[doc(hidden)]
pub app_instance_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub processors: std::option::Option<std::vec::Vec<crate::model::Processor>>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
}
impl CreateChannelFlowInput {
pub fn app_instance_arn(&self) -> std::option::Option<&str> {
self.app_instance_arn.as_deref()
}
pub fn processors(&self) -> std::option::Option<&[crate::model::Processor]> {
self.processors.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
}
impl std::fmt::Debug for CreateChannelFlowInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateChannelFlowInput");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("processors", &self.processors);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateChannelBanInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl CreateChannelBanInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn member_arn(&self) -> std::option::Option<&str> {
self.member_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct CreateChannelInput {
#[doc(hidden)]
pub app_instance_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub mode: std::option::Option<crate::model::ChannelMode>,
#[doc(hidden)]
pub privacy: std::option::Option<crate::model::ChannelPrivacy>,
#[doc(hidden)]
pub metadata: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_request_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub member_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub moderator_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub elastic_channel_configuration:
std::option::Option<crate::model::ElasticChannelConfiguration>,
}
impl CreateChannelInput {
pub fn app_instance_arn(&self) -> std::option::Option<&str> {
self.app_instance_arn.as_deref()
}
pub fn name(&self) -> std::option::Option<&str> {
self.name.as_deref()
}
pub fn mode(&self) -> std::option::Option<&crate::model::ChannelMode> {
self.mode.as_ref()
}
pub fn privacy(&self) -> std::option::Option<&crate::model::ChannelPrivacy> {
self.privacy.as_ref()
}
pub fn metadata(&self) -> std::option::Option<&str> {
self.metadata.as_deref()
}
pub fn client_request_token(&self) -> std::option::Option<&str> {
self.client_request_token.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn channel_id(&self) -> std::option::Option<&str> {
self.channel_id.as_deref()
}
pub fn member_arns(&self) -> std::option::Option<&[std::string::String]> {
self.member_arns.as_deref()
}
pub fn moderator_arns(&self) -> std::option::Option<&[std::string::String]> {
self.moderator_arns.as_deref()
}
pub fn elastic_channel_configuration(
&self,
) -> std::option::Option<&crate::model::ElasticChannelConfiguration> {
self.elastic_channel_configuration.as_ref()
}
}
impl std::fmt::Debug for CreateChannelInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let mut formatter = f.debug_struct("CreateChannelInput");
formatter.field("app_instance_arn", &self.app_instance_arn);
formatter.field("name", &"*** Sensitive Data Redacted ***");
formatter.field("mode", &self.mode);
formatter.field("privacy", &self.privacy);
formatter.field("metadata", &"*** Sensitive Data Redacted ***");
formatter.field("client_request_token", &"*** Sensitive Data Redacted ***");
formatter.field("tags", &self.tags);
formatter.field("chime_bearer", &self.chime_bearer);
formatter.field("channel_id", &"*** Sensitive Data Redacted ***");
formatter.field("member_arns", &self.member_arns);
formatter.field("moderator_arns", &self.moderator_arns);
formatter.field(
"elastic_channel_configuration",
&self.elastic_channel_configuration,
);
formatter.finish()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ChannelFlowCallbackInput {
#[doc(hidden)]
pub callback_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub delete_resource: bool,
#[doc(hidden)]
pub channel_message: std::option::Option<crate::model::ChannelMessageCallback>,
}
impl ChannelFlowCallbackInput {
pub fn callback_id(&self) -> std::option::Option<&str> {
self.callback_id.as_deref()
}
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn delete_resource(&self) -> bool {
self.delete_resource
}
pub fn channel_message(&self) -> std::option::Option<&crate::model::ChannelMessageCallback> {
self.channel_message.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchCreateChannelMembershipInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub r#type: std::option::Option<crate::model::ChannelMembershipType>,
#[doc(hidden)]
pub member_arns: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sub_channel_id: std::option::Option<std::string::String>,
}
impl BatchCreateChannelMembershipInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn r#type(&self) -> std::option::Option<&crate::model::ChannelMembershipType> {
self.r#type.as_ref()
}
pub fn member_arns(&self) -> std::option::Option<&[std::string::String]> {
self.member_arns.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
pub fn sub_channel_id(&self) -> std::option::Option<&str> {
self.sub_channel_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateChannelFlowInput {
#[doc(hidden)]
pub channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub channel_flow_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub chime_bearer: std::option::Option<std::string::String>,
}
impl AssociateChannelFlowInput {
pub fn channel_arn(&self) -> std::option::Option<&str> {
self.channel_arn.as_deref()
}
pub fn channel_flow_arn(&self) -> std::option::Option<&str> {
self.channel_flow_arn.as_deref()
}
pub fn chime_bearer(&self) -> std::option::Option<&str> {
self.chime_bearer.as_deref()
}
}