apimatic-ak-sdk 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (229) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +190 -0
  4. data/bin/console +15 -0
  5. data/lib/akoya/api_helper.rb +10 -0
  6. data/lib/akoya/client.rb +117 -0
  7. data/lib/akoya/configuration.rb +195 -0
  8. data/lib/akoya/controllers/account_information_controller.rb +93 -0
  9. data/lib/akoya/controllers/balances_controller.rb +92 -0
  10. data/lib/akoya/controllers/base_controller.rb +65 -0
  11. data/lib/akoya/controllers/customers_controller.rb +112 -0
  12. data/lib/akoya/controllers/investments_controller.rb +95 -0
  13. data/lib/akoya/controllers/payments_controller.rb +70 -0
  14. data/lib/akoya/controllers/statements_controller.rb +158 -0
  15. data/lib/akoya/controllers/tokens_controller.rb +122 -0
  16. data/lib/akoya/controllers/transactions_controller.rb +108 -0
  17. data/lib/akoya/exceptions/api_exception.rb +21 -0
  18. data/lib/akoya/exceptions/error_entity_exception.rb +54 -0
  19. data/lib/akoya/exceptions/error_response_exception.rb +53 -0
  20. data/lib/akoya/http/api_response.rb +19 -0
  21. data/lib/akoya/http/auth/basic_auth.rb +62 -0
  22. data/lib/akoya/http/auth/bearer_auth.rb +53 -0
  23. data/lib/akoya/http/http_call_back.rb +10 -0
  24. data/lib/akoya/http/http_method_enum.rb +10 -0
  25. data/lib/akoya/http/http_request.rb +10 -0
  26. data/lib/akoya/http/http_response.rb +10 -0
  27. data/lib/akoya/http/proxy_settings.rb +22 -0
  28. data/lib/akoya/logging/configuration/api_logging_configuration.rb +186 -0
  29. data/lib/akoya/logging/sdk_logger.rb +17 -0
  30. data/lib/akoya/models/account.rb +86 -0
  31. data/lib/akoya/models/account_category.rb +50 -0
  32. data/lib/akoya/models/account_contact_entity.rb +132 -0
  33. data/lib/akoya/models/account_holder_entity.rb +178 -0
  34. data/lib/akoya/models/account_holder_relationship.rb +110 -0
  35. data/lib/akoya/models/account_holder_relationship_account_holder_entity.rb +110 -0
  36. data/lib/akoya/models/account_information.rb +335 -0
  37. data/lib/akoya/models/action.rb +48 -0
  38. data/lib/akoya/models/address.rb +144 -0
  39. data/lib/akoya/models/akoya_account_info_product.rb +88 -0
  40. data/lib/akoya/models/an_array_of_statements.rb +95 -0
  41. data/lib/akoya/models/an_investment_holding.rb +493 -0
  42. data/lib/akoya/models/annual_increase_type.rb +40 -0
  43. data/lib/akoya/models/annuity_account.rb +370 -0
  44. data/lib/akoya/models/annuity_account_info.rb +86 -0
  45. data/lib/akoya/models/annuity_balance_details.rb +87 -0
  46. data/lib/akoya/models/annuity_balances.rb +477 -0
  47. data/lib/akoya/models/annuity_product_type.rb +36 -0
  48. data/lib/akoya/models/annuity_value_basis.rb +36 -0
  49. data/lib/akoya/models/array_of_account_payment_networks.rb +85 -0
  50. data/lib/akoya/models/asset_class.rb +95 -0
  51. data/lib/akoya/models/asset_class_an_investment_holding.rb +85 -0
  52. data/lib/akoya/models/asset_class_asset_class.rb +56 -0
  53. data/lib/akoya/models/asset_class_citi_bank_investment_holdings.rb +86 -0
  54. data/lib/akoya/models/balance_type.rb +37 -0
  55. data/lib/akoya/models/balance_type_investment_balance_list.rb +36 -0
  56. data/lib/akoya/models/balances.rb +88 -0
  57. data/lib/akoya/models/base_model.rb +110 -0
  58. data/lib/akoya/models/business_customer_entity.rb +127 -0
  59. data/lib/akoya/models/business_customer_entity_account_holder_entity.rb +126 -0
  60. data/lib/akoya/models/business_customer_entity_customer.rb +126 -0
  61. data/lib/akoya/models/call_type.rb +44 -0
  62. data/lib/akoya/models/citi_bank_investment.rb +535 -0
  63. data/lib/akoya/models/citi_bank_investment_details.rb +75 -0
  64. data/lib/akoya/models/citi_bank_investment_holdings.rb +210 -0
  65. data/lib/akoya/models/compounding_period.rb +56 -0
  66. data/lib/akoya/models/contribution_entity.rb +266 -0
  67. data/lib/akoya/models/coupon_mature_frequency.rb +48 -0
  68. data/lib/akoya/models/currency.rb +108 -0
  69. data/lib/akoya/models/currency_citi_bank_investment_holdings.rb +86 -0
  70. data/lib/akoya/models/currency_entity.rb +109 -0
  71. data/lib/akoya/models/current_customer.rb +75 -0
  72. data/lib/akoya/models/customer.rb +164 -0
  73. data/lib/akoya/models/customer_current_customer.rb +164 -0
  74. data/lib/akoya/models/customer_name.rb +127 -0
  75. data/lib/akoya/models/customer_name_account_holder_entity.rb +127 -0
  76. data/lib/akoya/models/customer_name_customer.rb +127 -0
  77. data/lib/akoya/models/debit_credit_memo.rb +37 -0
  78. data/lib/akoya/models/debt_class.rb +44 -0
  79. data/lib/akoya/models/debt_security.rb +137 -0
  80. data/lib/akoya/models/debt_security_entity.rb +216 -0
  81. data/lib/akoya/models/debt_type.rb +36 -0
  82. data/lib/akoya/models/delivery_address.rb +153 -0
  83. data/lib/akoya/models/deposit_account.rb +375 -0
  84. data/lib/akoya/models/deposit_account_info.rb +86 -0
  85. data/lib/akoya/models/deposit_balance_details.rb +87 -0
  86. data/lib/akoya/models/deposit_balances.rb +438 -0
  87. data/lib/akoya/models/deposit_transaction.rb +369 -0
  88. data/lib/akoya/models/deposit_transaction_details.rb +87 -0
  89. data/lib/akoya/models/domicile.rb +85 -0
  90. data/lib/akoya/models/equity_grant.rb +199 -0
  91. data/lib/akoya/models/error_entity_account_information.rb +97 -0
  92. data/lib/akoya/models/error_entity_annuity_account.rb +97 -0
  93. data/lib/akoya/models/error_entity_annuity_balances.rb +97 -0
  94. data/lib/akoya/models/error_entity_citi_bank_investment.rb +97 -0
  95. data/lib/akoya/models/error_entity_deposit_account.rb +97 -0
  96. data/lib/akoya/models/error_entity_deposit_balances.rb +97 -0
  97. data/lib/akoya/models/error_entity_insurance_account.rb +97 -0
  98. data/lib/akoya/models/error_entity_insurance_balances.rb +97 -0
  99. data/lib/akoya/models/error_entity_investment_account.rb +97 -0
  100. data/lib/akoya/models/error_entity_investment_balances.rb +97 -0
  101. data/lib/akoya/models/error_entity_line_of_credit_balances.rb +97 -0
  102. data/lib/akoya/models/error_entity_loan_account.rb +97 -0
  103. data/lib/akoya/models/error_entity_loan_balances.rb +97 -0
  104. data/lib/akoya/models/error_entity_us_bank_investment.rb +97 -0
  105. data/lib/akoya/models/fi_asset_class.rb +95 -0
  106. data/lib/akoya/models/fi_asset_class_an_investment_holding.rb +85 -0
  107. data/lib/akoya/models/fi_attribute.rb +95 -0
  108. data/lib/akoya/models/fi_attribute_entity.rb +95 -0
  109. data/lib/akoya/models/frequency.rb +56 -0
  110. data/lib/akoya/models/hateoas_link.rb +105 -0
  111. data/lib/akoya/models/held_in_account.rb +44 -0
  112. data/lib/akoya/models/holding_sub_type.rb +36 -0
  113. data/lib/akoya/models/holding_type.rb +56 -0
  114. data/lib/akoya/models/income_type.rb +41 -0
  115. data/lib/akoya/models/industry_code.rb +85 -0
  116. data/lib/akoya/models/insurance_account.rb +349 -0
  117. data/lib/akoya/models/insurance_account_info.rb +87 -0
  118. data/lib/akoya/models/insurance_balance_details.rb +87 -0
  119. data/lib/akoya/models/insurance_balances.rb +420 -0
  120. data/lib/akoya/models/insurance_transaction.rb +351 -0
  121. data/lib/akoya/models/insurance_transaction_details.rb +87 -0
  122. data/lib/akoya/models/interest_rate_type.rb +36 -0
  123. data/lib/akoya/models/inv401_k_source.rb +56 -0
  124. data/lib/akoya/models/inv401_k_source_open_order_entity.rb +57 -0
  125. data/lib/akoya/models/inv401_k_surce.rb +56 -0
  126. data/lib/akoya/models/investment_account.rb +411 -0
  127. data/lib/akoya/models/investment_account_annuity_balance.rb +87 -0
  128. data/lib/akoya/models/investment_account_deposit_balance.rb +87 -0
  129. data/lib/akoya/models/investment_account_info.rb +87 -0
  130. data/lib/akoya/models/investment_account_insurance_balance.rb +87 -0
  131. data/lib/akoya/models/investment_account_loan_balance.rb +86 -0
  132. data/lib/akoya/models/investment_account_loc_balance.rb +86 -0
  133. data/lib/akoya/models/investment_balance_details.rb +87 -0
  134. data/lib/akoya/models/investment_balance_list.rb +148 -0
  135. data/lib/akoya/models/investment_balances.rb +525 -0
  136. data/lib/akoya/models/investment_details.rb +88 -0
  137. data/lib/akoya/models/investment_loan_entity.rb +271 -0
  138. data/lib/akoya/models/investment_transaction.rb +783 -0
  139. data/lib/akoya/models/investment_transaction_details.rb +87 -0
  140. data/lib/akoya/models/investments.rb +88 -0
  141. data/lib/akoya/models/line_item.rb +156 -0
  142. data/lib/akoya/models/line_of_credit_balances.rb +601 -0
  143. data/lib/akoya/models/links.rb +95 -0
  144. data/lib/akoya/models/loan_account.rb +417 -0
  145. data/lib/akoya/models/loan_account_info.rb +86 -0
  146. data/lib/akoya/models/loan_balance_details.rb +86 -0
  147. data/lib/akoya/models/loan_balances.rb +556 -0
  148. data/lib/akoya/models/loan_payment_frequency.rb +68 -0
  149. data/lib/akoya/models/loan_transaction.rb +360 -0
  150. data/lib/akoya/models/loan_transaction_details.rb +87 -0
  151. data/lib/akoya/models/loc_account_info.rb +86 -0
  152. data/lib/akoya/models/loc_balance_details.rb +86 -0
  153. data/lib/akoya/models/loc_transaction.rb +372 -0
  154. data/lib/akoya/models/loc_transaction_details.rb +86 -0
  155. data/lib/akoya/models/mnext.rb +84 -0
  156. data/lib/akoya/models/mode.rb +36 -0
  157. data/lib/akoya/models/mutual_fund_security.rb +99 -0
  158. data/lib/akoya/models/mutual_fund_security_entity.rb +150 -0
  159. data/lib/akoya/models/mutual_fund_type.rb +40 -0
  160. data/lib/akoya/models/obtain_tokens.rb +99 -0
  161. data/lib/akoya/models/open_order_entity.rb +228 -0
  162. data/lib/akoya/models/option_security.rb +125 -0
  163. data/lib/akoya/models/option_security_entity.rb +127 -0
  164. data/lib/akoya/models/option_type.rb +36 -0
  165. data/lib/akoya/models/order_duration.rb +40 -0
  166. data/lib/akoya/models/order_type.rb +60 -0
  167. data/lib/akoya/models/other_security_entity.rb +77 -0
  168. data/lib/akoya/models/paginated_array.rb +75 -0
  169. data/lib/akoya/models/payment_details.rb +142 -0
  170. data/lib/akoya/models/payment_frequency.rb +56 -0
  171. data/lib/akoya/models/payment_frequency_annuity_account.rb +44 -0
  172. data/lib/akoya/models/payment_frequency_annuity_balances.rb +44 -0
  173. data/lib/akoya/models/payment_network_supported_by_account.rb +129 -0
  174. data/lib/akoya/models/pension_source_entity.rb +143 -0
  175. data/lib/akoya/models/period_certain_guarantee.rb +48 -0
  176. data/lib/akoya/models/policy_premium_term.rb +36 -0
  177. data/lib/akoya/models/position_type.rb +36 -0
  178. data/lib/akoya/models/postion_type.rb +36 -0
  179. data/lib/akoya/models/prev.rb +84 -0
  180. data/lib/akoya/models/refresh_tokens.rb +103 -0
  181. data/lib/akoya/models/secured.rb +36 -0
  182. data/lib/akoya/models/security_id_type.rb +52 -0
  183. data/lib/akoya/models/security_id_type_investment_transaction.rb +52 -0
  184. data/lib/akoya/models/security_type.rb +56 -0
  185. data/lib/akoya/models/statement_entity.rb +136 -0
  186. data/lib/akoya/models/status.rb +56 -0
  187. data/lib/akoya/models/status_deposit_transaction.rb +44 -0
  188. data/lib/akoya/models/status_insurance_transaction.rb +44 -0
  189. data/lib/akoya/models/status_investment_transaction.rb +44 -0
  190. data/lib/akoya/models/status_loan_transaction.rb +44 -0
  191. data/lib/akoya/models/status_loc_transaction.rb +44 -0
  192. data/lib/akoya/models/status_statement_entity.rb +40 -0
  193. data/lib/akoya/models/status_transaction.rb +44 -0
  194. data/lib/akoya/models/stock_security_entity.rb +137 -0
  195. data/lib/akoya/models/stock_type.rb +56 -0
  196. data/lib/akoya/models/sub_account.rb +44 -0
  197. data/lib/akoya/models/sub_account_fund.rb +44 -0
  198. data/lib/akoya/models/sub_account_sec.rb +44 -0
  199. data/lib/akoya/models/sweep_security_entity.rb +118 -0
  200. data/lib/akoya/models/tax_lot.rb +137 -0
  201. data/lib/akoya/models/tax_lot_an_investment_holding.rb +139 -0
  202. data/lib/akoya/models/telephone.rb +95 -0
  203. data/lib/akoya/models/telephone_number.rb +95 -0
  204. data/lib/akoya/models/token_example_response.rb +101 -0
  205. data/lib/akoya/models/transaction.rb +328 -0
  206. data/lib/akoya/models/transaction_reason.rb +41 -0
  207. data/lib/akoya/models/transaction_type.rb +84 -0
  208. data/lib/akoya/models/transaction_type_insurance_transaction.rb +44 -0
  209. data/lib/akoya/models/transaction_type_investment_transaction.rb +192 -0
  210. data/lib/akoya/models/transaction_type_loan_transaction.rb +44 -0
  211. data/lib/akoya/models/transaction_type_loc_transaction.rb +84 -0
  212. data/lib/akoya/models/transactions_entity.rb +98 -0
  213. data/lib/akoya/models/transfer_action.rb +36 -0
  214. data/lib/akoya/models/type.rb +44 -0
  215. data/lib/akoya/models/type_hateoas_link.rb +52 -0
  216. data/lib/akoya/models/type_telephone_number.rb +44 -0
  217. data/lib/akoya/models/unit_type.rb +36 -0
  218. data/lib/akoya/models/unit_type_open_order_entity.rb +36 -0
  219. data/lib/akoya/models/us_bank_investment.rb +535 -0
  220. data/lib/akoya/models/us_bank_investment_details.rb +75 -0
  221. data/lib/akoya/models/us_bank_investment_holdings.rb +403 -0
  222. data/lib/akoya/models/vesting.rb +135 -0
  223. data/lib/akoya/models/vesting_entity.rb +185 -0
  224. data/lib/akoya/models/x_akoya_interaction_type.rb +36 -0
  225. data/lib/akoya/utilities/date_time_helper.rb +11 -0
  226. data/lib/akoya/utilities/file_wrapper.rb +28 -0
  227. data/lib/akoya/utilities/union_type_lookup.rb +91 -0
  228. data/lib/akoya.rb +250 -0
  229. metadata +312 -0
