Class: Merge::Accounting::BankFeedTransactionRequestRequest
- Inherits:
-
Object
- Object
- Merge::Accounting::BankFeedTransactionRequestRequest
- Defined in:
- lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.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::BankFeedTransactionRequestRequestBankFeedAccount
readonly
The bank feed account associated with the transaction.
-
#credit_or_debit ⇒ Merge::Accounting::CreditOrDebitEnum
readonly
If the transaction is of type debit or credit.
-
#description ⇒ String
readonly
The description of the transaction.
- #integration_params ⇒ Hash{String => Object} readonly
- #linked_account_params ⇒ Hash{String => Object} readonly
-
#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.
-
#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::BankFeedTransactionRequestRequest
Deserialize a JSON object to an instance of BankFeedTransactionRequestRequest.
-
.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(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, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Accounting::BankFeedTransactionRequestRequest constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of BankFeedTransactionRequestRequest to a JSON object.
Constructor Details
#initialize(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, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) ⇒ Merge::Accounting::BankFeedTransactionRequestRequest
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 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 69 def initialize(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, integration_params: OMIT, linked_account_params: OMIT, additional_properties: nil) @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 @integration_params = integration_params if integration_params != OMIT @linked_account_params = linked_account_params if linked_account_params != OMIT @additional_properties = additional_properties @_field_set = { "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, "integration_params": integration_params, "linked_account_params": linked_account_params }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
46 47 48 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 46 def additional_properties @additional_properties end |
#amount ⇒ Float (readonly)
Returns The amount of the transaction.
27 28 29 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 27 def amount @amount end |
#bank_feed_account ⇒ Merge::Accounting::BankFeedTransactionRequestRequestBankFeedAccount (readonly)
Returns The bank feed account associated with the transaction.
21 22 23 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 21 def bank_feed_account @bank_feed_account end |
#credit_or_debit ⇒ Merge::Accounting::CreditOrDebitEnum (readonly)
Returns If the transaction is of type debit or credit.
-
‘CREDIT` - CREDIT
-
‘DEBIT` - DEBIT.
38 39 40 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 38 def credit_or_debit @credit_or_debit end |
#description ⇒ String (readonly)
Returns The description of the transaction.
29 30 31 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 29 def description @description end |
#integration_params ⇒ Hash{String => Object} (readonly)
42 43 44 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 42 def integration_params @integration_params end |
#linked_account_params ⇒ Hash{String => Object} (readonly)
44 45 46 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 44 def linked_account_params @linked_account_params end |
#payee ⇒ String (readonly)
Returns The person or merchant who initiated the transaction, or alternatively, to whom the transaction was paid.
34 35 36 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 34 def payee @payee end |
#posted_date ⇒ DateTime (readonly)
Returns The date the transaction was posted to the bank account.
25 26 27 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 25 def posted_date @posted_date end |
#source_transaction_id ⇒ String (readonly)
Returns The customer’s identifier for the transaction.
40 41 42 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 40 def source_transaction_id @source_transaction_id end |
#transaction_date ⇒ DateTime (readonly)
Returns The date that the transaction occurred.
23 24 25 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 23 def transaction_date @transaction_date end |
#transaction_type ⇒ String (readonly)
Returns The underlying type of the transaction.
31 32 33 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 31 def transaction_type @transaction_type end |
Class Method Details
.from_json(json_object:) ⇒ Merge::Accounting::BankFeedTransactionRequestRequest
Deserialize a JSON object to an instance of BankFeedTransactionRequestRequest
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 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 104 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) 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::BankFeedTransactionRequestRequestBankFeedAccount.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"] integration_params = parsed_json["integration_params"] linked_account_params = parsed_json["linked_account_params"] new( 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, integration_params: integration_params, linked_account_params: linked_account_params, 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.
152 153 154 155 156 157 158 159 160 161 162 163 164 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 152 def self.validate_raw(obj:) obj.bank_feed_account.nil? || Merge::Accounting::BankFeedTransactionRequestRequestBankFeedAccount.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.integration_params&.is_a?(Hash) != false || raise("Passed value for field obj.integration_params is not the expected type, validation failed.") obj.linked_account_params&.is_a?(Hash) != false || raise("Passed value for field obj.linked_account_params is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of BankFeedTransactionRequestRequest to a JSON object
142 143 144 |
# File 'lib/merge_ruby_client/accounting/types/bank_feed_transaction_request_request.rb', line 142 def to_json(*_args) @_field_set&.to_json end |