xero-apimatic-sdk 1.0.0

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 (289) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +28 -0
  3. data/README.md +175 -0
  4. data/bin/console +15 -0
  5. data/lib/xero_ap_is/api_helper.rb +10 -0
  6. data/lib/xero_ap_is/apis/accounting_api.rb +8328 -0
  7. data/lib/xero_ap_is/apis/asset_api.rb +210 -0
  8. data/lib/xero_ap_is/apis/bank_feeds_api.rb +268 -0
  9. data/lib/xero_ap_is/apis/base_api.rb +67 -0
  10. data/lib/xero_ap_is/apis/identity_api.rb +51 -0
  11. data/lib/xero_ap_is/apis/oauth_authorization_api.rb +87 -0
  12. data/lib/xero_ap_is/apis/project_api.rb +662 -0
  13. data/lib/xero_ap_is/client.rb +110 -0
  14. data/lib/xero_ap_is/configuration.rb +196 -0
  15. data/lib/xero_ap_is/exceptions/api_exception.rb +21 -0
  16. data/lib/xero_ap_is/exceptions/asset_types400_error_exception.rb +72 -0
  17. data/lib/xero_ap_is/exceptions/assets400_error_exception.rb +72 -0
  18. data/lib/xero_ap_is/exceptions/error_error1_exception.rb +63 -0
  19. data/lib/xero_ap_is/exceptions/error_error2_exception.rb +51 -0
  20. data/lib/xero_ap_is/exceptions/error_exception.rb +72 -0
  21. data/lib/xero_ap_is/exceptions/feed_connections_error_exception.rb +60 -0
  22. data/lib/xero_ap_is/exceptions/oauth_provider_exception.rb +64 -0
  23. data/lib/xero_ap_is/exceptions/statements_error_exception.rb +60 -0
  24. data/lib/xero_ap_is/http/api_response.rb +19 -0
  25. data/lib/xero_ap_is/http/auth/basic_auth.rb +62 -0
  26. data/lib/xero_ap_is/http/auth/oauth_2.rb +161 -0
  27. data/lib/xero_ap_is/http/http_call_back.rb +10 -0
  28. data/lib/xero_ap_is/http/http_method_enum.rb +10 -0
  29. data/lib/xero_ap_is/http/http_request.rb +10 -0
  30. data/lib/xero_ap_is/http/http_response.rb +10 -0
  31. data/lib/xero_ap_is/http/proxy_settings.rb +22 -0
  32. data/lib/xero_ap_is/logging/configuration/api_logging_configuration.rb +186 -0
  33. data/lib/xero_ap_is/logging/sdk_logger.rb +17 -0
  34. data/lib/xero_ap_is/models/access_token.rb +116 -0
  35. data/lib/xero_ap_is/models/account.rb +300 -0
  36. data/lib/xero_ap_is/models/account_type.rb +100 -0
  37. data/lib/xero_ap_is/models/account_type1.rb +37 -0
  38. data/lib/xero_ap_is/models/accounts.rb +84 -0
  39. data/lib/xero_ap_is/models/accounts_payable.rb +85 -0
  40. data/lib/xero_ap_is/models/accounts_receivable.rb +85 -0
  41. data/lib/xero_ap_is/models/action.rb +85 -0
  42. data/lib/xero_ap_is/models/actions.rb +84 -0
  43. data/lib/xero_ap_is/models/address.rb +167 -0
  44. data/lib/xero_ap_is/models/address_for_organisation.rb +167 -0
  45. data/lib/xero_ap_is/models/address_type.rb +40 -0
  46. data/lib/xero_ap_is/models/address_type1.rb +36 -0
  47. data/lib/xero_ap_is/models/allocation.rb +174 -0
  48. data/lib/xero_ap_is/models/allocations.rb +85 -0
  49. data/lib/xero_ap_is/models/amount.rb +85 -0
  50. data/lib/xero_ap_is/models/asset.rb +249 -0
  51. data/lib/xero_ap_is/models/asset_status.rb +40 -0
  52. data/lib/xero_ap_is/models/asset_status_query_param.rb +40 -0
  53. data/lib/xero_ap_is/models/asset_type.rb +154 -0
  54. data/lib/xero_ap_is/models/assets.rb +94 -0
  55. data/lib/xero_ap_is/models/attachment.rb +126 -0
  56. data/lib/xero_ap_is/models/attachments.rb +85 -0
  57. data/lib/xero_ap_is/models/averaging_method.rb +36 -0
  58. data/lib/xero_ap_is/models/balance_details.rb +98 -0
  59. data/lib/xero_ap_is/models/balances.rb +89 -0
  60. data/lib/xero_ap_is/models/bank_account_type.rb +44 -0
  61. data/lib/xero_ap_is/models/bank_transaction.rb +319 -0
  62. data/lib/xero_ap_is/models/bank_transactions.rb +114 -0
  63. data/lib/xero_ap_is/models/bank_transfer.rb +224 -0
  64. data/lib/xero_ap_is/models/bank_transfers.rb +85 -0
  65. data/lib/xero_ap_is/models/base_model.rb +110 -0
  66. data/lib/xero_ap_is/models/batch_payment.rb +275 -0
  67. data/lib/xero_ap_is/models/batch_payment_delete.rb +84 -0
  68. data/lib/xero_ap_is/models/batch_payment_delete_by_url_param.rb +73 -0
  69. data/lib/xero_ap_is/models/batch_payment_details.rb +128 -0
  70. data/lib/xero_ap_is/models/batch_payments.rb +85 -0
  71. data/lib/xero_ap_is/models/bill.rb +85 -0
  72. data/lib/xero_ap_is/models/book_depreciation_detail.rb +243 -0
  73. data/lib/xero_ap_is/models/book_depreciation_setting.rb +170 -0
  74. data/lib/xero_ap_is/models/branding_theme.rb +129 -0
  75. data/lib/xero_ap_is/models/branding_themes.rb +85 -0
  76. data/lib/xero_ap_is/models/budget.rb +145 -0
  77. data/lib/xero_ap_is/models/budget_balance.rb +105 -0
  78. data/lib/xero_ap_is/models/budget_line.rb +105 -0
  79. data/lib/xero_ap_is/models/budgets.rb +84 -0
  80. data/lib/xero_ap_is/models/charge_type.rb +42 -0
  81. data/lib/xero_ap_is/models/cis_org_setting.rb +105 -0
  82. data/lib/xero_ap_is/models/cis_org_settings.rb +85 -0
  83. data/lib/xero_ap_is/models/cis_setting.rb +86 -0
  84. data/lib/xero_ap_is/models/cis_settings.rb +85 -0
  85. data/lib/xero_ap_is/models/class1.rb +113 -0
  86. data/lib/xero_ap_is/models/connection.rb +155 -0
  87. data/lib/xero_ap_is/models/contact.rb +661 -0
  88. data/lib/xero_ap_is/models/contact_group.rb +119 -0
  89. data/lib/xero_ap_is/models/contact_groups.rb +85 -0
  90. data/lib/xero_ap_is/models/contact_person.rb +108 -0
  91. data/lib/xero_ap_is/models/contact_status.rb +40 -0
  92. data/lib/xero_ap_is/models/contacts.rb +113 -0
  93. data/lib/xero_ap_is/models/conversion_balances.rb +108 -0
  94. data/lib/xero_ap_is/models/conversion_date.rb +87 -0
  95. data/lib/xero_ap_is/models/country_code.rb +990 -0
  96. data/lib/xero_ap_is/models/credit_debit_indicator.rb +37 -0
  97. data/lib/xero_ap_is/models/credit_note.rb +453 -0
  98. data/lib/xero_ap_is/models/credit_notes.rb +113 -0
  99. data/lib/xero_ap_is/models/currencies.rb +85 -0
  100. data/lib/xero_ap_is/models/currency.rb +85 -0
  101. data/lib/xero_ap_is/models/currency_code.rb +700 -0
  102. data/lib/xero_ap_is/models/currency_code1.rb +680 -0
  103. data/lib/xero_ap_is/models/depreciation_calculation_method.rb +40 -0
  104. data/lib/xero_ap_is/models/depreciation_method.rb +52 -0
  105. data/lib/xero_ap_is/models/due_date_type.rb +52 -0
  106. data/lib/xero_ap_is/models/edition.rb +38 -0
  107. data/lib/xero_ap_is/models/element.rb +160 -0
  108. data/lib/xero_ap_is/models/employee.rb +160 -0
  109. data/lib/xero_ap_is/models/employees.rb +85 -0
  110. data/lib/xero_ap_is/models/end_balance.rb +89 -0
  111. data/lib/xero_ap_is/models/error1.rb +138 -0
  112. data/lib/xero_ap_is/models/error2.rb +106 -0
  113. data/lib/xero_ap_is/models/error3.rb +85 -0
  114. data/lib/xero_ap_is/models/expense_claim.rb +209 -0
  115. data/lib/xero_ap_is/models/expense_claims.rb +85 -0
  116. data/lib/xero_ap_is/models/external_link.rb +95 -0
  117. data/lib/xero_ap_is/models/federal_tax_classification.rb +56 -0
  118. data/lib/xero_ap_is/models/feed_connection.rb +177 -0
  119. data/lib/xero_ap_is/models/feed_connections.rb +94 -0
  120. data/lib/xero_ap_is/models/field_validation_errors_element.rb +127 -0
  121. data/lib/xero_ap_is/models/history_record.rb +105 -0
  122. data/lib/xero_ap_is/models/history_records.rb +85 -0
  123. data/lib/xero_ap_is/models/import_summary.rb +87 -0
  124. data/lib/xero_ap_is/models/import_summary_accounts.rb +154 -0
  125. data/lib/xero_ap_is/models/import_summary_object.rb +76 -0
  126. data/lib/xero_ap_is/models/import_summary_organisation.rb +75 -0
  127. data/lib/xero_ap_is/models/invoice.rb +586 -0
  128. data/lib/xero_ap_is/models/invoice_address.rb +158 -0
  129. data/lib/xero_ap_is/models/invoice_address_type.rb +37 -0
  130. data/lib/xero_ap_is/models/invoice_reminder.rb +75 -0
  131. data/lib/xero_ap_is/models/invoice_reminders.rb +85 -0
  132. data/lib/xero_ap_is/models/invoices.rb +113 -0
  133. data/lib/xero_ap_is/models/item.rb +259 -0
  134. data/lib/xero_ap_is/models/items.rb +84 -0
  135. data/lib/xero_ap_is/models/journal.rb +157 -0
  136. data/lib/xero_ap_is/models/journal_line.rb +201 -0
  137. data/lib/xero_ap_is/models/journals.rb +103 -0
  138. data/lib/xero_ap_is/models/line_amount_types.rb +41 -0
  139. data/lib/xero_ap_is/models/line_item.rb +287 -0
  140. data/lib/xero_ap_is/models/line_item_item.rb +95 -0
  141. data/lib/xero_ap_is/models/line_item_tracking.rb +108 -0
  142. data/lib/xero_ap_is/models/link_type.rb +48 -0
  143. data/lib/xero_ap_is/models/linked_transaction.rb +215 -0
  144. data/lib/xero_ap_is/models/linked_transactions.rb +85 -0
  145. data/lib/xero_ap_is/models/manual_journal.rb +255 -0
  146. data/lib/xero_ap_is/models/manual_journal_line.rb +156 -0
  147. data/lib/xero_ap_is/models/manual_journals.rb +114 -0
  148. data/lib/xero_ap_is/models/mclass.rb +48 -0
  149. data/lib/xero_ap_is/models/oauth_provider_error.rb +62 -0
  150. data/lib/xero_ap_is/models/oauth_scope_oauth_2.rb +113 -0
  151. data/lib/xero_ap_is/models/oauth_token.rb +96 -0
  152. data/lib/xero_ap_is/models/online_invoice.rb +77 -0
  153. data/lib/xero_ap_is/models/online_invoices.rb +85 -0
  154. data/lib/xero_ap_is/models/order_by.rb +56 -0
  155. data/lib/xero_ap_is/models/organisation.rb +467 -0
  156. data/lib/xero_ap_is/models/organisation_entity_type.rb +80 -0
  157. data/lib/xero_ap_is/models/organisation_role.rb +61 -0
  158. data/lib/xero_ap_is/models/organisation_type.rb +80 -0
  159. data/lib/xero_ap_is/models/organisations.rb +85 -0
  160. data/lib/xero_ap_is/models/overpayment.rb +309 -0
  161. data/lib/xero_ap_is/models/overpayments.rb +113 -0
  162. data/lib/xero_ap_is/models/pagination.rb +105 -0
  163. data/lib/xero_ap_is/models/payment.rb +381 -0
  164. data/lib/xero_ap_is/models/payment_delete.rb +73 -0
  165. data/lib/xero_ap_is/models/payment_service.rb +143 -0
  166. data/lib/xero_ap_is/models/payment_services.rb +85 -0
  167. data/lib/xero_ap_is/models/payment_term.rb +85 -0
  168. data/lib/xero_ap_is/models/payment_term_type.rb +44 -0
  169. data/lib/xero_ap_is/models/payment_type.rb +60 -0
  170. data/lib/xero_ap_is/models/payments.rb +113 -0
  171. data/lib/xero_ap_is/models/phone.rb +108 -0
  172. data/lib/xero_ap_is/models/phone_type.rb +48 -0
  173. data/lib/xero_ap_is/models/prepayment.rb +309 -0
  174. data/lib/xero_ap_is/models/prepayments.rb +113 -0
  175. data/lib/xero_ap_is/models/project.rb +328 -0
  176. data/lib/xero_ap_is/models/project_create_or_update.rb +115 -0
  177. data/lib/xero_ap_is/models/project_patch.rb +73 -0
  178. data/lib/xero_ap_is/models/project_status.rb +36 -0
  179. data/lib/xero_ap_is/models/project_user.rb +95 -0
  180. data/lib/xero_ap_is/models/project_users.rb +94 -0
  181. data/lib/xero_ap_is/models/projects.rb +94 -0
  182. data/lib/xero_ap_is/models/purchase.rb +112 -0
  183. data/lib/xero_ap_is/models/purchase_order.rb +408 -0
  184. data/lib/xero_ap_is/models/purchase_orders.rb +114 -0
  185. data/lib/xero_ap_is/models/purchases_default_line_amount_type.rb +42 -0
  186. data/lib/xero_ap_is/models/quote.rb +338 -0
  187. data/lib/xero_ap_is/models/quote_line_amount_types.rb +41 -0
  188. data/lib/xero_ap_is/models/quote_status_codes.rb +52 -0
  189. data/lib/xero_ap_is/models/quotes.rb +84 -0
  190. data/lib/xero_ap_is/models/receipt.rb +287 -0
  191. data/lib/xero_ap_is/models/receipts.rb +84 -0
  192. data/lib/xero_ap_is/models/refresh_token.rb +106 -0
  193. data/lib/xero_ap_is/models/repeating_invoice.rb +290 -0
  194. data/lib/xero_ap_is/models/repeating_invoices.rb +85 -0
  195. data/lib/xero_ap_is/models/report.rb +136 -0
  196. data/lib/xero_ap_is/models/report_attribute.rb +85 -0
  197. data/lib/xero_ap_is/models/report_cell.rb +94 -0
  198. data/lib/xero_ap_is/models/report_fields.rb +95 -0
  199. data/lib/xero_ap_is/models/report_row.rb +104 -0
  200. data/lib/xero_ap_is/models/report_rows.rb +123 -0
  201. data/lib/xero_ap_is/models/report_tax_type.rb +424 -0
  202. data/lib/xero_ap_is/models/report_type.rb +26 -0
  203. data/lib/xero_ap_is/models/report_with_row.rb +176 -0
  204. data/lib/xero_ap_is/models/report_with_rows.rb +84 -0
  205. data/lib/xero_ap_is/models/reports.rb +84 -0
  206. data/lib/xero_ap_is/models/request_empty.rb +75 -0
  207. data/lib/xero_ap_is/models/resource_validation_errors_element.rb +116 -0
  208. data/lib/xero_ap_is/models/row_type.rb +44 -0
  209. data/lib/xero_ap_is/models/sales_default_line_amount_type.rb +42 -0
  210. data/lib/xero_ap_is/models/sales_tax_basis.rb +60 -0
  211. data/lib/xero_ap_is/models/sales_tax_period.rb +88 -0
  212. data/lib/xero_ap_is/models/sales_tracking_category.rb +89 -0
  213. data/lib/xero_ap_is/models/schedule.rb +140 -0
  214. data/lib/xero_ap_is/models/setting.rb +175 -0
  215. data/lib/xero_ap_is/models/setup.rb +117 -0
  216. data/lib/xero_ap_is/models/sort_direction.rb +36 -0
  217. data/lib/xero_ap_is/models/source_transaction_type_code.rb +38 -0
  218. data/lib/xero_ap_is/models/source_type.rb +128 -0
  219. data/lib/xero_ap_is/models/start_balance.rb +88 -0
  220. data/lib/xero_ap_is/models/statement.rb +194 -0
  221. data/lib/xero_ap_is/models/statement_line.rb +162 -0
  222. data/lib/xero_ap_is/models/statements.rb +94 -0
  223. data/lib/xero_ap_is/models/status.rb +41 -0
  224. data/lib/xero_ap_is/models/status1.rb +38 -0
  225. data/lib/xero_ap_is/models/status10.rb +40 -0
  226. data/lib/xero_ap_is/models/status11.rb +44 -0
  227. data/lib/xero_ap_is/models/status110.rb +40 -0
  228. data/lib/xero_ap_is/models/status111.rb +43 -0
  229. data/lib/xero_ap_is/models/status12.rb +48 -0
  230. data/lib/xero_ap_is/models/status13.rb +48 -0
  231. data/lib/xero_ap_is/models/status14.rb +52 -0
  232. data/lib/xero_ap_is/models/status15.rb +48 -0
  233. data/lib/xero_ap_is/models/status16.rb +36 -0
  234. data/lib/xero_ap_is/models/status17.rb +48 -0
  235. data/lib/xero_ap_is/models/status18.rb +40 -0
  236. data/lib/xero_ap_is/models/status19.rb +44 -0
  237. data/lib/xero_ap_is/models/status2.rb +40 -0
  238. data/lib/xero_ap_is/models/status20.rb +48 -0
  239. data/lib/xero_ap_is/models/status21.rb +36 -0
  240. data/lib/xero_ap_is/models/status22.rb +44 -0
  241. data/lib/xero_ap_is/models/status3.rb +52 -0
  242. data/lib/xero_ap_is/models/status4.rb +40 -0
  243. data/lib/xero_ap_is/models/status5.rb +40 -0
  244. data/lib/xero_ap_is/models/status6.rb +52 -0
  245. data/lib/xero_ap_is/models/status7.rb +36 -0
  246. data/lib/xero_ap_is/models/status8.rb +37 -0
  247. data/lib/xero_ap_is/models/status9.rb +40 -0
  248. data/lib/xero_ap_is/models/system_account.rb +110 -0
  249. data/lib/xero_ap_is/models/task.rb +234 -0
  250. data/lib/xero_ap_is/models/task_create_or_update.rb +105 -0
  251. data/lib/xero_ap_is/models/tasks.rb +94 -0
  252. data/lib/xero_ap_is/models/tax_breakdown_component.rb +172 -0
  253. data/lib/xero_ap_is/models/tax_component.rb +108 -0
  254. data/lib/xero_ap_is/models/tax_number_type.rb +45 -0
  255. data/lib/xero_ap_is/models/tax_rate.rb +213 -0
  256. data/lib/xero_ap_is/models/tax_rates.rb +85 -0
  257. data/lib/xero_ap_is/models/tax_type.rb +520 -0
  258. data/lib/xero_ap_is/models/taxability.rb +48 -0
  259. data/lib/xero_ap_is/models/ten_ninety_nine_contact.rb +318 -0
  260. data/lib/xero_ap_is/models/time_entries.rb +94 -0
  261. data/lib/xero_ap_is/models/time_entry.rb +179 -0
  262. data/lib/xero_ap_is/models/time_entry_create_or_update.rb +120 -0
  263. data/lib/xero_ap_is/models/time_zone.rb +592 -0
  264. data/lib/xero_ap_is/models/timeframe.rb +40 -0
  265. data/lib/xero_ap_is/models/tracking_categories.rb +85 -0
  266. data/lib/xero_ap_is/models/tracking_category.rb +140 -0
  267. data/lib/xero_ap_is/models/tracking_option.rb +109 -0
  268. data/lib/xero_ap_is/models/tracking_options.rb +84 -0
  269. data/lib/xero_ap_is/models/type.rb +60 -0
  270. data/lib/xero_ap_is/models/type1.rb +26 -0
  271. data/lib/xero_ap_is/models/type10.rb +36 -0
  272. data/lib/xero_ap_is/models/type11.rb +114 -0
  273. data/lib/xero_ap_is/models/type2.rb +48 -0
  274. data/lib/xero_ap_is/models/type3.rb +60 -0
  275. data/lib/xero_ap_is/models/type4.rb +44 -0
  276. data/lib/xero_ap_is/models/type5.rb +40 -0
  277. data/lib/xero_ap_is/models/type6.rb +36 -0
  278. data/lib/xero_ap_is/models/type7.rb +37 -0
  279. data/lib/xero_ap_is/models/type8.rb +36 -0
  280. data/lib/xero_ap_is/models/type9.rb +26 -0
  281. data/lib/xero_ap_is/models/unit.rb +36 -0
  282. data/lib/xero_ap_is/models/user.rb +139 -0
  283. data/lib/xero_ap_is/models/users.rb +84 -0
  284. data/lib/xero_ap_is/models/validation_error.rb +75 -0
  285. data/lib/xero_ap_is/models/version.rb +68 -0
  286. data/lib/xero_ap_is/utilities/date_time_helper.rb +11 -0
  287. data/lib/xero_ap_is/utilities/file_wrapper.rb +28 -0
  288. data/lib/xero_ap_is.rb +309 -0
  289. metadata +372 -0
