xero-ruby 2.5.1 → 2.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (454) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +47 -7
  3. data/lib/xero-ruby.rb +4 -3
  4. data/lib/xero-ruby/api/accounting_api.rb +446 -441
  5. data/lib/xero-ruby/api/asset_api.rb +3 -8
  6. data/lib/xero-ruby/api/files_api.rb +49 -56
  7. data/lib/xero-ruby/api/payroll_au_api.rb +63 -64
  8. data/lib/xero-ruby/api/payroll_nz_api.rb +171 -172
  9. data/lib/xero-ruby/api/payroll_uk_api.rb +173 -174
  10. data/lib/xero-ruby/api/project_api.rb +45 -46
  11. data/lib/xero-ruby/api_client.rb +29 -91
  12. data/lib/xero-ruby/api_error.rb +1 -2
  13. data/lib/xero-ruby/configuration.rb +3 -4
  14. data/lib/xero-ruby/models/accounting/account.rb +15 -8
  15. data/lib/xero-ruby/models/accounting/account_type.rb +1 -2
  16. data/lib/xero-ruby/models/accounting/accounts.rb +15 -7
  17. data/lib/xero-ruby/models/accounting/accounts_payable.rb +15 -7
  18. data/lib/xero-ruby/models/accounting/accounts_receivable.rb +15 -7
  19. data/lib/xero-ruby/models/accounting/action.rb +15 -7
  20. data/lib/xero-ruby/models/accounting/actions.rb +15 -7
  21. data/lib/xero-ruby/models/accounting/address.rb +15 -7
  22. data/lib/xero-ruby/models/accounting/address_for_organisation.rb +15 -7
  23. data/lib/xero-ruby/models/accounting/allocation.rb +15 -7
  24. data/lib/xero-ruby/models/accounting/allocations.rb +15 -7
  25. data/lib/xero-ruby/models/accounting/attachment.rb +15 -7
  26. data/lib/xero-ruby/models/accounting/attachments.rb +15 -7
  27. data/lib/xero-ruby/models/accounting/balance_details.rb +15 -7
  28. data/lib/xero-ruby/models/accounting/balances.rb +15 -7
  29. data/lib/xero-ruby/models/accounting/bank_transaction.rb +15 -7
  30. data/lib/xero-ruby/models/accounting/bank_transactions.rb +15 -7
  31. data/lib/xero-ruby/models/accounting/bank_transfer.rb +15 -7
  32. data/lib/xero-ruby/models/accounting/bank_transfers.rb +15 -7
  33. data/lib/xero-ruby/models/accounting/batch_payment.rb +15 -7
  34. data/lib/xero-ruby/models/accounting/batch_payment_details.rb +15 -7
  35. data/lib/xero-ruby/models/accounting/batch_payments.rb +15 -7
  36. data/lib/xero-ruby/models/accounting/bill.rb +15 -7
  37. data/lib/xero-ruby/models/accounting/branding_theme.rb +15 -7
  38. data/lib/xero-ruby/models/accounting/branding_themes.rb +15 -7
  39. data/lib/xero-ruby/models/accounting/cis_org_setting.rb +15 -7
  40. data/lib/xero-ruby/models/{files/file_response204.rb → accounting/cis_org_settings.rb} +30 -20
  41. data/lib/xero-ruby/models/accounting/cis_setting.rb +15 -7
  42. data/lib/xero-ruby/models/accounting/cis_settings.rb +15 -7
  43. data/lib/xero-ruby/models/accounting/contact.rb +15 -7
  44. data/lib/xero-ruby/models/accounting/contact_group.rb +15 -7
  45. data/lib/xero-ruby/models/accounting/contact_groups.rb +15 -7
  46. data/lib/xero-ruby/models/accounting/contact_person.rb +15 -7
  47. data/lib/xero-ruby/models/accounting/contacts.rb +15 -7
  48. data/lib/xero-ruby/models/accounting/conversion_balances.rb +15 -7
  49. data/lib/xero-ruby/models/accounting/conversion_date.rb +15 -7
  50. data/lib/xero-ruby/models/accounting/country_code.rb +1 -2
  51. data/lib/xero-ruby/models/accounting/credit_note.rb +32 -12
  52. data/lib/xero-ruby/models/accounting/credit_notes.rb +15 -7
  53. data/lib/xero-ruby/models/accounting/currencies.rb +15 -7
  54. data/lib/xero-ruby/models/accounting/currency.rb +15 -7
  55. data/lib/xero-ruby/models/accounting/currency_code.rb +1 -2
  56. data/lib/xero-ruby/models/accounting/element.rb +15 -7
  57. data/lib/xero-ruby/models/accounting/employee.rb +15 -7
  58. data/lib/xero-ruby/models/accounting/employees.rb +15 -7
  59. data/lib/xero-ruby/models/accounting/error.rb +15 -7
  60. data/lib/xero-ruby/models/accounting/expense_claim.rb +15 -7
  61. data/lib/xero-ruby/models/accounting/expense_claims.rb +15 -7
  62. data/lib/xero-ruby/models/accounting/external_link.rb +15 -7
  63. data/lib/xero-ruby/models/accounting/history_record.rb +15 -7
  64. data/lib/xero-ruby/models/accounting/history_records.rb +15 -7
  65. data/lib/xero-ruby/models/accounting/import_summary.rb +15 -7
  66. data/lib/xero-ruby/models/accounting/import_summary_accounts.rb +15 -7
  67. data/lib/xero-ruby/models/accounting/import_summary_object.rb +15 -7
  68. data/lib/xero-ruby/models/accounting/import_summary_organisation.rb +15 -7
  69. data/lib/xero-ruby/models/accounting/invoice.rb +15 -7
  70. data/lib/xero-ruby/models/accounting/invoice_reminder.rb +15 -7
  71. data/lib/xero-ruby/models/accounting/invoice_reminders.rb +15 -7
  72. data/lib/xero-ruby/models/accounting/invoices.rb +15 -7
  73. data/lib/xero-ruby/models/accounting/item.rb +15 -7
  74. data/lib/xero-ruby/models/accounting/items.rb +15 -7
  75. data/lib/xero-ruby/models/accounting/journal.rb +15 -7
  76. data/lib/xero-ruby/models/accounting/journal_line.rb +15 -7
  77. data/lib/xero-ruby/models/accounting/journals.rb +15 -7
  78. data/lib/xero-ruby/models/accounting/line_amount_types.rb +1 -2
  79. data/lib/xero-ruby/models/accounting/line_item.rb +15 -7
  80. data/lib/xero-ruby/models/accounting/line_item_tracking.rb +15 -7
  81. data/lib/xero-ruby/models/accounting/linked_transaction.rb +15 -7
  82. data/lib/xero-ruby/models/accounting/linked_transactions.rb +15 -7
  83. data/lib/xero-ruby/models/accounting/manual_journal.rb +15 -7
  84. data/lib/xero-ruby/models/accounting/manual_journal_line.rb +15 -7
  85. data/lib/xero-ruby/models/accounting/manual_journals.rb +15 -7
  86. data/lib/xero-ruby/models/accounting/online_invoice.rb +15 -7
  87. data/lib/xero-ruby/models/accounting/online_invoices.rb +15 -7
  88. data/lib/xero-ruby/models/accounting/organisation.rb +15 -9
  89. data/lib/xero-ruby/models/accounting/organisations.rb +15 -7
  90. data/lib/xero-ruby/models/accounting/overpayment.rb +15 -7
  91. data/lib/xero-ruby/models/accounting/overpayments.rb +15 -7
  92. data/lib/xero-ruby/models/accounting/payment.rb +26 -8
  93. data/lib/xero-ruby/models/accounting/payment_delete.rb +15 -7
  94. data/lib/xero-ruby/models/accounting/payment_service.rb +15 -7
  95. data/lib/xero-ruby/models/accounting/payment_services.rb +15 -7
  96. data/lib/xero-ruby/models/accounting/payment_term.rb +15 -7
  97. data/lib/xero-ruby/models/accounting/payment_term_type.rb +1 -2
  98. data/lib/xero-ruby/models/accounting/payments.rb +15 -7
  99. data/lib/xero-ruby/models/accounting/phone.rb +15 -7
  100. data/lib/xero-ruby/models/accounting/prepayment.rb +15 -7
  101. data/lib/xero-ruby/models/accounting/prepayments.rb +15 -7
  102. data/lib/xero-ruby/models/accounting/purchase.rb +15 -7
  103. data/lib/xero-ruby/models/accounting/purchase_order.rb +15 -7
  104. data/lib/xero-ruby/models/accounting/purchase_orders.rb +15 -7
  105. data/lib/xero-ruby/models/accounting/quote.rb +15 -7
  106. data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +1 -2
  107. data/lib/xero-ruby/models/accounting/quote_status_codes.rb +1 -2
  108. data/lib/xero-ruby/models/accounting/quotes.rb +15 -7
  109. data/lib/xero-ruby/models/accounting/receipt.rb +15 -7
  110. data/lib/xero-ruby/models/accounting/receipts.rb +15 -7
  111. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +15 -7
  112. data/lib/xero-ruby/models/accounting/repeating_invoices.rb +15 -7
  113. data/lib/xero-ruby/models/accounting/report.rb +15 -7
  114. data/lib/xero-ruby/models/accounting/report_attribute.rb +15 -7
  115. data/lib/xero-ruby/models/accounting/report_cell.rb +15 -7
  116. data/lib/xero-ruby/models/accounting/report_fields.rb +15 -7
  117. data/lib/xero-ruby/models/accounting/report_row.rb +15 -7
  118. data/lib/xero-ruby/models/accounting/report_rows.rb +15 -7
  119. data/lib/xero-ruby/models/accounting/report_with_row.rb +15 -7
  120. data/lib/xero-ruby/models/accounting/report_with_rows.rb +15 -7
  121. data/lib/xero-ruby/models/accounting/reports.rb +15 -7
  122. data/lib/xero-ruby/models/accounting/request_empty.rb +15 -7
  123. data/lib/xero-ruby/models/accounting/row_type.rb +1 -2
  124. data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +15 -7
  125. data/lib/xero-ruby/models/accounting/schedule.rb +15 -7
  126. data/lib/xero-ruby/models/accounting/setup.rb +15 -7
  127. data/lib/xero-ruby/models/accounting/tax_component.rb +15 -7
  128. data/lib/xero-ruby/models/accounting/tax_rate.rb +15 -7
  129. data/lib/xero-ruby/models/accounting/tax_rates.rb +15 -7
  130. data/lib/xero-ruby/models/accounting/tax_type.rb +1 -2
  131. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +15 -7
  132. data/lib/xero-ruby/models/accounting/time_zone.rb +1 -2
  133. data/lib/xero-ruby/models/accounting/tracking_categories.rb +15 -7
  134. data/lib/xero-ruby/models/accounting/tracking_category.rb +15 -7
  135. data/lib/xero-ruby/models/accounting/tracking_option.rb +15 -7
  136. data/lib/xero-ruby/models/accounting/tracking_options.rb +15 -7
  137. data/lib/xero-ruby/models/accounting/user.rb +15 -7
  138. data/lib/xero-ruby/models/accounting/users.rb +15 -7
  139. data/lib/xero-ruby/models/accounting/validation_error.rb +15 -7
  140. data/lib/xero-ruby/models/assets/asset.rb +15 -7
  141. data/lib/xero-ruby/models/assets/asset_status.rb +1 -2
  142. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +1 -2
  143. data/lib/xero-ruby/models/assets/asset_type.rb +15 -7
  144. data/lib/xero-ruby/models/assets/assets.rb +15 -7
  145. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +15 -7
  146. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +15 -7
  147. data/lib/xero-ruby/models/assets/error.rb +15 -7
  148. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +16 -8
  149. data/lib/xero-ruby/models/assets/pagination.rb +15 -7
  150. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +16 -8
  151. data/lib/xero-ruby/models/assets/setting.rb +15 -7
  152. data/lib/xero-ruby/models/files/association.rb +15 -7
  153. data/lib/xero-ruby/models/files/file_object.rb +15 -7
  154. data/lib/xero-ruby/models/files/files.rb +15 -7
  155. data/lib/xero-ruby/models/files/folder.rb +15 -7
  156. data/lib/xero-ruby/models/files/folders.rb +15 -7
  157. data/lib/xero-ruby/models/files/inline_object.rb +15 -7
  158. data/lib/xero-ruby/models/files/object_group.rb +1 -2
  159. data/lib/xero-ruby/models/files/object_type.rb +1 -2
  160. data/lib/xero-ruby/models/files/user.rb +15 -7
  161. data/lib/xero-ruby/models/payroll_au/account.rb +15 -7
  162. data/lib/xero-ruby/models/payroll_au/account_type.rb +1 -2
  163. data/lib/xero-ruby/models/payroll_au/allowance_type.rb +1 -2
  164. data/lib/xero-ruby/models/payroll_au/api_exception.rb +15 -7
  165. data/lib/xero-ruby/models/payroll_au/bank_account.rb +15 -7
  166. data/lib/xero-ruby/models/payroll_au/calendar_type.rb +1 -2
  167. data/lib/xero-ruby/models/payroll_au/deduction_line.rb +15 -7
  168. data/lib/xero-ruby/models/payroll_au/deduction_type.rb +15 -7
  169. data/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb +1 -2
  170. data/lib/xero-ruby/models/payroll_au/earnings_line.rb +15 -7
  171. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +15 -7
  172. data/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb +1 -2
  173. data/lib/xero-ruby/models/payroll_au/earnings_type.rb +2 -2
  174. data/lib/xero-ruby/models/payroll_au/employee.rb +15 -7
  175. data/lib/xero-ruby/models/payroll_au/employee_status.rb +1 -2
  176. data/lib/xero-ruby/models/payroll_au/employees.rb +15 -7
  177. data/lib/xero-ruby/models/payroll_au/employment_basis.rb +1 -2
  178. data/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb +1 -2
  179. data/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb +1 -2
  180. data/lib/xero-ruby/models/payroll_au/home_address.rb +15 -7
  181. data/lib/xero-ruby/models/payroll_au/leave_accrual_line.rb +15 -7
  182. data/lib/xero-ruby/models/payroll_au/leave_application.rb +15 -7
  183. data/lib/xero-ruby/models/payroll_au/leave_applications.rb +15 -7
  184. data/lib/xero-ruby/models/payroll_au/leave_balance.rb +15 -7
  185. data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +15 -7
  186. data/lib/xero-ruby/models/payroll_au/leave_line.rb +15 -7
  187. data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +1 -2
  188. data/lib/xero-ruby/models/payroll_au/leave_lines.rb +15 -7
  189. data/lib/xero-ruby/models/payroll_au/leave_period.rb +15 -7
  190. data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +1 -2
  191. data/lib/xero-ruby/models/payroll_au/leave_type.rb +15 -7
  192. data/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb +1 -2
  193. data/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +1 -2
  194. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +15 -7
  195. data/lib/xero-ruby/models/payroll_au/pay_item.rb +15 -7
  196. data/lib/xero-ruby/models/payroll_au/pay_items.rb +15 -7
  197. data/lib/xero-ruby/models/payroll_au/pay_run.rb +15 -7
  198. data/lib/xero-ruby/models/payroll_au/pay_run_status.rb +1 -2
  199. data/lib/xero-ruby/models/payroll_au/pay_runs.rb +15 -7
  200. data/lib/xero-ruby/models/payroll_au/pay_template.rb +15 -7
  201. data/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb +1 -2
  202. data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +15 -7
  203. data/lib/xero-ruby/models/payroll_au/payroll_calendars.rb +15 -7
  204. data/lib/xero-ruby/models/payroll_au/payslip.rb +15 -7
  205. data/lib/xero-ruby/models/payroll_au/payslip_lines.rb +15 -7
  206. data/lib/xero-ruby/models/payroll_au/payslip_object.rb +15 -7
  207. data/lib/xero-ruby/models/payroll_au/payslip_summary.rb +15 -7
  208. data/lib/xero-ruby/models/payroll_au/payslips.rb +15 -7
  209. data/lib/xero-ruby/models/payroll_au/rate_type.rb +1 -2
  210. data/lib/xero-ruby/models/payroll_au/reimbursement_line.rb +15 -7
  211. data/lib/xero-ruby/models/payroll_au/reimbursement_lines.rb +15 -7
  212. data/lib/xero-ruby/models/payroll_au/reimbursement_type.rb +15 -7
  213. data/lib/xero-ruby/models/payroll_au/residency_status.rb +1 -2
  214. data/lib/xero-ruby/models/payroll_au/settings.rb +15 -7
  215. data/lib/xero-ruby/models/payroll_au/settings_object.rb +15 -7
  216. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories.rb +15 -7
  217. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_employee_groups.rb +15 -7
  218. data/lib/xero-ruby/models/payroll_au/settings_tracking_categories_timesheet_categories.rb +15 -7
  219. data/lib/xero-ruby/models/payroll_au/state.rb +1 -2
  220. data/lib/xero-ruby/models/payroll_au/super_fund.rb +15 -7
  221. data/lib/xero-ruby/models/payroll_au/super_fund_product.rb +15 -7
  222. data/lib/xero-ruby/models/payroll_au/super_fund_products.rb +15 -7
  223. data/lib/xero-ruby/models/payroll_au/super_fund_type.rb +1 -2
  224. data/lib/xero-ruby/models/payroll_au/super_funds.rb +15 -7
  225. data/lib/xero-ruby/models/payroll_au/super_line.rb +16 -8
  226. data/lib/xero-ruby/models/payroll_au/super_membership.rb +16 -8
  227. data/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb +1 -2
  228. data/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb +1 -2
  229. data/lib/xero-ruby/models/payroll_au/superannuation_line.rb +15 -7
  230. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +15 -7
  231. data/lib/xero-ruby/models/payroll_au/tax_line.rb +15 -7
  232. data/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb +1 -2
  233. data/lib/xero-ruby/models/payroll_au/timesheet.rb +15 -7
  234. data/lib/xero-ruby/models/payroll_au/timesheet_line.rb +15 -7
  235. data/lib/xero-ruby/models/payroll_au/timesheet_object.rb +15 -7
  236. data/lib/xero-ruby/models/payroll_au/timesheet_status.rb +1 -2
  237. data/lib/xero-ruby/models/payroll_au/timesheets.rb +15 -7
  238. data/lib/xero-ruby/models/payroll_au/validation_error.rb +15 -7
  239. data/lib/xero-ruby/models/payroll_nz/account.rb +14 -6
  240. data/lib/xero-ruby/models/payroll_nz/accounts.rb +14 -6
  241. data/lib/xero-ruby/models/payroll_nz/address.rb +14 -6
  242. data/lib/xero-ruby/models/payroll_nz/bank_account.rb +14 -6
  243. data/lib/xero-ruby/models/payroll_nz/benefit.rb +14 -6
  244. data/lib/xero-ruby/models/payroll_nz/calendar_type.rb +0 -1
  245. data/lib/xero-ruby/models/payroll_nz/deduction.rb +14 -6
  246. data/lib/xero-ruby/models/payroll_nz/deduction_line.rb +14 -6
  247. data/lib/xero-ruby/models/payroll_nz/deduction_object.rb +14 -6
  248. data/lib/xero-ruby/models/payroll_nz/deductions.rb +14 -6
  249. data/lib/xero-ruby/models/payroll_nz/earnings_line.rb +15 -7
  250. data/lib/xero-ruby/models/payroll_nz/earnings_order.rb +14 -6
  251. data/lib/xero-ruby/models/payroll_nz/earnings_order_object.rb +14 -6
  252. data/lib/xero-ruby/models/payroll_nz/earnings_orders.rb +14 -6
  253. data/lib/xero-ruby/models/payroll_nz/earnings_rate.rb +14 -6
  254. data/lib/xero-ruby/models/payroll_nz/earnings_rate_object.rb +14 -6
  255. data/lib/xero-ruby/models/payroll_nz/earnings_rates.rb +14 -6
  256. data/lib/xero-ruby/models/payroll_nz/earnings_template.rb +14 -6
  257. data/lib/xero-ruby/models/payroll_nz/earnings_template_object.rb +14 -6
  258. data/lib/xero-ruby/models/payroll_nz/employee.rb +14 -6
  259. data/lib/xero-ruby/models/payroll_nz/employee_earnings_templates.rb +14 -6
  260. data/lib/xero-ruby/models/payroll_nz/employee_leave.rb +14 -6
  261. data/lib/xero-ruby/models/payroll_nz/employee_leave_balance.rb +14 -6
  262. data/lib/xero-ruby/models/payroll_nz/employee_leave_balances.rb +14 -6
  263. data/lib/xero-ruby/models/payroll_nz/employee_leave_object.rb +14 -6
  264. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +14 -6
  265. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup_object.rb +14 -6
  266. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +14 -6
  267. data/lib/xero-ruby/models/payroll_nz/employee_leave_type_object.rb +14 -6
  268. data/lib/xero-ruby/models/payroll_nz/employee_leave_types.rb +14 -6
  269. data/lib/xero-ruby/models/payroll_nz/employee_leaves.rb +14 -6
  270. data/lib/xero-ruby/models/payroll_nz/employee_object.rb +14 -6
  271. data/lib/xero-ruby/models/payroll_nz/employee_opening_balance.rb +14 -6
  272. data/lib/xero-ruby/models/payroll_nz/employee_opening_balances_object.rb +14 -6
  273. data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +14 -6
  274. data/lib/xero-ruby/models/payroll_nz/employee_pay_template_object.rb +14 -6
  275. data/lib/xero-ruby/models/payroll_nz/employee_pay_templates.rb +14 -6
  276. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb +14 -6
  277. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance_object.rb +14 -6
  278. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb +14 -6
  279. data/lib/xero-ruby/models/payroll_nz/employee_statutory_leaves_summaries.rb +14 -6
  280. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave.rb +15 -7
  281. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leave_object.rb +14 -6
  282. data/lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb +14 -6
  283. data/lib/xero-ruby/models/payroll_nz/employee_tax.rb +14 -6
  284. data/lib/xero-ruby/models/payroll_nz/employee_tax_object.rb +14 -6
  285. data/lib/xero-ruby/models/payroll_nz/employees.rb +14 -6
  286. data/lib/xero-ruby/models/payroll_nz/employment.rb +14 -6
  287. data/lib/xero-ruby/models/payroll_nz/employment_object.rb +14 -6
  288. data/lib/xero-ruby/models/payroll_nz/gross_earnings_history.rb +14 -6
  289. data/lib/xero-ruby/models/payroll_nz/invalid_field.rb +14 -6
  290. data/lib/xero-ruby/models/payroll_nz/leave_accrual_line.rb +14 -6
  291. data/lib/xero-ruby/models/payroll_nz/leave_earnings_line.rb +15 -7
  292. data/lib/xero-ruby/models/payroll_nz/leave_period.rb +14 -6
  293. data/lib/xero-ruby/models/payroll_nz/leave_periods.rb +14 -6
  294. data/lib/xero-ruby/models/payroll_nz/leave_type.rb +14 -6
  295. data/lib/xero-ruby/models/payroll_nz/leave_type_object.rb +14 -6
  296. data/lib/xero-ruby/models/payroll_nz/leave_types.rb +14 -6
  297. data/lib/xero-ruby/models/payroll_nz/pagination.rb +14 -6
  298. data/lib/xero-ruby/models/payroll_nz/pay_run.rb +14 -6
  299. data/lib/xero-ruby/models/payroll_nz/pay_run_calendar.rb +14 -6
  300. data/lib/xero-ruby/models/payroll_nz/pay_run_calendar_object.rb +14 -6
  301. data/lib/xero-ruby/models/payroll_nz/pay_run_calendars.rb +14 -6
  302. data/lib/xero-ruby/models/payroll_nz/pay_run_object.rb +14 -6
  303. data/lib/xero-ruby/models/payroll_nz/pay_runs.rb +14 -6
  304. data/lib/xero-ruby/models/payroll_nz/pay_slip.rb +14 -6
  305. data/lib/xero-ruby/models/payroll_nz/pay_slip_object.rb +14 -6
  306. data/lib/xero-ruby/models/payroll_nz/pay_slips.rb +14 -6
  307. data/lib/xero-ruby/models/payroll_nz/payment_line.rb +14 -6
  308. data/lib/xero-ruby/models/payroll_nz/payment_method.rb +14 -6
  309. data/lib/xero-ruby/models/payroll_nz/payment_method_object.rb +14 -6
  310. data/lib/xero-ruby/models/payroll_nz/problem.rb +14 -6
  311. data/lib/xero-ruby/models/payroll_nz/reimbursement.rb +14 -6
  312. data/lib/xero-ruby/models/payroll_nz/reimbursement_line.rb +14 -6
  313. data/lib/xero-ruby/models/payroll_nz/reimbursement_object.rb +14 -6
  314. data/lib/xero-ruby/models/payroll_nz/reimbursements.rb +14 -6
  315. data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +14 -6
  316. data/lib/xero-ruby/models/payroll_nz/salary_and_wage_object.rb +14 -6
  317. data/lib/xero-ruby/models/payroll_nz/salary_and_wages.rb +14 -6
  318. data/lib/xero-ruby/models/payroll_nz/settings.rb +14 -6
  319. data/lib/xero-ruby/models/payroll_nz/statutory_deduction.rb +14 -6
  320. data/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb +0 -1
  321. data/lib/xero-ruby/models/payroll_nz/statutory_deduction_line.rb +14 -6
  322. data/lib/xero-ruby/models/payroll_nz/statutory_deduction_object.rb +14 -6
  323. data/lib/xero-ruby/models/payroll_nz/statutory_deductions.rb +14 -6
  324. data/lib/xero-ruby/models/payroll_nz/superannuation_line.rb +15 -7
  325. data/lib/xero-ruby/models/payroll_nz/superannuation_object.rb +14 -6
  326. data/lib/xero-ruby/models/payroll_nz/superannuations.rb +14 -6
  327. data/lib/xero-ruby/models/payroll_nz/tax_code.rb +0 -1
  328. data/lib/xero-ruby/models/payroll_nz/tax_line.rb +14 -6
  329. data/lib/xero-ruby/models/payroll_nz/tax_settings.rb +14 -6
  330. data/lib/xero-ruby/models/payroll_nz/timesheet.rb +15 -7
  331. data/lib/xero-ruby/models/payroll_nz/timesheet_earnings_line.rb +15 -7
  332. data/lib/xero-ruby/models/payroll_nz/timesheet_line.rb +14 -6
  333. data/lib/xero-ruby/models/payroll_nz/timesheet_line_object.rb +14 -6
  334. data/lib/xero-ruby/models/payroll_nz/timesheet_object.rb +14 -6
  335. data/lib/xero-ruby/models/payroll_nz/timesheets.rb +14 -6
  336. data/lib/xero-ruby/models/payroll_nz/tracking_categories.rb +14 -6
  337. data/lib/xero-ruby/models/payroll_nz/tracking_category.rb +14 -6
  338. data/lib/xero-ruby/models/payroll_uk/account.rb +14 -6
  339. data/lib/xero-ruby/models/payroll_uk/accounts.rb +14 -6
  340. data/lib/xero-ruby/models/payroll_uk/address.rb +14 -6
  341. data/lib/xero-ruby/models/payroll_uk/bank_account.rb +14 -6
  342. data/lib/xero-ruby/models/payroll_uk/benefit.rb +14 -6
  343. data/lib/xero-ruby/models/payroll_uk/benefit_line.rb +14 -6
  344. data/lib/xero-ruby/models/payroll_uk/benefit_object.rb +14 -6
  345. data/lib/xero-ruby/models/payroll_uk/benefits.rb +14 -6
  346. data/lib/xero-ruby/models/payroll_uk/court_order_line.rb +14 -6
  347. data/lib/xero-ruby/models/payroll_uk/deduction.rb +14 -6
  348. data/lib/xero-ruby/models/payroll_uk/deduction_line.rb +14 -6
  349. data/lib/xero-ruby/models/payroll_uk/deduction_object.rb +14 -6
  350. data/lib/xero-ruby/models/payroll_uk/deductions.rb +14 -6
  351. data/lib/xero-ruby/models/payroll_uk/earnings_line.rb +14 -6
  352. data/lib/xero-ruby/models/payroll_uk/earnings_order.rb +14 -6
  353. data/lib/xero-ruby/models/payroll_uk/earnings_order_object.rb +14 -6
  354. data/lib/xero-ruby/models/payroll_uk/earnings_orders.rb +14 -6
  355. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +23 -8
  356. data/lib/xero-ruby/models/payroll_uk/earnings_rate_object.rb +14 -6
  357. data/lib/xero-ruby/models/payroll_uk/earnings_rates.rb +14 -6
  358. data/lib/xero-ruby/models/payroll_uk/earnings_template.rb +14 -6
  359. data/lib/xero-ruby/models/payroll_uk/earnings_template_object.rb +14 -6
  360. data/lib/xero-ruby/models/payroll_uk/employee.rb +14 -6
  361. data/lib/xero-ruby/models/payroll_uk/employee_leave.rb +14 -6
  362. data/lib/xero-ruby/models/payroll_uk/employee_leave_balance.rb +14 -6
  363. data/lib/xero-ruby/models/payroll_uk/employee_leave_balances.rb +14 -6
  364. data/lib/xero-ruby/models/payroll_uk/employee_leave_object.rb +14 -6
  365. data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +14 -6
  366. data/lib/xero-ruby/models/payroll_uk/employee_leave_type_object.rb +14 -6
  367. data/lib/xero-ruby/models/payroll_uk/employee_leave_types.rb +14 -6
  368. data/lib/xero-ruby/models/payroll_uk/employee_leaves.rb +14 -6
  369. data/lib/xero-ruby/models/payroll_uk/employee_object.rb +14 -6
  370. data/lib/xero-ruby/models/payroll_uk/employee_opening_balances.rb +14 -6
  371. data/lib/xero-ruby/models/payroll_uk/employee_opening_balances_object.rb +14 -6
  372. data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +14 -6
  373. data/lib/xero-ruby/models/payroll_uk/employee_pay_template_object.rb +14 -6
  374. data/lib/xero-ruby/models/payroll_uk/employee_pay_templates.rb +14 -6
  375. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +14 -6
  376. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance_object.rb +14 -6
  377. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +14 -6
  378. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leaves_summaries.rb +14 -6
  379. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave.rb +15 -7
  380. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leave_object.rb +14 -6
  381. data/lib/xero-ruby/models/payroll_uk/employee_statutory_sick_leaves.rb +14 -6
  382. data/lib/xero-ruby/models/payroll_uk/employee_tax.rb +14 -6
  383. data/lib/xero-ruby/models/payroll_uk/employee_tax_object.rb +14 -6
  384. data/lib/xero-ruby/models/payroll_uk/employees.rb +14 -6
  385. data/lib/xero-ruby/models/payroll_uk/employment.rb +14 -6
  386. data/lib/xero-ruby/models/payroll_uk/employment_object.rb +14 -6
  387. data/lib/xero-ruby/models/payroll_uk/invalid_field.rb +14 -6
  388. data/lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb +14 -6
  389. data/lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb +14 -6
  390. data/lib/xero-ruby/models/payroll_uk/leave_period.rb +14 -6
  391. data/lib/xero-ruby/models/payroll_uk/leave_periods.rb +14 -6
  392. data/lib/xero-ruby/models/payroll_uk/leave_type.rb +14 -6
  393. data/lib/xero-ruby/models/payroll_uk/leave_type_object.rb +14 -6
  394. data/lib/xero-ruby/models/payroll_uk/leave_types.rb +14 -6
  395. data/lib/xero-ruby/models/payroll_uk/pagination.rb +14 -6
  396. data/lib/xero-ruby/models/payroll_uk/pay_run.rb +14 -6
  397. data/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb +14 -6
  398. data/lib/xero-ruby/models/payroll_uk/pay_run_calendar_object.rb +14 -6
  399. data/lib/xero-ruby/models/payroll_uk/pay_run_calendars.rb +14 -6
  400. data/lib/xero-ruby/models/payroll_uk/pay_run_object.rb +14 -6
  401. data/lib/xero-ruby/models/payroll_uk/pay_runs.rb +14 -6
  402. data/lib/xero-ruby/models/payroll_uk/payment_line.rb +14 -6
  403. data/lib/xero-ruby/models/payroll_uk/payment_method.rb +14 -6
  404. data/lib/xero-ruby/models/payroll_uk/payment_method_object.rb +14 -6
  405. data/lib/xero-ruby/models/payroll_uk/payslip.rb +14 -6
  406. data/lib/xero-ruby/models/payroll_uk/payslip_object.rb +14 -6
  407. data/lib/xero-ruby/models/payroll_uk/payslips.rb +14 -6
  408. data/lib/xero-ruby/models/payroll_uk/problem.rb +14 -6
  409. data/lib/xero-ruby/models/payroll_uk/reimbursement.rb +14 -6
  410. data/lib/xero-ruby/models/payroll_uk/reimbursement_line.rb +14 -6
  411. data/lib/xero-ruby/models/payroll_uk/reimbursement_object.rb +14 -6
  412. data/lib/xero-ruby/models/payroll_uk/reimbursements.rb +14 -6
  413. data/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb +14 -6
  414. data/lib/xero-ruby/models/payroll_uk/salary_and_wage_object.rb +14 -6
  415. data/lib/xero-ruby/models/payroll_uk/salary_and_wages.rb +14 -6
  416. data/lib/xero-ruby/models/payroll_uk/settings.rb +14 -6
  417. data/lib/xero-ruby/models/payroll_uk/statutory_deduction.rb +14 -6
  418. data/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb +0 -1
  419. data/lib/xero-ruby/models/payroll_uk/tax_line.rb +14 -6
  420. data/lib/xero-ruby/models/payroll_uk/timesheet.rb +15 -7
  421. data/lib/xero-ruby/models/payroll_uk/timesheet_earnings_line.rb +14 -6
  422. data/lib/xero-ruby/models/payroll_uk/timesheet_line.rb +14 -6
  423. data/lib/xero-ruby/models/payroll_uk/timesheet_line_object.rb +14 -6
  424. data/lib/xero-ruby/models/payroll_uk/timesheet_object.rb +14 -6
  425. data/lib/xero-ruby/models/payroll_uk/timesheets.rb +14 -6
  426. data/lib/xero-ruby/models/payroll_uk/tracking_categories.rb +14 -6
  427. data/lib/xero-ruby/models/payroll_uk/tracking_category.rb +14 -6
  428. data/lib/xero-ruby/models/projects/amount.rb +14 -6
  429. data/lib/xero-ruby/models/projects/charge_type.rb +0 -1
  430. data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
  431. data/lib/xero-ruby/models/projects/error.rb +14 -6
  432. data/lib/xero-ruby/models/projects/pagination.rb +14 -6
  433. data/lib/xero-ruby/models/projects/project.rb +14 -6
  434. data/lib/xero-ruby/models/projects/project_create_or_update.rb +14 -6
  435. data/lib/xero-ruby/models/projects/project_patch.rb +14 -6
  436. data/lib/xero-ruby/models/projects/project_status.rb +0 -1
  437. data/lib/xero-ruby/models/projects/project_user.rb +14 -6
  438. data/lib/xero-ruby/models/projects/project_users.rb +14 -6
  439. data/lib/xero-ruby/models/projects/projects.rb +14 -6
  440. data/lib/xero-ruby/models/projects/task.rb +14 -6
  441. data/lib/xero-ruby/models/projects/task_create_or_update.rb +14 -6
  442. data/lib/xero-ruby/models/projects/tasks.rb +14 -6
  443. data/lib/xero-ruby/models/projects/time_entries.rb +14 -6
  444. data/lib/xero-ruby/models/projects/time_entry.rb +14 -6
  445. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +14 -6
  446. data/lib/xero-ruby/string_serialization.rb +52 -0
  447. data/lib/xero-ruby/version.rb +3 -3
  448. data/lib/xero-ruby/where.rb +65 -0
  449. data/spec/api_client_spec.rb +86 -0
  450. data/spec/configuration_spec.rb +1 -1
  451. data/spec/helper_methods_spec.rb +82 -0
  452. data/spec/where_spec.rb +82 -0
  453. metadata +10 -6
  454. data/spec/files/models/file_response204_spec.rb +0 -41
