aws-sdk-payments 1.1.0

AWS SDK for AWS Payments
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>How much of the record's <code>amount</code> is outstanding, processing, settled, and canceled. The four balances add up to <code>amount</code>. Each balance is in the currency of <code>amount</code>, and a balance with nothing in it is 0.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Balances {
    /// <p>The part of the amount that isn't settled and has no settlement in progress. For an invoice, this is what remains to pay. For a credit memo, this is the credit that isn't yet applied. This balance doesn't include <code>processing</code>.</p>
    pub outstanding: ::std::option::Option<crate::types::CurrencyAmount>,
    /// <p>The part of the amount with a settlement in progress, for example a payment that's submitted but not yet confirmed. It moves to <code>settled</code> when the settlement completes, and back to <code>outstanding</code> when the settlement fails. This balance is more than 0 only when the <code>status</code> is <code>PROCESSING</code>.</p>
    pub processing: ::std::option::Option<crate::types::CurrencyAmount>,
    /// <p>The part of the amount that is settled. For an invoice, this is the amount paid or covered by credit memos. For a credit memo, this is the amount applied to invoices. This balance is 0 when nothing is settled yet.</p>
    pub settled: ::std::option::Option<crate::types::CurrencyAmount>,
    /// <p>The part of the amount that was canceled and isn't settled, for example when an invoice is voided. When a partly settled record is canceled, it keeps its <code>settled</code> balance, and the rest of the amount moves to <code>canceled</code>. This balance is more than 0 only when the <code>status</code> is <code>CANCELED</code>.</p>
    pub canceled: ::std::option::Option<crate::types::CurrencyAmount>,
}
impl Balances {
    /// <p>The part of the amount that isn't settled and has no settlement in progress. For an invoice, this is what remains to pay. For a credit memo, this is the credit that isn't yet applied. This balance doesn't include <code>processing</code>.</p>
    pub fn outstanding(&self) -> ::std::option::Option<&crate::types::CurrencyAmount> {
        self.outstanding.as_ref()
    }
    /// <p>The part of the amount with a settlement in progress, for example a payment that's submitted but not yet confirmed. It moves to <code>settled</code> when the settlement completes, and back to <code>outstanding</code> when the settlement fails. This balance is more than 0 only when the <code>status</code> is <code>PROCESSING</code>.</p>
    pub fn processing(&self) -> ::std::option::Option<&crate::types::CurrencyAmount> {
        self.processing.as_ref()
    }
    /// <p>The part of the amount that is settled. For an invoice, this is the amount paid or covered by credit memos. For a credit memo, this is the amount applied to invoices. This balance is 0 when nothing is settled yet.</p>
    pub fn settled(&self) -> ::std::option::Option<&crate::types::CurrencyAmount> {
        self.settled.as_ref()
    }
    /// <p>The part of the amount that was canceled and isn't settled, for example when an invoice is voided. When a partly settled record is canceled, it keeps its <code>settled</code> balance, and the rest of the amount moves to <code>canceled</code>. This balance is more than 0 only when the <code>status</code> is <code>CANCELED</code>.</p>
    pub fn canceled(&self) -> ::std::option::Option<&crate::types::CurrencyAmount> {
        self.canceled.as_ref()
    }
}
impl Balances {
    /// Creates a new builder-style object to manufacture [`Balances`](crate::types::Balances).
    pub fn builder() -> crate::types::builders::BalancesBuilder {
        crate::types::builders::BalancesBuilder::default()
    }
}