@@ -0,0 +1,89 @@
1
+ # xero_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module XeroApIs
7
+ # The raw AccountsReceivable(sales invoices) and AccountsPayable(bills)
8
+ # outstanding and overdue amounts, not converted to base currency (read only)
9
+ class Balances < BaseModel
10
+ SKIP = Object.new
11
+ private_constant :SKIP
12
+
13
+ # TODO: Write general description for this method
14
+ # @return [AccountsReceivable]
15
+ attr_accessor :accounts_receivable
16
+
17
+ # TODO: Write general description for this method
18
+ # @return [AccountsPayable]
19
+ attr_accessor :accounts_payable
20
+
21
+ # A mapping from model property names to API property names.
22
+ def self.names
23
+ @_hash = {} if @_hash.nil?
24
+ @_hash['accounts_receivable'] = 'AccountsReceivable'
25
+ @_hash['accounts_payable'] = 'AccountsPayable'
26
+ @_hash
27
+ end
28
+
29
+ # An array for optional fields
30
+ def self.optionals
31
+ %w[
32
+ accounts_receivable
33
+ accounts_payable
34
+ ]
35
+ end
36
+
37
+ # An array for nullable fields
38
+ def self.nullables
39
+ []
40
+ end
41
+
42
+ def initialize(accounts_receivable: SKIP, accounts_payable: SKIP,
43
+ additional_properties: nil)
44
+ # Add additional model properties to the instance
45
+ additional_properties = {} if additional_properties.nil?
46
+
47
+ @accounts_receivable = accounts_receivable unless accounts_receivable == SKIP
48
+ @accounts_payable = accounts_payable unless accounts_payable == SKIP
49
+ @additional_properties = additional_properties
50
+ end
51
+
52
+ # Creates an instance of the object from a hash.
53
+ def self.from_hash(hash)
54
+ return nil unless hash
55
+
56
+ # Extract variables from the hash.
57
+ accounts_receivable = AccountsReceivable.from_hash(hash['AccountsReceivable']) if
58
+ hash['AccountsReceivable']
59
+ accounts_payable = AccountsPayable.from_hash(hash['AccountsPayable']) if
60
+ hash['AccountsPayable']
61
+
62
+ # Create a new hash for additional properties, removing known properties.
63
+ new_hash = hash.reject { |k, _| names.value?(k) }
64
+
65
+ additional_properties = APIHelper.get_additional_properties(
66
+ new_hash, proc { |value| value }
67
+ )
68
+
69
+ # Create object from extracted values.
70
+ Balances.new(accounts_receivable: accounts_receivable,
71
+ accounts_payable: accounts_payable,
72
+ additional_properties: additional_properties)
73
+ end
74
+
75
+ # Provides a human-readable string representation of the object.
76
+ def to_s
77
+ class_name = self.class.name.split('::').last
78
+ "<#{class_name} accounts_receivable: #{@accounts_receivable}, accounts_payable:"\
79
+ " #{@accounts_payable}, additional_properties: #{@additional_properties}>"
80
+ end
81
+
82
+ # Provides a debugging-friendly string with detailed object information.
83
+ def inspect
84
+ class_name = self.class.name.split('::').last
85
+ "<#{class_name} accounts_receivable: #{@accounts_receivable.inspect}, accounts_payable:"\
86
+ " #{@accounts_payable.inspect}, additional_properties: #{@additional_properties}>"
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,44 @@
1
+ # xero_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module XeroApIs
7
+ # For bank accounts only. See Bank Account types
8
+ class BankAccountType
9
+ BANK_ACCOUNT_TYPE = [
10
+ # TODO: Write general description for BANK
11
+ BANK = 'BANK'.freeze,
12
+
13
+ # TODO: Write general description for CREDITCARD
14
+ CREDITCARD = 'CREDITCARD'.freeze,
15
+
16
+ # TODO: Write general description for PAYPAL
17
+ PAYPAL = 'PAYPAL'.freeze,
18
+
19
+ # TODO: Write general description for NONE
20
+ NONE = 'NONE'.freeze
21
+ ].freeze
22
+
23
+ def self.validate(value)
24
+ return false if value.nil?
25
+
26
+ BANK_ACCOUNT_TYPE.include?(value)
27
+ end
28
+
29
+ def self.from_value(value, default_value = BANK)
30
+ return default_value if value.nil?
31
+
32
+ str = value.to_s.strip
33
+
34
+ case str.downcase
35
+ when 'bank' then BANK
36
+ when 'creditcard' then CREDITCARD
37
+ when 'paypal' then PAYPAL
38
+ when 'none' then NONE
39
+ else
40
+ default_value
41
+ end
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,319 @@
1
+ # xero_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module XeroApIs
7
+ # BankTransaction Model.
8
+ class BankTransaction < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # See Bank Transaction Types
13
+ # @return [Type]
14
+ attr_accessor :type
15
+
16
+ # See Bank Transaction Types
17
+ # @return [Contact]
18
+ attr_accessor :contact
19
+
20
+ # See LineItems
21
+ # @return [Array[LineItem]]
22
+ attr_accessor :line_items
23
+
24
+ # See LineItems
25
+ # @return [Account]
26
+ attr_accessor :bank_account
27
+
28
+ # Boolean to show if transaction is reconciled
29
+ # @return [TrueClass | FalseClass]
30
+ attr_accessor :is_reconciled
31
+
32
+ # Date of transaction – YYYY-MM-DD
33
+ # @return [String]
34
+ attr_accessor :date
35
+
36
+ # Reference for the transaction. Only supported for SPEND and RECEIVE
37
+ # transactions.
38
+ # @return [String]
39
+ attr_accessor :reference
40
+
41
+ # 3 letter alpha code for the currency – see list of currency codes
42
+ # @return [CurrencyCode]
43
+ attr_accessor :currency_code
44
+
45
+ # Exchange rate to base currency when money is spent or received. e.g.0.7500
46
+ # Only used for bank transactions in non base currency. If this isn’t
47
+ # specified for non base currency accounts then either the user-defined rate
48
+ # (preference) or the XE.com day rate will be used. Setting currency is only
49
+ # supported on overpayments.
50
+ # @return [Float]
51
+ attr_accessor :currency_rate
52
+
53
+ # URL link to a source document – shown as “Go to App Name”
54
+ # @return [String]
55
+ attr_accessor :url
56
+
57
+ # See Bank Transaction Status Codes
58
+ # @return [Status2]
59
+ attr_accessor :status
60
+
61
+ # Line amounts are exclusive of tax by default if you don’t specify this
62
+ # element. See Line Amount Types
63
+ # @return [LineAmountTypes]
64
+ attr_accessor :line_amount_types
65
+
66
+ # Total of bank transaction excluding taxes
67
+ # @return [Float]
68
+ attr_accessor :sub_total
69
+
70
+ # Total tax on bank transaction
71
+ # @return [Float]
72
+ attr_accessor :total_tax
73
+
74
+ # Total of bank transaction tax inclusive
75
+ # @return [Float]
76
+ attr_accessor :total
77
+
78
+ # Xero generated unique identifier for bank transaction
79
+ # @return [UUID | String]
80
+ attr_accessor :bank_transaction_id
81
+
82
+ # Xero generated unique identifier for a Prepayment. This will be returned
83
+ # on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT
84
+ # @return [UUID | String]
85
+ attr_accessor :prepayment_id
86
+
87
+ # Xero generated unique identifier for an Overpayment. This will be returned
88
+ # on BankTransactions with a Type of SPEND-OVERPAYMENT or
89
+ # RECEIVE-OVERPAYMENT
90
+ # @return [UUID | String]
91
+ attr_accessor :overpayment_id
92
+
93
+ # Last modified date UTC format
94
+ # @return [String]
95
+ attr_accessor :updated_date_utc
96
+
97
+ # Boolean to indicate if a bank transaction has an attachment
98
+ # @return [TrueClass | FalseClass]
99
+ attr_accessor :has_attachments
100
+
101
+ # A string to indicate if a invoice status
102
+ # @return [String]
103
+ attr_accessor :status_attribute_string
104
+
105
+ # Displays array of validation error messages from the API
106
+ # @return [Array[ValidationError]]
107
+ attr_accessor :validation_errors
108
+
109
+ # A mapping from model property names to API property names.
110
+ def self.names
111
+ @_hash = {} if @_hash.nil?
112
+ @_hash['type'] = 'Type'
113
+ @_hash['contact'] = 'Contact'
114
+ @_hash['line_items'] = 'LineItems'
115
+ @_hash['bank_account'] = 'BankAccount'
116
+ @_hash['is_reconciled'] = 'IsReconciled'
117
+ @_hash['date'] = 'Date'
118
+ @_hash['reference'] = 'Reference'
119
+ @_hash['currency_code'] = 'CurrencyCode'
120
+ @_hash['currency_rate'] = 'CurrencyRate'
121
+ @_hash['url'] = 'Url'
122
+ @_hash['status'] = 'Status'
123
+ @_hash['line_amount_types'] = 'LineAmountTypes'
124
+ @_hash['sub_total'] = 'SubTotal'
125
+ @_hash['total_tax'] = 'TotalTax'
126
+ @_hash['total'] = 'Total'
127
+ @_hash['bank_transaction_id'] = 'BankTransactionID'
128
+ @_hash['prepayment_id'] = 'PrepaymentID'
129
+ @_hash['overpayment_id'] = 'OverpaymentID'
130
+ @_hash['updated_date_utc'] = 'UpdatedDateUTC'
131
+ @_hash['has_attachments'] = 'HasAttachments'
132
+ @_hash['status_attribute_string'] = 'StatusAttributeString'
133
+ @_hash['validation_errors'] = 'ValidationErrors'
134
+ @_hash
135
+ end
136
+
137
+ # An array for optional fields
138
+ def self.optionals
139
+ %w[
140
+ contact
141
+ is_reconciled
142
+ date
143
+ reference
144
+ currency_code
145
+ currency_rate
146
+ url
147
+ status
148
+ line_amount_types
149
+ sub_total
150
+ total_tax
151
+ total
152
+ bank_transaction_id
153
+ prepayment_id
154
+ overpayment_id
155
+ updated_date_utc
156
+ has_attachments
157
+ status_attribute_string
158
+ validation_errors
159
+ ]
160
+ end
161
+
162
+ # An array for nullable fields
163
+ def self.nullables
164
+ []
165
+ end
166
+
167
+ def initialize(type:, line_items:, bank_account:, contact: SKIP,
168
+ is_reconciled: SKIP, date: SKIP, reference: SKIP,
169
+ currency_code: SKIP, currency_rate: SKIP, url: SKIP,
170
+ status: SKIP, line_amount_types: SKIP, sub_total: SKIP,
171
+ total_tax: SKIP, total: SKIP, bank_transaction_id: SKIP,
172
+ prepayment_id: SKIP, overpayment_id: SKIP,
173
+ updated_date_utc: SKIP, has_attachments: false,
174
+ status_attribute_string: SKIP, validation_errors: SKIP,
175
+ additional_properties: nil)
176
+ # Add additional model properties to the instance
177
+ additional_properties = {} if additional_properties.nil?
178
+
179
+ @type = type
180
+ @contact = contact unless contact == SKIP
181
+ @line_items = line_items
182
+ @bank_account = bank_account
183
+ @is_reconciled = is_reconciled unless is_reconciled == SKIP
184
+ @date = date unless date == SKIP
185
+ @reference = reference unless reference == SKIP
186
+ @currency_code = currency_code unless currency_code == SKIP
187
+ @currency_rate = currency_rate unless currency_rate == SKIP
188
+ @url = url unless url == SKIP
189
+ @status = status unless status == SKIP
190
+ @line_amount_types = line_amount_types unless line_amount_types == SKIP
191
+ @sub_total = sub_total unless sub_total == SKIP
192
+ @total_tax = total_tax unless total_tax == SKIP
193
+ @total = total unless total == SKIP
194
+ @bank_transaction_id = bank_transaction_id unless bank_transaction_id == SKIP
195
+ @prepayment_id = prepayment_id unless prepayment_id == SKIP
196
+ @overpayment_id = overpayment_id unless overpayment_id == SKIP
197
+ @updated_date_utc = updated_date_utc unless updated_date_utc == SKIP
198
+ @has_attachments = has_attachments unless has_attachments == SKIP
199
+ @status_attribute_string = status_attribute_string unless status_attribute_string == SKIP
200
+ @validation_errors = validation_errors unless validation_errors == SKIP
201
+ @additional_properties = additional_properties
202
+ end
203
+
204
+ # Creates an instance of the object from a hash.
205
+ def self.from_hash(hash)
206
+ return nil unless hash
207
+
208
+ # Extract variables from the hash.
209
+ type = hash.key?('Type') ? hash['Type'] : nil
210
+ # Parameter is an array, so we need to iterate through it
211
+ line_items = nil
212
+ unless hash['LineItems'].nil?
213
+ line_items = []
214
+ hash['LineItems'].each do |structure|
215
+ line_items << (LineItem.from_hash(structure) if structure)
216
+ end
217
+ end
218
+
219
+ line_items = nil unless hash.key?('LineItems')
220
+ bank_account = Account.from_hash(hash['BankAccount']) if hash['BankAccount']
221
+ contact = Contact.from_hash(hash['Contact']) if hash['Contact']
222
+ is_reconciled = hash.key?('IsReconciled') ? hash['IsReconciled'] : SKIP
223
+ date = hash.key?('Date') ? hash['Date'] : SKIP
224
+ reference = hash.key?('Reference') ? hash['Reference'] : SKIP
225
+ currency_code = hash.key?('CurrencyCode') ? hash['CurrencyCode'] : SKIP
226
+ currency_rate = hash.key?('CurrencyRate') ? hash['CurrencyRate'] : SKIP
227
+ url = hash.key?('Url') ? hash['Url'] : SKIP
228
+ status = hash.key?('Status') ? hash['Status'] : SKIP
229
+ line_amount_types =
230
+ hash.key?('LineAmountTypes') ? hash['LineAmountTypes'] : SKIP
231
+ sub_total = hash.key?('SubTotal') ? hash['SubTotal'] : SKIP
232
+ total_tax = hash.key?('TotalTax') ? hash['TotalTax'] : SKIP
233
+ total = hash.key?('Total') ? hash['Total'] : SKIP
234
+ bank_transaction_id =
235
+ hash.key?('BankTransactionID') ? hash['BankTransactionID'] : SKIP
236
+ prepayment_id = hash.key?('PrepaymentID') ? hash['PrepaymentID'] : SKIP
237
+ overpayment_id = hash.key?('OverpaymentID') ? hash['OverpaymentID'] : SKIP
238
+ updated_date_utc =
239
+ hash.key?('UpdatedDateUTC') ? hash['UpdatedDateUTC'] : SKIP
240
+ has_attachments = hash['HasAttachments'] ||= false
241
+ status_attribute_string =
242
+ hash.key?('StatusAttributeString') ? hash['StatusAttributeString'] : SKIP
243
+ # Parameter is an array, so we need to iterate through it
244
+ validation_errors = nil
245
+ unless hash['ValidationErrors'].nil?
246
+ validation_errors = []
247
+ hash['ValidationErrors'].each do |structure|
248
+ validation_errors << (ValidationError.from_hash(structure) if structure)
249
+ end
250
+ end
251
+
252
+ validation_errors = SKIP unless hash.key?('ValidationErrors')
253
+
254
+ # Create a new hash for additional properties, removing known properties.
255
+ new_hash = hash.reject { |k, _| names.value?(k) }
256
+
257
+ additional_properties = APIHelper.get_additional_properties(
258
+ new_hash, proc { |value| value }
259
+ )
260
+
261
+ # Create object from extracted values.
262
+ BankTransaction.new(type: type,
263
+ line_items: line_items,
264
+ bank_account: bank_account,
265
+ contact: contact,
266
+ is_reconciled: is_reconciled,
267
+ date: date,
268
+ reference: reference,
269
+ currency_code: currency_code,
270
+ currency_rate: currency_rate,
271
+ url: url,
272
+ status: status,
273
+ line_amount_types: line_amount_types,
274
+ sub_total: sub_total,
275
+ total_tax: total_tax,
276
+ total: total,
277
+ bank_transaction_id: bank_transaction_id,
278
+ prepayment_id: prepayment_id,
279
+ overpayment_id: overpayment_id,
280
+ updated_date_utc: updated_date_utc,
281
+ has_attachments: has_attachments,
282
+ status_attribute_string: status_attribute_string,
283
+ validation_errors: validation_errors,
284
+ additional_properties: additional_properties)
285
+ end
286
+
287
+ # Provides a human-readable string representation of the object.
288
+ def to_s
289
+ class_name = self.class.name.split('::').last
290
+ "<#{class_name} type: #{@type}, contact: #{@contact}, line_items: #{@line_items},"\
291
+ " bank_account: #{@bank_account}, is_reconciled: #{@is_reconciled}, date: #{@date},"\
292
+ " reference: #{@reference}, currency_code: #{@currency_code}, currency_rate:"\
293
+ " #{@currency_rate}, url: #{@url}, status: #{@status}, line_amount_types:"\
294
+ " #{@line_amount_types}, sub_total: #{@sub_total}, total_tax: #{@total_tax}, total:"\
295
+ " #{@total}, bank_transaction_id: #{@bank_transaction_id}, prepayment_id: #{@prepayment_id},"\
296
+ " overpayment_id: #{@overpayment_id}, updated_date_utc: #{@updated_date_utc},"\
297
+ " has_attachments: #{@has_attachments}, status_attribute_string:"\
298
+ " #{@status_attribute_string}, validation_errors: #{@validation_errors},"\
299
+ " additional_properties: #{@additional_properties}>"
300
+ end
301
+
302
+ # Provides a debugging-friendly string with detailed object information.
303
+ def inspect
304
+ class_name = self.class.name.split('::').last
305
+ "<#{class_name} type: #{@type.inspect}, contact: #{@contact.inspect}, line_items:"\
306
+ " #{@line_items.inspect}, bank_account: #{@bank_account.inspect}, is_reconciled:"\
307
+ " #{@is_reconciled.inspect}, date: #{@date.inspect}, reference: #{@reference.inspect},"\
308
+ " currency_code: #{@currency_code.inspect}, currency_rate: #{@currency_rate.inspect}, url:"\
309
+ " #{@url.inspect}, status: #{@status.inspect}, line_amount_types:"\
310
+ " #{@line_amount_types.inspect}, sub_total: #{@sub_total.inspect}, total_tax:"\
311
+ " #{@total_tax.inspect}, total: #{@total.inspect}, bank_transaction_id:"\
312
+ " #{@bank_transaction_id.inspect}, prepayment_id: #{@prepayment_id.inspect}, overpayment_id:"\
313
+ " #{@overpayment_id.inspect}, updated_date_utc: #{@updated_date_utc.inspect},"\
314
+ " has_attachments: #{@has_attachments.inspect}, status_attribute_string:"\
315
+ " #{@status_attribute_string.inspect}, validation_errors: #{@validation_errors.inspect},"\
316
+ " additional_properties: #{@additional_properties}>"
317
+ end
318
+ end
319
+ end
@@ -0,0 +1,114 @@
1
+ # xero_ap_is
2
+ #
3
+ # This file was automatically generated by APIMATIC v3.0 (
4
+ # https://www.apimatic.io ).
5
+
6
+ module XeroApIs
7
+ # BankTransactions Model.
8
+ class BankTransactions < BaseModel
9
+ SKIP = Object.new
10
+ private_constant :SKIP
11
+
12
+ # TODO: Write general description for this method
13
+ # @return [Pagination]
14
+ attr_accessor :pagination
15
+
16
+ # Displays array of warning messages from the API
17
+ # @return [Array[ValidationError]]
18
+ attr_accessor :warnings
19
+
20
+ # Displays array of warning messages from the API
21
+ # @return [Array[BankTransaction]]
22
+ attr_accessor :bank_transactions
23
+
24
+ # A mapping from model property names to API property names.
25
+ def self.names
26
+ @_hash = {} if @_hash.nil?
27
+ @_hash['pagination'] = 'pagination'
28
+ @_hash['warnings'] = 'Warnings'
29
+ @_hash['bank_transactions'] = 'BankTransactions'
30
+ @_hash
31
+ end
32
+
33
+ # An array for optional fields
34
+ def self.optionals
35
+ %w[
36
+ pagination
37
+ warnings
38
+ bank_transactions
39
+ ]
40
+ end
41
+
42
+ # An array for nullable fields
43
+ def self.nullables
44
+ []
45
+ end
46
+
47
+ def initialize(pagination: SKIP, warnings: SKIP, bank_transactions: SKIP,
48
+ additional_properties: nil)
49
+ # Add additional model properties to the instance
50
+ additional_properties = {} if additional_properties.nil?
51
+
52
+ @pagination = pagination unless pagination == SKIP
53
+ @warnings = warnings unless warnings == SKIP
54
+ @bank_transactions = bank_transactions unless bank_transactions == SKIP
55
+ @additional_properties = additional_properties
56
+ end
57
+
58
+ # Creates an instance of the object from a hash.
59
+ def self.from_hash(hash)
60
+ return nil unless hash
61
+
62
+ # Extract variables from the hash.
63
+ pagination = Pagination.from_hash(hash['pagination']) if hash['pagination']
64
+ # Parameter is an array, so we need to iterate through it
65
+ warnings = nil
66
+ unless hash['Warnings'].nil?
67
+ warnings = []
68
+ hash['Warnings'].each do |structure|
69
+ warnings << (ValidationError.from_hash(structure) if structure)
70
+ end
71
+ end
72
+
73
+ warnings = SKIP unless hash.key?('Warnings')
74
+ # Parameter is an array, so we need to iterate through it
75
+ bank_transactions = nil
76
+ unless hash['BankTransactions'].nil?
77
+ bank_transactions = []
78
+ hash['BankTransactions'].each do |structure|
79
+ bank_transactions << (BankTransaction.from_hash(structure) if structure)
80
+ end
81
+ end
82
+
83
+ bank_transactions = SKIP unless hash.key?('BankTransactions')
84
+
85
+ # Create a new hash for additional properties, removing known properties.
86
+ new_hash = hash.reject { |k, _| names.value?(k) }
87
+
88
+ additional_properties = APIHelper.get_additional_properties(
89
+ new_hash, proc { |value| value }
90
+ )
91
+
92
+ # Create object from extracted values.
93
+ BankTransactions.new(pagination: pagination,
94
+ warnings: warnings,
95
+ bank_transactions: bank_transactions,
96
+ additional_properties: additional_properties)
97
+ end
98
+
99
+ # Provides a human-readable string representation of the object.
100
+ def to_s
101
+ class_name = self.class.name.split('::').last
102
+ "<#{class_name} pagination: #{@pagination}, warnings: #{@warnings}, bank_transactions:"\
103
+ " #{@bank_transactions}, additional_properties: #{@additional_properties}>"
104
+ end
105
+
106
+ # Provides a debugging-friendly string with detailed object information.
107
+ def inspect
108
+ class_name = self.class.name.split('::').last
109
+ "<#{class_name} pagination: #{@pagination.inspect}, warnings: #{@warnings.inspect},"\
110
+ " bank_transactions: #{@bank_transactions.inspect}, additional_properties:"\
111
+ " #{@additional_properties}>"
112
+ end
113
+ end
114
+ end