@@ -3,7 +3,6 @@
3
3
 
4
4
  #This is the Xero Projects API
5
5
 
6
- The version of the OpenAPI document: 2.8.0
7
6
  Contact: api@xero.com
8
7
  Generated by: https://openapi-generator.tech
9
8
  OpenAPI Generator version: 4.3.1
@@ -17,7 +16,7 @@ module XeroRuby
17
16
  def initialize(api_client = ApiClient.new)
18
17
  @api_client = api_client
19
18
  end
20
- # create one or more new projects
19
+ # Create one or more new projects
21
20
  # @param xero_tenant_id [String] Xero identifier for Tenant
22
21
  # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
23
22
  # @param [Hash] opts the optional parameters
@@ -27,7 +26,7 @@ module XeroRuby
27
26
  data
28
27
  end
29
28
 
30
- # create one or more new projects
29
+ # Create one or more new projects
31
30
  # @param xero_tenant_id [String] Xero identifier for Tenant
32
31
  # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
33
32
  # @param [Hash] opts the optional parameters
@@ -45,7 +44,7 @@ module XeroRuby
45
44
  fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.create_project"
46
45
  end
47
46
  # resource path
48
- local_var_path = '/projects'
47
+ local_var_path = '/Projects'
49
48
 
50
49
  # camelize keys of incoming `where` opts
