use std::fmt::Write;
pub mod associate_origination_identity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_id: std::option::Option<std::string::String>,
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) iso_country_code: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn iso_country_code(mut self, input: impl Into<std::string::String>) -> Self {
self.iso_country_code = Some(input.into());
self
}
pub fn set_iso_country_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iso_country_code = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::AssociateOriginationIdentityInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::AssociateOriginationIdentityInput {
pool_id: self.pool_id,
origination_identity: self.origination_identity,
iso_country_code: self.iso_country_code,
client_token: self.client_token,
})
}
}
}
impl AssociateOriginationIdentityInput {
#[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::AssociateOriginationIdentity,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::AssociateOriginationIdentityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::AssociateOriginationIdentityInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.AssociateOriginationIdentity",
);
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_origination_identity(&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::AssociateOriginationIdentity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"AssociateOriginationIdentity",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::associate_origination_identity_input::Builder {
crate::input::associate_origination_identity_input::Builder::default()
}
}
pub mod create_configuration_set_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_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_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateConfigurationSetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateConfigurationSetInput {
configuration_set_name: self.configuration_set_name,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateConfigurationSetInput {
#[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::CreateConfigurationSet,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateConfigurationSetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateConfigurationSetInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.CreateConfigurationSet",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_create_configuration_set(
&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::CreateConfigurationSet::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateConfigurationSet",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_configuration_set_input::Builder {
crate::input::create_configuration_set_input::Builder::default()
}
}
pub mod create_event_destination_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) event_destination_name: std::option::Option<std::string::String>,
pub(crate) matching_event_types:
std::option::Option<std::vec::Vec<crate::model::EventType>>,
pub(crate) cloud_watch_logs_destination:
std::option::Option<crate::model::CloudWatchLogsDestination>,
pub(crate) kinesis_firehose_destination:
std::option::Option<crate::model::KinesisFirehoseDestination>,
pub(crate) sns_destination: std::option::Option<crate::model::SnsDestination>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn event_destination_name(mut self, input: impl Into<std::string::String>) -> Self {
self.event_destination_name = Some(input.into());
self
}
pub fn set_event_destination_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_destination_name = input;
self
}
pub fn matching_event_types(mut self, input: crate::model::EventType) -> Self {
let mut v = self.matching_event_types.unwrap_or_default();
v.push(input);
self.matching_event_types = Some(v);
self
}
pub fn set_matching_event_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::EventType>>,
) -> Self {
self.matching_event_types = input;
self
}
pub fn cloud_watch_logs_destination(
mut self,
input: crate::model::CloudWatchLogsDestination,
) -> Self {
self.cloud_watch_logs_destination = Some(input);
self
}
pub fn set_cloud_watch_logs_destination(
mut self,
input: std::option::Option<crate::model::CloudWatchLogsDestination>,
) -> Self {
self.cloud_watch_logs_destination = input;
self
}
pub fn kinesis_firehose_destination(
mut self,
input: crate::model::KinesisFirehoseDestination,
) -> Self {
self.kinesis_firehose_destination = Some(input);
self
}
pub fn set_kinesis_firehose_destination(
mut self,
input: std::option::Option<crate::model::KinesisFirehoseDestination>,
) -> Self {
self.kinesis_firehose_destination = input;
self
}
pub fn sns_destination(mut self, input: crate::model::SnsDestination) -> Self {
self.sns_destination = Some(input);
self
}
pub fn set_sns_destination(
mut self,
input: std::option::Option<crate::model::SnsDestination>,
) -> Self {
self.sns_destination = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateEventDestinationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateEventDestinationInput {
configuration_set_name: self.configuration_set_name,
event_destination_name: self.event_destination_name,
matching_event_types: self.matching_event_types,
cloud_watch_logs_destination: self.cloud_watch_logs_destination,
kinesis_firehose_destination: self.kinesis_firehose_destination,
sns_destination: self.sns_destination,
client_token: self.client_token,
})
}
}
}
impl CreateEventDestinationInput {
#[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::CreateEventDestination,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateEventDestinationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateEventDestinationInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.CreateEventDestination",
);
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_event_destination(
&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::CreateEventDestination::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateEventDestination",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_event_destination_input::Builder {
crate::input::create_event_destination_input::Builder::default()
}
}
pub mod create_opt_out_list_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_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_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::CreateOptOutListInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::CreateOptOutListInput {
opt_out_list_name: self.opt_out_list_name,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreateOptOutListInput {
#[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::CreateOptOutList,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreateOptOutListInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreateOptOutListInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.CreateOptOutList",
);
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_opt_out_list(&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::CreateOptOutList::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreateOptOutList",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_opt_out_list_input::Builder {
crate::input::create_opt_out_list_input::Builder::default()
}
}
pub mod create_pool_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) iso_country_code: std::option::Option<std::string::String>,
pub(crate) message_type: std::option::Option<crate::model::MessageType>,
pub(crate) deletion_protection_enabled: std::option::Option<bool>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn iso_country_code(mut self, input: impl Into<std::string::String>) -> Self {
self.iso_country_code = Some(input.into());
self
}
pub fn set_iso_country_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iso_country_code = input;
self
}
pub fn message_type(mut self, input: crate::model::MessageType) -> Self {
self.message_type = Some(input);
self
}
pub fn set_message_type(
mut self,
input: std::option::Option<crate::model::MessageType>,
) -> Self {
self.message_type = input;
self
}
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = Some(input);
self
}
pub fn set_deletion_protection_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = 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_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::CreatePoolInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::CreatePoolInput {
origination_identity: self.origination_identity,
iso_country_code: self.iso_country_code,
message_type: self.message_type,
deletion_protection_enabled: self.deletion_protection_enabled,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl CreatePoolInput {
#[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::CreatePool,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::CreatePoolInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::CreatePoolInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.CreatePool",
);
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_pool(&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::CreatePool::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"CreatePool",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::create_pool_input::Builder {
crate::input::create_pool_input::Builder::default()
}
}
pub mod delete_configuration_set_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteConfigurationSetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteConfigurationSetInput {
configuration_set_name: self.configuration_set_name,
})
}
}
}
impl DeleteConfigurationSetInput {
#[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::DeleteConfigurationSet,
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::DeleteConfigurationSetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteConfigurationSetInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteConfigurationSet",
);
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_delete_configuration_set(
&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::DeleteConfigurationSet::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteConfigurationSet",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_configuration_set_input::Builder {
crate::input::delete_configuration_set_input::Builder::default()
}
}
pub mod delete_default_message_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteDefaultMessageTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteDefaultMessageTypeInput {
configuration_set_name: self.configuration_set_name,
})
}
}
}
impl DeleteDefaultMessageTypeInput {
#[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::DeleteDefaultMessageType,
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::DeleteDefaultMessageTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDefaultMessageTypeInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteDefaultMessageType",
);
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_delete_default_message_type(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteDefaultMessageType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDefaultMessageType",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_default_message_type_input::Builder {
crate::input::delete_default_message_type_input::Builder::default()
}
}
pub mod delete_default_sender_id_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteDefaultSenderIdInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteDefaultSenderIdInput {
configuration_set_name: self.configuration_set_name,
})
}
}
}
impl DeleteDefaultSenderIdInput {
#[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::DeleteDefaultSenderId,
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::DeleteDefaultSenderIdInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDefaultSenderIdInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteDefaultSenderId",
);
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_delete_default_sender_id(
&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::DeleteDefaultSenderId::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDefaultSenderId",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_default_sender_id_input::Builder {
crate::input::delete_default_sender_id_input::Builder::default()
}
}
pub mod delete_event_destination_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) event_destination_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn event_destination_name(mut self, input: impl Into<std::string::String>) -> Self {
self.event_destination_name = Some(input.into());
self
}
pub fn set_event_destination_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_destination_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteEventDestinationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteEventDestinationInput {
configuration_set_name: self.configuration_set_name,
event_destination_name: self.event_destination_name,
})
}
}
}
impl DeleteEventDestinationInput {
#[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::DeleteEventDestination,
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::DeleteEventDestinationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteEventDestinationInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteEventDestination",
);
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_delete_event_destination(
&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::DeleteEventDestination::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteEventDestination",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_event_destination_input::Builder {
crate::input::delete_event_destination_input::Builder::default()
}
}
pub mod delete_keyword_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) keyword: std::option::Option<std::string::String>,
}
impl Builder {
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn keyword(mut self, input: impl Into<std::string::String>) -> Self {
self.keyword = Some(input.into());
self
}
pub fn set_keyword(mut self, input: std::option::Option<std::string::String>) -> Self {
self.keyword = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteKeywordInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteKeywordInput {
origination_identity: self.origination_identity,
keyword: self.keyword,
})
}
}
}
impl DeleteKeywordInput {
#[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::DeleteKeyword,
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::DeleteKeywordInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteKeywordInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteKeyword",
);
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_delete_keyword(&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::DeleteKeyword::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteKeyword",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_keyword_input::Builder {
crate::input::delete_keyword_input::Builder::default()
}
}
pub mod delete_opted_out_number_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) opted_out_number: std::option::Option<std::string::String>,
}
impl Builder {
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn opted_out_number(mut self, input: impl Into<std::string::String>) -> Self {
self.opted_out_number = Some(input.into());
self
}
pub fn set_opted_out_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opted_out_number = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteOptedOutNumberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteOptedOutNumberInput {
opt_out_list_name: self.opt_out_list_name,
opted_out_number: self.opted_out_number,
})
}
}
}
impl DeleteOptedOutNumberInput {
#[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::DeleteOptedOutNumber,
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::DeleteOptedOutNumberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteOptedOutNumberInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteOptedOutNumber",
);
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_delete_opted_out_number(
&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::DeleteOptedOutNumber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteOptedOutNumber",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_opted_out_number_input::Builder {
crate::input::delete_opted_out_number_input::Builder::default()
}
}
pub mod delete_opt_out_list_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DeleteOptOutListInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteOptOutListInput {
opt_out_list_name: self.opt_out_list_name,
})
}
}
}
impl DeleteOptOutListInput {
#[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::DeleteOptOutList,
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::DeleteOptOutListInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteOptOutListInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteOptOutList",
);
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_delete_opt_out_list(&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::DeleteOptOutList::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteOptOutList",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_opt_out_list_input::Builder {
crate::input::delete_opt_out_list_input::Builder::default()
}
}
pub mod delete_pool_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeletePoolInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeletePoolInput {
pool_id: self.pool_id,
})
}
}
}
impl DeletePoolInput {
#[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::DeletePool,
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::DeletePoolInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeletePoolInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeletePool",
);
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_delete_pool(&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::DeletePool::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeletePool",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_pool_input::Builder {
crate::input::delete_pool_input::Builder::default()
}
}
pub mod delete_text_message_spend_limit_override_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::DeleteTextMessageSpendLimitOverrideInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteTextMessageSpendLimitOverrideInput {})
}
}
}
impl DeleteTextMessageSpendLimitOverrideInput {
#[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::DeleteTextMessageSpendLimitOverride,
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::DeleteTextMessageSpendLimitOverrideInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteTextMessageSpendLimitOverrideInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteTextMessageSpendLimitOverride",
);
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_delete_text_message_spend_limit_override(&self)?
);
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::DeleteTextMessageSpendLimitOverride::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteTextMessageSpendLimitOverride",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_text_message_spend_limit_override_input::Builder {
crate::input::delete_text_message_spend_limit_override_input::Builder::default()
}
}
pub mod delete_voice_message_spend_limit_override_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::DeleteVoiceMessageSpendLimitOverrideInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DeleteVoiceMessageSpendLimitOverrideInput {})
}
}
}
impl DeleteVoiceMessageSpendLimitOverrideInput {
#[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::DeleteVoiceMessageSpendLimitOverride,
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::DeleteVoiceMessageSpendLimitOverrideInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteVoiceMessageSpendLimitOverrideInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DeleteVoiceMessageSpendLimitOverride",
);
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_delete_voice_message_spend_limit_override(&self)?
);
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::DeleteVoiceMessageSpendLimitOverride::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteVoiceMessageSpendLimitOverride",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_voice_message_spend_limit_override_input::Builder {
crate::input::delete_voice_message_spend_limit_override_input::Builder::default()
}
}
pub mod describe_account_attributes_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
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 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 build(
self,
) -> Result<
crate::input::DescribeAccountAttributesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeAccountAttributesInput {
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeAccountAttributesInput {
#[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::DescribeAccountAttributes,
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::DescribeAccountAttributesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeAccountAttributesInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeAccountAttributes",
);
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_describe_account_attributes(
&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::DescribeAccountAttributes::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeAccountAttributes",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_account_attributes_input::Builder {
crate::input::describe_account_attributes_input::Builder::default()
}
}
pub mod describe_account_limits_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
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 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 build(
self,
) -> Result<
crate::input::DescribeAccountLimitsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeAccountLimitsInput {
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeAccountLimitsInput {
#[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::DescribeAccountLimits,
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::DescribeAccountLimitsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeAccountLimitsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeAccountLimits",
);
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_describe_account_limits(
&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::DescribeAccountLimits::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeAccountLimits",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_account_limits_input::Builder {
crate::input::describe_account_limits_input::Builder::default()
}
}
pub mod describe_configuration_sets_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_names: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) filters:
std::option::Option<std::vec::Vec<crate::model::ConfigurationSetFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn configuration_set_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.configuration_set_names.unwrap_or_default();
v.push(input.into());
self.configuration_set_names = Some(v);
self
}
pub fn set_configuration_set_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.configuration_set_names = input;
self
}
pub fn filters(mut self, input: crate::model::ConfigurationSetFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::ConfigurationSetFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::DescribeConfigurationSetsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeConfigurationSetsInput {
configuration_set_names: self.configuration_set_names,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeConfigurationSetsInput {
#[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::DescribeConfigurationSets,
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::DescribeConfigurationSetsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeConfigurationSetsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeConfigurationSets",
);
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_describe_configuration_sets(
&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::DescribeConfigurationSets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeConfigurationSets",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_configuration_sets_input::Builder {
crate::input::describe_configuration_sets_input::Builder::default()
}
}
pub mod describe_keywords_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) keywords: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::KeywordFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn keywords(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.keywords.unwrap_or_default();
v.push(input.into());
self.keywords = Some(v);
self
}
pub fn set_keywords(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.keywords = input;
self
}
pub fn filters(mut self, input: crate::model::KeywordFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::KeywordFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::DescribeKeywordsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeKeywordsInput {
origination_identity: self.origination_identity,
keywords: self.keywords,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeKeywordsInput {
#[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::DescribeKeywords,
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::DescribeKeywordsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeKeywordsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeKeywords",
);
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_describe_keywords(&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::DescribeKeywords::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeKeywords",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_keywords_input::Builder {
crate::input::describe_keywords_input::Builder::default()
}
}
pub mod describe_opted_out_numbers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) opted_out_numbers: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::OptedOutFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn opted_out_numbers(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.opted_out_numbers.unwrap_or_default();
v.push(input.into());
self.opted_out_numbers = Some(v);
self
}
pub fn set_opted_out_numbers(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.opted_out_numbers = input;
self
}
pub fn filters(mut self, input: crate::model::OptedOutFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::OptedOutFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::DescribeOptedOutNumbersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeOptedOutNumbersInput {
opt_out_list_name: self.opt_out_list_name,
opted_out_numbers: self.opted_out_numbers,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeOptedOutNumbersInput {
#[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::DescribeOptedOutNumbers,
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::DescribeOptedOutNumbersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeOptedOutNumbersInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeOptedOutNumbers",
);
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_describe_opted_out_numbers(
&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::DescribeOptedOutNumbers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeOptedOutNumbers",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_opted_out_numbers_input::Builder {
crate::input::describe_opted_out_numbers_input::Builder::default()
}
}
pub mod describe_opt_out_lists_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_names: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn opt_out_list_names(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.opt_out_list_names.unwrap_or_default();
v.push(input.into());
self.opt_out_list_names = Some(v);
self
}
pub fn set_opt_out_list_names(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.opt_out_list_names = 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 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 build(
self,
) -> Result<
crate::input::DescribeOptOutListsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeOptOutListsInput {
opt_out_list_names: self.opt_out_list_names,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeOptOutListsInput {
#[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::DescribeOptOutLists,
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::DescribeOptOutListsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeOptOutListsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeOptOutLists",
);
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_describe_opt_out_lists(
&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::DescribeOptOutLists::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeOptOutLists",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_opt_out_lists_input::Builder {
crate::input::describe_opt_out_lists_input::Builder::default()
}
}
pub mod describe_phone_numbers_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) phone_number_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::PhoneNumberFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn phone_number_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.phone_number_ids.unwrap_or_default();
v.push(input.into());
self.phone_number_ids = Some(v);
self
}
pub fn set_phone_number_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.phone_number_ids = input;
self
}
pub fn filters(mut self, input: crate::model::PhoneNumberFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PhoneNumberFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::DescribePhoneNumbersInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribePhoneNumbersInput {
phone_number_ids: self.phone_number_ids,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribePhoneNumbersInput {
#[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::DescribePhoneNumbers,
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::DescribePhoneNumbersInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribePhoneNumbersInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribePhoneNumbers",
);
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_describe_phone_numbers(
&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::DescribePhoneNumbers::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribePhoneNumbers",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_phone_numbers_input::Builder {
crate::input::describe_phone_numbers_input::Builder::default()
}
}
pub mod describe_pools_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_ids: std::option::Option<std::vec::Vec<std::string::String>>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::PoolFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn pool_ids(mut self, input: impl Into<std::string::String>) -> Self {
let mut v = self.pool_ids.unwrap_or_default();
v.push(input.into());
self.pool_ids = Some(v);
self
}
pub fn set_pool_ids(
mut self,
input: std::option::Option<std::vec::Vec<std::string::String>>,
) -> Self {
self.pool_ids = input;
self
}
pub fn filters(mut self, input: crate::model::PoolFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::PoolFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<crate::input::DescribePoolsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribePoolsInput {
pool_ids: self.pool_ids,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribePoolsInput {
#[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::DescribePools,
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::DescribePoolsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribePoolsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribePools",
);
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_describe_pools(&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::DescribePools::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribePools",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_pools_input::Builder {
crate::input::describe_pools_input::Builder::default()
}
}
pub mod describe_sender_ids_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) sender_ids: std::option::Option<std::vec::Vec<crate::model::SenderIdAndCountry>>,
pub(crate) filters: std::option::Option<std::vec::Vec<crate::model::SenderIdFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn sender_ids(mut self, input: crate::model::SenderIdAndCountry) -> Self {
let mut v = self.sender_ids.unwrap_or_default();
v.push(input);
self.sender_ids = Some(v);
self
}
pub fn set_sender_ids(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SenderIdAndCountry>>,
) -> Self {
self.sender_ids = input;
self
}
pub fn filters(mut self, input: crate::model::SenderIdFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::SenderIdFilter>>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::DescribeSenderIdsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeSenderIdsInput {
sender_ids: self.sender_ids,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeSenderIdsInput {
#[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::DescribeSenderIds,
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::DescribeSenderIdsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSenderIdsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeSenderIds",
);
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_describe_sender_ids(&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::DescribeSenderIds::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSenderIds",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_sender_ids_input::Builder {
crate::input::describe_sender_ids_input::Builder::default()
}
}
pub mod describe_spend_limits_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
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 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 build(
self,
) -> Result<
crate::input::DescribeSpendLimitsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeSpendLimitsInput {
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl DescribeSpendLimitsInput {
#[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::DescribeSpendLimits,
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::DescribeSpendLimitsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeSpendLimitsInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DescribeSpendLimits",
);
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_describe_spend_limits(&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::DescribeSpendLimits::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeSpendLimits",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_spend_limits_input::Builder {
crate::input::describe_spend_limits_input::Builder::default()
}
}
pub mod disassociate_origination_identity_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_id: std::option::Option<std::string::String>,
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) iso_country_code: std::option::Option<std::string::String>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn iso_country_code(mut self, input: impl Into<std::string::String>) -> Self {
self.iso_country_code = Some(input.into());
self
}
pub fn set_iso_country_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iso_country_code = input;
self
}
pub fn client_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DisassociateOriginationIdentityInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DisassociateOriginationIdentityInput {
pool_id: self.pool_id,
origination_identity: self.origination_identity,
iso_country_code: self.iso_country_code,
client_token: self.client_token,
})
}
}
}
impl DisassociateOriginationIdentityInput {
#[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::DisassociateOriginationIdentity,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::DisassociateOriginationIdentityInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DisassociateOriginationIdentityInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.DisassociateOriginationIdentity",
);
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_disassociate_origination_identity(&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::DisassociateOriginationIdentity::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DisassociateOriginationIdentity",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::disassociate_origination_identity_input::Builder {
crate::input::disassociate_origination_identity_input::Builder::default()
}
}
pub mod list_pool_origination_identities_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_id: std::option::Option<std::string::String>,
pub(crate) filters:
std::option::Option<std::vec::Vec<crate::model::PoolOriginationIdentitiesFilter>>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
}
impl Builder {
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn filters(mut self, input: crate::model::PoolOriginationIdentitiesFilter) -> Self {
let mut v = self.filters.unwrap_or_default();
v.push(input);
self.filters = Some(v);
self
}
pub fn set_filters(
mut self,
input: std::option::Option<
std::vec::Vec<crate::model::PoolOriginationIdentitiesFilter>,
>,
) -> Self {
self.filters = 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 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 build(
self,
) -> Result<
crate::input::ListPoolOriginationIdentitiesInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListPoolOriginationIdentitiesInput {
pool_id: self.pool_id,
filters: self.filters,
next_token: self.next_token,
max_results: self.max_results,
})
}
}
}
impl ListPoolOriginationIdentitiesInput {
#[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::ListPoolOriginationIdentities,
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::ListPoolOriginationIdentitiesInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListPoolOriginationIdentitiesInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.ListPoolOriginationIdentities",
);
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_list_pool_origination_identities(&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::ListPoolOriginationIdentities::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListPoolOriginationIdentities",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_pool_origination_identities_input::Builder {
crate::input::list_pool_origination_identities_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, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListTagsForResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.ListTagsForResource",
);
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_list_tags_for_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::ListTagsForResource::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListTagsForResource",
"pinpointsmsvoicev2",
));
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_keyword_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) keyword: std::option::Option<std::string::String>,
pub(crate) keyword_message: std::option::Option<std::string::String>,
pub(crate) keyword_action: std::option::Option<crate::model::KeywordAction>,
}
impl Builder {
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn keyword(mut self, input: impl Into<std::string::String>) -> Self {
self.keyword = Some(input.into());
self
}
pub fn set_keyword(mut self, input: std::option::Option<std::string::String>) -> Self {
self.keyword = input;
self
}
pub fn keyword_message(mut self, input: impl Into<std::string::String>) -> Self {
self.keyword_message = Some(input.into());
self
}
pub fn set_keyword_message(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.keyword_message = input;
self
}
pub fn keyword_action(mut self, input: crate::model::KeywordAction) -> Self {
self.keyword_action = Some(input);
self
}
pub fn set_keyword_action(
mut self,
input: std::option::Option<crate::model::KeywordAction>,
) -> Self {
self.keyword_action = input;
self
}
pub fn build(
self,
) -> Result<crate::input::PutKeywordInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::PutKeywordInput {
origination_identity: self.origination_identity,
keyword: self.keyword,
keyword_message: self.keyword_message,
keyword_action: self.keyword_action,
})
}
}
}
impl PutKeywordInput {
#[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::PutKeyword,
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::PutKeywordInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutKeywordInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.PutKeyword",
);
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_keyword(&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::PutKeyword::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutKeyword",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_keyword_input::Builder {
crate::input::put_keyword_input::Builder::default()
}
}
pub mod put_opted_out_number_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) opted_out_number: std::option::Option<std::string::String>,
}
impl Builder {
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn opted_out_number(mut self, input: impl Into<std::string::String>) -> Self {
self.opted_out_number = Some(input.into());
self
}
pub fn set_opted_out_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opted_out_number = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::PutOptedOutNumberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::PutOptedOutNumberInput {
opt_out_list_name: self.opt_out_list_name,
opted_out_number: self.opted_out_number,
})
}
}
}
impl PutOptedOutNumberInput {
#[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::PutOptedOutNumber,
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::PutOptedOutNumberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::PutOptedOutNumberInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.PutOptedOutNumber",
);
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_opted_out_number(&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::PutOptedOutNumber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"PutOptedOutNumber",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::put_opted_out_number_input::Builder {
crate::input::put_opted_out_number_input::Builder::default()
}
}
pub mod release_phone_number_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) phone_number_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn phone_number_id(mut self, input: impl Into<std::string::String>) -> Self {
self.phone_number_id = Some(input.into());
self
}
pub fn set_phone_number_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.phone_number_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::ReleasePhoneNumberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ReleasePhoneNumberInput {
phone_number_id: self.phone_number_id,
})
}
}
}
impl ReleasePhoneNumberInput {
#[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::ReleasePhoneNumber,
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::ReleasePhoneNumberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ReleasePhoneNumberInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.ReleasePhoneNumber",
);
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_release_phone_number(&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::ReleasePhoneNumber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ReleasePhoneNumber",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::release_phone_number_input::Builder {
crate::input::release_phone_number_input::Builder::default()
}
}
pub mod request_phone_number_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) iso_country_code: std::option::Option<std::string::String>,
pub(crate) message_type: std::option::Option<crate::model::MessageType>,
pub(crate) number_capabilities:
std::option::Option<std::vec::Vec<crate::model::NumberCapability>>,
pub(crate) number_type: std::option::Option<crate::model::RequestableNumberType>,
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) pool_id: std::option::Option<std::string::String>,
pub(crate) registration_id: std::option::Option<std::string::String>,
pub(crate) deletion_protection_enabled: std::option::Option<bool>,
pub(crate) tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
pub(crate) client_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn iso_country_code(mut self, input: impl Into<std::string::String>) -> Self {
self.iso_country_code = Some(input.into());
self
}
pub fn set_iso_country_code(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.iso_country_code = input;
self
}
pub fn message_type(mut self, input: crate::model::MessageType) -> Self {
self.message_type = Some(input);
self
}
pub fn set_message_type(
mut self,
input: std::option::Option<crate::model::MessageType>,
) -> Self {
self.message_type = input;
self
}
pub fn number_capabilities(mut self, input: crate::model::NumberCapability) -> Self {
let mut v = self.number_capabilities.unwrap_or_default();
v.push(input);
self.number_capabilities = Some(v);
self
}
pub fn set_number_capabilities(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::NumberCapability>>,
) -> Self {
self.number_capabilities = input;
self
}
pub fn number_type(mut self, input: crate::model::RequestableNumberType) -> Self {
self.number_type = Some(input);
self
}
pub fn set_number_type(
mut self,
input: std::option::Option<crate::model::RequestableNumberType>,
) -> Self {
self.number_type = input;
self
}
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn registration_id(mut self, input: impl Into<std::string::String>) -> Self {
self.registration_id = Some(input.into());
self
}
pub fn set_registration_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.registration_id = input;
self
}
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = Some(input);
self
}
pub fn set_deletion_protection_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = 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_token(mut self, input: impl Into<std::string::String>) -> Self {
self.client_token = Some(input.into());
self
}
pub fn set_client_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.client_token = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::RequestPhoneNumberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::RequestPhoneNumberInput {
iso_country_code: self.iso_country_code,
message_type: self.message_type,
number_capabilities: self.number_capabilities,
number_type: self.number_type,
opt_out_list_name: self.opt_out_list_name,
pool_id: self.pool_id,
registration_id: self.registration_id,
deletion_protection_enabled: self.deletion_protection_enabled,
tags: self.tags,
client_token: self.client_token,
})
}
}
}
impl RequestPhoneNumberInput {
#[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::RequestPhoneNumber,
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_token.is_none() {
self.client_token = Some(_config.make_token.make_idempotency_token());
}
let mut request = {
fn uri_base(
_input: &crate::input::RequestPhoneNumberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RequestPhoneNumberInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.RequestPhoneNumber",
);
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_request_phone_number(&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::RequestPhoneNumber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RequestPhoneNumber",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::request_phone_number_input::Builder {
crate::input::request_phone_number_input::Builder::default()
}
}
pub mod send_text_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) destination_phone_number: std::option::Option<std::string::String>,
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) message_body: std::option::Option<std::string::String>,
pub(crate) message_type: std::option::Option<crate::model::MessageType>,
pub(crate) keyword: std::option::Option<std::string::String>,
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) max_price: std::option::Option<std::string::String>,
pub(crate) time_to_live: std::option::Option<i32>,
pub(crate) context: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) destination_country_parameters: std::option::Option<
std::collections::HashMap<
crate::model::DestinationCountryParameterKey,
std::string::String,
>,
>,
pub(crate) dry_run: std::option::Option<bool>,
}
impl Builder {
pub fn destination_phone_number(mut self, input: impl Into<std::string::String>) -> Self {
self.destination_phone_number = Some(input.into());
self
}
pub fn set_destination_phone_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_phone_number = input;
self
}
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn message_body(mut self, input: impl Into<std::string::String>) -> Self {
self.message_body = Some(input.into());
self
}
pub fn set_message_body(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_body = input;
self
}
pub fn message_type(mut self, input: crate::model::MessageType) -> Self {
self.message_type = Some(input);
self
}
pub fn set_message_type(
mut self,
input: std::option::Option<crate::model::MessageType>,
) -> Self {
self.message_type = input;
self
}
pub fn keyword(mut self, input: impl Into<std::string::String>) -> Self {
self.keyword = Some(input.into());
self
}
pub fn set_keyword(mut self, input: std::option::Option<std::string::String>) -> Self {
self.keyword = input;
self
}
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn max_price(mut self, input: impl Into<std::string::String>) -> Self {
self.max_price = Some(input.into());
self
}
pub fn set_max_price(mut self, input: std::option::Option<std::string::String>) -> Self {
self.max_price = input;
self
}
pub fn time_to_live(mut self, input: i32) -> Self {
self.time_to_live = Some(input);
self
}
pub fn set_time_to_live(mut self, input: std::option::Option<i32>) -> Self {
self.time_to_live = input;
self
}
pub fn context(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.context.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.context = Some(hash_map);
self
}
pub fn set_context(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.context = input;
self
}
pub fn destination_country_parameters(
mut self,
k: crate::model::DestinationCountryParameterKey,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.destination_country_parameters.unwrap_or_default();
hash_map.insert(k, v.into());
self.destination_country_parameters = Some(hash_map);
self
}
pub fn set_destination_country_parameters(
mut self,
input: std::option::Option<
std::collections::HashMap<
crate::model::DestinationCountryParameterKey,
std::string::String,
>,
>,
) -> Self {
self.destination_country_parameters = input;
self
}
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = Some(input);
self
}
pub fn set_dry_run(mut self, input: std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
pub fn build(
self,
) -> Result<crate::input::SendTextMessageInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::SendTextMessageInput {
destination_phone_number: self.destination_phone_number,
origination_identity: self.origination_identity,
message_body: self.message_body,
message_type: self.message_type,
keyword: self.keyword,
configuration_set_name: self.configuration_set_name,
max_price: self.max_price,
time_to_live: self.time_to_live,
context: self.context,
destination_country_parameters: self.destination_country_parameters,
dry_run: self.dry_run.unwrap_or_default(),
})
}
}
}
impl SendTextMessageInput {
#[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::SendTextMessage,
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::SendTextMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SendTextMessageInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SendTextMessage",
);
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_text_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::SendTextMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SendTextMessage",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::send_text_message_input::Builder {
crate::input::send_text_message_input::Builder::default()
}
}
pub mod send_voice_message_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) destination_phone_number: std::option::Option<std::string::String>,
pub(crate) origination_identity: std::option::Option<std::string::String>,
pub(crate) message_body: std::option::Option<std::string::String>,
pub(crate) message_body_text_type:
std::option::Option<crate::model::VoiceMessageBodyTextType>,
pub(crate) voice_id: std::option::Option<crate::model::VoiceId>,
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) max_price_per_minute: std::option::Option<std::string::String>,
pub(crate) time_to_live: std::option::Option<i32>,
pub(crate) context: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
pub(crate) dry_run: std::option::Option<bool>,
}
impl Builder {
pub fn destination_phone_number(mut self, input: impl Into<std::string::String>) -> Self {
self.destination_phone_number = Some(input.into());
self
}
pub fn set_destination_phone_number(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.destination_phone_number = input;
self
}
pub fn origination_identity(mut self, input: impl Into<std::string::String>) -> Self {
self.origination_identity = Some(input.into());
self
}
pub fn set_origination_identity(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.origination_identity = input;
self
}
pub fn message_body(mut self, input: impl Into<std::string::String>) -> Self {
self.message_body = Some(input.into());
self
}
pub fn set_message_body(mut self, input: std::option::Option<std::string::String>) -> Self {
self.message_body = input;
self
}
pub fn message_body_text_type(
mut self,
input: crate::model::VoiceMessageBodyTextType,
) -> Self {
self.message_body_text_type = Some(input);
self
}
pub fn set_message_body_text_type(
mut self,
input: std::option::Option<crate::model::VoiceMessageBodyTextType>,
) -> Self {
self.message_body_text_type = input;
self
}
pub fn voice_id(mut self, input: crate::model::VoiceId) -> Self {
self.voice_id = Some(input);
self
}
pub fn set_voice_id(mut self, input: std::option::Option<crate::model::VoiceId>) -> Self {
self.voice_id = input;
self
}
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn max_price_per_minute(mut self, input: impl Into<std::string::String>) -> Self {
self.max_price_per_minute = Some(input.into());
self
}
pub fn set_max_price_per_minute(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.max_price_per_minute = input;
self
}
pub fn time_to_live(mut self, input: i32) -> Self {
self.time_to_live = Some(input);
self
}
pub fn set_time_to_live(mut self, input: std::option::Option<i32>) -> Self {
self.time_to_live = input;
self
}
pub fn context(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.context.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.context = Some(hash_map);
self
}
pub fn set_context(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.context = input;
self
}
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = Some(input);
self
}
pub fn set_dry_run(mut self, input: std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SendVoiceMessageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SendVoiceMessageInput {
destination_phone_number: self.destination_phone_number,
origination_identity: self.origination_identity,
message_body: self.message_body,
message_body_text_type: self.message_body_text_type,
voice_id: self.voice_id,
configuration_set_name: self.configuration_set_name,
max_price_per_minute: self.max_price_per_minute,
time_to_live: self.time_to_live,
context: self.context,
dry_run: self.dry_run.unwrap_or_default(),
})
}
}
}
impl SendVoiceMessageInput {
#[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::SendVoiceMessage,
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::SendVoiceMessageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SendVoiceMessageInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SendVoiceMessage",
);
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_voice_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::SendVoiceMessage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SendVoiceMessage",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::send_voice_message_input::Builder {
crate::input::send_voice_message_input::Builder::default()
}
}
pub mod set_default_message_type_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) message_type: std::option::Option<crate::model::MessageType>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn message_type(mut self, input: crate::model::MessageType) -> Self {
self.message_type = Some(input);
self
}
pub fn set_message_type(
mut self,
input: std::option::Option<crate::model::MessageType>,
) -> Self {
self.message_type = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetDefaultMessageTypeInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetDefaultMessageTypeInput {
configuration_set_name: self.configuration_set_name,
message_type: self.message_type,
})
}
}
}
impl SetDefaultMessageTypeInput {
#[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::SetDefaultMessageType,
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::SetDefaultMessageTypeInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetDefaultMessageTypeInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SetDefaultMessageType",
);
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_set_default_message_type(
&self,
)?,
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SetDefaultMessageType::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetDefaultMessageType",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_default_message_type_input::Builder {
crate::input::set_default_message_type_input::Builder::default()
}
}
pub mod set_default_sender_id_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) sender_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn sender_id(mut self, input: impl Into<std::string::String>) -> Self {
self.sender_id = Some(input.into());
self
}
pub fn set_sender_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.sender_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetDefaultSenderIdInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetDefaultSenderIdInput {
configuration_set_name: self.configuration_set_name,
sender_id: self.sender_id,
})
}
}
}
impl SetDefaultSenderIdInput {
#[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::SetDefaultSenderId,
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::SetDefaultSenderIdInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetDefaultSenderIdInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SetDefaultSenderId",
);
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_set_default_sender_id(&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::SetDefaultSenderId::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetDefaultSenderId",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_default_sender_id_input::Builder {
crate::input::set_default_sender_id_input::Builder::default()
}
}
pub mod set_text_message_spend_limit_override_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) monthly_limit: std::option::Option<i64>,
}
impl Builder {
pub fn monthly_limit(mut self, input: i64) -> Self {
self.monthly_limit = Some(input);
self
}
pub fn set_monthly_limit(mut self, input: std::option::Option<i64>) -> Self {
self.monthly_limit = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetTextMessageSpendLimitOverrideInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetTextMessageSpendLimitOverrideInput {
monthly_limit: self.monthly_limit,
})
}
}
}
impl SetTextMessageSpendLimitOverrideInput {
#[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::SetTextMessageSpendLimitOverride,
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::SetTextMessageSpendLimitOverrideInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetTextMessageSpendLimitOverrideInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SetTextMessageSpendLimitOverride",
);
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_set_text_message_spend_limit_override(&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::SetTextMessageSpendLimitOverride::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetTextMessageSpendLimitOverride",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_text_message_spend_limit_override_input::Builder {
crate::input::set_text_message_spend_limit_override_input::Builder::default()
}
}
pub mod set_voice_message_spend_limit_override_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) monthly_limit: std::option::Option<i64>,
}
impl Builder {
pub fn monthly_limit(mut self, input: i64) -> Self {
self.monthly_limit = Some(input);
self
}
pub fn set_monthly_limit(mut self, input: std::option::Option<i64>) -> Self {
self.monthly_limit = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetVoiceMessageSpendLimitOverrideInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetVoiceMessageSpendLimitOverrideInput {
monthly_limit: self.monthly_limit,
})
}
}
}
impl SetVoiceMessageSpendLimitOverrideInput {
#[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::SetVoiceMessageSpendLimitOverride,
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::SetVoiceMessageSpendLimitOverrideInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetVoiceMessageSpendLimitOverrideInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.SetVoiceMessageSpendLimitOverride",
);
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_set_voice_message_spend_limit_override(&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::SetVoiceMessageSpendLimitOverride::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetVoiceMessageSpendLimitOverride",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_voice_message_spend_limit_override_input::Builder {
crate::input::set_voice_message_spend_limit_override_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, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::TagResourceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.TagResource",
);
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",
"pinpointsmsvoicev2",
));
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, "/").expect("formatting should succeed");
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)?;
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.UntagResource",
);
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",
"pinpointsmsvoicev2",
));
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_event_destination_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) configuration_set_name: std::option::Option<std::string::String>,
pub(crate) event_destination_name: std::option::Option<std::string::String>,
pub(crate) enabled: std::option::Option<bool>,
pub(crate) matching_event_types:
std::option::Option<std::vec::Vec<crate::model::EventType>>,
pub(crate) cloud_watch_logs_destination:
std::option::Option<crate::model::CloudWatchLogsDestination>,
pub(crate) kinesis_firehose_destination:
std::option::Option<crate::model::KinesisFirehoseDestination>,
pub(crate) sns_destination: std::option::Option<crate::model::SnsDestination>,
}
impl Builder {
pub fn configuration_set_name(mut self, input: impl Into<std::string::String>) -> Self {
self.configuration_set_name = Some(input.into());
self
}
pub fn set_configuration_set_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.configuration_set_name = input;
self
}
pub fn event_destination_name(mut self, input: impl Into<std::string::String>) -> Self {
self.event_destination_name = Some(input.into());
self
}
pub fn set_event_destination_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.event_destination_name = input;
self
}
pub fn enabled(mut self, input: bool) -> Self {
self.enabled = Some(input);
self
}
pub fn set_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.enabled = input;
self
}
pub fn matching_event_types(mut self, input: crate::model::EventType) -> Self {
let mut v = self.matching_event_types.unwrap_or_default();
v.push(input);
self.matching_event_types = Some(v);
self
}
pub fn set_matching_event_types(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::EventType>>,
) -> Self {
self.matching_event_types = input;
self
}
pub fn cloud_watch_logs_destination(
mut self,
input: crate::model::CloudWatchLogsDestination,
) -> Self {
self.cloud_watch_logs_destination = Some(input);
self
}
pub fn set_cloud_watch_logs_destination(
mut self,
input: std::option::Option<crate::model::CloudWatchLogsDestination>,
) -> Self {
self.cloud_watch_logs_destination = input;
self
}
pub fn kinesis_firehose_destination(
mut self,
input: crate::model::KinesisFirehoseDestination,
) -> Self {
self.kinesis_firehose_destination = Some(input);
self
}
pub fn set_kinesis_firehose_destination(
mut self,
input: std::option::Option<crate::model::KinesisFirehoseDestination>,
) -> Self {
self.kinesis_firehose_destination = input;
self
}
pub fn sns_destination(mut self, input: crate::model::SnsDestination) -> Self {
self.sns_destination = Some(input);
self
}
pub fn set_sns_destination(
mut self,
input: std::option::Option<crate::model::SnsDestination>,
) -> Self {
self.sns_destination = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdateEventDestinationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdateEventDestinationInput {
configuration_set_name: self.configuration_set_name,
event_destination_name: self.event_destination_name,
enabled: self.enabled,
matching_event_types: self.matching_event_types,
cloud_watch_logs_destination: self.cloud_watch_logs_destination,
kinesis_firehose_destination: self.kinesis_firehose_destination,
sns_destination: self.sns_destination,
})
}
}
}
impl UpdateEventDestinationInput {
#[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::UpdateEventDestination,
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::UpdateEventDestinationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateEventDestinationInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.UpdateEventDestination",
);
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_event_destination(
&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::UpdateEventDestination::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateEventDestination",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_event_destination_input::Builder {
crate::input::update_event_destination_input::Builder::default()
}
}
pub mod update_phone_number_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) phone_number_id: std::option::Option<std::string::String>,
pub(crate) two_way_enabled: std::option::Option<bool>,
pub(crate) two_way_channel_arn: std::option::Option<std::string::String>,
pub(crate) self_managed_opt_outs_enabled: std::option::Option<bool>,
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) deletion_protection_enabled: std::option::Option<bool>,
}
impl Builder {
pub fn phone_number_id(mut self, input: impl Into<std::string::String>) -> Self {
self.phone_number_id = Some(input.into());
self
}
pub fn set_phone_number_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.phone_number_id = input;
self
}
pub fn two_way_enabled(mut self, input: bool) -> Self {
self.two_way_enabled = Some(input);
self
}
pub fn set_two_way_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.two_way_enabled = input;
self
}
pub fn two_way_channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.two_way_channel_arn = Some(input.into());
self
}
pub fn set_two_way_channel_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.two_way_channel_arn = input;
self
}
pub fn self_managed_opt_outs_enabled(mut self, input: bool) -> Self {
self.self_managed_opt_outs_enabled = Some(input);
self
}
pub fn set_self_managed_opt_outs_enabled(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.self_managed_opt_outs_enabled = input;
self
}
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = Some(input);
self
}
pub fn set_deletion_protection_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UpdatePhoneNumberInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UpdatePhoneNumberInput {
phone_number_id: self.phone_number_id,
two_way_enabled: self.two_way_enabled,
two_way_channel_arn: self.two_way_channel_arn,
self_managed_opt_outs_enabled: self.self_managed_opt_outs_enabled,
opt_out_list_name: self.opt_out_list_name,
deletion_protection_enabled: self.deletion_protection_enabled,
})
}
}
}
impl UpdatePhoneNumberInput {
#[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::UpdatePhoneNumber,
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::UpdatePhoneNumberInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePhoneNumberInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.UpdatePhoneNumber",
);
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_phone_number(&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::UpdatePhoneNumber::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePhoneNumber",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_phone_number_input::Builder {
crate::input::update_phone_number_input::Builder::default()
}
}
pub mod update_pool_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) pool_id: std::option::Option<std::string::String>,
pub(crate) two_way_enabled: std::option::Option<bool>,
pub(crate) two_way_channel_arn: std::option::Option<std::string::String>,
pub(crate) self_managed_opt_outs_enabled: std::option::Option<bool>,
pub(crate) opt_out_list_name: std::option::Option<std::string::String>,
pub(crate) shared_routes_enabled: std::option::Option<bool>,
pub(crate) deletion_protection_enabled: std::option::Option<bool>,
}
impl Builder {
pub fn pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.pool_id = Some(input.into());
self
}
pub fn set_pool_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.pool_id = input;
self
}
pub fn two_way_enabled(mut self, input: bool) -> Self {
self.two_way_enabled = Some(input);
self
}
pub fn set_two_way_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.two_way_enabled = input;
self
}
pub fn two_way_channel_arn(mut self, input: impl Into<std::string::String>) -> Self {
self.two_way_channel_arn = Some(input.into());
self
}
pub fn set_two_way_channel_arn(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.two_way_channel_arn = input;
self
}
pub fn self_managed_opt_outs_enabled(mut self, input: bool) -> Self {
self.self_managed_opt_outs_enabled = Some(input);
self
}
pub fn set_self_managed_opt_outs_enabled(
mut self,
input: std::option::Option<bool>,
) -> Self {
self.self_managed_opt_outs_enabled = input;
self
}
pub fn opt_out_list_name(mut self, input: impl Into<std::string::String>) -> Self {
self.opt_out_list_name = Some(input.into());
self
}
pub fn set_opt_out_list_name(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.opt_out_list_name = input;
self
}
pub fn shared_routes_enabled(mut self, input: bool) -> Self {
self.shared_routes_enabled = Some(input);
self
}
pub fn set_shared_routes_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.shared_routes_enabled = input;
self
}
pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
self.deletion_protection_enabled = Some(input);
self
}
pub fn set_deletion_protection_enabled(mut self, input: std::option::Option<bool>) -> Self {
self.deletion_protection_enabled = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdatePoolInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdatePoolInput {
pool_id: self.pool_id,
two_way_enabled: self.two_way_enabled,
two_way_channel_arn: self.two_way_channel_arn,
self_managed_opt_outs_enabled: self.self_managed_opt_outs_enabled,
opt_out_list_name: self.opt_out_list_name,
shared_routes_enabled: self.shared_routes_enabled,
deletion_protection_enabled: self.deletion_protection_enabled,
})
}
}
}
impl UpdatePoolInput {
#[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::UpdatePool,
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::UpdatePoolInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdatePoolInput,
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/x-amz-json-1.0",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"PinpointSMSVoiceV2.UpdatePool",
);
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_pool(&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::UpdatePool::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdatePool",
"pinpointsmsvoicev2",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_pool_input::Builder {
crate::input::update_pool_input::Builder::default()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePoolInput {
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub two_way_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub two_way_channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub self_managed_opt_outs_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub shared_routes_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub deletion_protection_enabled: std::option::Option<bool>,
}
impl UpdatePoolInput {
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
pub fn two_way_enabled(&self) -> std::option::Option<bool> {
self.two_way_enabled
}
pub fn two_way_channel_arn(&self) -> std::option::Option<&str> {
self.two_way_channel_arn.as_deref()
}
pub fn self_managed_opt_outs_enabled(&self) -> std::option::Option<bool> {
self.self_managed_opt_outs_enabled
}
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn shared_routes_enabled(&self) -> std::option::Option<bool> {
self.shared_routes_enabled
}
pub fn deletion_protection_enabled(&self) -> std::option::Option<bool> {
self.deletion_protection_enabled
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdatePhoneNumberInput {
#[doc(hidden)]
pub phone_number_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub two_way_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub two_way_channel_arn: std::option::Option<std::string::String>,
#[doc(hidden)]
pub self_managed_opt_outs_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub deletion_protection_enabled: std::option::Option<bool>,
}
impl UpdatePhoneNumberInput {
pub fn phone_number_id(&self) -> std::option::Option<&str> {
self.phone_number_id.as_deref()
}
pub fn two_way_enabled(&self) -> std::option::Option<bool> {
self.two_way_enabled
}
pub fn two_way_channel_arn(&self) -> std::option::Option<&str> {
self.two_way_channel_arn.as_deref()
}
pub fn self_managed_opt_outs_enabled(&self) -> std::option::Option<bool> {
self.self_managed_opt_outs_enabled
}
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn deletion_protection_enabled(&self) -> std::option::Option<bool> {
self.deletion_protection_enabled
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateEventDestinationInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub event_destination_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub enabled: std::option::Option<bool>,
#[doc(hidden)]
pub matching_event_types: std::option::Option<std::vec::Vec<crate::model::EventType>>,
#[doc(hidden)]
pub cloud_watch_logs_destination: std::option::Option<crate::model::CloudWatchLogsDestination>,
#[doc(hidden)]
pub kinesis_firehose_destination: std::option::Option<crate::model::KinesisFirehoseDestination>,
#[doc(hidden)]
pub sns_destination: std::option::Option<crate::model::SnsDestination>,
}
impl UpdateEventDestinationInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn event_destination_name(&self) -> std::option::Option<&str> {
self.event_destination_name.as_deref()
}
pub fn enabled(&self) -> std::option::Option<bool> {
self.enabled
}
pub fn matching_event_types(&self) -> std::option::Option<&[crate::model::EventType]> {
self.matching_event_types.as_deref()
}
pub fn cloud_watch_logs_destination(
&self,
) -> std::option::Option<&crate::model::CloudWatchLogsDestination> {
self.cloud_watch_logs_destination.as_ref()
}
pub fn kinesis_firehose_destination(
&self,
) -> std::option::Option<&crate::model::KinesisFirehoseDestination> {
self.kinesis_firehose_destination.as_ref()
}
pub fn sns_destination(&self) -> std::option::Option<&crate::model::SnsDestination> {
self.sns_destination.as_ref()
}
}
#[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, std::fmt::Debug)]
pub struct SetVoiceMessageSpendLimitOverrideInput {
#[doc(hidden)]
pub monthly_limit: std::option::Option<i64>,
}
impl SetVoiceMessageSpendLimitOverrideInput {
pub fn monthly_limit(&self) -> std::option::Option<i64> {
self.monthly_limit
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SetTextMessageSpendLimitOverrideInput {
#[doc(hidden)]
pub monthly_limit: std::option::Option<i64>,
}
impl SetTextMessageSpendLimitOverrideInput {
pub fn monthly_limit(&self) -> std::option::Option<i64> {
self.monthly_limit
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SetDefaultSenderIdInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub sender_id: std::option::Option<std::string::String>,
}
impl SetDefaultSenderIdInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn sender_id(&self) -> std::option::Option<&str> {
self.sender_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SetDefaultMessageTypeInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_type: std::option::Option<crate::model::MessageType>,
}
impl SetDefaultMessageTypeInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn message_type(&self) -> std::option::Option<&crate::model::MessageType> {
self.message_type.as_ref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SendVoiceMessageInput {
#[doc(hidden)]
pub destination_phone_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_body: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_body_text_type: std::option::Option<crate::model::VoiceMessageBodyTextType>,
#[doc(hidden)]
pub voice_id: std::option::Option<crate::model::VoiceId>,
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_price_per_minute: std::option::Option<std::string::String>,
#[doc(hidden)]
pub time_to_live: std::option::Option<i32>,
#[doc(hidden)]
pub context:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub dry_run: bool,
}
impl SendVoiceMessageInput {
pub fn destination_phone_number(&self) -> std::option::Option<&str> {
self.destination_phone_number.as_deref()
}
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn message_body(&self) -> std::option::Option<&str> {
self.message_body.as_deref()
}
pub fn message_body_text_type(
&self,
) -> std::option::Option<&crate::model::VoiceMessageBodyTextType> {
self.message_body_text_type.as_ref()
}
pub fn voice_id(&self) -> std::option::Option<&crate::model::VoiceId> {
self.voice_id.as_ref()
}
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn max_price_per_minute(&self) -> std::option::Option<&str> {
self.max_price_per_minute.as_deref()
}
pub fn time_to_live(&self) -> std::option::Option<i32> {
self.time_to_live
}
pub fn context(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.context.as_ref()
}
pub fn dry_run(&self) -> bool {
self.dry_run
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SendTextMessageInput {
#[doc(hidden)]
pub destination_phone_number: std::option::Option<std::string::String>,
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_body: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_type: std::option::Option<crate::model::MessageType>,
#[doc(hidden)]
pub keyword: std::option::Option<std::string::String>,
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_price: std::option::Option<std::string::String>,
#[doc(hidden)]
pub time_to_live: std::option::Option<i32>,
#[doc(hidden)]
pub context:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
#[doc(hidden)]
pub destination_country_parameters: std::option::Option<
std::collections::HashMap<
crate::model::DestinationCountryParameterKey,
std::string::String,
>,
>,
#[doc(hidden)]
pub dry_run: bool,
}
impl SendTextMessageInput {
pub fn destination_phone_number(&self) -> std::option::Option<&str> {
self.destination_phone_number.as_deref()
}
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn message_body(&self) -> std::option::Option<&str> {
self.message_body.as_deref()
}
pub fn message_type(&self) -> std::option::Option<&crate::model::MessageType> {
self.message_type.as_ref()
}
pub fn keyword(&self) -> std::option::Option<&str> {
self.keyword.as_deref()
}
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn max_price(&self) -> std::option::Option<&str> {
self.max_price.as_deref()
}
pub fn time_to_live(&self) -> std::option::Option<i32> {
self.time_to_live
}
pub fn context(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.context.as_ref()
}
pub fn destination_country_parameters(
&self,
) -> std::option::Option<
&std::collections::HashMap<
crate::model::DestinationCountryParameterKey,
std::string::String,
>,
> {
self.destination_country_parameters.as_ref()
}
pub fn dry_run(&self) -> bool {
self.dry_run
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RequestPhoneNumberInput {
#[doc(hidden)]
pub iso_country_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_type: std::option::Option<crate::model::MessageType>,
#[doc(hidden)]
pub number_capabilities: std::option::Option<std::vec::Vec<crate::model::NumberCapability>>,
#[doc(hidden)]
pub number_type: std::option::Option<crate::model::RequestableNumberType>,
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub registration_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub deletion_protection_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl RequestPhoneNumberInput {
pub fn iso_country_code(&self) -> std::option::Option<&str> {
self.iso_country_code.as_deref()
}
pub fn message_type(&self) -> std::option::Option<&crate::model::MessageType> {
self.message_type.as_ref()
}
pub fn number_capabilities(&self) -> std::option::Option<&[crate::model::NumberCapability]> {
self.number_capabilities.as_deref()
}
pub fn number_type(&self) -> std::option::Option<&crate::model::RequestableNumberType> {
self.number_type.as_ref()
}
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
pub fn registration_id(&self) -> std::option::Option<&str> {
self.registration_id.as_deref()
}
pub fn deletion_protection_enabled(&self) -> std::option::Option<bool> {
self.deletion_protection_enabled
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ReleasePhoneNumberInput {
#[doc(hidden)]
pub phone_number_id: std::option::Option<std::string::String>,
}
impl ReleasePhoneNumberInput {
pub fn phone_number_id(&self) -> std::option::Option<&str> {
self.phone_number_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutOptedOutNumberInput {
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub opted_out_number: std::option::Option<std::string::String>,
}
impl PutOptedOutNumberInput {
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn opted_out_number(&self) -> std::option::Option<&str> {
self.opted_out_number.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct PutKeywordInput {
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keyword: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keyword_message: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keyword_action: std::option::Option<crate::model::KeywordAction>,
}
impl PutKeywordInput {
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn keyword(&self) -> std::option::Option<&str> {
self.keyword.as_deref()
}
pub fn keyword_message(&self) -> std::option::Option<&str> {
self.keyword_message.as_deref()
}
pub fn keyword_action(&self) -> std::option::Option<&crate::model::KeywordAction> {
self.keyword_action.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, std::fmt::Debug)]
pub struct ListPoolOriginationIdentitiesInput {
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::PoolOriginationIdentitiesFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl ListPoolOriginationIdentitiesInput {
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::PoolOriginationIdentitiesFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DisassociateOriginationIdentityInput {
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub iso_country_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl DisassociateOriginationIdentityInput {
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn iso_country_code(&self) -> std::option::Option<&str> {
self.iso_country_code.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeSpendLimitsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeSpendLimitsInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeSenderIdsInput {
#[doc(hidden)]
pub sender_ids: std::option::Option<std::vec::Vec<crate::model::SenderIdAndCountry>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::SenderIdFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeSenderIdsInput {
pub fn sender_ids(&self) -> std::option::Option<&[crate::model::SenderIdAndCountry]> {
self.sender_ids.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::SenderIdFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribePoolsInput {
#[doc(hidden)]
pub pool_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::PoolFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribePoolsInput {
pub fn pool_ids(&self) -> std::option::Option<&[std::string::String]> {
self.pool_ids.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::PoolFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribePhoneNumbersInput {
#[doc(hidden)]
pub phone_number_ids: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::PhoneNumberFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribePhoneNumbersInput {
pub fn phone_number_ids(&self) -> std::option::Option<&[std::string::String]> {
self.phone_number_ids.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::PhoneNumberFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeOptOutListsInput {
#[doc(hidden)]
pub opt_out_list_names: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeOptOutListsInput {
pub fn opt_out_list_names(&self) -> std::option::Option<&[std::string::String]> {
self.opt_out_list_names.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeOptedOutNumbersInput {
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub opted_out_numbers: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::OptedOutFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeOptedOutNumbersInput {
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn opted_out_numbers(&self) -> std::option::Option<&[std::string::String]> {
self.opted_out_numbers.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::OptedOutFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeKeywordsInput {
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keywords: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::KeywordFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeKeywordsInput {
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn keywords(&self) -> std::option::Option<&[std::string::String]> {
self.keywords.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::KeywordFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeConfigurationSetsInput {
#[doc(hidden)]
pub configuration_set_names: std::option::Option<std::vec::Vec<std::string::String>>,
#[doc(hidden)]
pub filters: std::option::Option<std::vec::Vec<crate::model::ConfigurationSetFilter>>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeConfigurationSetsInput {
pub fn configuration_set_names(&self) -> std::option::Option<&[std::string::String]> {
self.configuration_set_names.as_deref()
}
pub fn filters(&self) -> std::option::Option<&[crate::model::ConfigurationSetFilter]> {
self.filters.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeAccountLimitsInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeAccountLimitsInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeAccountAttributesInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: std::option::Option<i32>,
}
impl DescribeAccountAttributesInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> std::option::Option<i32> {
self.max_results
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteVoiceMessageSpendLimitOverrideInput {}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteTextMessageSpendLimitOverrideInput {}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeletePoolInput {
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
}
impl DeletePoolInput {
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteOptOutListInput {
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
}
impl DeleteOptOutListInput {
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteOptedOutNumberInput {
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub opted_out_number: std::option::Option<std::string::String>,
}
impl DeleteOptedOutNumberInput {
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn opted_out_number(&self) -> std::option::Option<&str> {
self.opted_out_number.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteKeywordInput {
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub keyword: std::option::Option<std::string::String>,
}
impl DeleteKeywordInput {
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn keyword(&self) -> std::option::Option<&str> {
self.keyword.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteEventDestinationInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub event_destination_name: std::option::Option<std::string::String>,
}
impl DeleteEventDestinationInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn event_destination_name(&self) -> std::option::Option<&str> {
self.event_destination_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDefaultSenderIdInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
}
impl DeleteDefaultSenderIdInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDefaultMessageTypeInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
}
impl DeleteDefaultMessageTypeInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteConfigurationSetInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
}
impl DeleteConfigurationSetInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreatePoolInput {
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub iso_country_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub message_type: std::option::Option<crate::model::MessageType>,
#[doc(hidden)]
pub deletion_protection_enabled: std::option::Option<bool>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreatePoolInput {
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn iso_country_code(&self) -> std::option::Option<&str> {
self.iso_country_code.as_deref()
}
pub fn message_type(&self) -> std::option::Option<&crate::model::MessageType> {
self.message_type.as_ref()
}
pub fn deletion_protection_enabled(&self) -> std::option::Option<bool> {
self.deletion_protection_enabled
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateOptOutListInput {
#[doc(hidden)]
pub opt_out_list_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateOptOutListInput {
pub fn opt_out_list_name(&self) -> std::option::Option<&str> {
self.opt_out_list_name.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateEventDestinationInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub event_destination_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub matching_event_types: std::option::Option<std::vec::Vec<crate::model::EventType>>,
#[doc(hidden)]
pub cloud_watch_logs_destination: std::option::Option<crate::model::CloudWatchLogsDestination>,
#[doc(hidden)]
pub kinesis_firehose_destination: std::option::Option<crate::model::KinesisFirehoseDestination>,
#[doc(hidden)]
pub sns_destination: std::option::Option<crate::model::SnsDestination>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateEventDestinationInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn event_destination_name(&self) -> std::option::Option<&str> {
self.event_destination_name.as_deref()
}
pub fn matching_event_types(&self) -> std::option::Option<&[crate::model::EventType]> {
self.matching_event_types.as_deref()
}
pub fn cloud_watch_logs_destination(
&self,
) -> std::option::Option<&crate::model::CloudWatchLogsDestination> {
self.cloud_watch_logs_destination.as_ref()
}
pub fn kinesis_firehose_destination(
&self,
) -> std::option::Option<&crate::model::KinesisFirehoseDestination> {
self.kinesis_firehose_destination.as_ref()
}
pub fn sns_destination(&self) -> std::option::Option<&crate::model::SnsDestination> {
self.sns_destination.as_ref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct CreateConfigurationSetInput {
#[doc(hidden)]
pub configuration_set_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub tags: std::option::Option<std::vec::Vec<crate::model::Tag>>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl CreateConfigurationSetInput {
pub fn configuration_set_name(&self) -> std::option::Option<&str> {
self.configuration_set_name.as_deref()
}
pub fn tags(&self) -> std::option::Option<&[crate::model::Tag]> {
self.tags.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct AssociateOriginationIdentityInput {
#[doc(hidden)]
pub pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub origination_identity: std::option::Option<std::string::String>,
#[doc(hidden)]
pub iso_country_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_token: std::option::Option<std::string::String>,
}
impl AssociateOriginationIdentityInput {
pub fn pool_id(&self) -> std::option::Option<&str> {
self.pool_id.as_deref()
}
pub fn origination_identity(&self) -> std::option::Option<&str> {
self.origination_identity.as_deref()
}
pub fn iso_country_code(&self) -> std::option::Option<&str> {
self.iso_country_code.as_deref()
}
pub fn client_token(&self) -> std::option::Option<&str> {
self.client_token.as_deref()
}
}