Class: ModernTreasury::LedgerAccountPayoutCreateRequest
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ModernTreasury::LedgerAccountPayoutCreateRequest
- Defined in:
- lib/modern_treasury/models/ledger_account_payout_create_request.rb
Overview
LedgerAccountPayoutCreateRequest Model.
Instance Attribute Summary collapse
-
#description ⇒ String
The description of the ledger account payout.
-
#effective_at_upper_bound ⇒ DateTime
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account payout.
-
#funding_ledger_account_id ⇒ UUID | String
The id of the funding ledger account that sends to or receives funds from the payout ledger account.
-
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs.
-
#payout_ledger_account_id ⇒ UUID | String
The id of the payout ledger account whose ledger entries are queried against, and its balance is reduced as a result.
-
#skip_payout_ledger_transaction ⇒ TrueClass | FalseClass
It is set to ‘false` by default.
-
#status ⇒ Status7Enum
The status of the ledger account payout.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(payout_ledger_account_id = nil, funding_ledger_account_id = nil, description = SKIP, status = SKIP, effective_at_upper_bound = SKIP, metadata = SKIP, skip_payout_ledger_transaction = SKIP) ⇒ LedgerAccountPayoutCreateRequest
constructor
A new instance of LedgerAccountPayoutCreateRequest.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_effective_at_upper_bound ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(payout_ledger_account_id = nil, funding_ledger_account_id = nil, description = SKIP, status = SKIP, effective_at_upper_bound = SKIP, metadata = SKIP, skip_payout_ledger_transaction = SKIP) ⇒ LedgerAccountPayoutCreateRequest
Returns a new instance of LedgerAccountPayoutCreateRequest.
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 83 def initialize(payout_ledger_account_id = nil, funding_ledger_account_id = nil, description = SKIP, status = SKIP, effective_at_upper_bound = SKIP, = SKIP, skip_payout_ledger_transaction = SKIP) @description = description unless description == SKIP @status = status unless status == SKIP @payout_ledger_account_id = payout_ledger_account_id @funding_ledger_account_id = funding_ledger_account_id @effective_at_upper_bound = effective_at_upper_bound unless effective_at_upper_bound == SKIP @metadata = unless == SKIP unless skip_payout_ledger_transaction == SKIP @skip_payout_ledger_transaction = skip_payout_ledger_transaction end end |
Instance Attribute Details
#description ⇒ String
The description of the ledger account payout.
15 16 17 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 15 def description @description end |
#effective_at_upper_bound ⇒ DateTime
The exclusive upper bound of the effective_at timestamp of the ledger entries to be included in the ledger account payout. The default value is the created_at timestamp of the ledger account payout.
36 37 38 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 36 def effective_at_upper_bound @effective_at_upper_bound end |
#funding_ledger_account_id ⇒ UUID | String
The id of the funding ledger account that sends to or receives funds from the payout ledger account.
30 31 32 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 30 def funding_ledger_account_id @funding_ledger_account_id end |
#metadata ⇒ Hash[String, String]
Additional data represented as key-value pairs. Both the key and value must be strings.
41 42 43 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 41 def @metadata end |
#payout_ledger_account_id ⇒ UUID | String
The id of the payout ledger account whose ledger entries are queried against, and its balance is reduced as a result.
25 26 27 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 25 def payout_ledger_account_id @payout_ledger_account_id end |
#skip_payout_ledger_transaction ⇒ TrueClass | FalseClass
It is set to ‘false` by default. It should be set to `true` when migrating existing payouts.
46 47 48 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 46 def skip_payout_ledger_transaction @skip_payout_ledger_transaction end |
#status ⇒ Status7Enum
The status of the ledger account payout. It is set to ‘pending` by default. To post a ledger account payout at creation, use `posted`.
20 21 22 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 20 def status @status end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
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 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 100 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. payout_ledger_account_id = hash.key?('payout_ledger_account_id') ? hash['payout_ledger_account_id'] : nil funding_ledger_account_id = hash.key?('funding_ledger_account_id') ? hash['funding_ledger_account_id'] : nil description = hash.key?('description') ? hash['description'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP effective_at_upper_bound = if hash.key?('effective_at_upper_bound') (DateTimeHelper.from_rfc3339(hash['effective_at_upper_bound']) if hash['effective_at_upper_bound']) else SKIP end = hash.key?('metadata') ? hash['metadata'] : SKIP skip_payout_ledger_transaction = hash.key?('skip_payout_ledger_transaction') ? hash['skip_payout_ledger_transaction'] : SKIP # Create object from extracted values. LedgerAccountPayoutCreateRequest.new(payout_ledger_account_id, funding_ledger_account_id, description, status, effective_at_upper_bound, , skip_payout_ledger_transaction) end |
.names ⇒ Object
A mapping from model property names to API property names.
49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 49 def self.names @_hash = {} if @_hash.nil? @_hash['description'] = 'description' @_hash['status'] = 'status' @_hash['payout_ledger_account_id'] = 'payout_ledger_account_id' @_hash['funding_ledger_account_id'] = 'funding_ledger_account_id' @_hash['effective_at_upper_bound'] = 'effective_at_upper_bound' @_hash['metadata'] = 'metadata' @_hash['skip_payout_ledger_transaction'] = 'skip_payout_ledger_transaction' @_hash end |
.nullables ⇒ Object
An array for nullable fields
74 75 76 77 78 79 80 81 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 74 def self.nullables %w[ description status effective_at_upper_bound skip_payout_ledger_transaction ] end |
.optionals ⇒ Object
An array for optional fields
63 64 65 66 67 68 69 70 71 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 63 def self.optionals %w[ description status effective_at_upper_bound metadata skip_payout_ledger_transaction ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
143 144 145 146 147 148 149 150 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 143 def inspect class_name = self.class.name.split('::').last "<#{class_name} description: #{@description.inspect}, status: #{@status.inspect},"\ " payout_ledger_account_id: #{@payout_ledger_account_id.inspect}, funding_ledger_account_id:"\ " #{@funding_ledger_account_id.inspect}, effective_at_upper_bound:"\ " #{@effective_at_upper_bound.inspect}, metadata: #{@metadata.inspect},"\ " skip_payout_ledger_transaction: #{@skip_payout_ledger_transaction.inspect}>" end |
#to_custom_effective_at_upper_bound ⇒ Object
129 130 131 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 129 def to_custom_effective_at_upper_bound DateTimeHelper.to_rfc3339(effective_at_upper_bound) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
134 135 136 137 138 139 140 |
# File 'lib/modern_treasury/models/ledger_account_payout_create_request.rb', line 134 def to_s class_name = self.class.name.split('::').last "<#{class_name} description: #{@description}, status: #{@status}, payout_ledger_account_id:"\ " #{@payout_ledger_account_id}, funding_ledger_account_id: #{@funding_ledger_account_id},"\ " effective_at_upper_bound: #{@effective_at_upper_bound}, metadata: #{@metadata},"\ " skip_payout_ledger_transaction: #{@skip_payout_ledger_transaction}>" end |