51
50
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -93,7 +92,7 @@ module XeroRuby
93
92
  return data, status_code, headers
94
93
  end
95
94
 
96
- # Allows you to create a task
95
+ # Creates a time entry for a specific project
97
96
  # Allows you to create a specific task
98
97
  # @param xero_tenant_id [String] Xero identifier for Tenant
99
98
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -105,7 +104,7 @@ module XeroRuby
105
104
  data
106
105
  end
107
106
 
108
- # Allows you to create a task
107
+ # Creates a time entry for a specific project
109
108
  # Allows you to create a specific task
110
109
  # @param xero_tenant_id [String] Xero identifier for Tenant
111
110
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -129,7 +128,7 @@ module XeroRuby
129
128
  fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.create_time_entry"
130
129
  end
131
130
  # resource path
132
- local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
131
+ local_var_path = '/Projects/{projectId}/Time'.sub('{' + 'projectId' + '}', project_id.to_s)
133
132
 
134
133
  # camelize keys of incoming `where` opts
135
134
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -177,7 +176,7 @@ module XeroRuby
177
176
  return data, status_code, headers
178
177
  end
179
178
 
180
- # Allows you to delete a time entry
179
+ # Deletes a time entry for a specific project
181
180
  # Allows you to delete a specific time entry
182
181
  # @param xero_tenant_id [String] Xero identifier for Tenant
