xero-ruby 3.1.0 → 3.2.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 (399) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +191 -225
  3. data/lib/xero-ruby.rb +2 -1
  4. data/lib/xero-ruby/api/accounting_api.rb +5 -5
  5. data/lib/xero-ruby/api_client.rb +16 -2
  6. data/lib/xero-ruby/models/accounting/account.rb +2 -0
  7. data/lib/xero-ruby/models/accounting/accounts.rb +2 -0
  8. data/lib/xero-ruby/models/accounting/accounts_payable.rb +2 -0
  9. data/lib/xero-ruby/models/accounting/accounts_receivable.rb +2 -0
  10. data/lib/xero-ruby/models/accounting/action.rb +2 -0
  11. data/lib/xero-ruby/models/accounting/actions.rb +2 -0
  12. data/lib/xero-ruby/models/accounting/address.rb +2 -0
  13. data/lib/xero-ruby/models/accounting/address_for_organisation.rb +2 -0
  14. data/lib/xero-ruby/models/accounting/allocation.rb +2 -0
  15. data/lib/xero-ruby/models/accounting/allocations.rb +2 -0
  16. data/lib/xero-ruby/models/accounting/attachment.rb +2 -0
  17. data/lib/xero-ruby/models/accounting/attachments.rb +2 -0
  18. data/lib/xero-ruby/models/accounting/balance_details.rb +2 -0
  19. data/lib/xero-ruby/models/accounting/balances.rb +2 -0
  20. data/lib/xero-ruby/models/accounting/bank_transaction.rb +2 -0
  21. data/lib/xero-ruby/models/accounting/bank_transactions.rb +2 -0
  22. data/lib/xero-ruby/models/accounting/bank_transfer.rb +2 -0
  23. data/lib/xero-ruby/models/accounting/bank_transfers.rb +2 -0
  24. data/lib/xero-ruby/models/accounting/batch_payment.rb +2 -0
  25. data/lib/xero-ruby/models/accounting/batch_payment_details.rb +2 -0
  26. data/lib/xero-ruby/models/accounting/batch_payments.rb +2 -0
  27. data/lib/xero-ruby/models/accounting/bill.rb +2 -0
  28. data/lib/xero-ruby/models/accounting/branding_theme.rb +2 -0
  29. data/lib/xero-ruby/models/accounting/branding_themes.rb +2 -0
  30. data/lib/xero-ruby/models/accounting/budget.rb +10 -4
  31. data/lib/xero-ruby/models/accounting/{budget_lines.rb → budget_balance.rb} +5 -3
  32. data/lib/xero-ruby/models/accounting/budget_line.rb +244 -0
  33. data/lib/xero-ruby/models/accounting/budgets.rb +2 -0
  34. data/lib/xero-ruby/models/accounting/cis_org_setting.rb +2 -0
  35. data/lib/xero-ruby/models/accounting/cis_org_settings.rb +2 -0
  36. data/lib/xero-ruby/models/accounting/cis_setting.rb +2 -0
  37. data/lib/xero-ruby/models/accounting/cis_settings.rb +2 -0
  38. data/lib/xero-ruby/models/accounting/contact.rb +2 -0
  39. data/lib/xero-ruby/models/accounting/contact_group.rb +2 -0
  40. data/lib/xero-ruby/models/accounting/contact_groups.rb +2 -0
  41. data/lib/xero-ruby/models/accounting/contact_person.rb +2 -0
  42. data/lib/xero-ruby/models/accounting/contacts.rb +2 -0
  43. data/lib/xero-ruby/models/accounting/conversion_balances.rb +2 -0
  44. data/lib/xero-ruby/models/accounting/conversion_date.rb +2 -0
  45. data/lib/xero-ruby/models/accounting/credit_note.rb +2 -0
  46. data/lib/xero-ruby/models/accounting/credit_notes.rb +2 -0
  47. data/lib/xero-ruby/models/accounting/currencies.rb +2 -0
  48. data/lib/xero-ruby/models/accounting/currency.rb +2 -0
  49. data/lib/xero-ruby/models/accounting/element.rb +2 -0
  50. data/lib/xero-ruby/models/accounting/employee.rb +2 -0
  51. data/lib/xero-ruby/models/accounting/employees.rb +2 -0
  52. data/lib/xero-ruby/models/accounting/error.rb +2 -0
  53. data/lib/xero-ruby/models/accounting/expense_claim.rb +2 -0
  54. data/lib/xero-ruby/models/accounting/expense_claims.rb +2 -0
  55. data/lib/xero-ruby/models/accounting/external_link.rb +2 -0
  56. data/lib/xero-ruby/models/accounting/history_record.rb +2 -0
  57. data/lib/xero-ruby/models/accounting/history_records.rb +2 -0
  58. data/lib/xero-ruby/models/accounting/import_summary.rb +2 -0
  59. data/lib/xero-ruby/models/accounting/import_summary_accounts.rb +2 -0
  60. data/lib/xero-ruby/models/accounting/import_summary_object.rb +2 -0
  61. data/lib/xero-ruby/models/accounting/import_summary_organisation.rb +2 -0
  62. data/lib/xero-ruby/models/accounting/invoice.rb +2 -0
  63. data/lib/xero-ruby/models/accounting/invoice_reminder.rb +2 -0
  64. data/lib/xero-ruby/models/accounting/invoice_reminders.rb +2 -0
  65. data/lib/xero-ruby/models/accounting/invoices.rb +2 -0
  66. data/lib/xero-ruby/models/accounting/item.rb +2 -0
  67. data/lib/xero-ruby/models/accounting/items.rb +2 -0
  68. data/lib/xero-ruby/models/accounting/journal.rb +2 -0
  69. data/lib/xero-ruby/models/accounting/journal_line.rb +2 -0
  70. data/lib/xero-ruby/models/accounting/journals.rb +2 -0
  71. data/lib/xero-ruby/models/accounting/line_item.rb +2 -0
  72. data/lib/xero-ruby/models/accounting/line_item_tracking.rb +2 -0
  73. data/lib/xero-ruby/models/accounting/linked_transaction.rb +2 -0
  74. data/lib/xero-ruby/models/accounting/linked_transactions.rb +2 -0
  75. data/lib/xero-ruby/models/accounting/manual_journal.rb +2 -0
  76. data/lib/xero-ruby/models/accounting/manual_journal_line.rb +2 -0
  77. data/lib/xero-ruby/models/accounting/manual_journals.rb +2 -0
  78. data/lib/xero-ruby/models/accounting/online_invoice.rb +2 -0
  79. data/lib/xero-ruby/models/accounting/online_invoices.rb +2 -0
  80. data/lib/xero-ruby/models/accounting/organisation.rb +2 -0
  81. data/lib/xero-ruby/models/accounting/organisations.rb +2 -0
  82. data/lib/xero-ruby/models/accounting/overpayment.rb +2 -0
  83. data/lib/xero-ruby/models/accounting/overpayments.rb +2 -0
  84. data/lib/xero-ruby/models/accounting/payment.rb +2 -0
  85. data/lib/xero-ruby/models/accounting/payment_delete.rb +2 -0
  86. data/lib/xero-ruby/models/accounting/payment_service.rb +2 -0
  87. data/lib/xero-ruby/models/accounting/payment_services.rb +2 -0
  88. data/lib/xero-ruby/models/accounting/payment_term.rb +2 -0
  89. data/lib/xero-ruby/models/accounting/payments.rb +2 -0
  90. data/lib/xero-ruby/models/accounting/phone.rb +2 -0
  91. data/lib/xero-ruby/models/accounting/prepayment.rb +2 -0
  92. data/lib/xero-ruby/models/accounting/prepayments.rb +2 -0
  93. data/lib/xero-ruby/models/accounting/purchase.rb +2 -0
  94. data/lib/xero-ruby/models/accounting/purchase_order.rb +2 -0
  95. data/lib/xero-ruby/models/accounting/purchase_orders.rb +2 -0
  96. data/lib/xero-ruby/models/accounting/quote.rb +2 -0
  97. data/lib/xero-ruby/models/accounting/quotes.rb +2 -0
  98. data/lib/xero-ruby/models/accounting/receipt.rb +2 -0
  99. data/lib/xero-ruby/models/accounting/receipts.rb +2 -0
  100. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +2 -0
  101. data/lib/xero-ruby/models/accounting/repeating_invoices.rb +2 -0
  102. data/lib/xero-ruby/models/accounting/report.rb +2 -0
  103. data/lib/xero-ruby/models/accounting/report_attribute.rb +2 -0
  104. data/lib/xero-ruby/models/accounting/report_cell.rb +2 -0
  105. data/lib/xero-ruby/models/accounting/report_fields.rb +2 -0
  106. data/lib/xero-ruby/models/accounting/report_row.rb +2 -0
  107. data/lib/xero-ruby/models/accounting/report_rows.rb +2 -0
  108. data/lib/xero-ruby/models/accounting/report_with_row.rb +2 -0
  109. data/lib/xero-ruby/models/accounting/report_with_rows.rb +2 -0
  110. data/lib/xero-ruby/models/accounting/reports.rb +2 -0
  111. data/lib/xero-ruby/models/accounting/request_empty.rb +2 -0
  112. data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +2 -0
  113. data/lib/xero-ruby/models/accounting/schedule.rb +2 -0
  114. data/lib/xero-ruby/models/accounting/setup.rb +2 -0
  115. data/lib/xero-ruby/models/accounting/tax_component.rb +2 -0
  116. data/lib/xero-ruby/models/accounting/tax_rate.rb +2 -0
  117. data/lib/xero-ruby/models/accounting/tax_rates.rb +2 -0
  118. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +2 -0
  119. data/lib/xero-ruby/models/accounting/tracking_categories.rb +2 -0
  120. data/lib/xero-ruby/models/accounting/tracking_category.rb +2 -0
  121. data/lib/xero-ruby/models/accounting/tracking_option.rb +2 -0
  122. data/lib/xero-ruby/models/accounting/tracking_options.rb +2 -0
  123. data/lib/xero-ruby/models/accounting/user.rb +2 -0
  124. data/lib/xero-ruby/models/accounting/users.rb +2 -0
  125. data/lib/xero-ruby/models/accounting/validation_error.rb +2 -0
  126. data/lib/xero-ruby/models/assets/asset.rb +2 -0
  127. data/lib/xero-ruby/models/assets/asset_type.rb +2 -0
  128. data/lib/xero-ruby/models/assets/assets.rb +2 -0
  129. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +2 -0
  130. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +2 -0
  131. data/lib/xero-ruby/models/assets/error.rb +2 -0
  132. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +2 -0
  133. data/lib/xero-ruby/models/assets/pagination.rb +2 -0
  134. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +2 -0
  135. data/lib/xero-ruby/models/assets/setting.rb +2 -0
  136. data/lib/xero-ruby/models/files/association.rb +2 -0
  137. data/lib/xero-ruby/models/files/file_object.rb +2 -0
  138. data/lib/xero-ruby/models/files/files.rb +2 -0
  139. data/lib/xero-ruby/models/files/folder.rb +2 -0
  140. data/lib/xero-ruby/models/files/folders.rb +2 -0
  141. data/lib/xero-ruby/models/files/upload_object.rb +2 -0
  142. data/lib/xero-ruby/models/files/user.rb +2 -0
  143. data/lib/xero-ruby/models/payroll_au/account.rb +2 -0
  144. data/lib/xero-ruby/models/payroll_au/api_exception.rb +2 -0
  145. data/lib/xero-ruby/models/payroll_au/bank_account.rb +2 -0
  146. data/lib/xero-ruby/models/payroll_au/deduction_line.rb +2 -0
  147. data/lib/xero-ruby/models/payroll_au/deduction_type.rb +2 -0
  148. data/lib/xero-ruby/models/payroll_au/earnings_line.rb +2 -0
  149. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +2 -0
  150. data/lib/xero-ruby/models/payroll_au/employee.rb +2 -0
  151. data/lib/xero-ruby/models/payroll_au/employees.rb +2 -0
  152. data/lib/xero-ruby/models/payroll_au/home_address.rb +2 -0
  153. data/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb +2 -0
  154. data/lib/xero-ruby/models/payroll_au/leave_application.rb +2 -0
  155. data/lib/xero-ruby/models/payroll_au/leave_applications.rb +2 -0
  156. data/lib/xero-ruby/models/payroll_au/leave_balance.rb +2 -0
  157. data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +2 -0
  158. data/lib/xero-ruby/models/payroll_au/leave_line.rb +2 -0
  159. data/lib/xero-ruby/models/payroll_au/leave_lines.rb +2 -0
  160. data/lib/xero-ruby/models/payroll_au/leave_period.rb +2 -0
  161. data/lib/xero-ruby/models/payroll_au/leave_type.rb +2 -0
  162. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +2 -0
  163. data/lib/xero-ruby/models/payroll_au/pay_item.rb +2 -0
  164. data/lib/xero-ruby/models/payroll_au/pay_items.rb +2 -0
  165. data/lib/xero-ruby/models/payroll_au/pay_run.rb +2 -0
  166. data/lib/xero-ruby/models/payroll_au/pay_runs.rb +2 -0
  167. data/lib/xero-ruby/models/payroll_au/pay_template.rb +2 -0
  168. data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +2 -0
  169. data/lib/xero-ruby/models/payroll_au/payroll_calendars.rb +2 -0
  170. data/lib/xero-ruby/models/payroll_au/payslip.rb +2 -0
  171. data/lib/xero-ruby/models/payroll_au/payslip_lines.rb +2 -0
  172. data/lib/xero-ruby/models/payroll_au/payslip_object.rb +2 -0
  173. data/lib/xero-ruby/models/payroll_au/payslip_summary.rb +2 -0
  174. data/lib/xero-ruby/models/payroll_au/payslips.rb +2 -0
  175. data/lib/xero-ruby/models/payroll_au/reimbursement_line.rb +2 -0
  176. data/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb +2 -0
  177. data/lib/xero-ruby/models/payroll_au/reimbursement_type.rb +2 -0
  178. data/lib/xero-ruby/models/payroll_au/settings.rb +2 -0
  179. data/lib/xero-ruby/models/payroll_au/settings_object.rb +2 -0
  180. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb +2 -0
  181. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb +2 -0
  182. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb +2 -0
  183. data/lib/xero-ruby/models/payroll_au/super_fund.rb +2 -0
  184. data/lib/xero-ruby/models/payroll_au/super_fund_product.rb +2 -0
  185. data/lib/xero-ruby/models/payroll_au/super_fund_products.rb +2 -0
  186. data/lib/xero-ruby/models/payroll_au/super_funds.rb +2 -0
  187. data/lib/xero-ruby/models/payroll_au/super_line.rb +2 -0
  188. data/lib/xero-ruby/models/payroll_au/super_membership.rb +2 -0
  189. data/lib/xero-ruby/models/payroll_au/superannuation_line.rb +2 -0
  190. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +2 -0
  191. data/lib/xero-ruby/models/payroll_au/tax_line.rb +2 -0
  192. data/lib/xero-ruby/models/payroll_au/timesheet.rb +2 -0
  193. data/lib/xero-ruby/models/payroll_au/timesheet_line.rb +2 -0
  194. data/lib/xero-ruby/models/payroll_au/timesheet_object.rb +2 -0
  195. data/lib/xero-ruby/models/payroll_au/timesheets.rb +2 -0
  196. data/lib/xero-ruby/models/payroll_au/validation_error.rb +2 -0
  197. data/lib/xero-ruby/models/payroll_nz/account.rb +2 -0
  198. data/lib/xero-ruby/models/payroll_nz/accounts.rb +2 -0
  199. data/lib/xero-ruby/models/payroll_nz/address.rb +2 -0
  200. data/lib/xero-ruby/models/payroll_nz/bank_account.rb +2 -0
  201. data/lib/xero-ruby/models/payroll_nz/benefit.rb +2 -0
  202. data/lib/xero-ruby/models/payroll_nz/deduction.rb +2 -0
  203. data/lib/xero-ruby/models/payroll_nz/deduction_line.rb +2 -0
  204. data/lib/xero-ruby/models/payroll_nz/deduction_object.rb +2 -0
  205. data/lib/xero-ruby/models/payroll_nz/deductions.rb +2 -0
  206. data/lib/xero-ruby/models/payroll_nz/earnings_line.rb +2 -0
  207. data/lib/xero-ruby/models/payroll_nz/earnings_order.rb +2 -0
  208. data/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb +2 -0
  209. data/lib/xero-ruby/models/payroll_nz/earnings_orders.rb +2 -0
  210. data/lib/xero-ruby/models/payroll_nz/earnings_rate.rb +2 -0
  211. data/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb +2 -0
  212. data/lib/xero-ruby/models/payroll_nz/earnings_rates.rb +2 -0
  213. data/lib/xero-ruby/models/payroll_nz/earnings_template.rb +2 -0
  214. data/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb +2 -0
  215. data/lib/xero-ruby/models/payroll_nz/employee.rb +2 -0
  216. data/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb +2 -0
  217. data/lib/xero-ruby/models/payroll_nz/employee_leave.rb +2 -0
  218. data/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb +2 -0
  219. data/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb +2 -0
  220. data/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb +2 -0
  221. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +2 -0
  222. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb +2 -0
  223. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +2 -0
  224. data/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb +2 -0
  225. data/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb +2 -0
  226. data/lib/xero-ruby/models/payroll_nz/employee_leaves.rb +2 -0
  227. data/lib/xero-ruby/models/payroll_nz/employee_object.rb +2 -0
  228. data/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb +2 -0
  229. data/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb +2 -0
  230. data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +2 -0
  231. data/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb +2 -0
  232. data/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb +2 -0
  233. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb +2 -0
  234. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb +2 -0
  235. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb +2 -0
  236. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb +2 -0
  237. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb +2 -0
  238. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb +2 -0
  239. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb +2 -0
  240. data/lib/xero-ruby/models/payroll_nz/employee_tax.rb +2 -0
  241. data/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb +2 -0
  242. data/lib/xero-ruby/models/payroll_nz/employees.rb +2 -0
  243. data/lib/xero-ruby/models/payroll_nz/employment.rb +2 -0
  244. data/lib/xero-ruby/models/payroll_nz/employment_object.rb +2 -0
  245. data/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb +2 -0
  246. data/lib/xero-ruby/models/payroll_nz/invalid_field.rb +2 -0
  247. data/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb +2 -0
  248. data/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb +2 -0
  249. data/lib/xero-ruby/models/payroll_nz/leave_period.rb +2 -0
  250. data/lib/xero-ruby/models/payroll_nz/leave_periods.rb +2 -0
  251. data/lib/xero-ruby/models/payroll_nz/leave_type.rb +2 -0
  252. data/lib/xero-ruby/models/payroll_nz/leave_type_object.rb +2 -0
  253. data/lib/xero-ruby/models/payroll_nz/leave_types.rb +2 -0
  254. data/lib/xero-ruby/models/payroll_nz/pagination.rb +2 -0
  255. data/lib/xero-ruby/models/payroll_nz/pay_run.rb +2 -0
  256. data/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb +2 -0
  257. data/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb +2 -0
  258. data/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb +2 -0
  259. data/lib/xero-ruby/models/payroll_nz/pay_run_object.rb +2 -0
  260. data/lib/xero-ruby/models/payroll_nz/pay_runs.rb +2 -0
  261. data/lib/xero-ruby/models/payroll_nz/pay_slip.rb +2 -0
  262. data/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb +2 -0
  263. data/lib/xero-ruby/models/payroll_nz/pay_slips.rb +2 -0
  264. data/lib/xero-ruby/models/payroll_nz/payment_line.rb +2 -0
  265. data/lib/xero-ruby/models/payroll_nz/payment_method.rb +2 -0
  266. data/lib/xero-ruby/models/payroll_nz/payment_method_object.rb +2 -0
  267. data/lib/xero-ruby/models/payroll_nz/problem.rb +2 -0
  268. data/lib/xero-ruby/models/payroll_nz/reimbursement.rb +2 -0
  269. data/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb +2 -0
  270. data/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb +2 -0
  271. data/lib/xero-ruby/models/payroll_nz/reimbursements.rb +2 -0
  272. data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +2 -0
  273. data/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb +2 -0
  274. data/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb +2 -0
  275. data/lib/xero-ruby/models/payroll_nz/settings.rb +2 -0
  276. data/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb +2 -0
  277. data/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb +2 -0
  278. data/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb +2 -0
  279. data/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb +2 -0
  280. data/lib/xero-ruby/models/payroll_nz/superannuation_line.rb +2 -0
  281. data/lib/xero-ruby/models/payroll_nz/superannuation_object.rb +2 -0
  282. data/lib/xero-ruby/models/payroll_nz/superannuations.rb +2 -0
  283. data/lib/xero-ruby/models/payroll_nz/tax_line.rb +2 -0
  284. data/lib/xero-ruby/models/payroll_nz/tax_settings.rb +2 -0
  285. data/lib/xero-ruby/models/payroll_nz/timesheet.rb +2 -0
  286. data/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb +2 -0
  287. data/lib/xero-ruby/models/payroll_nz/timesheet_line.rb +2 -0
  288. data/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb +2 -0
  289. data/lib/xero-ruby/models/payroll_nz/timesheet_object.rb +2 -0
  290. data/lib/xero-ruby/models/payroll_nz/timesheets.rb +2 -0
  291. data/lib/xero-ruby/models/payroll_nz/tracking_categories.rb +2 -0
  292. data/lib/xero-ruby/models/payroll_nz/tracking_category.rb +2 -0
  293. data/lib/xero-ruby/models/payroll_uk/account.rb +2 -0
  294. data/lib/xero-ruby/models/payroll_uk/accounts.rb +2 -0
  295. data/lib/xero-ruby/models/payroll_uk/address.rb +2 -0
  296. data/lib/xero-ruby/models/payroll_uk/bank_account.rb +2 -0
  297. data/lib/xero-ruby/models/payroll_uk/benefit.rb +2 -0
  298. data/lib/xero-ruby/models/payroll_uk/benefit_line.rb +2 -0
  299. data/lib/xero-ruby/models/payroll_uk/benefit_object.rb +2 -0
  300. data/lib/xero-ruby/models/payroll_uk/benefits.rb +2 -0
  301. data/lib/xero-ruby/models/payroll_uk/court_order_line.rb +2 -0
  302. data/lib/xero-ruby/models/payroll_uk/deduction.rb +2 -0
  303. data/lib/xero-ruby/models/payroll_uk/deduction_line.rb +2 -0
  304. data/lib/xero-ruby/models/payroll_uk/deduction_object.rb +2 -0
  305. data/lib/xero-ruby/models/payroll_uk/deductions.rb +2 -0
  306. data/lib/xero-ruby/models/payroll_uk/earnings_line.rb +2 -0
  307. data/lib/xero-ruby/models/payroll_uk/earnings_order.rb +2 -0
  308. data/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb +2 -0
  309. data/lib/xero-ruby/models/payroll_uk/earnings_orders.rb +2 -0
  310. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +5 -2
  311. data/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb +2 -0
  312. data/lib/xero-ruby/models/payroll_uk/earnings_rates.rb +2 -0
  313. data/lib/xero-ruby/models/payroll_uk/earnings_template.rb +2 -0
  314. data/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb +2 -0
  315. data/lib/xero-ruby/models/payroll_uk/employee.rb +2 -0
  316. data/lib/xero-ruby/models/payroll_uk/employee_leave.rb +2 -0
  317. data/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb +2 -0
  318. data/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb +2 -0
  319. data/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb +2 -0
  320. data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +2 -0
  321. data/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb +2 -0
  322. data/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb +2 -0
  323. data/lib/xero-ruby/models/payroll_uk/employee_leaves.rb +2 -0
  324. data/lib/xero-ruby/models/payroll_uk/employee_object.rb +2 -0
  325. data/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb +2 -0
  326. data/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb +2 -0
  327. data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +2 -0
  328. data/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb +2 -0
  329. data/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb +2 -0
  330. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +2 -0
  331. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb +2 -0
  332. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +2 -0
  333. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb +2 -0
  334. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb +2 -0
  335. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb +2 -0
  336. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb +2 -0
  337. data/lib/xero-ruby/models/payroll_uk/employee_tax.rb +2 -0
  338. data/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb +2 -0
  339. data/lib/xero-ruby/models/payroll_uk/employees.rb +2 -0
  340. data/lib/xero-ruby/models/payroll_uk/employment.rb +2 -0
  341. data/lib/xero-ruby/models/payroll_uk/employment_object.rb +2 -0
  342. data/lib/xero-ruby/models/payroll_uk/invalid_field.rb +2 -0
  343. data/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb +2 -0
  344. data/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb +2 -0
  345. data/lib/xero-ruby/models/payroll_uk/leave_period.rb +2 -0
  346. data/lib/xero-ruby/models/payroll_uk/leave_periods.rb +2 -0
  347. data/lib/xero-ruby/models/payroll_uk/leave_type.rb +2 -0
  348. data/lib/xero-ruby/models/payroll_uk/leave_type_object.rb +2 -0
  349. data/lib/xero-ruby/models/payroll_uk/leave_types.rb +2 -0
  350. data/lib/xero-ruby/models/payroll_uk/pagination.rb +2 -0
  351. data/lib/xero-ruby/models/payroll_uk/pay_run.rb +2 -0
  352. data/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb +2 -0
  353. data/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb +2 -0
  354. data/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb +2 -0
  355. data/lib/xero-ruby/models/payroll_uk/pay_run_object.rb +2 -0
  356. data/lib/xero-ruby/models/payroll_uk/pay_runs.rb +2 -0
  357. data/lib/xero-ruby/models/payroll_uk/payment_line.rb +2 -0
  358. data/lib/xero-ruby/models/payroll_uk/payment_method.rb +2 -0
  359. data/lib/xero-ruby/models/payroll_uk/payment_method_object.rb +2 -0
  360. data/lib/xero-ruby/models/payroll_uk/payslip.rb +2 -0
  361. data/lib/xero-ruby/models/payroll_uk/payslip_object.rb +2 -0
  362. data/lib/xero-ruby/models/payroll_uk/payslips.rb +2 -0
  363. data/lib/xero-ruby/models/payroll_uk/problem.rb +2 -0
  364. data/lib/xero-ruby/models/payroll_uk/reimbursement.rb +2 -0
  365. data/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb +2 -0
  366. data/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb +2 -0
  367. data/lib/xero-ruby/models/payroll_uk/reimbursements.rb +2 -0
  368. data/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb +2 -0
  369. data/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb +2 -0
  370. data/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb +2 -0
  371. data/lib/xero-ruby/models/payroll_uk/settings.rb +2 -0
  372. data/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb +2 -0
  373. data/lib/xero-ruby/models/payroll_uk/tax_line.rb +2 -0
  374. data/lib/xero-ruby/models/payroll_uk/timesheet.rb +2 -0
  375. data/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb +2 -0
  376. data/lib/xero-ruby/models/payroll_uk/timesheet_line.rb +2 -0
  377. data/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb +2 -0
  378. data/lib/xero-ruby/models/payroll_uk/timesheet_object.rb +2 -0
  379. data/lib/xero-ruby/models/payroll_uk/timesheets.rb +2 -0
  380. data/lib/xero-ruby/models/payroll_uk/tracking_categories.rb +2 -0
  381. data/lib/xero-ruby/models/payroll_uk/tracking_category.rb +2 -0
  382. data/lib/xero-ruby/models/projects/amount.rb +2 -0
  383. data/lib/xero-ruby/models/projects/error.rb +2 -0
  384. data/lib/xero-ruby/models/projects/pagination.rb +2 -0
  385. data/lib/xero-ruby/models/projects/project.rb +2 -0
  386. data/lib/xero-ruby/models/projects/project_create_or_update.rb +2 -0
  387. data/lib/xero-ruby/models/projects/project_patch.rb +2 -0
  388. data/lib/xero-ruby/models/projects/project_user.rb +2 -0
  389. data/lib/xero-ruby/models/projects/project_users.rb +2 -0
  390. data/lib/xero-ruby/models/projects/projects.rb +2 -0
  391. data/lib/xero-ruby/models/projects/task.rb +2 -0
  392. data/lib/xero-ruby/models/projects/task_create_or_update.rb +2 -0
  393. data/lib/xero-ruby/models/projects/tasks.rb +2 -0
  394. data/lib/xero-ruby/models/projects/time_entries.rb +2 -0
  395. data/lib/xero-ruby/models/projects/time_entry.rb +2 -0
  396. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +2 -0
  397. data/lib/xero-ruby/version.rb +2 -2
  398. data/spec/api_client_spec.rb +23 -0
  399. metadata +4 -3
