Class: ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb,
sig/modern_treasury/models/ledger_transaction_create_partial_post_params.rbs

Defined Under Namespace

Modules: Direction

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(direction:, ledger_account_id:, amount: nil, amount_string: nil, available_balance_amount: nil, lock_version: nil, metadata: nil, pending_balance_amount: nil, posted_balance_amount: nil, show_resulting_ledger_account_balances: nil) ⇒ Object

Some parameter documentations has been truncated, see ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry for more details.

Parameters:

  • direction (Symbol, ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction)

    One of credit, debit. Describes the direction money is flowing in the transa

  • ledger_account_id (String)

    The ledger account that this ledger entry is associated with.

  • amount (Integer) (defaults to: nil)

    Value in specified currency's smallest unit. e.g. $10 would be represented as 10

  • amount_string (String) (defaults to: nil)

    The amount of the ledger entry as a string, preserving full precision for values

  • available_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • lock_version (Integer, nil) (defaults to: nil)

    Lock version of the ledger account. This can be passed when creating a ledger tr

  • metadata (Hash{Symbol=>String}) (defaults to: nil)

    Additional data represented as key-value pairs. Both the key and value must be s

  • pending_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • posted_balance_amount (Hash{Symbol=>Integer}, nil) (defaults to: nil)

    Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the accou

  • show_resulting_ledger_account_balances (Boolean, nil) (defaults to: nil)

    If true, response will include the balance of the associated ledger account for



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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 62

class PostedLedgerEntry < ModernTreasury::Internal::Type::BaseModel
  # @!attribute direction
  #   One of `credit`, `debit`. Describes the direction money is flowing in the
  #   transaction. A `credit` moves money from your account to someone else's. A
  #   `debit` pulls money from someone else's account to your own. Note that wire,
  #   rtp, and check payments will always be `credit`.
  #
  #   @return [Symbol, ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction]
  required :direction,
           enum: -> { ModernTreasury::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction }

  # @!attribute ledger_account_id
  #   The ledger account that this ledger entry is associated with.
  #
  #   @return [String]
  required :ledger_account_id, String

  # @!attribute amount
  #   Value in specified currency's smallest unit. e.g. $10 would be represented
  #   as 1000. Can be any integer up to 36 digits.
  #
  #   @return [Integer, nil]
  optional :amount, Integer

  # @!attribute amount_string
  #   The amount of the ledger entry as a string, preserving full precision for values
  #   that may exceed safe integer limits in some languages.
  #
  #   @return [String, nil]
  optional :amount_string, String

  # @!attribute available_balance_amount
  #   Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
  #   account’s available balance. If any of these conditions would be false after the
  #   transaction is created, the entire call will fail with error code 422.
  #
  #   @return [Hash{Symbol=>Integer}, nil]
  optional :available_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

  # @!attribute lock_version
  #   Lock version of the ledger account. This can be passed when creating a ledger
  #   transaction to only succeed if no ledger transactions have posted since the
  #   given version. See our post about Designing the Ledgers API with Optimistic
  #   Locking for more details.
  #
  #   @return [Integer, nil]
  optional :lock_version, Integer, nil?: true

  # @!attribute metadata
  #   Additional data represented as key-value pairs. Both the key and value must be
  #   strings.
  #
  #   @return [Hash{Symbol=>String}, nil]
  optional :metadata, ModernTreasury::Internal::Type::HashOf[String]

  # @!attribute pending_balance_amount
  #   Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
  #   account’s pending balance. If any of these conditions would be false after the
  #   transaction is created, the entire call will fail with error code 422.
  #
  #   @return [Hash{Symbol=>Integer}, nil]
  optional :pending_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

  # @!attribute posted_balance_amount
  #   Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the
  #   account’s posted balance. If any of these conditions would be false after the
  #   transaction is created, the entire call will fail with error code 422.
  #
  #   @return [Hash{Symbol=>Integer}, nil]
  optional :posted_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

  # @!attribute show_resulting_ledger_account_balances
  #   If true, response will include the balance of the associated ledger account for
  #   the entry.
  #
  #   @return [Boolean, nil]
  optional :show_resulting_ledger_account_balances, ModernTreasury::Internal::Type::Boolean, nil?: true

  # @!method initialize(direction:, ledger_account_id:, amount: nil, amount_string: nil, available_balance_amount: nil, lock_version: nil, metadata: nil, pending_balance_amount: nil, posted_balance_amount: nil, show_resulting_ledger_account_balances: nil)
  #   Some parameter documentations has been truncated, see
  #   {ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry}
  #   for more details.
  #
  #   @param direction [Symbol, ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction] One of `credit`, `debit`. Describes the direction money is flowing in the transa
  #
  #   @param ledger_account_id [String] The ledger account that this ledger entry is associated with.
  #
  #   @param amount [Integer] Value in specified currency's smallest unit. e.g. $10 would be represented as 10
  #
  #   @param amount_string [String] The amount of the ledger entry as a string, preserving full precision for values
  #
  #   @param available_balance_amount [Hash{Symbol=>Integer}, nil] Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the accou
  #
  #   @param lock_version [Integer, nil] Lock version of the ledger account. This can be passed when creating a ledger tr
  #
  #   @param metadata [Hash{Symbol=>String}] Additional data represented as key-value pairs. Both the key and value must be s
  #
  #   @param pending_balance_amount [Hash{Symbol=>Integer}, nil] Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the accou
  #
  #   @param posted_balance_amount [Hash{Symbol=>Integer}, nil] Use `gt` (>), `gte` (>=), `lt` (<), `lte` (<=), or `eq` (=) to lock on the accou
  #
  #   @param show_resulting_ledger_account_balances [Boolean, nil] If true, response will include the balance of the associated ledger account for

  # One of `credit`, `debit`. Describes the direction money is flowing in the
  # transaction. A `credit` moves money from your account to someone else's. A
  # `debit` pulls money from someone else's account to your own. Note that wire,
  # rtp, and check payments will always be `credit`.
  #
  # @see ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry#direction
  module Direction
    extend ModernTreasury::Internal::Type::Enum

    CREDIT = :credit
    DEBIT = :debit

    # @!method self.values
    #   @return [Array<Symbol>]
  end
