use std::fmt::Write;
pub mod bulk_publish_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn build(
self,
) -> Result<crate::input::BulkPublishInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::BulkPublishInput {
identity_pool_id: self.identity_pool_id,
})
}
}
}
impl BulkPublishInput {
#[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::BulkPublish,
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::BulkPublishInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_1 = &_input.identity_pool_id;
let input_1 = input_1.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_1,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/bulkpublish",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BulkPublishInput,
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
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::BulkPublish::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BulkPublish",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::bulk_publish_input::Builder {
crate::input::bulk_publish_input::Builder::default()
}
}
pub mod delete_dataset_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DeleteDatasetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DeleteDatasetInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
})
}
}
}
impl DeleteDatasetInput {
#[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::DeleteDataset,
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::DeleteDatasetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_2 = &_input.identity_pool_id;
let input_2 = input_2.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_2,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_3 = &_input.identity_id;
let input_3 = input_3.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_3,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_4 = &_input.dataset_name;
let input_4 = input_4.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_4,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DeleteDatasetInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DeleteDataset::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DeleteDataset",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::delete_dataset_input::Builder {
crate::input::delete_dataset_input::Builder::default()
}
}
pub mod describe_dataset_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn build(
self,
) -> Result<crate::input::DescribeDatasetInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::DescribeDatasetInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
})
}
}
}
impl DescribeDatasetInput {
#[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::DescribeDataset,
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::DescribeDatasetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_5 = &_input.identity_pool_id;
let input_5 = input_5.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_5,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_6 = &_input.identity_id;
let input_6 = input_6.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_6,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_7 = &_input.dataset_name;
let input_7 = input_7.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_7,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeDatasetInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeDataset::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeDataset",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_dataset_input::Builder {
crate::input::describe_dataset_input::Builder::default()
}
}
pub mod describe_identity_pool_usage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeIdentityPoolUsageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeIdentityPoolUsageInput {
identity_pool_id: self.identity_pool_id,
})
}
}
}
impl DescribeIdentityPoolUsageInput {
#[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::DescribeIdentityPoolUsage,
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::DescribeIdentityPoolUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_8 = &_input.identity_pool_id;
let input_8 = input_8.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_8,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeIdentityPoolUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeIdentityPoolUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeIdentityPoolUsage",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_identity_pool_usage_input::Builder {
crate::input::describe_identity_pool_usage_input::Builder::default()
}
}
pub mod describe_identity_usage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::DescribeIdentityUsageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::DescribeIdentityUsageInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
})
}
}
}
impl DescribeIdentityUsageInput {
#[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::DescribeIdentityUsage,
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::DescribeIdentityUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_9 = &_input.identity_pool_id;
let input_9 = input_9.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_9,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_10 = &_input.identity_id;
let input_10 = input_10.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_10,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/identities/{IdentityId}",
IdentityPoolId = identity_pool_id,
IdentityId = identity_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::DescribeIdentityUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::DescribeIdentityUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"DescribeIdentityUsage",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::describe_identity_usage_input::Builder {
crate::input::describe_identity_usage_input::Builder::default()
}
}
pub mod get_bulk_publish_details_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetBulkPublishDetailsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetBulkPublishDetailsInput {
identity_pool_id: self.identity_pool_id,
})
}
}
}
impl GetBulkPublishDetailsInput {
#[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::GetBulkPublishDetails,
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::GetBulkPublishDetailsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_11 = &_input.identity_pool_id;
let input_11 = input_11.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_11,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/getBulkPublishDetails",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetBulkPublishDetailsInput,
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
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetBulkPublishDetails::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetBulkPublishDetails",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_bulk_publish_details_input::Builder {
crate::input::get_bulk_publish_details_input::Builder::default()
}
}
pub mod get_cognito_events_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetCognitoEventsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetCognitoEventsInput {
identity_pool_id: self.identity_pool_id,
})
}
}
}
impl GetCognitoEventsInput {
#[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::GetCognitoEvents,
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::GetCognitoEventsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_12 = &_input.identity_pool_id;
let input_12 = input_12.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_12,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/events",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetCognitoEventsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetCognitoEvents::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetCognitoEvents",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_cognito_events_input::Builder {
crate::input::get_cognito_events_input::Builder::default()
}
}
pub mod get_identity_pool_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::GetIdentityPoolConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::GetIdentityPoolConfigurationInput {
identity_pool_id: self.identity_pool_id,
})
}
}
}
impl GetIdentityPoolConfigurationInput {
#[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::GetIdentityPoolConfiguration,
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::GetIdentityPoolConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_13 = &_input.identity_pool_id;
let input_13 = input_13.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_13,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/configuration",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::GetIdentityPoolConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::GetIdentityPoolConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"GetIdentityPoolConfiguration",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::get_identity_pool_configuration_input::Builder {
crate::input::get_identity_pool_configuration_input::Builder::default()
}
}
pub mod list_datasets_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<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 identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = 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::ListDatasetsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListDatasetsInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListDatasetsInput {
#[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::ListDatasets,
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::ListDatasetsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_14 = &_input.identity_pool_id;
let input_14 = input_14.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_14,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_15 = &_input.identity_id;
let input_15 = input_15.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_15,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets",
IdentityPoolId = identity_pool_id,
IdentityId = identity_id
)
.expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListDatasetsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_16) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_16));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListDatasetsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListDatasets::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListDatasets",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_datasets_input::Builder {
crate::input::list_datasets_input::Builder::default()
}
}
pub mod list_identity_pool_usage_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::ListIdentityPoolUsageInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::ListIdentityPoolUsageInput {
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
})
}
}
}
impl ListIdentityPoolUsageInput {
#[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::ListIdentityPoolUsage,
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::ListIdentityPoolUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/identitypools").expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListIdentityPoolUsageInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_17) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_17));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListIdentityPoolUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListIdentityPoolUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListIdentityPoolUsage",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_identity_pool_usage_input::Builder {
crate::input::list_identity_pool_usage_input::Builder::default()
}
}
pub mod list_records_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
pub(crate) last_sync_count: std::option::Option<i64>,
pub(crate) next_token: std::option::Option<std::string::String>,
pub(crate) max_results: std::option::Option<i32>,
pub(crate) sync_session_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn last_sync_count(mut self, input: i64) -> Self {
self.last_sync_count = Some(input);
self
}
pub fn set_last_sync_count(mut self, input: std::option::Option<i64>) -> Self {
self.last_sync_count = 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 sync_session_token(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_session_token = Some(input.into());
self
}
pub fn set_sync_session_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sync_session_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ListRecordsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ListRecordsInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
last_sync_count: self.last_sync_count,
next_token: self.next_token,
max_results: self.max_results.unwrap_or_default(),
sync_session_token: self.sync_session_token,
})
}
}
}
impl ListRecordsInput {
#[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::ListRecords,
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::ListRecordsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_18 = &_input.identity_pool_id;
let input_18 = input_18.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_18,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_19 = &_input.identity_id;
let input_19 = input_19.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_19,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_20 = &_input.dataset_name;
let input_20 = input_20.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_20,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/records", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name).expect("formatting should succeed");
Ok(())
}
fn uri_query(
_input: &crate::input::ListRecordsInput,
mut output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let mut query = aws_smithy_http::query::Writer::new(&mut output);
if let Some(inner_21) = &_input.last_sync_count {
if *inner_21 != 0 {
query.push_kv(
"lastSyncCount",
aws_smithy_types::primitive::Encoder::from(*inner_21).encode(),
);
}
}
if let Some(inner_22) = &_input.next_token {
{
query.push_kv("nextToken", &aws_smithy_http::query::fmt_string(&inner_22));
}
}
if _input.max_results != 0 {
query.push_kv(
"maxResults",
aws_smithy_types::primitive::Encoder::from(_input.max_results).encode(),
);
}
if let Some(inner_23) = &_input.sync_session_token {
{
query.push_kv(
"syncSessionToken",
&aws_smithy_http::query::fmt_string(&inner_23),
);
}
}
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ListRecordsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
uri_query(input, &mut uri)?;
Ok(builder.method("GET").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::ListRecords::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ListRecords",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::list_records_input::Builder {
crate::input::list_records_input::Builder::default()
}
}
pub mod register_device_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) platform: std::option::Option<crate::model::Platform>,
pub(crate) token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn platform(mut self, input: crate::model::Platform) -> Self {
self.platform = Some(input);
self
}
pub fn set_platform(mut self, input: std::option::Option<crate::model::Platform>) -> Self {
self.platform = input;
self
}
pub fn token(mut self, input: impl Into<std::string::String>) -> Self {
self.token = Some(input.into());
self
}
pub fn set_token(mut self, input: std::option::Option<std::string::String>) -> Self {
self.token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::RegisterDeviceInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::RegisterDeviceInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
platform: self.platform,
token: self.token,
})
}
}
}
impl RegisterDeviceInput {
#[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::RegisterDevice,
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::RegisterDeviceInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_24 = &_input.identity_pool_id;
let input_24 = input_24.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_24,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_25 = &_input.identity_id;
let input_25 = input_25.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_25,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/identity/{IdentityId}/device",
IdentityPoolId = identity_pool_id,
IdentityId = identity_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RegisterDeviceInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_register_device(&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::RegisterDevice::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RegisterDevice",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::register_device_input::Builder {
crate::input::register_device_input::Builder::default()
}
}
pub mod set_cognito_events_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) events: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn events(
mut self,
k: impl Into<std::string::String>,
v: impl Into<std::string::String>,
) -> Self {
let mut hash_map = self.events.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.events = Some(hash_map);
self
}
pub fn set_events(
mut self,
input: std::option::Option<
std::collections::HashMap<std::string::String, std::string::String>,
>,
) -> Self {
self.events = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetCognitoEventsInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetCognitoEventsInput {
identity_pool_id: self.identity_pool_id,
events: self.events,
})
}
}
}
impl SetCognitoEventsInput {
#[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::SetCognitoEvents,
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::SetCognitoEventsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_26 = &_input.identity_pool_id;
let input_26 = input_26.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_26,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/events",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetCognitoEventsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_set_cognito_events(&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::SetCognitoEvents::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetCognitoEvents",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_cognito_events_input::Builder {
crate::input::set_cognito_events_input::Builder::default()
}
}
pub mod set_identity_pool_configuration_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) push_sync: std::option::Option<crate::model::PushSync>,
pub(crate) cognito_streams: std::option::Option<crate::model::CognitoStreams>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn push_sync(mut self, input: crate::model::PushSync) -> Self {
self.push_sync = Some(input);
self
}
pub fn set_push_sync(mut self, input: std::option::Option<crate::model::PushSync>) -> Self {
self.push_sync = input;
self
}
pub fn cognito_streams(mut self, input: crate::model::CognitoStreams) -> Self {
self.cognito_streams = Some(input);
self
}
pub fn set_cognito_streams(
mut self,
input: std::option::Option<crate::model::CognitoStreams>,
) -> Self {
self.cognito_streams = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SetIdentityPoolConfigurationInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SetIdentityPoolConfigurationInput {
identity_pool_id: self.identity_pool_id,
push_sync: self.push_sync,
cognito_streams: self.cognito_streams,
})
}
}
}
impl SetIdentityPoolConfigurationInput {
#[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::SetIdentityPoolConfiguration,
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::SetIdentityPoolConfigurationInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_27 = &_input.identity_pool_id;
let input_27 = input_27.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_27,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
write!(
output,
"/identitypools/{IdentityPoolId}/configuration",
IdentityPoolId = identity_pool_id
)
.expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SetIdentityPoolConfigurationInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_set_identity_pool_configuration(&self)?
);
if let Some(content_length) = body.content_length() {
request = aws_smithy_http::header::set_request_header_if_absent(
request,
http::header::CONTENT_LENGTH,
content_length,
);
}
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SetIdentityPoolConfiguration::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SetIdentityPoolConfiguration",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::set_identity_pool_configuration_input::Builder {
crate::input::set_identity_pool_configuration_input::Builder::default()
}
}
pub mod subscribe_to_dataset_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::SubscribeToDatasetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::SubscribeToDatasetInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
device_id: self.device_id,
})
}
}
}
impl SubscribeToDatasetInput {
#[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::SubscribeToDataset,
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::SubscribeToDatasetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_28 = &_input.identity_pool_id;
let input_28 = input_28.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_28,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_29 = &_input.identity_id;
let input_29 = input_29.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_29,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_30 = &_input.dataset_name;
let input_30 = input_30.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_30,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
let input_31 = &_input.device_id;
let input_31 = input_31.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
)
})?;
let device_id = aws_smithy_http::label::fmt_string(
input_31,
aws_smithy_http::label::EncodingStrategy::Default,
);
if device_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name, DeviceId = device_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::SubscribeToDatasetInput,
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
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::SubscribeToDataset::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"SubscribeToDataset",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::subscribe_to_dataset_input::Builder {
crate::input::subscribe_to_dataset_input::Builder::default()
}
}
pub mod unsubscribe_from_dataset_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn build(
self,
) -> Result<
crate::input::UnsubscribeFromDatasetInput,
aws_smithy_http::operation::error::BuildError,
> {
Ok(crate::input::UnsubscribeFromDatasetInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
device_id: self.device_id,
})
}
}
}
impl UnsubscribeFromDatasetInput {
#[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::UnsubscribeFromDataset,
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::UnsubscribeFromDatasetInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_32 = &_input.identity_pool_id;
let input_32 = input_32.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_32,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_33 = &_input.identity_id;
let input_33 = input_33.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_33,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_34 = &_input.dataset_name;
let input_34 = input_34.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_34,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
let input_35 = &_input.device_id;
let input_35 = input_35.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
)
})?;
let device_id = aws_smithy_http::label::fmt_string(
input_35,
aws_smithy_http::label::EncodingStrategy::Default,
);
if device_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"device_id",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}/subscriptions/{DeviceId}", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name, DeviceId = device_id).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UnsubscribeFromDatasetInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("DELETE").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from("");
let request = request.body(body).expect("should be valid request");
let mut request = aws_smithy_http::operation::Request::from_parts(request, properties);
request.properties_mut().insert(endpoint_result);
if let Some(params) = params {
request.properties_mut().insert(params);
}
request
.properties_mut()
.insert(aws_smithy_http::http_versions::DEFAULT_HTTP_VERSION_LIST.clone());
let mut user_agent = aws_http::user_agent::AwsUserAgent::new_from_environment(
aws_types::os_shim_internal::Env::real(),
crate::API_METADATA.clone(),
);
if let Some(app_name) = _config.app_name() {
user_agent = user_agent.with_app_name(app_name.clone());
}
request.properties_mut().insert(user_agent);
let mut signing_config = aws_sig_auth::signer::OperationSigningConfig::default_config();
request.properties_mut().insert(signing_config);
request
.properties_mut()
.insert(aws_types::SigningService::from_static(
_config.signing_service(),
));
if let Some(region) = &_config.region {
request
.properties_mut()
.insert(aws_types::region::SigningRegion::from(region.clone()));
}
if let Some(region) = &_config.region {
request.properties_mut().insert(region.clone());
}
aws_http::auth::set_credentials_cache(
&mut request.properties_mut(),
_config.credentials_cache.clone(),
);
let op = aws_smithy_http::operation::Operation::new(
request,
crate::operation::UnsubscribeFromDataset::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UnsubscribeFromDataset",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::unsubscribe_from_dataset_input::Builder {
crate::input::unsubscribe_from_dataset_input::Builder::default()
}
}
pub mod update_records_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) identity_pool_id: std::option::Option<std::string::String>,
pub(crate) identity_id: std::option::Option<std::string::String>,
pub(crate) dataset_name: std::option::Option<std::string::String>,
pub(crate) device_id: std::option::Option<std::string::String>,
pub(crate) record_patches: std::option::Option<std::vec::Vec<crate::model::RecordPatch>>,
pub(crate) sync_session_token: std::option::Option<std::string::String>,
pub(crate) client_context: std::option::Option<std::string::String>,
}
impl Builder {
pub fn identity_pool_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_pool_id = Some(input.into());
self
}
pub fn set_identity_pool_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.identity_pool_id = input;
self
}
pub fn identity_id(mut self, input: impl Into<std::string::String>) -> Self {
self.identity_id = Some(input.into());
self
}
pub fn set_identity_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.identity_id = input;
self
}
pub fn dataset_name(mut self, input: impl Into<std::string::String>) -> Self {
self.dataset_name = Some(input.into());
self
}
pub fn set_dataset_name(mut self, input: std::option::Option<std::string::String>) -> Self {
self.dataset_name = input;
self
}
pub fn device_id(mut self, input: impl Into<std::string::String>) -> Self {
self.device_id = Some(input.into());
self
}
pub fn set_device_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.device_id = input;
self
}
pub fn record_patches(mut self, input: crate::model::RecordPatch) -> Self {
let mut v = self.record_patches.unwrap_or_default();
v.push(input);
self.record_patches = Some(v);
self
}
pub fn set_record_patches(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RecordPatch>>,
) -> Self {
self.record_patches = input;
self
}
pub fn sync_session_token(mut self, input: impl Into<std::string::String>) -> Self {
self.sync_session_token = Some(input.into());
self
}
pub fn set_sync_session_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sync_session_token = input;
self
}
pub fn client_context(mut self, input: impl Into<std::string::String>) -> Self {
self.client_context = Some(input.into());
self
}
pub fn set_client_context(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.client_context = input;
self
}
pub fn build(
self,
) -> Result<crate::input::UpdateRecordsInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::UpdateRecordsInput {
identity_pool_id: self.identity_pool_id,
identity_id: self.identity_id,
dataset_name: self.dataset_name,
device_id: self.device_id,
record_patches: self.record_patches,
sync_session_token: self.sync_session_token,
client_context: self.client_context,
})
}
}
}
impl UpdateRecordsInput {
#[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::UpdateRecords,
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::UpdateRecordsInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
let input_36 = &_input.identity_pool_id;
let input_36 = input_36.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
)
})?;
let identity_pool_id = aws_smithy_http::label::fmt_string(
input_36,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_pool_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_pool_id",
"cannot be empty or unset",
),
);
}
let input_37 = &_input.identity_id;
let input_37 = input_37.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
)
})?;
let identity_id = aws_smithy_http::label::fmt_string(
input_37,
aws_smithy_http::label::EncodingStrategy::Default,
);
if identity_id.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"identity_id",
"cannot be empty or unset",
),
);
}
let input_38 = &_input.dataset_name;
let input_38 = input_38.as_ref().ok_or_else(|| {
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
)
})?;
let dataset_name = aws_smithy_http::label::fmt_string(
input_38,
aws_smithy_http::label::EncodingStrategy::Default,
);
if dataset_name.is_empty() {
return Err(
aws_smithy_http::operation::error::BuildError::missing_field(
"dataset_name",
"cannot be empty or unset",
),
);
}
write!(output, "/identitypools/{IdentityPoolId}/identities/{IdentityId}/datasets/{DatasetName}", IdentityPoolId = identity_pool_id, IdentityId = identity_id, DatasetName = dataset_name).expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::UpdateRecordsInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
let builder = crate::http_serde::add_headers_update_records(input, builder)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/json",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_update_records(&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::UpdateRecords::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"UpdateRecords",
"cognitosync",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::update_records_input::Builder {
crate::input::update_records_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UpdateRecordsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub record_patches: std::option::Option<std::vec::Vec<crate::model::RecordPatch>>,
#[doc(hidden)]
pub sync_session_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub client_context: std::option::Option<std::string::String>,
}
impl UpdateRecordsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
pub fn record_patches(&self) -> std::option::Option<&[crate::model::RecordPatch]> {
self.record_patches.as_deref()
}
pub fn sync_session_token(&self) -> std::option::Option<&str> {
self.sync_session_token.as_deref()
}
pub fn client_context(&self) -> std::option::Option<&str> {
self.client_context.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct UnsubscribeFromDatasetInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
}
impl UnsubscribeFromDatasetInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SubscribeToDatasetInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub device_id: std::option::Option<std::string::String>,
}
impl SubscribeToDatasetInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
pub fn device_id(&self) -> std::option::Option<&str> {
self.device_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SetIdentityPoolConfigurationInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub push_sync: std::option::Option<crate::model::PushSync>,
#[doc(hidden)]
pub cognito_streams: std::option::Option<crate::model::CognitoStreams>,
}
impl SetIdentityPoolConfigurationInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn push_sync(&self) -> std::option::Option<&crate::model::PushSync> {
self.push_sync.as_ref()
}
pub fn cognito_streams(&self) -> std::option::Option<&crate::model::CognitoStreams> {
self.cognito_streams.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct SetCognitoEventsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub events:
std::option::Option<std::collections::HashMap<std::string::String, std::string::String>>,
}
impl SetCognitoEventsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn events(
&self,
) -> std::option::Option<&std::collections::HashMap<std::string::String, std::string::String>>
{
self.events.as_ref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RegisterDeviceInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub platform: std::option::Option<crate::model::Platform>,
#[doc(hidden)]
pub token: std::option::Option<std::string::String>,
}
impl RegisterDeviceInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn platform(&self) -> std::option::Option<&crate::model::Platform> {
self.platform.as_ref()
}
pub fn token(&self) -> std::option::Option<&str> {
self.token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListRecordsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
#[doc(hidden)]
pub last_sync_count: std::option::Option<i64>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
#[doc(hidden)]
pub sync_session_token: std::option::Option<std::string::String>,
}
impl ListRecordsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
pub fn last_sync_count(&self) -> std::option::Option<i64> {
self.last_sync_count
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
pub fn sync_session_token(&self) -> std::option::Option<&str> {
self.sync_session_token.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListIdentityPoolUsageInput {
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListIdentityPoolUsageInput {
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ListDatasetsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub next_token: std::option::Option<std::string::String>,
#[doc(hidden)]
pub max_results: i32,
}
impl ListDatasetsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn next_token(&self) -> std::option::Option<&str> {
self.next_token.as_deref()
}
pub fn max_results(&self) -> i32 {
self.max_results
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetIdentityPoolConfigurationInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
}
impl GetIdentityPoolConfigurationInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetCognitoEventsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
}
impl GetCognitoEventsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct GetBulkPublishDetailsInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
}
impl GetBulkPublishDetailsInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeIdentityUsageInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
}
impl DescribeIdentityUsageInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeIdentityPoolUsageInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
}
impl DescribeIdentityPoolUsageInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DescribeDatasetInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
}
impl DescribeDatasetInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct DeleteDatasetInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub identity_id: std::option::Option<std::string::String>,
#[doc(hidden)]
pub dataset_name: std::option::Option<std::string::String>,
}
impl DeleteDatasetInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
pub fn identity_id(&self) -> std::option::Option<&str> {
self.identity_id.as_deref()
}
pub fn dataset_name(&self) -> std::option::Option<&str> {
self.dataset_name.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BulkPublishInput {
#[doc(hidden)]
pub identity_pool_id: std::option::Option<std::string::String>,
}
impl BulkPublishInput {
pub fn identity_pool_id(&self) -> std::option::Option<&str> {
self.identity_pool_id.as_deref()
}
}