data/lib/xero-ruby.rb CHANGED
@@ -350,7 +350,8 @@ require 'xero-ruby/models/accounting/bill'
350
350
  require 'xero-ruby/models/accounting/branding_theme'
351
351
  require 'xero-ruby/models/accounting/branding_themes'
352
352
  require 'xero-ruby/models/accounting/budget'
353
- require 'xero-ruby/models/accounting/budget_lines'
353
+ require 'xero-ruby/models/accounting/budget_balance'
354
+ require 'xero-ruby/models/accounting/budget_line'
354
355
  require 'xero-ruby/models/accounting/budgets'
355
356
  require 'xero-ruby/models/accounting/cis_org_setting'
356
357
  require 'xero-ruby/models/accounting/cis_org_settings'
@@ -7722,7 +7722,7 @@ module XeroRuby
7722
7722
  return data, status_code, headers
7723
7723
  end
7724
7724
 
7725
- # Retrieves the contact Id and name of all the contacts in a contact group
7725
+ # Retrieves the contact Id and name of each contact group
7726
7726
  # @param xero_tenant_id [String] Xero identifier for Tenant
7727
7727
  # @param [Hash] opts the optional parameters
7728
7728
  # @option opts [String] :where Filter by an any element
@@ -7733,7 +7733,7 @@ module XeroRuby
7733
7733
  data