end

Instance Attribute Details

#amountInteger?

Value in specified currency's smallest unit. e.g. $10 would be represented as 1000. Can be any integer up to 36 digits.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


84
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 84

optional :amount, Integer

#amount_stringString?

The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.

Parameters:

  • (String)

Returns:

  • (String, nil)


91
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 91

optional :amount_string, String

#available_balance_amountHash{Symbol=>Integer}?

Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the account’s available balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


99
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 99

optional :available_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

#directionSymbol, ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction

One of credit, debit. Describes the direction money is flowing in the transaction. A credit moves money from your account to someone else's. A debit pulls money from someone else's account to your own. Note that wire, rtp, and check payments will always be credit.

Parameters:

  • value (ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::direction)

Returns:



70
71
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 70

required :direction,
enum: -> { ModernTreasury::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction }

#ledger_account_idString

The ledger account that this ledger entry is associated with.

Parameters:

  • value (String)

Returns:

  • (String)


77
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 77

required :ledger_account_id, String

#lock_versionInteger?

Lock version of the ledger account. This can be passed when creating a ledger transaction to only succeed if no ledger transactions have posted since the given version. See our post about Designing the Ledgers API with Optimistic Locking for more details.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


108
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 108

optional :lock_version, Integer, nil?: true

#metadataHash{Symbol=>String}?

Additional data represented as key-value pairs. Both the key and value must be strings.

Parameters:

  • (::Hash[Symbol, String])

Returns:

  • (Hash{Symbol=>String}, nil)


115
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 115

optional :metadata, ModernTreasury::Internal::Type::HashOf[String]

#pending_balance_amountHash{Symbol=>Integer}?

Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the account’s pending balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


123
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 123

optional :pending_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

#posted_balance_amountHash{Symbol=>Integer}?

Use gt (>), gte (>=), lt (<), lte (<=), or eq (=) to lock on the account’s posted balance. If any of these conditions would be false after the transaction is created, the entire call will fail with error code 422.

Parameters:

  • value (::Hash[Symbol, Integer], nil)

Returns:

  • (Hash{Symbol=>Integer}, nil)


131
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 131

optional :posted_balance_amount, ModernTreasury::Internal::Type::HashOf[Integer], nil?: true

#show_resulting_ledger_account_balancesBoolean?

If true, response will include the balance of the associated ledger account for the entry.

Parameters:

  • value (Boolean, nil)

Returns:

  • (Boolean, nil)


138
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 138

optional :show_resulting_ledger_account_balances, ModernTreasury::Internal::Type::Boolean, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


105
# File 'sig/modern_treasury/models/ledger_transaction_create_partial_post_params.rbs', line 105

def to_hash: -> {