use std::fmt::Write;
pub mod batch_meter_usage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) usage_records: std::option::Option<std::vec::Vec<crate::model::UsageRecord>>,
pub(crate) product_code: std::option::Option<std::string::String>,
}
impl Builder {
pub fn usage_records(mut self, input: crate::model::UsageRecord) -> Self {
let mut v = self.usage_records.unwrap_or_default();
v.push(input);
self.usage_records = Some(v);
self
}
pub fn set_usage_records(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::UsageRecord>>,
) -> Self {
self.usage_records = input;
self
}
pub fn product_code(mut self, input: impl Into<std::string::String>) -> Self {
self.product_code = Some(input.into());
self
}
pub fn set_product_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.product_code = input;
self
}
pub fn build(
self,
) -> Result<crate::input::BatchMeterUsageInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::BatchMeterUsageInput {
usage_records: self.usage_records,
product_code: self.product_code,
})
}
}
}
impl BatchMeterUsageInput {
#[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::BatchMeterUsage,
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::BatchMeterUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::BatchMeterUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSMPMeteringService.BatchMeterUsage",
);
builder
};
let mut properties = aws_smithy_http::property_bag::SharedPropertyBag::new();
#[allow(clippy::useless_conversion)]
let body = aws_smithy_http::body::SdkBody::from(
crate::operation_ser::serialize_operation_crate_operation_batch_meter_usage(&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::BatchMeterUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"BatchMeterUsage",
"marketplacemetering",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::batch_meter_usage_input::Builder {
crate::input::batch_meter_usage_input::Builder::default()
}
}
pub mod meter_usage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) product_code: std::option::Option<std::string::String>,
pub(crate) timestamp: std::option::Option<aws_smithy_types::DateTime>,
pub(crate) usage_dimension: std::option::Option<std::string::String>,
pub(crate) usage_quantity: std::option::Option<i32>,
pub(crate) dry_run: std::option::Option<bool>,
pub(crate) usage_allocations:
std::option::Option<std::vec::Vec<crate::model::UsageAllocation>>,
}
impl Builder {
pub fn product_code(mut self, input: impl Into<std::string::String>) -> Self {
self.product_code = Some(input.into());
self
}
pub fn set_product_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.product_code = input;
self
}
pub fn timestamp(mut self, input: aws_smithy_types::DateTime) -> Self {
self.timestamp = Some(input);
self
}
pub fn set_timestamp(
mut self,
input: std::option::Option<aws_smithy_types::DateTime>,
) -> Self {
self.timestamp = input;
self
}
pub fn usage_dimension(mut self, input: impl Into<std::string::String>) -> Self {
self.usage_dimension = Some(input.into());
self
}
pub fn set_usage_dimension(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.usage_dimension = input;
self
}
pub fn usage_quantity(mut self, input: i32) -> Self {
self.usage_quantity = Some(input);
self
}
pub fn set_usage_quantity(mut self, input: std::option::Option<i32>) -> Self {
self.usage_quantity = input;
self
}
pub fn dry_run(mut self, input: bool) -> Self {
self.dry_run = Some(input);
self
}
pub fn set_dry_run(mut self, input: std::option::Option<bool>) -> Self {
self.dry_run = input;
self
}
pub fn usage_allocations(mut self, input: crate::model::UsageAllocation) -> Self {
let mut v = self.usage_allocations.unwrap_or_default();
v.push(input);
self.usage_allocations = Some(v);
self
}
pub fn set_usage_allocations(
mut self,
input: std::option::Option<std::vec::Vec<crate::model::UsageAllocation>>,
) -> Self {
self.usage_allocations = input;
self
}
pub fn build(
self,
) -> Result<crate::input::MeterUsageInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::MeterUsageInput {
product_code: self.product_code,
timestamp: self.timestamp,
usage_dimension: self.usage_dimension,
usage_quantity: self.usage_quantity,
dry_run: self.dry_run,
usage_allocations: self.usage_allocations,
})
}
}
}
impl MeterUsageInput {
#[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::MeterUsage,
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::MeterUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::MeterUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSMPMeteringService.MeterUsage",
);
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_meter_usage(&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::MeterUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"MeterUsage",
"marketplacemetering",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::meter_usage_input::Builder {
crate::input::meter_usage_input::Builder::default()
}
}
pub mod register_usage_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) product_code: std::option::Option<std::string::String>,
pub(crate) public_key_version: std::option::Option<i32>,
pub(crate) nonce: std::option::Option<std::string::String>,
}
impl Builder {
pub fn product_code(mut self, input: impl Into<std::string::String>) -> Self {
self.product_code = Some(input.into());
self
}
pub fn set_product_code(mut self, input: std::option::Option<std::string::String>) -> Self {
self.product_code = input;
self
}
pub fn public_key_version(mut self, input: i32) -> Self {
self.public_key_version = Some(input);
self
}
pub fn set_public_key_version(mut self, input: std::option::Option<i32>) -> Self {
self.public_key_version = input;
self
}
pub fn nonce(mut self, input: impl Into<std::string::String>) -> Self {
self.nonce = Some(input.into());
self
}
pub fn set_nonce(mut self, input: std::option::Option<std::string::String>) -> Self {
self.nonce = input;
self
}
pub fn build(
self,
) -> Result<crate::input::RegisterUsageInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::RegisterUsageInput {
product_code: self.product_code,
public_key_version: self.public_key_version,
nonce: self.nonce,
})
}
}
}
impl RegisterUsageInput {
#[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::RegisterUsage,
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::RegisterUsageInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::RegisterUsageInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSMPMeteringService.RegisterUsage",
);
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_usage(&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::RegisterUsage::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"RegisterUsage",
"marketplacemetering",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::register_usage_input::Builder {
crate::input::register_usage_input::Builder::default()
}
}
pub mod resolve_customer_input {
#[derive(std::clone::Clone, std::cmp::PartialEq, std::default::Default, std::fmt::Debug)]
pub struct Builder {
pub(crate) registration_token: std::option::Option<std::string::String>,
}
impl Builder {
pub fn registration_token(mut self, input: impl Into<std::string::String>) -> Self {
self.registration_token = Some(input.into());
self
}
pub fn set_registration_token(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.registration_token = input;
self
}
pub fn build(
self,
) -> Result<crate::input::ResolveCustomerInput, aws_smithy_http::operation::error::BuildError>
{
Ok(crate::input::ResolveCustomerInput {
registration_token: self.registration_token,
})
}
}
}
impl ResolveCustomerInput {
#[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::ResolveCustomer,
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::ResolveCustomerInput,
output: &mut String,
) -> Result<(), aws_smithy_http::operation::error::BuildError> {
write!(output, "/").expect("formatting should succeed");
Ok(())
}
#[allow(clippy::unnecessary_wraps)]
fn update_http_builder(
input: &crate::input::ResolveCustomerInput,
builder: http::request::Builder,
) -> std::result::Result<
http::request::Builder,
aws_smithy_http::operation::error::BuildError,
> {
let mut uri = String::new();
uri_base(input, &mut uri)?;
Ok(builder.method("POST").uri(uri))
}
let mut builder = update_http_builder(&self, http::request::Builder::new())?;
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::CONTENT_TYPE,
"application/x-amz-json-1.1",
);
builder = aws_smithy_http::header::set_request_header_if_absent(
builder,
http::header::HeaderName::from_static("x-amz-target"),
"AWSMPMeteringService.ResolveCustomer",
);
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_resolve_customer(&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::ResolveCustomer::new(),
)
.with_metadata(aws_smithy_http::operation::Metadata::new(
"ResolveCustomer",
"marketplacemetering",
));
let op = op.with_retry_classifier(aws_http::retry::AwsResponseRetryClassifier::new());
Ok(op)
}
pub fn builder() -> crate::input::resolve_customer_input::Builder {
crate::input::resolve_customer_input::Builder::default()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct ResolveCustomerInput {
#[doc(hidden)]
pub registration_token: std::option::Option<std::string::String>,
}
impl ResolveCustomerInput {
pub fn registration_token(&self) -> std::option::Option<&str> {
self.registration_token.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct RegisterUsageInput {
#[doc(hidden)]
pub product_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub public_key_version: std::option::Option<i32>,
#[doc(hidden)]
pub nonce: std::option::Option<std::string::String>,
}
impl RegisterUsageInput {
pub fn product_code(&self) -> std::option::Option<&str> {
self.product_code.as_deref()
}
pub fn public_key_version(&self) -> std::option::Option<i32> {
self.public_key_version
}
pub fn nonce(&self) -> std::option::Option<&str> {
self.nonce.as_deref()
}
}
#[allow(missing_docs)] #[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct MeterUsageInput {
#[doc(hidden)]
pub product_code: std::option::Option<std::string::String>,
#[doc(hidden)]
pub timestamp: std::option::Option<aws_smithy_types::DateTime>,
#[doc(hidden)]
pub usage_dimension: std::option::Option<std::string::String>,
#[doc(hidden)]
pub usage_quantity: std::option::Option<i32>,
#[doc(hidden)]
pub dry_run: std::option::Option<bool>,
#[doc(hidden)]
pub usage_allocations: std::option::Option<std::vec::Vec<crate::model::UsageAllocation>>,
}
impl MeterUsageInput {
pub fn product_code(&self) -> std::option::Option<&str> {
self.product_code.as_deref()
}
pub fn timestamp(&self) -> std::option::Option<&aws_smithy_types::DateTime> {
self.timestamp.as_ref()
}
pub fn usage_dimension(&self) -> std::option::Option<&str> {
self.usage_dimension.as_deref()
}
pub fn usage_quantity(&self) -> std::option::Option<i32> {
self.usage_quantity
}
pub fn dry_run(&self) -> std::option::Option<bool> {
self.dry_run
}
pub fn usage_allocations(&self) -> std::option::Option<&[crate::model::UsageAllocation]> {
self.usage_allocations.as_deref()
}
}
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)]
pub struct BatchMeterUsageInput {
#[doc(hidden)]
pub usage_records: std::option::Option<std::vec::Vec<crate::model::UsageRecord>>,
#[doc(hidden)]
pub product_code: std::option::Option<std::string::String>,
}
impl BatchMeterUsageInput {
pub fn usage_records(&self) -> std::option::Option<&[crate::model::UsageRecord]> {
self.usage_records.as_deref()
}
pub fn product_code(&self) -> std::option::Option<&str> {
self.product_code.as_deref()
}
}