183
182
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -189,7 +188,7 @@ module XeroRuby
189
188
  nil
190
189
  end
191
190
 
192
- # Allows you to delete a time entry
191
+ # Deletes a time entry for a specific project
193
192
  # Allows you to delete a specific time entry
194
193
  # @param xero_tenant_id [String] Xero identifier for Tenant
195
194
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -213,7 +212,7 @@ module XeroRuby
213
212
  fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.delete_time_entry"
214
213
  end
215
214
  # resource path
216
- local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
215
+ local_var_path = '/Projects/{projectId}/Time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
217
216
 
218
217
  # camelize keys of incoming `where` opts
219
218
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -257,8 +256,8 @@ module XeroRuby
257
256
  return data, status_code, headers
258
257
  end
259
258
 
260
- # Allows you to retrieve a single project
261
- # Allows you to retrieve a specific project
259
+ # Retrieves a single project
260
+ # Allows you to retrieve a specific project using the projectId
262
261
  # @param xero_tenant_id [String] Xero identifier for Tenant
263
262
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
264
263
  # @param [Hash] opts the optional parameters
@@ -268,8 +267,8 @@ module XeroRuby
268
267
  data
269
268
  end
270
269
 
271
- # Allows you to retrieve a single project
272
- # Allows you to retrieve a specific project
270
+ # Retrieves a single project
271
+ # Allows you to retrieve a specific project using the projectId
273
272
  # @param xero_tenant_id [String] Xero identifier for Tenant