7734
7734
  end
7735
7735
 
7736
- # Retrieves the contact Id and name of all the contacts in a contact group
7736
+ # Retrieves the contact Id and name of each contact group
7737
7737
  # @param xero_tenant_id [String] Xero identifier for Tenant
7738
7738
  # @param [Hash] opts the optional parameters
7739
7739
  # @option opts [String] :where Filter by an any element
@@ -9542,8 +9542,8 @@ module XeroRuby
9542
9542
  # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
9543
9543
  # @option opts [Boolean] :include_archived e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response
9544
9544
  # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app
9545
- # @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (default to false)
9546
9545
  # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
9546
+ # @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient. (default to false)
9547
9547
  # @return [Invoices]
9548
9548
  def get_invoices(xero_tenant_id, opts = {})
9549
9549
  data, _status_code, _headers = get_invoices_with_http_info(xero_tenant_id, opts)
@@ -9563,8 +9563,8 @@ module XeroRuby
9563
9563
  # @option opts [Integer] :page e.g. page=1 – Up to 100 invoices will be returned in a single API call with line items shown for each invoice
9564
9564
  # @option opts [Boolean] :include_archived e.g. includeArchived=true - Invoices with a status of ARCHIVED will be included in the response
9565
9565
  # @option opts [Boolean] :created_by_my_app When set to true you'll only retrieve Invoices created by your app
