Class: Merge::Accounting::BankFeedTransaction
- Inherits:
-
Object
- Object
- Merge::Accounting::BankFeedTransaction
- Defined in:
- lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb
Overview
# The BankFeedTransaction Object
### Description
The `BankFeedTransaction` object is used to represent transactions linked to a
bank feed account. This includes details about the transaction such as the date,
amount, description, and type.
### Usage Example
Fetch from the `GET BankFeedTransaction` endpoint to view details of a
transaction associated with a bank feed account.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#amount ⇒ Float
readonly
The amount of the transaction.
-
#bank_feed_account ⇒ Merge::Accounting::BankFeedTransactionBankFeedAccount
readonly
The bank feed account associated with the transaction.
-
#created_at ⇒ DateTime
readonly
The datetime that this object was created by Merge.
-
#credit_or_debit ⇒ Merge::Accounting::CreditOrDebitEnum
readonly
If the transaction is of type debit or credit.
-
#description ⇒ String
readonly
The description of the transaction.
- #id ⇒ String readonly
-
#is_processed ⇒ Boolean
readonly
Whether or not this transaction has been processed by the external system.
-
#modified_at ⇒ DateTime
readonly
The datetime that this object was modified by Merge.
-
#payee ⇒ String
readonly
The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.
-
#posted_date ⇒ DateTime
readonly
The date the transaction was posted to the bank account.
-
#remote_id ⇒ String
readonly
The third-party API ID of the matching object.
-
#remote_was_deleted ⇒ Boolean
readonly
Indicates whether or not this object has been deleted in the third party platform.
-
#source_transaction_id ⇒ String
readonly
The customer’s identifier for the transaction.
-
#transaction_date ⇒ DateTime
readonly
The date that the transaction occurred.
-
#transaction_type ⇒ String
readonly
The underlying type of the transaction.
Class Method Summary collapse
-
.from_json(json_object:) ⇒ Merge::Accounting::BankFeedTransaction
Deserialize a JSON object to an instance of BankFeedTransaction.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, bank_feed_account: OMIT, transaction_date: OMIT, posted_date: OMIT, amount: OMIT, description: OMIT, transaction_type: OMIT, payee: OMIT, credit_or_debit: OMIT, source_transaction_id: OMIT, remote_was_deleted: OMIT, is_processed: OMIT, additional_properties: nil) ⇒ Merge::Accounting::BankFeedTransaction constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BankFeedTransaction to a JSON object.
Constructor Details
#initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, bank_feed_account: OMIT, transaction_date: OMIT, posted_date: OMIT, amount: OMIT, description: OMIT, transaction_type: OMIT, payee: OMIT, credit_or_debit: OMIT, source_transaction_id: OMIT, remote_was_deleted: OMIT, is_processed: OMIT, additional_properties: nil) ⇒ Merge::Accounting::BankFeedTransaction
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 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 91 def initialize(id: OMIT, remote_id: OMIT, created_at: OMIT, modified_at: OMIT, bank_feed_account: OMIT, transaction_date: OMIT, posted_date: OMIT, amount: OMIT, description: OMIT, transaction_type: OMIT, payee: OMIT, credit_or_debit: OMIT, source_transaction_id: OMIT, remote_was_deleted: OMIT, is_processed: OMIT, additional_properties: nil) @id = id if id != OMIT @remote_id = remote_id if remote_id != OMIT @created_at = created_at if created_at != OMIT @modified_at = modified_at if modified_at != OMIT @bank_feed_account = bank_feed_account if bank_feed_account != OMIT @transaction_date = transaction_date if transaction_date != OMIT @posted_date = posted_date if posted_date != OMIT @amount = amount if amount != OMIT @description = description if description != OMIT @transaction_type = transaction_type if transaction_type != OMIT @payee = payee if payee != OMIT @credit_or_debit = credit_or_debit if credit_or_debit != OMIT @source_transaction_id = source_transaction_id if source_transaction_id != OMIT @remote_was_deleted = remote_was_deleted if remote_was_deleted != OMIT @is_processed = is_processed if is_processed != OMIT @additional_properties = additional_properties @_field_set = { "id": id, "remote_id": remote_id, "created_at": created_at, "modified_at": modified_at, "bank_feed_account": bank_feed_account, "transaction_date": transaction_date, "posted_date": posted_date, "amount": amount, "description": description, "transaction_type": transaction_type, "payee": payee, "credit_or_debit": credit_or_debit, "source_transaction_id": source_transaction_id, "remote_was_deleted": remote_was_deleted, "is_processed": is_processed }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
59 60 61 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 59 def additional_properties @additional_properties end |
#amount ⇒ Float (readonly)
Returns The amount of the transaction.
35 36 37 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 35 def amount @amount end |
#bank_feed_account ⇒ Merge::Accounting::BankFeedTransactionBankFeedAccount (readonly)
Returns The bank feed account associated with the transaction.
29 30 31 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 29 def bank_feed_account @bank_feed_account end |
#created_at ⇒ DateTime (readonly)
Returns The datetime that this object was created by Merge.
25 26 27 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 25 def created_at @created_at end |
#credit_or_debit ⇒ Merge::Accounting::CreditOrDebitEnum (readonly)
Returns If the transaction is of type debit or credit.
-
‘CREDIT` - CREDIT
-
‘DEBIT` - DEBIT.
46 47 48 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 46 def credit_or_debit @credit_or_debit end |
#description ⇒ String (readonly)
Returns The description of the transaction.
37 38 39 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 37 def description @description end |
#id ⇒ String (readonly)
21 22 23 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 21 def id @id end |
#is_processed ⇒ Boolean (readonly)
Returns Whether or not this transaction has been processed by the external system. For example, NetSuite writes this field as True when the SuiteApp has processed the transaction.
57 58 59 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 57 def is_processed @is_processed end |
#modified_at ⇒ DateTime (readonly)
Returns The datetime that this object was modified by Merge.
27 28 29 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 27 def modified_at @modified_at end |
#payee ⇒ String (readonly)
Returns The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.
42 43 44 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 42 def payee @payee end |
#posted_date ⇒ DateTime (readonly)
Returns The date the transaction was posted to the bank account.
33 34 35 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 33 def posted_date @posted_date end |
#remote_id ⇒ String (readonly)
Returns The third-party API ID of the matching object.
23 24 25 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 23 def remote_id @remote_id end |
#remote_was_deleted ⇒ Boolean (readonly)
Returns Indicates whether or not this object has been deleted in the third party platform. Full coverage deletion detection is a premium add-on. Native deletion detection is offered for free with limited coverage. [Learn more](docs.merge.dev/integrations/hris/supported-features/).
53 54 55 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 53 def remote_was_deleted @remote_was_deleted end |
#source_transaction_id ⇒ String (readonly)
Returns The customer’s identifier for the transaction.
48 49 50 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 48 def source_transaction_id @source_transaction_id end |
#transaction_date ⇒ DateTime (readonly)
Returns The date that the transaction occurred.
31 32 33 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 31 def transaction_date @transaction_date end |
#transaction_type ⇒ String (readonly)
Returns The underlying type of the transaction.
39 40 41 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 39 def transaction_type @transaction_type end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::BankFeedTransaction
Deserialize a JSON object to an instance of BankFeedTransaction
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 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 134 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) id = parsed_json["id"] remote_id = parsed_json["remote_id"] created_at = (DateTime.parse(parsed_json["created_at"]) unless parsed_json["created_at"].nil?) modified_at = (DateTime.parse(parsed_json["modified_at"]) unless parsed_json["modified_at"].nil?) if parsed_json["bank_feed_account"].nil? bank_feed_account = nil else bank_feed_account = parsed_json["bank_feed_account"].to_json bank_feed_account = Merge::Accounting::BankFeedTransactionBankFeedAccount.from_json(json_object: bank_feed_account) end transaction_date = (DateTime.parse(parsed_json["transaction_date"]) unless parsed_json["transaction_date"].nil?) posted_date = (DateTime.parse(parsed_json["posted_date"]) unless parsed_json["posted_date"].nil?) amount = parsed_json["amount"] description = parsed_json["description"] transaction_type = parsed_json["transaction_type"] payee = parsed_json["payee"] credit_or_debit = parsed_json["credit_or_debit"] source_transaction_id = parsed_json["source_transaction_id"] remote_was_deleted = parsed_json["remote_was_deleted"] is_processed = parsed_json["is_processed"] new( id: id, remote_id: remote_id, created_at: created_at, modified_at: modified_at, bank_feed_account: bank_feed_account, transaction_date: transaction_date, posted_date: posted_date, amount: amount, description: description, transaction_type: transaction_type, payee: payee, credit_or_debit: credit_or_debit, source_transaction_id: source_transaction_id, remote_was_deleted: remote_was_deleted, is_processed: is_processed, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 190 def self.validate_raw(obj:) obj.id&.is_a?(String) != false || raise("Passed value for field obj.id is not the expected type, validation failed.") obj.remote_id&.is_a?(String) != false || raise("Passed value for field obj.remote_id is not the expected type, validation failed.") obj.created_at&.is_a?(DateTime) != false || raise("Passed value for field obj.created_at is not the expected type, validation failed.") obj.modified_at&.is_a?(DateTime) != false || raise("Passed value for field obj.modified_at is not the expected type, validation failed.") obj.bank_feed_account.nil? || Merge::Accounting::BankFeedTransactionBankFeedAccount.validate_raw(obj: obj.bank_feed_account) obj.transaction_date&.is_a?(DateTime) != false || raise("Passed value for field obj.transaction_date is not the expected type, validation failed.") obj.posted_date&.is_a?(DateTime) != false || raise("Passed value for field obj.posted_date is not the expected type, validation failed.") obj.amount&.is_a?(Float) != false || raise("Passed value for field obj.amount is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.transaction_type&.is_a?(String) != false || raise("Passed value for field obj.transaction_type is not the expected type, validation failed.") obj.payee&.is_a?(String) != false || raise("Passed value for field obj.payee is not the expected type, validation failed.") obj.credit_or_debit&.is_a?(Merge::Accounting::CreditOrDebitEnum) != false || raise("Passed value for field obj.credit_or_debit is not the expected type, validation failed.") obj.source_transaction_id&.is_a?(String) != false || raise("Passed value for field obj.source_transaction_id is not the expected type, validation failed.") obj.remote_was_deleted&.is_a?(Boolean) != false || raise("Passed value for field obj.remote_was_deleted is not the expected type, validation failed.") obj.is_processed&.is_a?(Boolean) != false || raise("Passed value for field obj.is_processed is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of BankFeedTransaction to a JSON object
180 181 182 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction.rb', line 180 def to_json(*_args) @_field_set&.to_json end |