274
273
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
275
274
  # @param [Hash] opts the optional parameters
@@ -287,7 +286,7 @@ module XeroRuby
287
286
  fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project"
288
287
  end
289
288
  # resource path
290
- local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
289
+ local_var_path = '/Projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
291
290
 
292
291
  # camelize keys of incoming `where` opts
293
292
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -333,7 +332,7 @@ module XeroRuby
333
332
  return data, status_code, headers
334
333
  end
335
334
 
336
- # list all project users
335
+ # Retrieves a list of all project users
337
336
  # Allows you to retrieve the users on a projects.
338
337
  # @param xero_tenant_id [String] Xero identifier for Tenant
339
338
  # @param [Hash] opts the optional parameters
@@ -345,7 +344,7 @@ module XeroRuby
345
344
  data
346
345
  end
347
346
 
348
- # list all project users
347
+ # Retrieves a list of all project users
349
348
  # Allows you to retrieve the users on a projects.
350
349
  # @param xero_tenant_id [String] Xero identifier for Tenant
351
350
  # @param [Hash] opts the optional parameters
@@ -369,7 +368,7 @@ module XeroRuby
369
368
  end
370
369
 
371
370
  # resource path
372
- local_var_path = '/projectsusers'
371
+ local_var_path = '/ProjectsUsers'
373
372
 