9566
- # @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
9567
9566
  # @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
9567
+ # @option opts [Boolean] :summary_only Use summaryOnly=true in GET Contacts and Invoices endpoint to retrieve a smaller version of the response object. This returns only lightweight fields, excluding computation-heavy fields from the response, making the API calls quick and efficient.
9568
9568
  # @return [Array<(Invoices, Integer, Hash)>] Invoices data, response status code and response headers
9569
9569
  def get_invoices_with_http_info(xero_tenant_id, options = {})
9570
9570
  opts = options.dup
@@ -9592,8 +9592,8 @@ module XeroRuby
9592
9592
  query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
9593
9593
  query_params[:'includeArchived'] = opts[:'include_archived'] if !opts[:'include_archived'].nil?
9594
9594
  query_params[:'createdByMyApp'] = opts[:'created_by_my_app'] if !opts[:'created_by_my_app'].nil?
9595
- query_params[:'summaryOnly'] = opts[:'summary_only'] if !opts[:'summary_only'].nil?
9596
9595
  query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil?
9596
+ query_params[:'summaryOnly'] = opts[:'summary_only'] if !opts[:'summary_only'].nil?
9597
9597
 
9598
9598
  # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
9599
9599
  query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
@@ -29,7 +29,7 @@ module XeroRuby
29
29
  # Defines the headers to be used in HTTP requests of all API calls by default.
