Class: ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry
- Inherits:
-
Internal::Type::BaseModel
- Object
- Internal::Type::BaseModel
- ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry
- 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
-
#amount ⇒ Integer?
Value in specified currency's smallest unit.
-
#amount_string ⇒ String?
The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.
-
#available_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s available balance. -
#direction ⇒ Symbol, ModernTreasury::Models::LedgerTransactionCreatePartialPostParams::PostedLedgerEntry::Direction
One of
credit,debit. -
#ledger_account_id ⇒ String
The ledger account that this ledger entry is associated with.
-
#lock_version ⇒ Integer?
Lock version of the ledger account.
-
#metadata ⇒ Hash{Symbol=>String}?
Additional data represented as key-value pairs.
-
#pending_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s pending balance. -
#posted_balance_amount ⇒ Hash{Symbol=>Integer}?
Use
gt(>),gte(>=),lt(<),lte(<=), oreq(=) to lock on the account’s posted balance. -
#show_resulting_ledger_account_balances ⇒ Boolean?
If true, response will include the balance of the associated ledger account for the entry.
Instance Method Summary collapse
-
#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
constructor
Some parameter documentations has been truncated, see PostedLedgerEntry for more details.
- #to_hash ⇒ {
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.
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
#amount ⇒ Integer?
Value in specified currency's smallest unit. e.g. $10 would be represented as 1000. Can be any integer up to 36 digits.
84 |
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 84 optional :amount, Integer |
#amount_string ⇒ String?
The amount of the ledger entry as a string, preserving full precision for values that may exceed safe integer limits in some languages.
91 |
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 91 optional :amount_string, String |
#available_balance_amount ⇒ Hash{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.
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 |
#direction ⇒ Symbol, 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.
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_id ⇒ String
The ledger account that this ledger entry is associated with.
77 |
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 77 required :ledger_account_id, String |
#lock_version ⇒ Integer?
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.
108 |
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 108 optional :lock_version, Integer, nil?: true |
#metadata ⇒ Hash{Symbol=>String}?
Additional data represented as key-value pairs. Both the key and value must be strings.
115 |
# File 'lib/modern_treasury/models/ledger_transaction_create_partial_post_params.rb', line 115 optional :metadata, ModernTreasury::Internal::Type::HashOf[String] |
#pending_balance_amount ⇒ Hash{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.
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_amount ⇒ Hash{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.
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_balances ⇒ Boolean?
If true, response will include the balance of the associated ledger account for the entry.
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 ⇒ {
105 |
# File 'sig/modern_treasury/models/ledger_transaction_create_partial_post_params.rbs', line 105
def to_hash: -> {
|