374
373
  # camelize keys of incoming `where` opts
375
374
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -417,7 +416,7 @@ module XeroRuby
417
416
  return data, status_code, headers
418
417
  end
419
418
 
420
- # list all projects
419
+ # Retrieves all projects
421
420
  # Allows you to retrieve, create and update projects.
422
421
  # @param xero_tenant_id [String] Xero identifier for Tenant
423
422
  # @param [Hash] opts the optional parameters
@@ -432,7 +431,7 @@ module XeroRuby
432
431
  data
433
432
  end
434
433
 
435
- # list all projects
434
+ # Retrieves all projects
436
435
  # Allows you to retrieve, create and update projects.
437
436
  # @param xero_tenant_id [String] Xero identifier for Tenant
438
437
  # @param [Hash] opts the optional parameters
@@ -459,7 +458,7 @@ module XeroRuby
459
458
  end
460
459
 
461
460
  # resource path
462
- local_var_path = '/projects'
461
+ local_var_path = '/Projects'
463
462
 
464
463
  # camelize keys of incoming `where` opts
465
464
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -510,11 +509,11 @@ module XeroRuby
510
509
  return data, status_code, headers
511
510
  end
512
511
 
513
- # Allows you to retrieve a single project
512
+ # Retrieves a single project task
514
513
  # Allows you to retrieve a specific project
515
514
  # @param xero_tenant_id [String] Xero identifier for Tenant
516
515
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
517
- # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
516
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskID}
518
517
  # @param [Hash] opts the optional parameters
519
518
  # @return [Task]
520
519
  def get_task(xero_tenant_id, project_id, task_id, opts = {})
@@ -522,11 +521,11 @@ module XeroRuby
522
521
  data
523
522
  end
524
523
 
525
- # Allows you to retrieve a single project
524
+ # Retrieves a single project task
526
525
  # Allows you to retrieve a specific project
527
526
  # @param xero_tenant_id [String] Xero identifier for Tenant
528
527
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
529
- # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
528
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskID}
530
529
  # @param [Hash] opts the optional parameters
531
530
  # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers
532
531
  def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {})
@@ -546,7 +545,7 @@ module XeroRuby
546
545
  fail ArgumentError, "Missing the required parameter 'task_id' when calling ProjectApi.get_task"
547
546
  end
548
547
  # resource path
549
- local_var_path = '/projects/{projectId}/tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s)
548
+ local_var_path = '/Projects/{projectId}/Tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s)
550
549
 
551
550
  # camelize keys of incoming `where` opts
552
551
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -592,14 +591,14 @@ module XeroRuby
592
591
  return data, status_code, headers
593
592
  end
594
593
 
595
- # Allows you to retrieve a single project
594
+ # Retrieves all project tasks
596
595
  # Allows you to retrieve a specific project
597
596
  # @param xero_tenant_id [String] Xero identifier for Tenant
598
597
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
599
598
  # @param [Hash] opts the optional parameters
600
599
  # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
601
600
  # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
