Class: ModernTreasury::Models::LedgerEntryCreateRequest

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/modern_treasury/models/ledger_entry_create_request.rb

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(amount: , direction: , ledger_account_id: , 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::LedgerEntryCreateRequest for more details.

Parameters:

  • amount (Integer) (defaults to: )

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

  • direction (Symbol, ModernTreasury::Models::TransactionDirection) (defaults to: )

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

  • ledger_account_id (String) (defaults to: )

    The ledger account that this ledger entry is associated with.

  • 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



# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 75


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.

Returns:

  • (Integer)


11
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 11

required :amount, Integer

#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.

Returns:

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


34
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 34

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

#directionSymbol, ModernTreasury::Models::TransactionDirection

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`.



20
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 20

required :direction, enum: -> { ModernTreasury::TransactionDirection }

#ledger_account_idString

The ledger account that this ledger entry is associated with.

Returns:

  • (String)


26
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 26

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.

Returns:

  • (Integer, nil)


43
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 43

optional :lock_version, Integer, nil?: true

#metadataHash{Symbol=>String}?

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

Returns:

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


50
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 50

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.

Returns:

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


58
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 58

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.

Returns:

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


66
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 66

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.

Returns:

  • (Boolean, nil)


73
# File 'lib/modern_treasury/models/ledger_entry_create_request.rb', line 73

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