@@ -0,0 +1,328 @@
1
+ # akoya
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ require 'date'
7
+ module Akoya
8
+ # Transaction elements
9
+ class Transaction < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # Corresponds to AccountId in Account
14
+ # @return [String]
15
+ attr_accessor :account_id
16
+
17
+ # The amount of money in the account currency.
18
+ # If balanceType is `ASSET`:
19
+ # 1. If `debitCreditMemo` = `DEBIT`, sign is "+" or not present
20
+ # 2. If `CREDIT`, sign is "-"
21
+ # If balanceType is `LIABILITY`:
22
+ # 1. If `debitCreditMemo` = `DEBIT`, sign is "-"
23
+ # 2. If `CREDIT`, sign is "+" or not present
24
+ # @return [Float]
25
+ attr_accessor :amount
26
+
27
+ # Transaction category, preferably MCC or SIC.
28
+ # @return [String]
29
+ attr_accessor :category
30
+
31
+ # Akoya will ensure that this is correctly populated with one of DEBIT or
32
+ # CREDIT and matches the sign of the status field.
33
+ # @return [DebitCreditMemo]
34
+ attr_accessor :debit_credit_memo
35
+
36
+ # The description of the transaction
37
+ # @return [String]
38
+ attr_accessor :description
39
+
40
+ # Array of image identifiers (unique to transaction) used to retrieve images
41
+ # of check or transaction receipt.
42
+ # @return [Array[String]]
43
+ attr_accessor :image_ids
44
+
45
+ # Array of FI-specific attributes
46
+ # @return [Array[FiAttributeEntity]]
47
+ attr_accessor :fi_attributes
48
+
49
+ # The amount of money in the foreign currency
50
+ # @return [Float]
51
+ attr_accessor :foreign_amount
52
+
53
+ # The ISO 4217 code of the foreign currency
54
+ # @return [String]
55
+ attr_accessor :foreign_currency
56
+
57
+ # Breakdown of the transaction details
58
+ # @return [Array[LineItem]]
59
+ attr_accessor :line_item
60
+
61
+ # Links (unique to this Transaction) used to retrieve images of checks or
62
+ # transaction receipts, or invoke other APIs
63
+ # @return [Array[HateoasLink]]
64
+ attr_accessor :links
65
+
66
+ # Secondary transaction description
67
+ # @return [String]
68
+ attr_accessor :memo
69
+
70
+ # The date and time that the transaction was posted to the account. If not
71
+ # provided then TransactionTimestamp can be used as PostedTimeStamp.
72
+ # @return [DateTime]
73
+ attr_accessor :posted_timestamp
74
+
75
+ # A tracking reference identifier
76
+ # @return [String]
77
+ attr_accessor :reference
78
+
79
+ # Akoya ensures that this field is populated for all transactions which are
80
+ # reversals, otherwise it is null. Either way it is always present.
81
+ # For reverse postings, the identity of the transaction being reversed. For
82
+ # the correction transaction, the identity of the reversing post. For credit
83
+ # card posting transactions, the identity of the authorization transaction.
84
+ # @return [String]
85
+ attr_accessor :reference_transaction_id
86
+
87
+ # AUTHORIZATION, MEMO, PENDING, or POSTED
88
+ # @return [StatusTransaction]
89
+ attr_accessor :status
90
+
91
+ # Transaction category detail
92
+ # @return [String]
93
+ attr_accessor :sub_category
94
+
95
+ # Long term persistent identity of the transaction (unique to account).
96
+ # Transaction IDs should:
97
+ #
98
+ # 1. be the same for pending and posted
99
+ # 2. be different for reversed transactions
100
+ # 3. `referenceTransactionId` should be present for reversed transactions'
101
+ # @return [String]
102
+ attr_accessor :transaction_id
103
+
104
+ # The date and time that the transaction was added to the server backend
105
+ # systems.
106
+ # Akoya ensures that this field is populated for all transactions to which
107
+ # it applies, otherwise it is null. Either way it is always present.
108
+ # @return [DateTime]
109
+ attr_accessor :transaction_timestamp
110
+
111
+ # A mapping from model property names to API property names.
112
+ def self.names
113
+ @_hash = {} if @_hash.nil?
114
+ @_hash['account_id'] = 'accountId'
115
+ @_hash['amount'] = 'amount'
116
+ @_hash['category'] = 'category'
117
+ @_hash['debit_credit_memo'] = 'debitCreditMemo'
118
+ @_hash['description'] = 'description'
119
+ @_hash['image_ids'] = 'imageIds'
120
+ @_hash['fi_attributes'] = 'fiAttributes'
121
+ @_hash['foreign_amount'] = 'foreignAmount'
122
+ @_hash['foreign_currency'] = 'foreignCurrency'
123
+ @_hash['line_item'] = 'lineItem'
124
+ @_hash['links'] = 'links'
125
+ @_hash['memo'] = 'memo'
126
+ @_hash['posted_timestamp'] = 'postedTimestamp'
127
+ @_hash['reference'] = 'reference'
128
+ @_hash['reference_transaction_id'] = 'referenceTransactionId'
129
+ @_hash['status'] = 'status'
130
+ @_hash['sub_category'] = 'subCategory'
131
+ @_hash['transaction_id'] = 'transactionId'
132
+ @_hash['transaction_timestamp'] = 'transactionTimestamp'
133
+ @_hash
134
+ end
135
+
136
+ # An array for optional fields
137
+ def self.optionals
138
+ %w[
139
+ account_id
140
+ amount
141
+ category
142
+ debit_credit_memo
143
+ description
144
+ image_ids
145
+ fi_attributes
146
+ foreign_amount
147
+ foreign_currency
148
+ line_item
149
+ links
150
+ memo
151
+ posted_timestamp
152
+ reference
153
+ reference_transaction_id
154
+ status
155
+ sub_category
156
+ transaction_id
157
+ transaction_timestamp
158
+ ]
159
+ end
160
+
161
+ # An array for nullable fields
162
+ def self.nullables
163
+ []
164
+ end
165
+
166
+ def initialize(account_id: SKIP, amount: SKIP, category: SKIP,
167
+ debit_credit_memo: SKIP, description: SKIP, image_ids: SKIP,
168
+ fi_attributes: SKIP, foreign_amount: SKIP,
169
+ foreign_currency: SKIP, line_item: SKIP, links: SKIP,
170
+ memo: SKIP, posted_timestamp: SKIP, reference: SKIP,
171
+ reference_transaction_id: SKIP, status: SKIP,
172
+ sub_category: SKIP, transaction_id: SKIP,
173
+ transaction_timestamp: SKIP, additional_properties: nil)
174
+ # Add additional model properties to the instance
175
+ additional_properties = {} if additional_properties.nil?
176
+
177
+ @account_id = account_id unless account_id == SKIP
178
+ @amount = amount unless amount == SKIP
179
+ @category = category unless category == SKIP
180
+ @debit_credit_memo = debit_credit_memo unless debit_credit_memo == SKIP
181
+ @description = description unless description == SKIP
182
+ @image_ids = image_ids unless image_ids == SKIP
183
+ @fi_attributes = fi_attributes unless fi_attributes == SKIP
184
+ @foreign_amount = foreign_amount unless foreign_amount == SKIP
185
+ @foreign_currency = foreign_currency unless foreign_currency == SKIP
186
+ @line_item = line_item unless line_item == SKIP
187
+ @links = links unless links == SKIP
188
+ @memo = memo unless memo == SKIP
189
+ @posted_timestamp = posted_timestamp unless posted_timestamp == SKIP
190
+ @reference = reference unless reference == SKIP
191
+ @reference_transaction_id = reference_transaction_id unless reference_transaction_id == SKIP
192
+ @status = status unless status == SKIP
193
+ @sub_category = sub_category unless sub_category == SKIP
194
+ @transaction_id = transaction_id unless transaction_id == SKIP
195
+ @transaction_timestamp = transaction_timestamp unless transaction_timestamp == SKIP
196
+ @additional_properties = additional_properties
197
+ end
198
+
199
+ # Creates an instance of the object from a hash.
200
+ def self.from_hash(hash)
201
+ return nil unless hash
202
+
203
+ # Extract variables from the hash.
204
+ account_id = hash.key?('accountId') ? hash['accountId'] : SKIP
205
+ amount = hash.key?('amount') ? hash['amount'] : SKIP
206
+ category = hash.key?('category') ? hash['category'] : SKIP
207
+ debit_credit_memo =
208
+ hash.key?('debitCreditMemo') ? hash['debitCreditMemo'] : SKIP
209
+ description = hash.key?('description') ? hash['description'] : SKIP
210
+ image_ids = hash.key?('imageIds') ? hash['imageIds'] : SKIP
211
+ # Parameter is an array, so we need to iterate through it
212
+ fi_attributes = nil
213
+ unless hash['fiAttributes'].nil?
214
+ fi_attributes = []
215
+ hash['fiAttributes'].each do |structure|
216
+ fi_attributes << (FiAttributeEntity.from_hash(structure) if structure)
217
+ end
218
+ end
219
+
220
+ fi_attributes = SKIP unless hash.key?('fiAttributes')
221
+ foreign_amount = hash.key?('foreignAmount') ? hash['foreignAmount'] : SKIP
222
+ foreign_currency =
223
+ hash.key?('foreignCurrency') ? hash['foreignCurrency'] : SKIP
224
+ # Parameter is an array, so we need to iterate through it
225
+ line_item = nil
226
+ unless hash['lineItem'].nil?
227
+ line_item = []
228
+ hash['lineItem'].each do |structure|
229
+ line_item << (LineItem.from_hash(structure) if structure)
230
+ end
231
+ end
232
+
233
+ line_item = SKIP unless hash.key?('lineItem')
234
+ # Parameter is an array, so we need to iterate through it
235
+ links = nil
236
+ unless hash['links'].nil?
237
+ links = []
238
+ hash['links'].each do |structure|
239
+ links << (HateoasLink.from_hash(structure) if structure)
240
+ end
241
+ end
242
+
243
+ links = SKIP unless hash.key?('links')
244
+ memo = hash.key?('memo') ? hash['memo'] : SKIP
245
+ posted_timestamp = if hash.key?('postedTimestamp')
246
+ (DateTimeHelper.from_rfc3339(hash['postedTimestamp']) if hash['postedTimestamp'])
247
+ else
248
+ SKIP
249
+ end
250
+ reference = hash.key?('reference') ? hash['reference'] : SKIP
251
+ reference_transaction_id =
252
+ hash.key?('referenceTransactionId') ? hash['referenceTransactionId'] : SKIP
253
+ status = hash.key?('status') ? hash['status'] : SKIP
254
+ sub_category = hash.key?('subCategory') ? hash['subCategory'] : SKIP
255
+ transaction_id = hash.key?('transactionId') ? hash['transactionId'] : SKIP
256
+ transaction_timestamp = if hash.key?('transactionTimestamp')
257
+ (DateTimeHelper.from_rfc3339(hash['transactionTimestamp']) if hash['transactionTimestamp'])
258
+ else
259
+ SKIP
260
+ end
261
+
262
+ # Create a new hash for additional properties, removing known properties.
263
+ new_hash = hash.reject { |k, _| names.value?(k) }
264
+
265
+ additional_properties = APIHelper.get_additional_properties(
266
+ new_hash, proc { |value| value }
267
+ )
268
+
269
+ # Create object from extracted values.
270
+ Transaction.new(account_id: account_id,
271
+ amount: amount,
272
+ category: category,
273
+ debit_credit_memo: debit_credit_memo,
274
+ description: description,
275
+ image_ids: image_ids,
276
+ fi_attributes: fi_attributes,
277
+ foreign_amount: foreign_amount,
278
+ foreign_currency: foreign_currency,
279
+ line_item: line_item,
280
+ links: links,
281
+ memo: memo,
282
+ posted_timestamp: posted_timestamp,
283
+ reference: reference,
284
+ reference_transaction_id: reference_transaction_id,
285
+ status: status,
286
+ sub_category: sub_category,
287
+ transaction_id: transaction_id,
288
+ transaction_timestamp: transaction_timestamp,
289
+ additional_properties: additional_properties)
290
+ end
291
+
292
+ def to_custom_posted_timestamp
293
+ DateTimeHelper.to_rfc3339(posted_timestamp)
294
+ end
295
+
296
+ def to_custom_transaction_timestamp
297
+ DateTimeHelper.to_rfc3339(transaction_timestamp)
298
+ end
299
+
300
+ # Provides a human-readable string representation of the object.
301
+ def to_s
302
+ class_name = self.class.name.split('::').last
303
+ "<#{class_name} account_id: #{@account_id}, amount: #{@amount}, category: #{@category},"\
304
+ " debit_credit_memo: #{@debit_credit_memo}, description: #{@description}, image_ids:"\
305
+ " #{@image_ids}, fi_attributes: #{@fi_attributes}, foreign_amount: #{@foreign_amount},"\
306
+ " foreign_currency: #{@foreign_currency}, line_item: #{@line_item}, links: #{@links}, memo:"\
307
+ " #{@memo}, posted_timestamp: #{@posted_timestamp}, reference: #{@reference},"\
308
+ " reference_transaction_id: #{@reference_transaction_id}, status: #{@status}, sub_category:"\
309
+ " #{@sub_category}, transaction_id: #{@transaction_id}, transaction_timestamp:"\
310
+ " #{@transaction_timestamp}, additional_properties: #{@additional_properties}>"
311
+ end
312
+
313
+ # Provides a debugging-friendly string with detailed object information.
314
+ def inspect
315
+ class_name = self.class.name.split('::').last
316
+ "<#{class_name} account_id: #{@account_id.inspect}, amount: #{@amount.inspect}, category:"\
317
+ " #{@category.inspect}, debit_credit_memo: #{@debit_credit_memo.inspect}, description:"\
318
+ " #{@description.inspect}, image_ids: #{@image_ids.inspect}, fi_attributes:"\
319
+ " #{@fi_attributes.inspect}, foreign_amount: #{@foreign_amount.inspect}, foreign_currency:"\
320
+ " #{@foreign_currency.inspect}, line_item: #{@line_item.inspect}, links: #{@links.inspect},"\
321
+ " memo: #{@memo.inspect}, posted_timestamp: #{@posted_timestamp.inspect}, reference:"\
322
+ " #{@reference.inspect}, reference_transaction_id: #{@reference_transaction_id.inspect},"\
323
+ " status: #{@status.inspect}, sub_category: #{@sub_category.inspect}, transaction_id:"\
324
+ " #{@transaction_id.inspect}, transaction_timestamp: #{@transaction_timestamp.inspect},"\
325
+ " additional_properties: #{@additional_properties}>"
326
+ end
327
+ end
328
+ end
@@ -0,0 +1,41 @@
1
+ # akoya
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Akoya
7
+ # Reason for this transaction; CALL (the debt was called), SELL (the debt was
8
+ # sold), MATURITY (the debt reached maturity)
9
+ class TransactionReason
10
+ TRANSACTION_REASON = [
11
+ # TODO: Write general description for CALL
12
+ CALL = 'CALL'.freeze,
13
+
14
+ # TODO: Write general description for SELL
15
+ SELL = 'SELL'.freeze,
16
+
17
+ # TODO: Write general description for MATURITY
18
+ MATURITY = 'MATURITY'.freeze
19
+ ].freeze
20
+
21
+ def self.validate(value)
22
+ return false if value.nil?
23
+
24
+ true
25
+ end
26
+
27
+ def self.from_value(value, default_value = CALL)
28
+ return default_value if value.nil?
29
+
30
+ str = value.to_s.strip
31
+
32
+ case str.downcase
33
+ when 'call' then CALL
34
+ when 'sell' then SELL
35
+ when 'maturity' then MATURITY
36
+ else
37
+ default_value
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,84 @@
1
+ # akoya
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Akoya
7
+ # DepositTransaction Type
8
+ class TransactionType
9
+ TRANSACTION_TYPE = [
10
+ # TODO: Write general description for CHECK
11
+ CHECK = 'CHECK'.freeze,
12
+
13
+ # TODO: Write general description for WITHDRAWAL
14
+ WITHDRAWAL = 'WITHDRAWAL'.freeze,
15
+
16
+ # TODO: Write general description for TRANSFER
17
+ TRANSFER = 'TRANSFER'.freeze,
18
+
19
+ # TODO: Write general description for POSDEBIT
20
+ POSDEBIT = 'POSDEBIT'.freeze,
21
+
22
+ # TODO: Write general description for ATMWITHDRAWAL
23
+ ATMWITHDRAWAL = 'ATMWITHDRAWAL'.freeze,
24
+
25
+ # TODO: Write general description for BILLPAYMENT
26
+ BILLPAYMENT = 'BILLPAYMENT'.freeze,
27
+
28
+ # TODO: Write general description for FEE
29
+ FEE = 'FEE'.freeze,
30
+
31
+ # TODO: Write general description for DEPOSIT
32
+ DEPOSIT = 'DEPOSIT'.freeze,
33
+
34
+ # TODO: Write general description for ADJUSTMENT
35
+ ADJUSTMENT = 'ADJUSTMENT'.freeze,
36
+
37
+ # TODO: Write general description for INTEREST
38
+ INTEREST = 'INTEREST'.freeze,
39
+
40
+ # TODO: Write general description for DIVIDEND
41
+ DIVIDEND = 'DIVIDEND'.freeze,
42
+
43
+ # TODO: Write general description for DIRECTDEPOSIT
44
+ DIRECTDEPOSIT = 'DIRECTDEPOSIT'.freeze,
45
+
46
+ # TODO: Write general description for ATMDEPOSIT
47
+ ATMDEPOSIT = 'ATMDEPOSIT'.freeze,
48
+
49
+ # TODO: Write general description for POSCREDIT
50
+ POSCREDIT = 'POSCREDIT'.freeze
51
+ ].freeze
52
+
53
+ def self.validate(value)
54
+ return false if value.nil?
55
+
56
+ true
57
+ end
58
+
59
+ def self.from_value(value, default_value = CHECK)
60
+ return default_value if value.nil?
61
+
62
+ str = value.to_s.strip
63
+
64
+ case str.downcase
65
+ when 'check' then CHECK
66
+ when 'withdrawal' then WITHDRAWAL
67
+ when 'transfer' then TRANSFER
68
+ when 'posdebit' then POSDEBIT
69
+ when 'atmwithdrawal' then ATMWITHDRAWAL
70
+ when 'billpayment' then BILLPAYMENT
71
+ when 'fee' then FEE
72
+ when 'deposit' then DEPOSIT
73
+ when 'adjustment' then ADJUSTMENT
74
+ when 'interest' then INTEREST
75
+ when 'dividend' then DIVIDEND
76
+ when 'directdeposit' then DIRECTDEPOSIT
77
+ when 'atmdeposit' then ATMDEPOSIT
78
+ when 'poscredit' then POSCREDIT
79
+ else
80
+ default_value
81
+ end
82
+ end
83
+ end
84
+ end
@@ -0,0 +1,44 @@
1
+ # akoya
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Akoya
7
+ # InsuranceTransaction Type
8
+ class TransactionTypeInsuranceTransaction
9
+ TRANSACTION_TYPE_INSURANCE_TRANSACTION = [
10
+ # TODO: Write general description for PAYMENT
11
+ PAYMENT = 'PAYMENT'.freeze,
12
+
13
+ # TODO: Write general description for FEE
14
+ FEE = 'FEE'.freeze,
15
+
16
+ # TODO: Write general description for ADJUSTMENT
17
+ ADJUSTMENT = 'ADJUSTMENT'.freeze,
18
+
19
+ # TODO: Write general description for INTEREST
20
+ INTEREST = 'INTEREST'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ true
27
+ end
28
+
29
+ def self.from_value(value, default_value = PAYMENT)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'payment' then PAYMENT
36
+ when 'fee' then FEE
37
+ when 'adjustment' then ADJUSTMENT
38
+ when 'interest' then INTEREST
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,192 @@
1
+ # akoya
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module Akoya
7
+ # InvestmentTransaction Type
8
+ class TransactionTypeInvestmentTransaction
9
+ TRANSACTION_TYPE_INVESTMENT_TRANSACTION = [
10
+ # TODO: Write general description for PURCHASED
11
+ PURCHASED = 'PURCHASED'.freeze,
12
+
13
+ # TODO: Write general description for SOLD
14
+ SOLD = 'SOLD'.freeze,
15
+
16
+ # TODO: Write general description for PURCHASEDTOCOVER
17
+ PURCHASEDTOCOVER = 'PURCHASEDTOCOVER'.freeze,
18
+
19
+ # TODO: Write general description for ADJUSTMENT
20
+ ADJUSTMENT = 'ADJUSTMENT'.freeze,
21
+
22
+ # TODO: Write general description for PURCHASETOOPEN
23
+ PURCHASETOOPEN = 'PURCHASETOOPEN'.freeze,
24
+
25
+ # TODO: Write general description for PURCHASETOCLOSE
26
+ PURCHASETOCLOSE = 'PURCHASETOCLOSE'.freeze,
27
+
28
+ # TODO: Write general description for SOLDTOOPEN
29
+ SOLDTOOPEN = 'SOLDTOOPEN'.freeze,
30
+
31
+ # TODO: Write general description for SOLDTOCLOSE
32
+ SOLDTOCLOSE = 'SOLDTOCLOSE'.freeze,
33
+
34
+ # TODO: Write general description for INTEREST
35
+ INTEREST = 'INTEREST'.freeze,
36
+
37
+ # TODO: Write general description for MARGININTEREST
38
+ MARGININTEREST = 'MARGININTEREST'.freeze,
39
+
40
+ # TODO: Write general description for REINVESTOFINCOME
41
+ REINVESTOFINCOME = 'REINVESTOFINCOME'.freeze,
42
+
43
+ # TODO: Write general description for RETURNOFCAPITAL
44
+ RETURNOFCAPITAL = 'RETURNOFCAPITAL'.freeze,
45
+
46
+ # TODO: Write general description for TRANSFER
47
+ TRANSFER = 'TRANSFER'.freeze,
48
+
49
+ # TODO: Write general description for CONTRIBUTION
50
+ CONTRIBUTION = 'CONTRIBUTION'.freeze,
51
+
52
+ # TODO: Write general description for FEE
53
+ FEE = 'FEE'.freeze,
54
+
55
+ # TODO: Write general description for OPTIONEXERCISE
56
+ OPTIONEXERCISE = 'OPTIONEXERCISE'.freeze,
57
+
58
+ # TODO: Write general description for OPTIONEXPIRATION
59
+ OPTIONEXPIRATION = 'OPTIONEXPIRATION'.freeze,
60
+
61
+ # TODO: Write general description for DIVIDEND
62
+ DIVIDEND = 'DIVIDEND'.freeze,
63
+
64
+ # TODO: Write general description for DIVIDENDREINVEST
65
+ DIVIDENDREINVEST = 'DIVIDENDREINVEST'.freeze,
66
+
67
+ # TODO: Write general description for SPLIT
68
+ SPLIT = 'SPLIT'.freeze,
69
+
70
+ # TODO: Write general description for CLOSURE
71
+ CLOSURE = 'CLOSURE'.freeze,
72
+
73
+ # TODO: Write general description for INCOME
74
+ INCOME = 'INCOME'.freeze,
75
+
76
+ # TODO: Write general description for EXPENSE
77
+ EXPENSE = 'EXPENSE'.freeze,
78
+
79
+ # TODO: Write general description for CLOSUREOPT
80
+ CLOSUREOPT = 'CLOSUREOPT'.freeze,
81
+
82
+ # TODO: Write general description for INVEXPENSE
83
+ INVEXPENSE = 'INVEXPENSE'.freeze,
84
+
85
+ # TODO: Write general description for JRNLSEC
86
+ JRNLSEC = 'JRNLSEC'.freeze,
87
+
88
+ # TODO: Write general description for JRNLFUND
89
+ JRNLFUND = 'JRNLFUND'.freeze,
90
+
91
+ # TODO: Write general description for OTHER
92
+ OTHER = 'OTHER'.freeze,
93
+
94
+ # TODO: Write general description for DIV
95
+ DIV = 'DIV'.freeze,
96
+
97
+ # TODO: Write general description for SRVCHG
98
+ SRVCHG = 'SRVCHG'.freeze,
99
+
100
+ # TODO: Write general description for DEP
101
+ DEP = 'DEP'.freeze,
102
+
103
+ # TODO: Write general description for DEPOSIT
104
+ DEPOSIT = 'DEPOSIT'.freeze,
105
+
106
+ # TODO: Write general description for ATM
107
+ ATM = 'ATM'.freeze,
108
+
109
+ # TODO: Write general description for POS
110
+ POS = 'POS'.freeze,
111
+
112
+ # TODO: Write general description for XFER
113
+ XFER = 'XFER'.freeze,
114
+
115
+ # TODO: Write general description for CHECK
116
+ CHECK = 'CHECK'.freeze,
117
+
118
+ # TODO: Write general description for PAYMENT
119
+ PAYMENT = 'PAYMENT'.freeze,
120
+
121
+ # TODO: Write general description for CASH
122
+ CASH = 'CASH'.freeze,
123
+
124
+ # TODO: Write general description for DIRECTDEP
125
+ DIRECTDEP = 'DIRECTDEP'.freeze,
126
+
127
+ # TODO: Write general description for DIRECTDEBIT
128
+ DIRECTDEBIT = 'DIRECTDEBIT'.freeze,
129
+
130
+ # TODO: Write general description for REPEATPMT
131
+ REPEATPMT = 'REPEATPMT'.freeze
132
+ ].freeze
133
+
134
+ def self.validate(value)
135
+ return false if value.nil?
136
+
137
+ true
138
+ end
139
+
140
+ def self.from_value(value, default_value = PURCHASED)
141
+ return default_value if value.nil?
142
+
143
+ str = value.to_s.strip
144
+
145
+ case str.downcase
146
+ when 'purchased' then PURCHASED
147
+ when 'sold' then SOLD
148
+ when 'purchasedtocover' then PURCHASEDTOCOVER
149
+ when 'adjustment' then ADJUSTMENT
150
+ when 'purchasetoopen' then PURCHASETOOPEN
151
+ when 'purchasetoclose' then PURCHASETOCLOSE
152
+ when 'soldtoopen' then SOLDTOOPEN
153
+ when 'soldtoclose' then SOLDTOCLOSE
154
+ when 'interest' then INTEREST
155
+ when 'margininterest' then MARGININTEREST
156
+ when 'reinvestofincome' then REINVESTOFINCOME
157
+ when 'returnofcapital' then RETURNOFCAPITAL
158
+ when 'transfer' then TRANSFER
159
+ when 'contribution' then CONTRIBUTION
160
+ when 'fee' then FEE
161
+ when 'optionexercise' then OPTIONEXERCISE
162
+ when 'optionexpiration' then OPTIONEXPIRATION
163
+ when 'dividend' then DIVIDEND
164
+ when 'dividendreinvest' then DIVIDENDREINVEST
165
+ when 'split' then SPLIT
166
+ when 'closure' then CLOSURE
167
+ when 'income' then INCOME
168
+ when 'expense' then EXPENSE
169
+ when 'closureopt' then CLOSUREOPT
170
+ when 'invexpense' then INVEXPENSE
171
+ when 'jrnlsec' then JRNLSEC
172
+ when 'jrnlfund' then JRNLFUND
173
+ when 'other' then OTHER
174
+ when 'div' then DIV
175
+ when 'srvchg' then SRVCHG
176
+ when 'dep' then DEP
177
+ when 'deposit' then DEPOSIT
178
+ when 'atm' then ATM
179
+ when 'pos' then POS
180
+ when 'xfer' then XFER
181
+ when 'check' then CHECK
182
+ when 'payment' then PAYMENT
183
+ when 'cash' then CASH
184
+ when 'directdep' then DIRECTDEP
185
+ when 'directdebit' then DIRECTDEBIT
186
+ when 'repeatpmt' then REPEATPMT
187
+ else
188
+ default_value
189
+ end
190
+ end
191
+ end
192
+ end