602
- # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds&#x3D;{taskId},{taskId}
601
+ # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds&#x3D;{taskID},{taskID}
603
602
  # @option opts [ChargeType] :charge_type
604
603
  # @return [Tasks]
605
604
  def get_tasks(xero_tenant_id, project_id, opts = {})
@@ -607,14 +606,14 @@ module XeroRuby
607
606
  data
608
607
  end
609
608
 
610
- # Allows you to retrieve a single project
609
+ # Retrieves all project tasks
611
610
  # Allows you to retrieve a specific project
612
611
  # @param xero_tenant_id [String] Xero identifier for Tenant
613
612
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
614
613
  # @param [Hash] opts the optional parameters
615
614
  # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
616
615
  # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
617
- # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds&#x3D;{taskId},{taskId}
616
+ # @option opts [String] :task_ids taskIdsSearch for all tasks that match a comma separated list of taskIds, i.e. GET https://.../tasks?taskIds&#x3D;{taskID},{taskID}
618
617
  # @option opts [ChargeType] :charge_type
619
618
  # @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers
620
619
  def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {})
@@ -630,7 +629,7 @@ module XeroRuby
630
629
  fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_tasks"
631
630
  end
632
631
  # resource path
633
- local_var_path = '/projects/{projectId}/tasks'.sub('{' + 'projectId' + '}', project_id.to_s)
632
+ local_var_path = '/Projects/{projectId}/Tasks'.sub('{' + 'projectId' + '}', project_id.to_s)
634
633
 
635
634
  # camelize keys of incoming `where` opts
636
635
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -680,7 +679,7 @@ module XeroRuby
680
679
  return data, status_code, headers
681
680
  end
682
681
 
683
- # Allows you to retrieve the time entries associated with a specific project
682
+ # Retrieves all time entries associated with a specific project
684
683
  # Allows you to retrieve the time entries associated with a specific project
685
684
  # @param xero_tenant_id [String] Xero identifier for Tenant
686
685
  # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
@@ -691,7 +690,7 @@ module XeroRuby
691
690
  # @option opts [String] :contact_id Finds all time entries for this contact identifier.
692
691
  # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
693
692
  # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
694
- # @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified.
693
+ # @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever is specified.
695
694
  # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
696
695
  # @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the &#x60;dateUtc&#x60; field.
697
696
  # @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the &#x60;dateUtc&#x60; field.
@@ -701,7 +700,7 @@ module XeroRuby
701
700
  data
702
701
  end
703
702
 
704
- # Allows you to retrieve the time entries associated with a specific project
703
+ # Retrieves all time entries associated with a specific project
705
704
  # Allows you to retrieve the time entries associated with a specific project
706
705
  # @param xero_tenant_id [String] Xero identifier for Tenant
707
706
  # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
@@ -712,7 +711,7 @@ module XeroRuby
712
711
  # @option opts [String] :contact_id Finds all time entries for this contact identifier.
713
712
  # @option opts [Integer] :page Set to 1 by default. The requested number of the page in paged response - Must be a number greater than 0.
714
713
  # @option opts [Integer] :page_size Optional, it is set to 50 by default. The number of items to return per page in a paged response - Must be a number between 1 and 500.
715
- # @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever’s specified.
714
+ # @option opts [Array<String>] :states Comma-separated list of states to find. Will find all time entries that are in the status of whatever is specified.
716
715
  # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
717
716
  # @option opts [DateTime] :date_after_utc ISO 8601 UTC date. Finds all time entries on or after this date filtered on the &#x60;dateUtc&#x60; field.
718
717
  # @option opts [DateTime] :date_before_utc ISO 8601 UTC date. Finds all time entries on or before this date filtered on the &#x60;dateUtc&#x60; field.
@@ -730,7 +729,7 @@ module XeroRuby
730
729
  fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entries"
731
730
  end
732
731
  # resource path
733
- local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
732
+ local_var_path = '/Projects/{projectId}/Time'.sub('{' + 'projectId' + '}', project_id.to_s)
734
733
 
735
734
  # camelize keys of incoming `where` opts
736
735
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -786,8 +785,8 @@ module XeroRuby
786
785
  return data, status_code, headers
787
786
  end
788
787
 
788
+ # Retrieves a single time entry for a specific project
789
789
  # Allows you to get a single time entry in a project
790
- # Allows you to upget a single time entry in a project
791
790
  # @param xero_tenant_id [String] Xero identifier for Tenant
792
791
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
793
792
  # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
@@ -798,8 +797,8 @@ module XeroRuby
798
797
  data
799
798
  end
800
799
 
800
+ # Retrieves a single time entry for a specific project
801
801
  # Allows you to get a single time entry in a project
802
- # Allows you to upget a single time entry in a project
803
802
  # @param xero_tenant_id [String] Xero identifier for Tenant
804
803
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
805
804
  # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
@@ -822,7 +821,7 @@ module XeroRuby
822
821
  fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.get_time_entry"
823
822
  end
824
823
  # resource path
825
- local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
824
+ local_var_path = '/Projects/{projectId}/Time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
826
825
 
827
826
  # camelize keys of incoming `where` opts
828
827
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -904,7 +903,7 @@ module XeroRuby
904
903
  fail ArgumentError, "Missing the required parameter 'project_patch' when calling ProjectApi.patch_project"
905
904
  end
906
905
  # resource path
907
- local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
906
+ local_var_path = '/Projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
908
907
 
909
908
  # camelize keys of incoming `where` opts
910
909
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -952,7 +951,7 @@ module XeroRuby
952
951
  return data, status_code, headers
953
952
  end
954
953
 
955
- # update a specific project
954
+ # Updates a specific project
956
955
  # Allows you to update a specific projects.
957
956
  # @param xero_tenant_id [String] Xero identifier for Tenant
958
957
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -964,7 +963,7 @@ module XeroRuby
964
963
  nil
965
964
  end
966
965
 
967
- # update a specific project
966
+ # Updates a specific project
968
967
  # Allows you to update a specific projects.
969
968
  # @param xero_tenant_id [String] Xero identifier for Tenant
970
969
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -988,7 +987,7 @@ module XeroRuby
988
987
  fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.update_project"
989
988
  end
990
989
  # resource path
991
- local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
990
+ local_var_path = '/Projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
992
991
 
993
992
  # camelize keys of incoming `where` opts
994
993
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -1036,7 +1035,7 @@ module XeroRuby
1036
1035
  return data, status_code, headers
1037
1036
  end
1038
1037
 
1039
- # Allows you to update time entry in a project
1038
+ # Updates a time entry for a specific project
1040
1039
  # Allows you to update time entry in a project
1041
1040
  # @param xero_tenant_id [String] Xero identifier for Tenant
1042
1041
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -1049,7 +1048,7 @@ module XeroRuby
1049
1048
  nil
1050
1049
  end
1051
1050
 
1052
- # Allows you to update time entry in a project
1051
+ # Updates a time entry for a specific project
1053
1052
  # Allows you to update time entry in a project
1054
1053
  # @param xero_tenant_id [String] Xero identifier for Tenant
1055
1054
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
@@ -1078,7 +1077,7 @@ module XeroRuby
1078
1077
  fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.update_time_entry"
1079
1078
  end
1080
1079
  # resource path
1081
- local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
1080
+ local_var_path = '/Projects/{projectId}/Time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
1082
1081
 
1083
1082
  # camelize keys of incoming `where` opts
1084
1083
  opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
@@ -1,9 +1,8 @@
1
1
  =begin
2
- #Accounting API
2
+ #Xero Accounting API
3
3
 
4
4
  #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