30
30
  #
31
31
  # @return [Hash]
32
- attr_accessor :default_headers
32
+ attr_accessor :default_headers, :grant_type
33
33
 
34
34
  # Initializes the ApiClient
35
35
  # @option config [Configuration] Configuration for initializing the object, default to Configuration.default
@@ -37,6 +37,7 @@ module XeroRuby
37
37
  @client_id = credentials[:client_id]
38
38
  @client_secret = credentials[:client_secret]
39
39
  @redirect_uri = credentials[:redirect_uri]
40
+ @grant_type = credentials[:grant_type] || 'authorization_code'
40
41
  @scopes = credentials[:scopes]
41
42
  @state = credentials[:state]
42
43
  default_config = Configuration.default.clone
@@ -135,9 +136,18 @@ module XeroRuby
135
136
  @config.id_token = id_token
136
137
  end
137
138
 
139
+ def get_client_credentials_token
140
+ data = {
141
+ grant_type: @grant_type
142
+ }
143
+ token_set = token_request(data, '/token')
144
+
145
+ return token_set
146
+ end
147
+
138
148
  def get_token_set_from_callback(params)
139
149
  data = {
140
- grant_type: 'authorization_code',
150
+ grant_type: @grant_type,
141
151
  code: params['code'],
142
152
  redirect_uri: @redirect_uri
143
153
  }
