aws-sdk-appmonetization 1.0.0

AWS SDK for AWS App Monetization
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::put_aws_service_event::_put_aws_service_event_input::PutAwsServiceEventInputBuilder;

pub use crate::operation::put_aws_service_event::_put_aws_service_event_output::PutAwsServiceEventOutputBuilder;

impl crate::operation::put_aws_service_event::builders::PutAwsServiceEventInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::put_aws_service_event::PutAwsServiceEventOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_aws_service_event::PutAwsServiceEventError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_aws_service_event();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutAwsServiceEvent`.
///
/// Records an AWS service usage event for cost attribution. The event is accepted and processed asynchronously.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutAwsServiceEventFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_aws_service_event::builders::PutAwsServiceEventInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_aws_service_event::PutAwsServiceEventOutput,
        crate::operation::put_aws_service_event::PutAwsServiceEventError,
    > for PutAwsServiceEventFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_aws_service_event::PutAwsServiceEventOutput,
            crate::operation::put_aws_service_event::PutAwsServiceEventError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutAwsServiceEventFluentBuilder {
    /// Creates a new `PutAwsServiceEventFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the PutAwsServiceEvent as a reference.
    pub fn as_input(&self) -> &crate::operation::put_aws_service_event::builders::PutAwsServiceEventInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::put_aws_service_event::PutAwsServiceEventOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_aws_service_event::PutAwsServiceEventError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::put_aws_service_event::PutAwsServiceEvent::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_aws_service_event::PutAwsServiceEvent::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::put_aws_service_event::PutAwsServiceEventOutput,
        crate::operation::put_aws_service_event::PutAwsServiceEventError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// The ID of the app.
    pub fn app_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.app_id(input.into());
        self
    }
    /// The ID of the app.
    pub fn set_app_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_app_id(input);
        self
    }
    /// The ID of the app.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_app_id()
    }
    /// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// A unique, case-sensitive identifier to ensure that the operation completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.user_id(input.into());
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_user_id(input);
        self
    }
    /// An opaque identifier that you assign to an end user. Do not include personally identifiable or otherwise sensitive data in this value.
    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_user_id()
    }
    /// The AWS service name that emitted the usage event.
    pub fn service(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.service(input.into());
        self
    }
    /// The AWS service name that emitted the usage event.
    pub fn set_service(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_service(input);
        self
    }
    /// The AWS service name that emitted the usage event.
    pub fn get_service(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_service()
    }
    /// The AWS operation (API action) that produced the usage event.
    pub fn operation(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.operation(input.into());
        self
    }
    /// The AWS operation (API action) that produced the usage event.
    pub fn set_operation(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_operation(input);
        self
    }
    /// The AWS operation (API action) that produced the usage event.
    pub fn get_operation(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_operation()
    }
    /// A non-negative decimal quantity represented as a string (for example, "1500" or "12.5").
    pub fn quantity(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.quantity(input.into());
        self
    }
    /// A non-negative decimal quantity represented as a string (for example, "1500" or "12.5").
    pub fn set_quantity(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_quantity(input);
        self
    }
    /// A non-negative decimal quantity represented as a string (for example, "1500" or "12.5").
    pub fn get_quantity(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_quantity()
    }
    /// The time the event occurred, as an ISO-8601 date-time in UTC (for example, "2026-07-26T15:04:05Z").
    pub fn timestamp(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.inner = self.inner.timestamp(input);
        self
    }
    /// The time the event occurred, as an ISO-8601 date-time in UTC (for example, "2026-07-26T15:04:05Z").
    pub fn set_timestamp(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.inner = self.inner.set_timestamp(input);
        self
    }
    /// The time the event occurred, as an ISO-8601 date-time in UTC (for example, "2026-07-26T15:04:05Z").
    pub fn get_timestamp(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        self.inner.get_timestamp()
    }
    /// The AWS Region in which the event occurred.
    pub fn aws_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.aws_region(input.into());
        self
    }
    /// The AWS Region in which the event occurred.
    pub fn set_aws_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_aws_region(input);
        self
    }
    /// The AWS Region in which the event occurred.
    pub fn get_aws_region(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_aws_region()
    }
    ///
    /// Adds a key-value pair to `properties`.
    ///
    /// To override the contents of this collection use [`set_properties`](Self::set_properties).
    ///
    /// The key/value properties carried on a usage event. Property values can be referenced by metric filters and grouping.
    pub fn properties(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.properties(k.into(), v.into());
        self
    }
    /// The key/value properties carried on a usage event. Property values can be referenced by metric filters and grouping.
    pub fn set_properties(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.inner = self.inner.set_properties(input);
        self
    }
    /// The key/value properties carried on a usage event. Property values can be referenced by metric filters and grouping.
    pub fn get_properties(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.inner.get_properties()
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn scope(mut self, input: crate::types::RequestScope) -> Self {
        self.inner = self.inner.scope(input);
        self
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn set_scope(mut self, input: ::std::option::Option<crate::types::RequestScope>) -> Self {
        self.inner = self.inner.set_scope(input);
        self
    }
    /// The environment of the app that this operation applies to. Specify live to use the live app, or sandbox to use the app's isolated test environment.
    pub fn get_scope(&self) -> &::std::option::Option<crate::types::RequestScope> {
        self.inner.get_scope()
    }
}