Class: ThePlaidApi::SimulatedTransferSweep
- Inherits:
-
BaseModel
- Object
- CoreLibrary::BaseModel
- BaseModel
- ThePlaidApi::SimulatedTransferSweep
- Defined in:
- lib/the_plaid_api/models/simulated_transfer_sweep.rb
Overview
A sweep returned from the ‘/sandbox/transfer/sweep/simulate` endpoint. Can be null if there are no transfers to include in a sweep.
Instance Attribute Summary collapse
-
#amount ⇒ String
Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. “-10.00”) If amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced.
-
#created ⇒ DateTime
The datetime when the sweep occurred, in RFC 3339 format.
-
#description ⇒ String
The description of the deposit that will be passed to the receiving bank (up to 10 characters).
-
#expected_funds_available_date ⇒ Date
The expected date when funds from a ledger deposit will be made available and can be withdrawn from the associated ledger balance.
-
#failure_reason ⇒ SweepFailure
The failure reason if the status for a sweep is ‘“failed”` or `“returned”`.
-
#funding_account_id ⇒ String
The id of the funding account to use, available in the Plaid Dashboard.
-
#id ⇒ String
Identifier of the sweep.
-
#iso_currency_code ⇒ String
The currency of the sweep, e.g.
-
#ledger_id ⇒ String
Plaid’s unique identifier for a Plaid Ledger Balance.
-
#network_trace_id ⇒ String
The trace identifier for the transfer based on its network.
-
#settled ⇒ Date
The date when the sweep settled, in the YYYY-MM-DD format.
-
#status ⇒ SweepStatus
The status of a sweep transfer ‘“pending”` - The sweep is currently pending `“posted”` - The sweep has been posted `“settled”` - The sweep has settled.
-
#trigger ⇒ SweepTrigger
The trigger of the sweep ‘“manual”` - The sweep is created manually by the customer `“incoming”` - The sweep is created by incoming funds flow (e.g. Incoming Wire) `“balance_threshold”` - The sweep is created by balance threshold setting `“automatic_aggregate”` - The sweep is created by the Plaid automatic aggregation process.
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(id:, funding_account_id:, created:, amount:, iso_currency_code:, settled:, ledger_id: SKIP, expected_funds_available_date: SKIP, status: SKIP, trigger: SKIP, description: SKIP, network_trace_id: SKIP, failure_reason: SKIP, additional_properties: nil) ⇒ SimulatedTransferSweep
constructor
A new instance of SimulatedTransferSweep.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_created ⇒ 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(id:, funding_account_id:, created:, amount:, iso_currency_code:, settled:, ledger_id: SKIP, expected_funds_available_date: SKIP, status: SKIP, trigger: SKIP, description: SKIP, network_trace_id: SKIP, failure_reason: SKIP, additional_properties: nil) ⇒ SimulatedTransferSweep
Returns a new instance of SimulatedTransferSweep.
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 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 147 def initialize(id:, funding_account_id:, created:, amount:, iso_currency_code:, settled:, ledger_id: SKIP, expected_funds_available_date: SKIP, status: SKIP, trigger: SKIP, description: SKIP, network_trace_id: SKIP, failure_reason: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @id = id @funding_account_id = funding_account_id @ledger_id = ledger_id unless ledger_id == SKIP @created = created @amount = amount @iso_currency_code = iso_currency_code @settled = settled unless expected_funds_available_date == SKIP @expected_funds_available_date = expected_funds_available_date end @status = status unless status == SKIP @trigger = trigger unless trigger == SKIP @description = description unless description == SKIP @network_trace_id = network_trace_id unless network_trace_id == SKIP @failure_reason = failure_reason unless failure_reason == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#amount ⇒ String
Signed decimal amount of the sweep as it appears on your sweep account ledger (e.g. “-10.00”) If amount is not present, the sweep was net-settled to zero and outstanding debits and credits between the sweep account and Plaid are balanced.
38 39 40 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 38 def amount @amount end |
#created ⇒ DateTime
The datetime when the sweep occurred, in RFC 3339 format.
30 31 32 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 30 def created @created end |
#description ⇒ String
The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement.
85 86 87 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 85 def description @description end |
#expected_funds_available_date ⇒ Date
The expected date when funds from a ledger deposit will be made available and can be withdrawn from the associated ledger balance. Only applies to deposits. This will be of the form YYYY-MM-DD.
52 53 54 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 52 def expected_funds_available_date @expected_funds_available_date end |
#failure_reason ⇒ SweepFailure
The failure reason if the status for a sweep is ‘“failed”` or `“returned”`. Null value otherwise.
99 100 101 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 99 def failure_reason @failure_reason end |
#funding_account_id ⇒ String
The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited.
22 23 24 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 22 def funding_account_id @funding_account_id end |
#id ⇒ String
Identifier of the sweep.
16 17 18 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 16 def id @id end |
#iso_currency_code ⇒ String
The currency of the sweep, e.g. “USD”.
42 43 44 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 42 def iso_currency_code @iso_currency_code end |
#ledger_id ⇒ String
Plaid’s unique identifier for a Plaid Ledger Balance.
26 27 28 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 26 def ledger_id @ledger_id end |
#network_trace_id ⇒ String
The trace identifier for the transfer based on its network. This will only be set after the transfer has posted. For ‘ach` or `same-day-ach` transfers, this is the ACH trace number. For `rtp` transfers, this is the Transaction Identification number. For `wire` transfers, this is the IMAD (Input Message Accountability Data) number.
94 95 96 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 94 def network_trace_id @network_trace_id end |
#settled ⇒ Date
The date when the sweep settled, in the YYYY-MM-DD format.
46 47 48 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 46 def settled @settled end |
#status ⇒ SweepStatus
The status of a sweep transfer ‘“pending”` - The sweep is currently pending `“posted”` - The sweep has been posted `“settled”` - The sweep has settled. This is the terminal state of a successful credit sweep. `“returned”` - The sweep has been returned. This is the terminal state of a returned sweep. Returns of a sweep are extremely rare, since sweeps are money movement between your own bank account and your own Ledger. `“funds_available”` - Funds from the sweep have been released from hold and applied to the ledger’s available balance. (Only applicable to deposits.) This is the terminal state of a successful deposit sweep. ‘“failed”` - The sweep has failed. This is the terminal state of a failed sweep.
68 69 70 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 68 def status @status end |
#trigger ⇒ SweepTrigger
The trigger of the sweep ‘“manual”` - The sweep is created manually by the customer `“incoming”` - The sweep is created by incoming funds flow (e.g. Incoming Wire) `“balance_threshold”` - The sweep is created by balance threshold setting `“automatic_aggregate”` - The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance.
79 80 81 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 79 def trigger @trigger end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 175 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. id = hash.key?('id') ? hash['id'] : nil funding_account_id = hash.key?('funding_account_id') ? hash['funding_account_id'] : nil created = if hash.key?('created') (DateTimeHelper.from_rfc3339(hash['created']) if hash['created']) end amount = hash.key?('amount') ? hash['amount'] : nil iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil settled = hash.key?('settled') ? hash['settled'] : nil ledger_id = hash.key?('ledger_id') ? hash['ledger_id'] : SKIP expected_funds_available_date = hash.key?('expected_funds_available_date') ? hash['expected_funds_available_date'] : SKIP status = hash.key?('status') ? hash['status'] : SKIP trigger = hash.key?('trigger') ? hash['trigger'] : SKIP description = hash.key?('description') ? hash['description'] : SKIP network_trace_id = hash.key?('network_trace_id') ? hash['network_trace_id'] : SKIP failure_reason = SweepFailure.from_hash(hash['failure_reason']) if hash['failure_reason'] # Create a new hash for additional properties, removing known properties. new_hash = hash.reject { |k, _| names.value?(k) } additional_properties = APIHelper.get_additional_properties( new_hash, proc { |value| value } ) # Create object from extracted values. SimulatedTransferSweep.new(id: id, funding_account_id: funding_account_id, created: created, amount: amount, iso_currency_code: iso_currency_code, settled: settled, ledger_id: ledger_id, expected_funds_available_date: expected_funds_available_date, status: status, trigger: trigger, description: description, network_trace_id: network_trace_id, failure_reason: failure_reason, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 102 def self.names @_hash = {} if @_hash.nil? @_hash['id'] = 'id' @_hash['funding_account_id'] = 'funding_account_id' @_hash['ledger_id'] = 'ledger_id' @_hash['created'] = 'created' @_hash['amount'] = 'amount' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['settled'] = 'settled' @_hash['expected_funds_available_date'] = 'expected_funds_available_date' @_hash['status'] = 'status' @_hash['trigger'] = 'trigger' @_hash['description'] = 'description' @_hash['network_trace_id'] = 'network_trace_id' @_hash['failure_reason'] = 'failure_reason' @_hash end |
.nullables ⇒ Object
An array for nullable fields
135 136 137 138 139 140 141 142 143 144 145 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 135 def self.nullables %w[ ledger_id settled expected_funds_available_date status trigger network_trace_id failure_reason ] end |
.optionals ⇒ Object
An array for optional fields
122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 122 def self.optionals %w[ ledger_id expected_funds_available_date status trigger description network_trace_id failure_reason ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
239 240 241 242 243 244 245 246 247 248 249 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 239 def inspect class_name = self.class.name.split('::').last "<#{class_name} id: #{@id.inspect}, funding_account_id: #{@funding_account_id.inspect},"\ " ledger_id: #{@ledger_id.inspect}, created: #{@created.inspect}, amount:"\ " #{@amount.inspect}, iso_currency_code: #{@iso_currency_code.inspect}, settled:"\ " #{@settled.inspect}, expected_funds_available_date:"\ " #{@expected_funds_available_date.inspect}, status: #{@status.inspect}, trigger:"\ " #{@trigger.inspect}, description: #{@description.inspect}, network_trace_id:"\ " #{@network_trace_id.inspect}, failure_reason: #{@failure_reason.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_created ⇒ Object
223 224 225 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 223 def to_custom_created DateTimeHelper.to_rfc3339(created) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
228 229 230 231 232 233 234 235 236 |
# File 'lib/the_plaid_api/models/simulated_transfer_sweep.rb', line 228 def to_s class_name = self.class.name.split('::').last "<#{class_name} id: #{@id}, funding_account_id: #{@funding_account_id}, ledger_id:"\ " #{@ledger_id}, created: #{@created}, amount: #{@amount}, iso_currency_code:"\ " #{@iso_currency_code}, settled: #{@settled}, expected_funds_available_date:"\ " #{@expected_funds_available_date}, status: #{@status}, trigger: #{@trigger}, description:"\ " #{@description}, network_trace_id: #{@network_trace_id}, failure_reason:"\ " #{@failure_reason}, additional_properties: #{@additional_properties}>" end |