/// A builder for [`Balances`](crate::types::Balances).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct BalancesBuilder {
    pub(crate) outstanding: ::std::option::Option<crate::types::CurrencyAmount>,
    pub(crate) processing: ::std::option::Option<crate::types::CurrencyAmount>,
    pub(crate) settled: ::std::option::Option<crate::types::CurrencyAmount>,
    pub(crate) canceled: ::std::option::Option<crate::types::CurrencyAmount>,
}
impl BalancesBuilder {
    /// <p>The part of the amount that isn't settled and has no settlement in progress. For an invoice, this is what remains to pay. For a credit memo, this is the credit that isn't yet applied. This balance doesn't include <code>processing</code>.</p>
    /// This field is required.
    pub fn outstanding(mut self, input: crate::types::CurrencyAmount) -> Self {
        self.outstanding = ::std::option::Option::Some(input);
        self
    }
    /// <p>The part of the amount that isn't settled and has no settlement in progress. For an invoice, this is what remains to pay. For a credit memo, this is the credit that isn't yet applied. This balance doesn't include <code>processing</code>.</p>
    pub fn set_outstanding(mut self, input: ::std::option::Option<crate::types::CurrencyAmount>) -> Self {
        self.outstanding = input;
        self
    }
    /// <p>The part of the amount that isn't settled and has no settlement in progress. For an invoice, this is what remains to pay. For a credit memo, this is the credit that isn't yet applied. This balance doesn't include <code>processing</code>.</p>
    pub fn get_outstanding(&self) -> &::std::option::Option<crate::types::CurrencyAmount> {
        &self.outstanding
    }
    /// <p>The part of the amount with a settlement in progress, for example a payment that's submitted but not yet confirmed. It moves to <code>settled</code> when the settlement completes, and back to <code>outstanding</code> when the settlement fails. This balance is more than 0 only when the <code>status</code> is <code>PROCESSING</code>.</p>
    /// This field is required.
    pub fn processing(mut self, input: crate::types::CurrencyAmount) -> Self {
        self.processing = ::std::option::Option::Some(input);
        self
    }
    /// <p>The part of the amount with a settlement in progress, for example a payment that's submitted but not yet confirmed. It moves to <code>settled</code> when the settlement completes, and back to <code>outstanding</code> when the settlement fails. This balance is more than 0 only when the <code>status</code> is <code>PROCESSING</code>.</p>
    pub fn set_processing(mut self, input: ::std::option::Option<crate::types::CurrencyAmount>) -> Self {
        self.processing = input;
        self
    }
    /// <p>The part of the amount with a settlement in progress, for example a payment that's submitted but not yet confirmed. It moves to <code>settled</code> when the settlement completes, and back to <code>outstanding</code> when the settlement fails. This balance is more than 0 only when the <code>status</code> is <code>PROCESSING</code>.</p>
    pub fn get_processing(&self) -> &::std::option::Option<crate::types::CurrencyAmount> {
        &self.processing
    }
    /// <p>The part of the amount that is settled. For an invoice, this is the amount paid or covered by credit memos. For a credit memo, this is the amount applied to invoices. This balance is 0 when nothing is settled yet.</p>
    /// This field is required.
    pub fn settled(mut self, input: crate::types::CurrencyAmount) -> Self {
        self.settled = ::std::option::Option::Some(input);
        self
    }
    /// <p>The part of the amount that is settled. For an invoice, this is the amount paid or covered by credit memos. For a credit memo, this is the amount applied to invoices. This balance is 0 when nothing is settled yet.</p>
    pub fn set_settled(mut self, input: ::std::option::Option<crate::types::CurrencyAmount>) -> Self {
        self.settled = input;
        self
    }
    /// <p>The part of the amount that is settled. For an invoice, this is the amount paid or covered by credit memos. For a credit memo, this is the amount applied to invoices. This balance is 0 when nothing is settled yet.</p>
    pub fn get_settled(&self) -> &::std::option::Option<crate::types::CurrencyAmount> {
        &self.settled
    }
    /// <p>The part of the amount that was canceled and isn't settled, for example when an invoice is voided. When a partly settled record is canceled, it keeps its <code>settled</code> balance, and the rest of the amount moves to <code>canceled</code>. This balance is more than 0 only when the <code>status</code> is <code>CANCELED</code>.</p>
    /// This field is required.
    pub fn canceled(mut self, input: crate::types::CurrencyAmount) -> Self {
        self.canceled = ::std::option::Option::Some(input);
        self
    }
    /// <p>The part of the amount that was canceled and isn't settled, for example when an invoice is voided. When a partly settled record is canceled, it keeps its <code>settled</code> balance, and the rest of the amount moves to <code>canceled</code>. This balance is more than 0 only when the <code>status</code> is <code>CANCELED</code>.</p>
    pub fn set_canceled(mut self, input: ::std::option::Option<crate::types::CurrencyAmount>) -> Self {
        self.canceled = input;
        self
    }
    /// <p>The part of the amount that was canceled and isn't settled, for example when an invoice is voided. When a partly settled record is canceled, it keeps its <code>settled</code> balance, and the rest of the amount moves to <code>canceled</code>. This balance is more than 0 only when the <code>status</code> is <code>CANCELED</code>.</p>
    pub fn get_canceled(&self) -> &::std::option::Option<crate::types::CurrencyAmount> {
        &self.canceled
    }
    /// Consumes the builder and constructs a [`Balances`](crate::types::Balances).
    pub fn build(self) -> crate::types::Balances {
        crate::types::Balances {
            outstanding: self.outstanding,
            processing: self.processing,
            settled: self.settled,
            canceled: self.canceled,
        }
    }
}