@@ -222,6 +232,10 @@ module XeroRuby
222
232
  response[0]
223
233
  end
224
234
 
235
+ def last_connection
236
+ connections.sort { |a,b| DateTime.parse(a['updatedDateUtc']) <=> DateTime.parse(b['updatedDateUtc'])}.first
237
+ end
238
+
225
239
  def disconnect(connection_id)
226
240
  @config.base_url = 'https://api.xero.com'
227
241
  opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
@@ -525,6 +525,8 @@ module XeroRuby::Accounting
525
525
  original, date, timezone = *date_pattern.match(datestring)
526
526
  date = (date.to_i / 1000)
527
527
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
528
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
529
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
528
530
  else # handle date 'types' for small subset of payroll API's
529
531
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
530
532
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -222,6 +222,8 @@ module XeroRuby::Accounting
222
222
  original, date, timezone = *date_pattern.match(datestring)
223
223
  date = (date.to_i / 1000)
224
224
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
225
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
226
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
225
227
  else # handle date 'types' for small subset of payroll API's
226
228
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
227
229
  end
@@ -222,6 +222,8 @@ module XeroRuby::Accounting
222
222
  original, date, timezone = *date_pattern.match(datestring)
223
223
  date = (date.to_i / 1000)
224
224
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
225
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
226
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
225
227
  else # handle date 'types' for small subset of payroll API's
