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_third_party_cost::_put_third_party_cost_input::PutThirdPartyCostInputBuilder;

pub use crate::operation::put_third_party_cost::_put_third_party_cost_output::PutThirdPartyCostOutputBuilder;

impl crate::operation::put_third_party_cost::builders::PutThirdPartyCostInputBuilder {
    /// 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_third_party_cost::PutThirdPartyCostOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_third_party_cost::PutThirdPartyCostError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.put_third_party_cost();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `PutThirdPartyCost`.
///
/// Adds or updates a seller-declared third-party (non-AWS) monthly cost for an app. Omit the cost identifier to create a new cost, or supply an existing cost identifier to update it in place. The amount is a flat monthly value, and currency defaults to USD when omitted.
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct PutThirdPartyCostFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::put_third_party_cost::builders::PutThirdPartyCostInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::put_third_party_cost::PutThirdPartyCostOutput,
        crate::operation::put_third_party_cost::PutThirdPartyCostError,
    > for PutThirdPartyCostFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::put_third_party_cost::PutThirdPartyCostOutput,
            crate::operation::put_third_party_cost::PutThirdPartyCostError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl PutThirdPartyCostFluentBuilder {
    /// Creates a new `PutThirdPartyCostFluentBuilder`.
    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 PutThirdPartyCost as a reference.
    pub fn as_input(&self) -> &crate::operation::put_third_party_cost::builders::PutThirdPartyCostInputBuilder {
        &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_third_party_cost::PutThirdPartyCostOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::put_third_party_cost::PutThirdPartyCostError,
            ::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_third_party_cost::PutThirdPartyCost::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::put_third_party_cost::PutThirdPartyCost::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_third_party_cost::PutThirdPartyCostOutput,
        crate::operation::put_third_party_cost::PutThirdPartyCostError,
        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 the cost belongs to.
    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 the cost belongs to.
    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 the cost belongs to.
    pub fn get_app_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_app_id()
    }
    /// The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.
    pub fn cost_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.cost_id(input.into());
        self
    }
    /// The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.
    pub fn set_cost_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_cost_id(input);
        self
    }
    /// The ID of the cost. Omit it to create a new cost, or supply an existing cost ID to update that cost in place.
    pub fn get_cost_id(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_cost_id()
    }
    /// A human-readable label for the cost (for example, "Anthropic API").
    pub fn label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.label(input.into());
        self
    }
    /// A human-readable label for the cost (for example, "Anthropic API").
    pub fn set_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_label(input);
        self
    }
    /// A human-readable label for the cost (for example, "Anthropic API").
    pub fn get_label(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_label()
    }
    /// A flat monthly amount as a decimal string (for example, "12.50").
    pub fn amount(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.amount(input.into());
        self
    }
    /// A flat monthly amount as a decimal string (for example, "12.50").
    pub fn set_amount(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_amount(input);
        self
    }
    /// A flat monthly amount as a decimal string (for example, "12.50").
    pub fn get_amount(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_amount()
    }
    /// How often the cost recurs. MONTHLY is the only value today.
    pub fn frequency(mut self, input: crate::types::ThirdPartyCostFrequency) -> Self {
        self.inner = self.inner.frequency(input);
        self
    }
    /// How often the cost recurs. MONTHLY is the only value today.
    pub fn set_frequency(mut self, input: ::std::option::Option<crate::types::ThirdPartyCostFrequency>) -> Self {
        self.inner = self.inner.set_frequency(input);
        self
    }
    /// How often the cost recurs. MONTHLY is the only value today.
    pub fn get_frequency(&self) -> &::std::option::Option<crate::types::ThirdPartyCostFrequency> {
        self.inner.get_frequency()
    }
    /// The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).
    pub fn currency(mut self, input: crate::types::Currency) -> Self {
        self.inner = self.inner.currency(input);
        self
    }
    /// The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).
    pub fn set_currency(mut self, input: ::std::option::Option<crate::types::Currency>) -> Self {
        self.inner = self.inner.set_currency(input);
        self
    }
    /// The currency of the amount. Defaults to USD when omitted (USD is the only supported currency).
    pub fn get_currency(&self) -> &::std::option::Option<crate::types::Currency> {
        self.inner.get_currency()
    }
    /// A free-form description of the cost.
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.description(input.into());
        self
    }
    /// A free-form description of the cost.
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_description(input);
        self
    }
    /// A free-form description of the cost.
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_description()
    }
    /// First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
    pub fn effective_from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.effective_from(input.into());
        self
    }
    /// First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
    pub fn set_effective_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_effective_from(input);
        self
    }
    /// First month (YYYY-MM) the cost applies in. Absent means the cost has no start month.
    pub fn get_effective_from(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_effective_from()
    }
    /// Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.
    pub fn effective_to(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.effective_to(input.into());
        self
    }
    /// Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.
    pub fn set_effective_to(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_effective_to(input);
        self
    }
    /// Last month (YYYY-MM) the cost applies in. Absent means the cost has no end month. When both are present, effectiveFrom must not be after effectiveTo.
    pub fn get_effective_to(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_effective_to()
    }
    /// AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the `costId` returned by the first call.
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.client_token(input.into());
        self
    }
    /// AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the `costId` returned by the first call.
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_client_token(input);
        self
    }
    /// AWS App Monetization does not use this value for this operation. To retry without creating a duplicate cost, pass the `costId` returned by the first call.
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_client_token()
    }
}