1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
// 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,
}
}
}