226
228
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
227
229
  end
@@ -258,6 +258,8 @@ module XeroRuby::Accounting
258
258
  original, date, timezone = *date_pattern.match(datestring)
259
259
  date = (date.to_i / 1000)
260
260
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
261
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
262
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
261
263
  else # handle date 'types' for small subset of payroll API's
262
264
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
263
265
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -473,6 +473,8 @@ module XeroRuby::Accounting
473
473
  original, date, timezone = *date_pattern.match(datestring)
474
474
  date = (date.to_i / 1000)
475
475
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
476
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
477
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
476
478
  else # handle date 'types' for small subset of payroll API's
477
479
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
478
480
  end
@@ -474,6 +474,8 @@ module XeroRuby::Accounting
474
474
  original, date, timezone = *date_pattern.match(datestring)
475
475
  date = (date.to_i / 1000)
476
476
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
477
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
478
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
477
479
  else # handle date 'types' for small subset of payroll API's
478
480
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
479
481
  end
@@ -299,6 +299,8 @@ module XeroRuby::Accounting
299
299
  original, date, timezone = *date_pattern.match(datestring)
300
300
  date = (date.to_i / 1000)
301
301
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
302
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
303
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
302
304
  else # handle date 'types' for small subset of payroll API's
303
305
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
304
306
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -262,6 +262,8 @@ module XeroRuby::Accounting
262
262
  original, date, timezone = *date_pattern.match(datestring)
263
263
  date = (date.to_i / 1000)
264
264
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
265
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
266
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
265
267
  else # handle date 'types' for small subset of payroll API's
266
268
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
267
269
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -233,6 +233,8 @@ module XeroRuby::Accounting
233
233
  original, date, timezone = *date_pattern.match(datestring)
234
234
  date = (date.to_i / 1000)
235
235
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
236
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
237
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
236
238
  else # handle date 'types' for small subset of payroll API's
237
239
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
238
240
  end
@@ -223,6 +223,8 @@ module XeroRuby::Accounting
223
223
  original, date, timezone = *date_pattern.match(datestring)
224
224
  date = (date.to_i / 1000)
225
225
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
226
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
227
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
226
228
  else # handle date 'types' for small subset of payroll API's
227
229
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
228
230
  end
@@ -500,6 +500,8 @@ module XeroRuby::Accounting
500
500
  original, date, timezone = *date_pattern.match(datestring)
501
501
  date = (date.to_i / 1000)
502
502
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
503
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
504
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
503
505
  else # handle date 'types' for small subset of payroll API's
504
506
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
505
507
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -331,6 +331,8 @@ module XeroRuby::Accounting
331
331
  original, date, timezone = *date_pattern.match(datestring)
332
332
  date = (date.to_i / 1000)
333
333
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
334
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
335
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
334
336
  else # handle date 'types' for small subset of payroll API's
335
337
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
336
338
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -486,6 +486,8 @@ module XeroRuby::Accounting
486
486
  original, date, timezone = *date_pattern.match(datestring)
487
487
  date = (date.to_i / 1000)
488
488
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
489
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
490
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
489
491
  else # handle date 'types' for small subset of payroll API's
490
492
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
491
493
  end
@@ -283,6 +283,8 @@ module XeroRuby::Accounting
283
283
  original, date, timezone = *date_pattern.match(datestring)
284
284
  date = (date.to_i / 1000)
285
285
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
286
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
287
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
286
288
  else # handle date 'types' for small subset of payroll API's
287
289
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
288
290
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -222,6 +222,8 @@ module XeroRuby::Accounting
222
222
  original, date, timezone = *date_pattern.match(datestring)
223
223
  date = (date.to_i / 1000)
224
224
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
225
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
226
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
225
227
  else # handle date 'types' for small subset of payroll API's