5
 
6
- The version of the OpenAPI document: 2.8.0
7
6
  Contact: api@xero.com
8
7
  Generated by: https://openapi-generator.tech
9
8
  OpenAPI Generator version: 4.3.1
@@ -16,9 +15,12 @@ require 'logger'
16
15
  require 'tempfile'
17
16
  require 'find'
18
17
  require 'faraday'
18
+ require 'base64'
19
19
 
20
20
  module XeroRuby
21
21
  class ApiClient
22
+ include StringSerialization
23
+
22
24
  # The Configuration object holding settings to be used in the API client.
23
25
  attr_accessor :config
24
26
 
@@ -44,7 +46,8 @@ module XeroRuby
44
46
  end
45
47
 
46
48
  def authorization_url
47
- url = "#{@config.login_url}?response_type=code&client_id=#{@client_id}&redirect_uri=#{@redirect_uri}&scope=#{@scopes}&state=#{@state}"
49
+ url = "#{@config.login_url}?response_type=code&client_id=#{@client_id}&redirect_uri=#{@redirect_uri}&scope=#{@scopes}"
50
+ url << "&state=#{@state}" if @state
48
51
  return url
49
52
  end
50
53
 
@@ -93,7 +96,7 @@ module XeroRuby
93
96
  end
94
97
 
95
98
  def set_token_set(token_set)
96
- # helper to set the token_set on a client once the user has y
99
+ # helper to set the token_set on a client once the user
97
100
  # has a valid token set ( access_token & refresh_token )
98
101
  XeroRuby.configure.token_set = token_set
99
102
  set_access_token(token_set['access_token'])
@@ -109,7 +112,7 @@ module XeroRuby
109
112
  code: params['code'],
110
113
  redirect_uri: @redirect_uri
111
114
  }
112
- return token_request(data)
115
+ return token_request(data, '/token')
113
116
  end
114
117
 
115
118
  def refresh_token_set(token_set)
@@ -117,31 +120,44 @@ module XeroRuby
117
120
  grant_type: 'refresh_token',
118
121
  refresh_token: token_set['refresh_token']
119
122
  }
120
- return token_request(data)
123
+ return token_request(data, '/token')
124
+ end
125
+
126
+ def revoke_token(token_set)
127
+ data = {
128
+ token: token_set['refresh_token']
129
+ }
130
+ return token_request(data, '/revocation')
121
131
  end
122
132
 
123
- def token_request(data)
124
- response = Faraday.post(@config.token_url) do |req|
133
+ def token_request(data, path)
134
+ response = Faraday.post("#{@config.token_url}#{path}") do |req|
125
135
  req.headers['Authorization'] = "Basic " + Base64.strict_encode64("#{@client_id}:#{@client_secret}")
126
136
  req.headers['Content-Type'] = 'application/x-www-form-urlencoded'
127
137
  req.body = URI.encode_www_form(data)
128
138
  end
129
139
  return_error(response) unless response.success?
130
- body = JSON.parse(response.body)
131
- set_token_set(body)
140
+ if !response.body.nil? && !response.body.empty?
141
+ body = JSON.parse(response.body)
142
+ set_token_set(body)
143
+ else
144
+ body = {}
145
+ end
132
146
  return body
133
147
  end
134
148
 
135
149
  # Connection heplers
136
150
  def connections
151
+ @config.base_url = 'https://api.xero.com'
137
152
  opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
138
- response = call_api(:GET, 'https://api.xero.com/connections/', nil, opts)
153
+ response = call_api(:GET, "/connections/", nil, opts)
139
154
  response[0]
140
155
  end
141
156
 
142
157
  def disconnect(connection_id)
158
+ @config.base_url = 'https://api.xero.com'
143
159
  opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
144
- call_api(:DELETE, "https://api.xero.com/connections/#{connection_id}", nil, opts)
160
+ call_api(:DELETE, "/connections/#{connection_id}", nil, opts)
145
161
  connections
146
162
  end
147
163
 
@@ -497,55 +513,6 @@ module XeroRuby
497
513
  end
498
514
  end
499
515
 
500
- # START - Re-serializes snake_cased params to PascalCase required by XeroAPI
501
- def to_camel_keys(value = self)
502
- case value
503
- when Array
504
- value.map { |v| to_camel_keys(v) }
505
- when Hash
506
- Hash[value.map { |k, v| [camelize_key(k), to_camel_keys(v)] }]
507
- else
508
- value
509
- end
510
- end
511
-
512
- def camelize_key(key, first_upper = true)
513
- if key.is_a? Symbol
514
- camelize(key.to_s, first_upper).to_sym
515
- elsif key.is_a? String
516
- camelize(key, first_upper)
517
- else
518
- key # can't camelize anything except strings and symbols
519
- end
520
- end
521
-
522
- def camelize(word, first_upper = true)
523
- if first_upper
524
- str = word.to_s
525
- str = gsubbed(str, /(?:^|_)([^_\s]+)/)
526
- str = gsubbed(str, %r{/([^/]*)}, "::")
527
- str
528
- else
529
- parts = word.split("_", 2)
530
- parts[0] << camelize(parts[1]) if parts.size > 1
531
- parts[0] || ""
532
- end
533
- end
534
-
535
- def gsubbed(str, pattern, extra = "")
536
- key_map_scronyms = {}
537
- str = str.gsub(pattern) do
538
- extra + (key_map_scronyms[Regexp.last_match(1)] || capitalize_first(Regexp.last_match(1)))
539
- end
540
- str
541
- end
542
-
543
- def capitalize_first(word)
544
- split = word.split('')
545
- "#{split[0].capitalize}#{split[1..-1].join}"
546
- end
547
- # END - Re-serializes snake_cased params to PascalCase required by XeroAPI
548
-
549
516
  # Build parameter value according to the given collection format.
550
517
  # @param [String] collection_format one of :csv, :ssv, :tsv, :pipes and :multi
551
518
  def build_collection_param(param, collection_format)
@@ -567,36 +534,7 @@ module XeroRuby
567
534
  end
568
535
 
569
536
  def parameterize_where(where_opts)
570
- where_opts.map do |k,v|
571
- case v
572
- when Array
573
- operator = v.first
574
- query = v.last
575
- if query.is_a?(Date)
576
- "#{camelize_key(k)} #{operator} DateTime(#{query.strftime("%Y,%m,%d")})"
577
- elsif [Float, Integer].member?(query.class)
578
- %{#{camelize_key(k)} #{operator} #{query}}
579
- elsif [true, false].member?(query)
580
- %{#{camelize_key(k)} #{operator} #{query}}
581
- else
582
- if k == :contact_id
583
- %{Contact.ContactID #{operator} guid("#{query}")}
584
- elsif k == :contact_number
585
- %{Contact.ContactNumber #{operator} "#{query}"}
586
- else
587
- %{#{camelize_key(k)} #{operator} "#{query}"}
588
- end
589
- end
590
- when Range
591
- if v.first.is_a?(DateTime) || v.first.is_a?(Date) || v.first.is_a?(Time)
592
- "#{camelize_key(k)} >= DateTime(#{v.first.strftime("%Y,%m,%d")}) AND #{camelize_key(k)} <= DateTime(#{v.last.strftime("%Y,%m,%d")})"
593
- else
594
- "#{camelize_key(k)} >= #{v.first} AND #{camelize_key(k)} <= #{v.last}"
595
- end
596
- else
597
- %{#{camelize_key(k)} #{v}}
598
- end
599
- end.join(' AND ')
537
+ Where.new(where_opts).to_param
600
538
  end
601
539
  end
602
540
  end