226
228
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
227
229
  end
@@ -297,6 +297,8 @@ module XeroRuby::Accounting
297
297
  original, date, timezone = *date_pattern.match(datestring)
298
298
  date = (date.to_i / 1000)
299
299
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
300
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
301
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
300
302
  else # handle date 'types' for small subset of payroll API's
301
303
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
302
304
  end
@@ -214,6 +214,8 @@ module XeroRuby::Accounting
214
214
  original, date, timezone = *date_pattern.match(datestring)
215
215
  date = (date.to_i / 1000)
216
216
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
217
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
218
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
217
219
  else # handle date 'types' for small subset of payroll API's
218
220
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
219
221
  end
@@ -77,8 +77,8 @@ module XeroRuby::Accounting
77
77
  :'type' => :'String',
78
78
  :'description' => :'String',
79
79
  :'updated_date_utc' => :'DateTime',
80
- :'budget_lines' => :'BudgetLines',
81
- :'tracking' => :'TrackingCategory'
80
+ :'budget_lines' => :'Array<BudgetLine>',
81
+ :'tracking' => :'Array<TrackingCategory>'
82
82
  }
83
83
  end
84
84
 
@@ -114,11 +114,15 @@ module XeroRuby::Accounting
114
114
  end
115
115
 
116
116
  if attributes.key?(:'budget_lines')
117
- self.budget_lines = attributes[:'budget_lines']
117
+ if (value = attributes[:'budget_lines']).is_a?(Array)
118
+ self.budget_lines = value
119
+ end
118
120
  end
119
121
 
120
122
  if attributes.key?(:'tracking')
121
- self.tracking = attributes[:'tracking']
123
+ if (value = attributes[:'tracking']).is_a?(Array)
124
+ self.tracking = value
125
+ end
122
126
  end
123
127
  end
124
128
 
@@ -313,6 +317,8 @@ module XeroRuby::Accounting
313
317
  original, date, timezone = *date_pattern.match(datestring)
314
318
  date = (date.to_i / 1000)
315
319
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
320
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
321
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
316
322
  else # handle date 'types' for small subset of payroll API's
317
323
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
318
324
  end
@@ -15,7 +15,7 @@ require 'date'
15
15
  module XeroRuby::Accounting
16
16
  require 'bigdecimal'
17
17
 
18
- class BudgetLines
18
+ class BudgetBalance
19
19
  # Period the amount applies to (e.g. “2019-08”)
20
20
  attr_accessor :period
21
21
 
@@ -52,13 +52,13 @@ module XeroRuby::Accounting
52
52
  # @param [Hash] attributes Model attributes in the form of hash
53
53
  def initialize(attributes = {})
54
54
  if (!attributes.is_a?(Hash))
55
- fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BudgetLines` initialize method"
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BudgetBalance` initialize method"
56
56
  end
57
57
 
58
58
  # check to see if the attribute exists and convert string to symbol for hash key
59
59
  attributes = attributes.each_with_object({}) { |(k, v), h|
60
60
  if (!self.class.attribute_map.key?(k.to_sym))
61
- fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BudgetLines`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BudgetBalance`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
62
  end
63
63
  h[k.to_sym] = v
64
64
  }
@@ -257,6 +257,8 @@ module XeroRuby::Accounting
257
257
  original, date, timezone = *date_pattern.match(datestring)
258
258
  date = (date.to_i / 1000)
259
259
  Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
260
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
261
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
260
262
  else # handle date 'types' for small subset of payroll API's
261
263
  Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
262
264
  end
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Xero Accounting API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::Accounting
16
+ require 'bigdecimal'
17
+
18
+ class BudgetLine
19
+ # See Accounts
20
+ attr_accessor :account_id
21
+
22
+ # See Accounts
23
+ attr_accessor :account_code
24
+
25
+
26
+ attr_accessor :budget_balances
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'account_id' => :'AccountID',
32
+ :'account_code' => :'AccountCode',
33
+ :'budget_balances' => :'BudgetBalances'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'account_id' => :'String',
41
+ :'account_code' => :'String',
42
+ :'budget_balances' => :'Array<BudgetBalance>'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Accounting::BudgetLine` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Accounting::BudgetLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'account_id')
62
+ self.account_id = attributes[:'account_id']
63
+ end
64
+
65
+ if attributes.key?(:'account_code')
66
+ self.account_code = attributes[:'account_code']
67
+ end
68
+
69
+ if attributes.key?(:'budget_balances')
70
+ if (value = attributes[:'budget_balances']).is_a?(Array)
71
+ self.budget_balances = value
72
+ end
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ account_id == o.account_id &&
95
+ account_code == o.account_code &&
96
+ budget_balances == o.budget_balances
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [account_id, account_code, budget_balances].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(parse_date(value))
146
+ when :Date
147
+ Date.parse(parse_date(value))
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BigDecimal
155
+ BigDecimal(value.to_s)
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ XeroRuby::Accounting.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash(downcase: false)
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ key = downcase ? attr : param
201
+ hash[key] = _to_hash(value, downcase: downcase)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Returns the object in the form of hash with snake_case
207
+ def to_attributes
208
+ to_hash(downcase: true)
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value, downcase: false)
216
+ if value.is_a?(Array)
217
+ value.map do |v|
218
+ v.to_hash(downcase: downcase)
219
+ end
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash(downcase: downcase)
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ def parse_date(datestring)
232
+ if datestring.include?('Date')
233
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
234
+ original, date, timezone = *date_pattern.match(datestring)
235
+ date = (date.to_i / 1000)
236
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
237
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
238
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
239
+ else # handle date 'types' for small subset of payroll API's
240
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
241
+ end
242
+ end
243
+ end
244
+ end