xero-ruby 0.2.3 → 1.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 (463) hide show
  1. checksums.yaml +4 -4
  2. data/CODE_OF_CONDUCT.md +76 -0
  3. data/CONTRIBUTING.md +82 -0
  4. data/Gemfile.lock +68 -0
  5. data/LICENSE +21 -0
  6. data/README.md +132 -438
  7. data/docs/{Account.md → accounting/Account.md} +5 -5
  8. data/docs/accounting/AccountType.md +16 -0
  9. data/docs/{AccountingApi.md → accounting/AccountingApi.md} +4973 -1782
  10. data/docs/{Accounts.md → accounting/Accounts.md} +3 -3
  11. data/docs/{AccountsPayable.md → accounting/AccountsPayable.md} +3 -3
  12. data/docs/{AccountsReceivable.md → accounting/AccountsReceivable.md} +3 -3
  13. data/docs/{Address.md → accounting/Address.md} +3 -3
  14. data/docs/accounting/Allocation.md +31 -0
  15. data/docs/{Allocations.md → accounting/Allocations.md} +3 -3
  16. data/docs/{Attachment.md → accounting/Attachment.md} +3 -3
  17. data/docs/{Attachments.md → accounting/Attachments.md} +3 -3
  18. data/docs/{Balances.md → accounting/Balances.md} +3 -3
  19. data/docs/{BankTransaction.md → accounting/BankTransaction.md} +5 -5
  20. data/docs/{BankTransactions.md → accounting/BankTransactions.md} +3 -3
  21. data/docs/{BankTransfer.md → accounting/BankTransfer.md} +6 -6
  22. data/docs/{BankTransfers.md → accounting/BankTransfers.md} +3 -3
  23. data/docs/{BatchPayment.md → accounting/BatchPayment.md} +4 -4
  24. data/docs/{BatchPaymentDetails.md → accounting/BatchPaymentDetails.md} +3 -3
  25. data/docs/{BatchPayments.md → accounting/BatchPayments.md} +3 -3
  26. data/docs/{Bill.md → accounting/Bill.md} +3 -3
  27. data/docs/{BrandingTheme.md → accounting/BrandingTheme.md} +3 -3
  28. data/docs/{BrandingThemes.md → accounting/BrandingThemes.md} +3 -3
  29. data/docs/{CISOrgSetting.md → accounting/CISOrgSetting.md} +3 -3
  30. data/docs/{CISSetting.md → accounting/CISSetting.md} +3 -3
  31. data/docs/{CISSettings.md → accounting/CISSettings.md} +3 -3
  32. data/docs/{Contact.md → accounting/Contact.md} +7 -7
  33. data/docs/{ContactGroup.md → accounting/ContactGroup.md} +3 -3
  34. data/docs/{ContactGroups.md → accounting/ContactGroups.md} +3 -3
  35. data/docs/{ContactPerson.md → accounting/ContactPerson.md} +3 -3
  36. data/docs/{Contacts.md → accounting/Contacts.md} +3 -3
  37. data/docs/accounting/CountryCode.md +16 -0
  38. data/docs/{CreditNote.md → accounting/CreditNote.md} +9 -7
  39. data/docs/{CreditNotes.md → accounting/CreditNotes.md} +3 -3
  40. data/docs/{Currencies.md → accounting/Currencies.md} +3 -3
  41. data/docs/{Currency.md → accounting/Currency.md} +3 -3
  42. data/docs/accounting/CurrencyCode.md +16 -0
  43. data/docs/{Element.md → accounting/Element.md} +3 -3
  44. data/docs/{Employee.md → accounting/Employee.md} +3 -3
  45. data/docs/{Employees.md → accounting/Employees.md} +3 -3
  46. data/docs/{Error.md → accounting/Error.md} +3 -3
  47. data/docs/{ExpenseClaim.md → accounting/ExpenseClaim.md} +3 -3
  48. data/docs/{ExpenseClaims.md → accounting/ExpenseClaims.md} +3 -3
  49. data/docs/{ExternalLink.md → accounting/ExternalLink.md} +3 -3
  50. data/docs/{HistoryRecord.md → accounting/HistoryRecord.md} +3 -3
  51. data/docs/{HistoryRecords.md → accounting/HistoryRecords.md} +3 -3
  52. data/docs/{Invoice.md → accounting/Invoice.md} +7 -7
  53. data/docs/{InvoiceReminder.md → accounting/InvoiceReminder.md} +3 -3
  54. data/docs/{InvoiceReminders.md → accounting/InvoiceReminders.md} +3 -3
  55. data/docs/{Invoices.md → accounting/Invoices.md} +3 -3
  56. data/docs/{Item.md → accounting/Item.md} +3 -3
  57. data/docs/{Items.md → accounting/Items.md} +3 -3
  58. data/docs/{Journal.md → accounting/Journal.md} +4 -4
  59. data/docs/{JournalLine.md → accounting/JournalLine.md} +3 -3
  60. data/docs/{Journals.md → accounting/Journals.md} +3 -3
  61. data/docs/accounting/LineAmountTypes.md +16 -0
  62. data/docs/{LineItem.md → accounting/LineItem.md} +3 -3
  63. data/docs/{LineItemTracking.md → accounting/LineItemTracking.md} +3 -3
  64. data/docs/{LinkedTransaction.md → accounting/LinkedTransaction.md} +3 -3
  65. data/docs/{LinkedTransactions.md → accounting/LinkedTransactions.md} +3 -3
  66. data/docs/{ManualJournal.md → accounting/ManualJournal.md} +5 -5
  67. data/docs/{ManualJournalLine.md → accounting/ManualJournalLine.md} +3 -3
  68. data/docs/{ManualJournals.md → accounting/ManualJournals.md} +3 -3
  69. data/docs/{OnlineInvoice.md → accounting/OnlineInvoice.md} +3 -3
  70. data/docs/{OnlineInvoices.md → accounting/OnlineInvoices.md} +3 -3
  71. data/docs/{Organisation.md → accounting/Organisation.md} +5 -3
  72. data/docs/{Organisations.md → accounting/Organisations.md} +3 -3
  73. data/docs/{Overpayment.md → accounting/Overpayment.md} +5 -5
  74. data/docs/{Overpayments.md → accounting/Overpayments.md} +3 -3
  75. data/docs/{Payment.md → accounting/Payment.md} +9 -7
  76. data/docs/{PaymentDelete.md → accounting/PaymentDelete.md} +3 -3
  77. data/docs/{PaymentService.md → accounting/PaymentService.md} +3 -3
  78. data/docs/{PaymentServices.md → accounting/PaymentServices.md} +3 -3
  79. data/docs/{PaymentTerm.md → accounting/PaymentTerm.md} +3 -3
  80. data/docs/{PaymentTermType.md → accounting/PaymentTermType.md} +3 -3
  81. data/docs/{Payments.md → accounting/Payments.md} +3 -3
  82. data/docs/{Phone.md → accounting/Phone.md} +3 -3
  83. data/docs/{Prepayment.md → accounting/Prepayment.md} +5 -5
  84. data/docs/{Prepayments.md → accounting/Prepayments.md} +3 -3
  85. data/docs/{Purchase.md → accounting/Purchase.md} +3 -3
  86. data/docs/{PurchaseOrder.md → accounting/PurchaseOrder.md} +5 -5
  87. data/docs/{PurchaseOrders.md → accounting/PurchaseOrders.md} +3 -3
  88. data/docs/{Quote.md → accounting/Quote.md} +8 -4
  89. data/docs/{QuoteLineAmountTypes.md → accounting/QuoteLineAmountTypes.md} +3 -3
  90. data/docs/{QuoteStatusCodes.md → accounting/QuoteStatusCodes.md} +3 -3
  91. data/docs/{Quotes.md → accounting/Quotes.md} +3 -3
  92. data/docs/{Receipt.md → accounting/Receipt.md} +5 -5
  93. data/docs/{Receipts.md → accounting/Receipts.md} +3 -3
  94. data/docs/{RepeatingInvoice.md → accounting/RepeatingInvoice.md} +5 -5
  95. data/docs/{RepeatingInvoices.md → accounting/RepeatingInvoices.md} +3 -3
  96. data/docs/{Report.md → accounting/Report.md} +3 -3
  97. data/docs/{ReportAttribute.md → accounting/ReportAttribute.md} +3 -3
  98. data/docs/{ReportCell.md → accounting/ReportCell.md} +3 -3
  99. data/docs/{ReportFields.md → accounting/ReportFields.md} +3 -3
  100. data/docs/{ReportRow.md → accounting/ReportRow.md} +3 -3
  101. data/docs/{ReportRows.md → accounting/ReportRows.md} +3 -3
  102. data/docs/{ReportWithRow.md → accounting/ReportWithRow.md} +3 -3
  103. data/docs/{ReportWithRows.md → accounting/ReportWithRows.md} +3 -3
  104. data/docs/{Reports.md → accounting/Reports.md} +3 -3
  105. data/docs/{RequestEmpty.md → accounting/RequestEmpty.md} +3 -3
  106. data/docs/{RowType.md → accounting/RowType.md} +3 -3
  107. data/docs/{SalesTrackingCategory.md → accounting/SalesTrackingCategory.md} +3 -3
  108. data/docs/{Schedule.md → accounting/Schedule.md} +3 -3
  109. data/docs/{TaxComponent.md → accounting/TaxComponent.md} +3 -3
  110. data/docs/{TaxRate.md → accounting/TaxRate.md} +3 -3
  111. data/docs/{TaxRates.md → accounting/TaxRates.md} +3 -3
  112. data/docs/{TaxType.md → accounting/TaxType.md} +3 -3
  113. data/docs/{TenNinteyNineContact.md → accounting/TenNinteyNineContact.md} +3 -3
  114. data/docs/{TimeZone.md → accounting/TimeZone.md} +3 -3
  115. data/docs/{TrackingCategories.md → accounting/TrackingCategories.md} +3 -3
  116. data/docs/{TrackingCategory.md → accounting/TrackingCategory.md} +3 -3
  117. data/docs/{TrackingOption.md → accounting/TrackingOption.md} +3 -3
  118. data/docs/{TrackingOptions.md → accounting/TrackingOptions.md} +3 -3
  119. data/docs/{User.md → accounting/User.md} +3 -3
  120. data/docs/{Users.md → accounting/Users.md} +3 -3
  121. data/docs/{ValidationError.md → accounting/ValidationError.md} +3 -3
  122. data/docs/assets/Asset.md +45 -0
  123. data/docs/assets/AssetApi.md +438 -0
  124. data/docs/{CurrencyCode.md → assets/AssetStatus.md} +3 -3
  125. data/docs/assets/AssetStatusQueryParam.md +16 -0
  126. data/docs/assets/AssetType.md +29 -0
  127. data/docs/assets/Assets.md +19 -0
  128. data/docs/assets/BookDepreciationDetail.md +29 -0
  129. data/docs/assets/BookDepreciationSetting.md +31 -0
  130. data/docs/assets/Error.md +25 -0
  131. data/docs/assets/FieldValidationErrorsElement.md +27 -0
  132. data/docs/assets/Pagination.md +23 -0
  133. data/docs/assets/ResourceValidationErrorsElement.md +25 -0
  134. data/docs/assets/Setting.md +31 -0
  135. data/docs/projects/Amount.md +19 -0
  136. data/docs/{AccountType.md → projects/ChargeType.md} +3 -3
  137. data/docs/{CountryCode.md → projects/CurrencyCode.md} +3 -3
  138. data/docs/projects/Error.md +19 -0
  139. data/docs/projects/Pagination.md +23 -0
  140. data/docs/projects/Project.md +59 -0
  141. data/docs/projects/ProjectApi.md +979 -0
  142. data/docs/projects/ProjectCreateOrUpdate.md +23 -0
  143. data/docs/projects/ProjectPatch.md +17 -0
  144. data/docs/{LineAmountTypes.md → projects/ProjectStatus.md} +3 -3
  145. data/docs/projects/ProjectUser.md +21 -0
  146. data/docs/projects/ProjectUsers.md +19 -0
  147. data/docs/projects/Projects.md +19 -0
  148. data/docs/projects/Task.md +45 -0
  149. data/docs/projects/TaskCreateOrUpdate.md +23 -0
  150. data/docs/projects/Tasks.md +19 -0
  151. data/docs/projects/TimeEntries.md +19 -0
  152. data/docs/projects/TimeEntry.md +33 -0
  153. data/docs/projects/TimeEntryCreateOrUpdate.md +25 -0
  154. data/lib/xero-ruby.rb +148 -122
  155. data/lib/xero-ruby/api/accounting_api.rb +165 -42
  156. data/lib/xero-ruby/api/asset_api.rb +452 -0
  157. data/lib/xero-ruby/api/project_api.rb +1035 -0
  158. data/lib/xero-ruby/api_client.rb +172 -44
  159. data/lib/xero-ruby/api_error.rb +2 -2
  160. data/lib/xero-ruby/configuration.rb +35 -22
  161. data/lib/xero-ruby/models/{account.rb → accounting/account.rb} +62 -24
  162. data/lib/xero-ruby/models/{account_type.rb → accounting/account_type.rb} +3 -3
  163. data/lib/xero-ruby/models/{accounts.rb → accounting/accounts.rb} +8 -7
  164. data/lib/xero-ruby/models/{accounts_payable.rb → accounting/accounts_payable.rb} +9 -7
  165. data/lib/xero-ruby/models/{accounts_receivable.rb → accounting/accounts_receivable.rb} +9 -7
  166. data/lib/xero-ruby/models/{address.rb → accounting/address.rb} +19 -16
  167. data/lib/xero-ruby/models/accounting/allocation.rb +291 -0
  168. data/lib/xero-ruby/models/{allocations.rb → accounting/allocations.rb} +8 -7
  169. data/lib/xero-ruby/models/{attachment.rb → accounting/attachment.rb} +12 -12
  170. data/lib/xero-ruby/models/{attachments.rb → accounting/attachments.rb} +8 -7
  171. data/lib/xero-ruby/models/{balances.rb → accounting/balances.rb} +9 -7
  172. data/lib/xero-ruby/models/{bank_transaction.rb → accounting/bank_transaction.rb} +41 -24
  173. data/lib/xero-ruby/models/{bank_transactions.rb → accounting/bank_transactions.rb} +8 -7
  174. data/lib/xero-ruby/models/{bank_transfer.rb → accounting/bank_transfer.rb} +21 -17
  175. data/lib/xero-ruby/models/{bank_transfers.rb → accounting/bank_transfers.rb} +8 -7
  176. data/lib/xero-ruby/models/{batch_payment.rb → accounting/batch_payment.rb} +28 -22
  177. data/lib/xero-ruby/models/{batch_payment_details.rb → accounting/batch_payment_details.rb} +11 -11
  178. data/lib/xero-ruby/models/{batch_payments.rb → accounting/batch_payments.rb} +8 -7
  179. data/lib/xero-ruby/models/{bill.rb → accounting/bill.rb} +8 -7
  180. data/lib/xero-ruby/models/{branding_theme.rb → accounting/branding_theme.rb} +13 -12
  181. data/lib/xero-ruby/models/{branding_themes.rb → accounting/branding_themes.rb} +8 -7
  182. data/lib/xero-ruby/models/{cis_org_setting.rb → accounting/cis_org_setting.rb} +9 -9
  183. data/lib/xero-ruby/models/{cis_setting.rb → accounting/cis_setting.rb} +8 -8
  184. data/lib/xero-ruby/models/{cis_settings.rb → accounting/cis_settings.rb} +8 -7
  185. data/lib/xero-ruby/models/{contact.rb → accounting/contact.rb} +52 -40
  186. data/lib/xero-ruby/models/{contact_group.rb → accounting/contact_group.rb} +12 -10
  187. data/lib/xero-ruby/models/{contact_groups.rb → accounting/contact_groups.rb} +8 -7
  188. data/lib/xero-ruby/models/{contact_person.rb → accounting/contact_person.rb} +10 -10
  189. data/lib/xero-ruby/models/{contacts.rb → accounting/contacts.rb} +8 -7
  190. data/lib/xero-ruby/models/{country_code.rb → accounting/country_code.rb} +3 -3
  191. data/lib/xero-ruby/models/{credit_note.rb → accounting/credit_note.rb} +54 -29
  192. data/lib/xero-ruby/models/{credit_notes.rb → accounting/credit_notes.rb} +8 -7
  193. data/lib/xero-ruby/models/{currencies.rb → accounting/currencies.rb} +8 -7
  194. data/lib/xero-ruby/models/{currency.rb → accounting/currency.rb} +9 -8
  195. data/lib/xero-ruby/models/{currency_code.rb → accounting/currency_code.rb} +5 -5
  196. data/lib/xero-ruby/models/{element.rb → accounting/element.rb} +14 -8
  197. data/lib/xero-ruby/models/{employee.rb → accounting/employee.rb} +17 -12
  198. data/lib/xero-ruby/models/{employees.rb → accounting/employees.rb} +8 -7
  199. data/lib/xero-ruby/models/{error.rb → accounting/error.rb} +10 -10
  200. data/lib/xero-ruby/models/{expense_claim.rb → accounting/expense_claim.rb} +23 -16
  201. data/lib/xero-ruby/models/{expense_claims.rb → accounting/expense_claims.rb} +8 -7
  202. data/lib/xero-ruby/models/{external_link.rb → accounting/external_link.rb} +14 -8
  203. data/lib/xero-ruby/models/{history_record.rb → accounting/history_record.rb} +10 -10
  204. data/lib/xero-ruby/models/{history_records.rb → accounting/history_records.rb} +8 -7
  205. data/lib/xero-ruby/models/{invoice.rb → accounting/invoice.rb} +62 -41
  206. data/lib/xero-ruby/models/{invoice_reminder.rb → accounting/invoice_reminder.rb} +7 -7
  207. data/lib/xero-ruby/models/{invoice_reminders.rb → accounting/invoice_reminders.rb} +8 -7
  208. data/lib/xero-ruby/models/{invoices.rb → accounting/invoices.rb} +8 -7
  209. data/lib/xero-ruby/models/{item.rb → accounting/item.rb} +22 -20
  210. data/lib/xero-ruby/models/{items.rb → accounting/items.rb} +8 -7
  211. data/lib/xero-ruby/models/{journal.rb → accounting/journal.rb} +40 -15
  212. data/lib/xero-ruby/models/{journal_line.rb → accounting/journal_line.rb} +18 -17
  213. data/lib/xero-ruby/models/{journals.rb → accounting/journals.rb} +8 -7
  214. data/lib/xero-ruby/models/{line_amount_types.rb → accounting/line_amount_types.rb} +3 -3
  215. data/lib/xero-ruby/models/{line_item.rb → accounting/line_item.rb} +19 -19
  216. data/lib/xero-ruby/models/{line_item_tracking.rb → accounting/line_item_tracking.rb} +10 -10
  217. data/lib/xero-ruby/models/{linked_transaction.rb → accounting/linked_transaction.rb} +25 -17
  218. data/lib/xero-ruby/models/{linked_transactions.rb → accounting/linked_transactions.rb} +8 -7
  219. data/lib/xero-ruby/models/{manual_journal.rb → accounting/manual_journal.rb} +27 -19
  220. data/lib/xero-ruby/models/{manual_journal_line.rb → accounting/manual_journal_line.rb} +13 -13
  221. data/lib/xero-ruby/models/{manual_journals.rb → accounting/manual_journals.rb} +8 -7
  222. data/lib/xero-ruby/models/{online_invoice.rb → accounting/online_invoice.rb} +7 -7
  223. data/lib/xero-ruby/models/{online_invoices.rb → accounting/online_invoices.rb} +8 -7
  224. data/lib/xero-ruby/models/{organisation.rb → accounting/organisation.rb} +107 -47
  225. data/lib/xero-ruby/models/{organisations.rb → accounting/organisations.rb} +8 -7
  226. data/lib/xero-ruby/models/{overpayment.rb → accounting/overpayment.rb} +33 -22
  227. data/lib/xero-ruby/models/{overpayments.rb → accounting/overpayments.rb} +8 -7
  228. data/lib/xero-ruby/models/{payment.rb → accounting/payment.rb} +55 -26
  229. data/lib/xero-ruby/models/{payment_delete.rb → accounting/payment_delete.rb} +7 -7
  230. data/lib/xero-ruby/models/{payment_service.rb → accounting/payment_service.rb} +12 -12
  231. data/lib/xero-ruby/models/{payment_services.rb → accounting/payment_services.rb} +8 -7
  232. data/lib/xero-ruby/models/{payment_term.rb → accounting/payment_term.rb} +9 -7
  233. data/lib/xero-ruby/models/{payment_term_type.rb → accounting/payment_term_type.rb} +3 -3
  234. data/lib/xero-ruby/models/{payments.rb → accounting/payments.rb} +8 -7
  235. data/lib/xero-ruby/models/{phone.rb → accounting/phone.rb} +16 -10
  236. data/lib/xero-ruby/models/{prepayment.rb → accounting/prepayment.rb} +34 -22
  237. data/lib/xero-ruby/models/{prepayments.rb → accounting/prepayments.rb} +8 -7
  238. data/lib/xero-ruby/models/{purchase.rb → accounting/purchase.rb} +10 -10
  239. data/lib/xero-ruby/models/{purchase_order.rb → accounting/purchase_order.rb} +42 -32
  240. data/lib/xero-ruby/models/{purchase_orders.rb → accounting/purchase_orders.rb} +8 -7
  241. data/lib/xero-ruby/models/{quote.rb → accounting/quote.rb} +54 -28
  242. data/lib/xero-ruby/models/{quote_line_amount_types.rb → accounting/quote_line_amount_types.rb} +3 -3
  243. data/lib/xero-ruby/models/{quote_status_codes.rb → accounting/quote_status_codes.rb} +3 -3
  244. data/lib/xero-ruby/models/{quotes.rb → accounting/quotes.rb} +8 -7
  245. data/lib/xero-ruby/models/{receipt.rb → accounting/receipt.rb} +31 -20
  246. data/lib/xero-ruby/models/{receipts.rb → accounting/receipts.rb} +8 -7
  247. data/lib/xero-ruby/models/{repeating_invoice.rb → accounting/repeating_invoice.rb} +29 -18
  248. data/lib/xero-ruby/models/{repeating_invoices.rb → accounting/repeating_invoices.rb} +8 -7
  249. data/lib/xero-ruby/models/{report.rb → accounting/report.rb} +14 -12
  250. data/lib/xero-ruby/models/{report_attribute.rb → accounting/report_attribute.rb} +9 -7
  251. data/lib/xero-ruby/models/{report_cell.rb → accounting/report_cell.rb} +9 -7
  252. data/lib/xero-ruby/models/{report_fields.rb → accounting/report_fields.rb} +10 -7
  253. data/lib/xero-ruby/models/{report_row.rb → accounting/report_row.rb} +10 -7
  254. data/lib/xero-ruby/models/{report_rows.rb → accounting/report_rows.rb} +11 -7
  255. data/lib/xero-ruby/models/{report_with_row.rb → accounting/report_with_row.rb} +15 -13
  256. data/lib/xero-ruby/models/{report_with_rows.rb → accounting/report_with_rows.rb} +8 -7
  257. data/lib/xero-ruby/models/{reports.rb → accounting/reports.rb} +8 -7
  258. data/lib/xero-ruby/models/{request_empty.rb → accounting/request_empty.rb} +7 -7
  259. data/lib/xero-ruby/models/{row_type.rb → accounting/row_type.rb} +3 -3
  260. data/lib/xero-ruby/models/{sales_tracking_category.rb → accounting/sales_tracking_category.rb} +8 -8
  261. data/lib/xero-ruby/models/{schedule.rb → accounting/schedule.rb} +23 -15
  262. data/lib/xero-ruby/models/{tax_component.rb → accounting/tax_component.rb} +10 -10
  263. data/lib/xero-ruby/models/{tax_rate.rb → accounting/tax_rate.rb} +98 -20
  264. data/lib/xero-ruby/models/{tax_rates.rb → accounting/tax_rates.rb} +8 -7
  265. data/lib/xero-ruby/models/{tax_type.rb → accounting/tax_type.rb} +7 -3
  266. data/lib/xero-ruby/models/{ten_nintey_nine_contact.rb → accounting/ten_nintey_nine_contact.rb} +28 -28
  267. data/lib/xero-ruby/models/{time_zone.rb → accounting/time_zone.rb} +3 -3
  268. data/lib/xero-ruby/models/{tracking_categories.rb → accounting/tracking_categories.rb} +8 -7
  269. data/lib/xero-ruby/models/{tracking_category.rb → accounting/tracking_category.rb} +15 -12
  270. data/lib/xero-ruby/models/{tracking_option.rb → accounting/tracking_option.rb} +13 -10
  271. data/lib/xero-ruby/models/{tracking_options.rb → accounting/tracking_options.rb} +8 -7
  272. data/lib/xero-ruby/models/{user.rb → accounting/user.rb} +20 -13
  273. data/lib/xero-ruby/models/{users.rb → accounting/users.rb} +8 -7
  274. data/lib/xero-ruby/models/{validation_error.rb → accounting/validation_error.rb} +7 -7
  275. data/lib/xero-ruby/models/assets/asset.rb +349 -0
  276. data/lib/xero-ruby/models/assets/asset_status.rb +38 -0
  277. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +38 -0
  278. data/lib/xero-ruby/models/assets/asset_type.rb +274 -0
  279. data/lib/xero-ruby/models/assets/assets.rb +216 -0
  280. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +264 -0
  281. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +343 -0
  282. data/lib/xero-ruby/models/assets/error.rb +248 -0
  283. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +254 -0
  284. data/lib/xero-ruby/models/assets/pagination.rb +234 -0
  285. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +244 -0
  286. data/lib/xero-ruby/models/assets/setting.rb +274 -0
  287. data/lib/xero-ruby/models/projects/amount.rb +214 -0
  288. data/lib/xero-ruby/models/projects/charge_type.rb +38 -0
  289. data/lib/xero-ruby/models/projects/currency_code.rb +199 -0
  290. data/lib/xero-ruby/models/projects/error.rb +214 -0
  291. data/lib/xero-ruby/models/{allocation.rb → projects/pagination.rb} +44 -48
  292. data/lib/xero-ruby/models/projects/project.rb +419 -0
  293. data/lib/xero-ruby/models/projects/project_create_or_update.rb +239 -0
  294. data/lib/xero-ruby/models/projects/project_patch.rb +209 -0
  295. data/lib/xero-ruby/models/projects/project_status.rb +37 -0
  296. data/lib/xero-ruby/models/projects/project_user.rb +224 -0
  297. data/lib/xero-ruby/models/projects/project_users.rb +216 -0
  298. data/lib/xero-ruby/models/projects/projects.rb +216 -0
  299. data/lib/xero-ruby/models/projects/task.rb +381 -0
  300. data/lib/xero-ruby/models/projects/task_create_or_update.rb +249 -0
  301. data/lib/xero-ruby/models/projects/tasks.rb +216 -0
  302. data/lib/xero-ruby/models/projects/time_entries.rb +216 -0
  303. data/lib/xero-ruby/models/projects/time_entry.rb +320 -0
  304. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +264 -0
  305. data/lib/xero-ruby/version.rb +3 -3
  306. data/spec/{api → accounting/api}/accounting_api_spec.rb +44 -20
  307. data/spec/{models → accounting/models}/account_spec.rb +5 -5
  308. data/spec/{models → accounting/models}/account_type_spec.rb +5 -5
  309. data/spec/{models → accounting/models}/accounts_payable_spec.rb +5 -5
  310. data/spec/{models → accounting/models}/accounts_receivable_spec.rb +5 -5
  311. data/spec/{models → accounting/models}/accounts_spec.rb +5 -5
  312. data/spec/{models → accounting/models}/address_spec.rb +5 -5
  313. data/spec/{models → accounting/models}/allocation_spec.rb +5 -5
  314. data/spec/{models → accounting/models}/allocations_spec.rb +5 -5
  315. data/spec/{models → accounting/models}/attachment_spec.rb +5 -5
  316. data/spec/{models → accounting/models}/attachments_spec.rb +5 -5
  317. data/spec/{models → accounting/models}/balances_spec.rb +5 -5
  318. data/spec/{models → accounting/models}/bank_transaction_spec.rb +5 -5
  319. data/spec/{models → accounting/models}/bank_transactions_spec.rb +5 -5
  320. data/spec/{models → accounting/models}/bank_transfer_spec.rb +5 -5
  321. data/spec/{models → accounting/models}/bank_transfers_spec.rb +5 -5
  322. data/spec/{models → accounting/models}/batch_payment_details_spec.rb +5 -5
  323. data/spec/{models → accounting/models}/batch_payment_spec.rb +5 -5
  324. data/spec/{models → accounting/models}/batch_payments_spec.rb +5 -5
  325. data/spec/{models → accounting/models}/bill_spec.rb +5 -5
  326. data/spec/{models → accounting/models}/branding_theme_spec.rb +5 -5
  327. data/spec/{models → accounting/models}/branding_themes_spec.rb +5 -5
  328. data/spec/{models → accounting/models}/cis_org_setting_spec.rb +5 -5
  329. data/spec/{models → accounting/models}/cis_setting_spec.rb +5 -5
  330. data/spec/{models → accounting/models}/cis_settings_spec.rb +5 -5
  331. data/spec/{models → accounting/models}/contact_group_spec.rb +5 -5
  332. data/spec/{models → accounting/models}/contact_groups_spec.rb +5 -5
  333. data/spec/{models → accounting/models}/contact_person_spec.rb +5 -5
  334. data/spec/{models → accounting/models}/contact_spec.rb +5 -5
  335. data/spec/{models → accounting/models}/contacts_spec.rb +5 -5
  336. data/spec/{models → accounting/models}/country_code_spec.rb +5 -5
  337. data/spec/{models → accounting/models}/credit_note_spec.rb +11 -5
  338. data/spec/{models → accounting/models}/credit_notes_spec.rb +5 -5
  339. data/spec/{models → accounting/models}/currencies_spec.rb +5 -5
  340. data/spec/{models → accounting/models}/currency_code_spec.rb +5 -5
  341. data/spec/{models → accounting/models}/currency_spec.rb +5 -5
  342. data/spec/{models → accounting/models}/element_spec.rb +5 -5
  343. data/spec/{models → accounting/models}/employee_spec.rb +5 -5
  344. data/spec/{models → accounting/models}/employees_spec.rb +5 -5
  345. data/spec/{models → accounting/models}/error_spec.rb +5 -5
  346. data/spec/{models → accounting/models}/expense_claim_spec.rb +5 -5
  347. data/spec/{models → accounting/models}/expense_claims_spec.rb +5 -5
  348. data/spec/{models → accounting/models}/external_link_spec.rb +5 -5
  349. data/spec/{models → accounting/models}/history_record_spec.rb +5 -5
  350. data/spec/{models → accounting/models}/history_records_spec.rb +5 -5
  351. data/spec/{models → accounting/models}/invoice_reminder_spec.rb +5 -5
  352. data/spec/{models → accounting/models}/invoice_reminders_spec.rb +5 -5
  353. data/spec/{models → accounting/models}/invoice_spec.rb +6 -6
  354. data/spec/{models → accounting/models}/invoices_spec.rb +5 -5
  355. data/spec/{models → accounting/models}/item_spec.rb +5 -5
  356. data/spec/{models → accounting/models}/items_spec.rb +5 -5
  357. data/spec/{models → accounting/models}/journal_line_spec.rb +5 -5
  358. data/spec/{models → accounting/models}/journal_spec.rb +5 -5
  359. data/spec/{models → accounting/models}/journals_spec.rb +5 -5
  360. data/spec/{models → accounting/models}/line_amount_types_spec.rb +5 -5
  361. data/spec/{models → accounting/models}/line_item_spec.rb +5 -5
  362. data/spec/{models → accounting/models}/line_item_tracking_spec.rb +5 -5
  363. data/spec/{models → accounting/models}/linked_transaction_spec.rb +5 -5
  364. data/spec/{models → accounting/models}/linked_transactions_spec.rb +5 -5
  365. data/spec/{models → accounting/models}/manual_journal_line_spec.rb +5 -5
  366. data/spec/{models → accounting/models}/manual_journal_spec.rb +5 -5
  367. data/spec/{models → accounting/models}/manual_journals_spec.rb +5 -5
  368. data/spec/{models → accounting/models}/online_invoice_spec.rb +5 -5
  369. data/spec/{models → accounting/models}/online_invoices_spec.rb +5 -5
  370. data/spec/{models → accounting/models}/organisation_spec.rb +5 -5
  371. data/spec/{models → accounting/models}/organisations_spec.rb +5 -5
  372. data/spec/{models → accounting/models}/overpayment_spec.rb +5 -5
  373. data/spec/{models → accounting/models}/overpayments_spec.rb +5 -5
  374. data/spec/{models → accounting/models}/payment_delete_spec.rb +5 -5
  375. data/spec/{models → accounting/models}/payment_service_spec.rb +5 -5
  376. data/spec/{models → accounting/models}/payment_services_spec.rb +5 -5
  377. data/spec/{models → accounting/models}/payment_spec.rb +11 -5
  378. data/spec/{models → accounting/models}/payment_term_spec.rb +5 -5
  379. data/spec/{models → accounting/models}/payment_term_type_spec.rb +5 -5
  380. data/spec/{models → accounting/models}/payments_spec.rb +5 -5
  381. data/spec/{models → accounting/models}/phone_spec.rb +5 -5
  382. data/spec/{models → accounting/models}/prepayment_spec.rb +5 -5
  383. data/spec/{models → accounting/models}/prepayments_spec.rb +5 -5
  384. data/spec/{models → accounting/models}/purchase_order_spec.rb +5 -5
  385. data/spec/{models → accounting/models}/purchase_orders_spec.rb +5 -5
  386. data/spec/{models → accounting/models}/purchase_spec.rb +5 -5
  387. data/spec/{models → accounting/models}/quote_line_amount_types_spec.rb +5 -5
  388. data/spec/{models → accounting/models}/quote_spec.rb +5 -5
  389. data/spec/{models → accounting/models}/quote_status_codes_spec.rb +5 -5
  390. data/spec/{models → accounting/models}/quotes_spec.rb +5 -5
  391. data/spec/{models → accounting/models}/receipt_spec.rb +5 -5
  392. data/spec/{models → accounting/models}/receipts_spec.rb +5 -5
  393. data/spec/{models → accounting/models}/repeating_invoice_spec.rb +5 -5
  394. data/spec/{models → accounting/models}/repeating_invoices_spec.rb +5 -5
  395. data/spec/{models → accounting/models}/report_attribute_spec.rb +5 -5
  396. data/spec/{models → accounting/models}/report_cell_spec.rb +5 -5
  397. data/spec/{models → accounting/models}/report_fields_spec.rb +5 -5
  398. data/spec/{models → accounting/models}/report_row_spec.rb +5 -5
  399. data/spec/{models → accounting/models}/report_rows_spec.rb +5 -5
  400. data/spec/{models → accounting/models}/report_spec.rb +5 -5
  401. data/spec/{models → accounting/models}/report_with_row_spec.rb +5 -5
  402. data/spec/{models → accounting/models}/report_with_rows_spec.rb +5 -5
  403. data/spec/{models → accounting/models}/reports_spec.rb +5 -5
  404. data/spec/{models → accounting/models}/request_empty_spec.rb +5 -5
  405. data/spec/{models → accounting/models}/row_type_spec.rb +5 -5
  406. data/spec/{models → accounting/models}/sales_tracking_category_spec.rb +5 -5
  407. data/spec/{models → accounting/models}/schedule_spec.rb +5 -5
  408. data/spec/{models → accounting/models}/tax_component_spec.rb +5 -5
  409. data/spec/{models → accounting/models}/tax_rate_spec.rb +6 -6
  410. data/spec/{models → accounting/models}/tax_rates_spec.rb +5 -5
  411. data/spec/{models → accounting/models}/tax_type_spec.rb +5 -5
  412. data/spec/{models → accounting/models}/ten_nintey_nine_contact_spec.rb +5 -5
  413. data/spec/{models → accounting/models}/time_zone_spec.rb +5 -5
  414. data/spec/{models → accounting/models}/tracking_categories_spec.rb +5 -5
  415. data/spec/{models → accounting/models}/tracking_category_spec.rb +5 -5
  416. data/spec/{models → accounting/models}/tracking_option_spec.rb +5 -5
  417. data/spec/{models → accounting/models}/tracking_options_spec.rb +5 -5
  418. data/spec/{models → accounting/models}/user_spec.rb +5 -5
  419. data/spec/{models → accounting/models}/users_spec.rb +5 -5
  420. data/spec/{models → accounting/models}/validation_error_spec.rb +5 -5
  421. data/spec/api_client_spec.rb +5 -43
  422. data/spec/assets/api/asset_api_spec.rb +116 -0
  423. data/spec/assets/models/asset_spec.rb +125 -0
  424. data/spec/assets/models/asset_status_query_param_spec.rb +35 -0
  425. data/spec/assets/models/asset_status_spec.rb +35 -0
  426. data/spec/assets/models/asset_type_spec.rb +77 -0
  427. data/spec/assets/models/assets_spec.rb +47 -0
  428. data/spec/assets/models/book_depreciation_detail_spec.rb +77 -0
  429. data/spec/assets/models/book_depreciation_setting_spec.rb +95 -0
  430. data/spec/assets/models/error_spec.rb +65 -0
  431. data/spec/assets/models/field_validation_errors_element_spec.rb +71 -0
  432. data/spec/assets/models/pagination_spec.rb +59 -0
  433. data/spec/assets/models/resource_validation_errors_element_spec.rb +65 -0
  434. data/spec/assets/models/setting_spec.rb +83 -0
  435. data/spec/configuration_spec.rb +7 -23
  436. data/spec/projects/api/project_api_spec.rb +229 -0
  437. data/spec/projects/models/amount_spec.rb +47 -0
  438. data/spec/projects/models/charge_type_spec.rb +35 -0
  439. data/spec/projects/models/currency_code_spec.rb +35 -0
  440. data/spec/projects/models/error_spec.rb +47 -0
  441. data/spec/projects/models/pagination_spec.rb +59 -0
  442. data/spec/projects/models/project_create_or_update_spec.rb +59 -0
  443. data/spec/projects/models/project_patch_spec.rb +41 -0
  444. data/spec/projects/models/project_spec.rb +167 -0
  445. data/spec/projects/models/project_status_spec.rb +35 -0
  446. data/spec/projects/models/project_user_spec.rb +53 -0
  447. data/spec/projects/models/project_users_spec.rb +47 -0
  448. data/spec/projects/models/projects_spec.rb +47 -0
  449. data/spec/projects/models/task_create_or_update_spec.rb +59 -0
  450. data/spec/projects/models/task_spec.rb +129 -0
  451. data/spec/projects/models/tasks_spec.rb +47 -0
  452. data/spec/projects/models/time_entries_spec.rb +47 -0
  453. data/spec/projects/models/time_entry_create_or_update_spec.rb +65 -0
  454. data/spec/projects/models/time_entry_spec.rb +93 -0
  455. data/spec/spec_helper.rb +2 -2
  456. data/xero-ruby.gem +0 -0
  457. data/xero-ruby.gemspec +4 -4
  458. metadata +611 -482
  459. data/docs/Allocation.md +0 -21
  460. data/lib/.DS_Store +0 -0
  461. data/pkg/xero-ruby-0.1.3.gem +0 -0
  462. data/pkg/xero-ruby-0.2.2.gem +0 -0
  463. data/pkg/xero-ruby-0.2.3.gem +0 -0
@@ -3,10 +3,10 @@
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.0.6
6
+ The version of the OpenAPI document: 2.2.2
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.2.0
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -16,7 +16,7 @@ module XeroRuby
16
16
  class AccountingApi
17
17
  attr_accessor :api_client
18
18
 
19
- def initialize(api_client = ApiClient.default)
19
+ def initialize(api_client = ApiClient.new)
20
20
  @api_client = api_client
21
21
  end
22
22
  # Allows you to create a new chart of accounts
@@ -1292,12 +1292,12 @@ module XeroRuby
1292
1292
  # @param xero_tenant_id [String] Xero identifier for Tenant
1293
1293
  # @param credit_note_id [String] Unique identifier for a Credit Note
1294
1294
  # @param file_name [String] Name of the file you are attaching to Credit Note
1295
- # @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
1296
1295
  # @param body [String] Byte array of file in body of request
1297
1296
  # @param [Hash] opts the optional parameters
1297
+ # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
1298
1298
  # @return [Attachments]
1299
- def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, include_online, body, opts = {})
1300
- data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, include_online, body, opts)
1299
+ def create_credit_note_attachment_by_file_name(xero_tenant_id, credit_note_id, file_name, body, opts = {})
1300
+ data, _status_code, _headers = create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts)
1301
1301
  data
1302
1302
  end
1303
1303
 
@@ -1305,11 +1305,11 @@ module XeroRuby
1305
1305
  # @param xero_tenant_id [String] Xero identifier for Tenant
1306
1306
  # @param credit_note_id [String] Unique identifier for a Credit Note
1307
1307
  # @param file_name [String] Name of the file you are attaching to Credit Note
1308
- # @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
1309
1308
  # @param body [String] Byte array of file in body of request
1310
1309
  # @param [Hash] opts the optional parameters
1310
+ # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
1311
1311
  # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
1312
- def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, include_online, body, opts = {})
1312
+ def create_credit_note_attachment_by_file_name_with_http_info(xero_tenant_id, credit_note_id, file_name, body, opts = {})
1313
1313
  if @api_client.config.debugging
1314
1314
  @api_client.config.logger.debug 'Calling API: AccountingApi.create_credit_note_attachment_by_file_name ...'
1315
1315
  end
@@ -1325,19 +1325,16 @@ module XeroRuby
1325
1325
  if @api_client.config.client_side_validation && file_name.nil?
1326
1326
  fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_credit_note_attachment_by_file_name"
1327
1327
  end
1328
- # verify the required parameter 'include_online' is set
1329
- if @api_client.config.client_side_validation && include_online.nil?
1330
- fail ArgumentError, "Missing the required parameter 'include_online' when calling AccountingApi.create_credit_note_attachment_by_file_name"
1331
- end
1332
1328
  # verify the required parameter 'body' is set
1333
1329
  if @api_client.config.client_side_validation && body.nil?
1334
1330
  fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_credit_note_attachment_by_file_name"
1335
1331
  end
1336
1332
  # resource path
1337
- local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s).sub('{' + 'IncludeOnline' + '}', include_online.to_s)
1333
+ local_var_path = '/CreditNotes/{CreditNoteID}/Attachments/{FileName}'.sub('{' + 'CreditNoteID' + '}', credit_note_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
1338
1334
 
1339
1335
  # query parameters
1340
1336
  query_params = opts[:query_params] || {}
1337
+ query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil?
1341
1338
 
1342
1339
  # header parameters
1343
1340
  header_params = opts[:header_params] || {}
@@ -1812,12 +1809,12 @@ module XeroRuby
1812
1809
  # @param xero_tenant_id [String] Xero identifier for Tenant
1813
1810
  # @param invoice_id [String] Unique identifier for an Invoice
1814
1811
  # @param file_name [String] Name of the file you are attaching
1815
- # @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
1816
1812
  # @param body [String] Byte array of file in body of request
1817
1813
  # @param [Hash] opts the optional parameters
1814
+ # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice (default to false)
1818
1815
  # @return [Attachments]
1819
- def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, include_online, body, opts = {})
1820
- data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, include_online, body, opts)
1816
+ def create_invoice_attachment_by_file_name(xero_tenant_id, invoice_id, file_name, body, opts = {})
1817
+ data, _status_code, _headers = create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts)
1821
1818
  data
1822
1819
  end
1823
1820
 
@@ -1825,11 +1822,11 @@ module XeroRuby
1825
1822
  # @param xero_tenant_id [String] Xero identifier for Tenant
1826
1823
  # @param invoice_id [String] Unique identifier for an Invoice
1827
1824
  # @param file_name [String] Name of the file you are attaching
1828
- # @param include_online [Boolean] Set an attachment to be included with the invoice when viewed online (through Xero)
1829
1825
  # @param body [String] Byte array of file in body of request
1830
1826
  # @param [Hash] opts the optional parameters
1827
+ # @option opts [Boolean] :include_online Allows an attachment to be seen by the end customer within their online invoice
1831
1828
  # @return [Array<(Attachments, Integer, Hash)>] Attachments data, response status code and response headers
1832
- def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, include_online, body, opts = {})
1829
+ def create_invoice_attachment_by_file_name_with_http_info(xero_tenant_id, invoice_id, file_name, body, opts = {})
1833
1830
  if @api_client.config.debugging
1834
1831
  @api_client.config.logger.debug 'Calling API: AccountingApi.create_invoice_attachment_by_file_name ...'
1835
1832
  end
@@ -1845,19 +1842,16 @@ module XeroRuby
1845
1842
  if @api_client.config.client_side_validation && file_name.nil?
1846
1843
  fail ArgumentError, "Missing the required parameter 'file_name' when calling AccountingApi.create_invoice_attachment_by_file_name"
1847
1844
  end
1848
- # verify the required parameter 'include_online' is set
1849
- if @api_client.config.client_side_validation && include_online.nil?
1850
- fail ArgumentError, "Missing the required parameter 'include_online' when calling AccountingApi.create_invoice_attachment_by_file_name"
1851
- end
1852
1845
  # verify the required parameter 'body' is set
1853
1846
  if @api_client.config.client_side_validation && body.nil?
1854
1847
  fail ArgumentError, "Missing the required parameter 'body' when calling AccountingApi.create_invoice_attachment_by_file_name"
1855
1848
  end
1856
1849
  # resource path
1857
- local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s).sub('{' + 'IncludeOnline' + '}', include_online.to_s)
1850
+ local_var_path = '/Invoices/{InvoiceID}/Attachments/{FileName}'.sub('{' + 'InvoiceID' + '}', invoice_id.to_s).sub('{' + 'FileName' + '}', file_name.to_s)
1858
1851
 
1859
1852
  # query parameters
1860
1853
  query_params = opts[:query_params] || {}
1854
+ query_params[:'IncludeOnline'] = opts[:'include_online'] if !opts[:'include_online'].nil?
1861
1855
 
1862
1856
  # header parameters
1863
1857
  header_params = opts[:header_params] || {}
@@ -2787,6 +2781,7 @@ module XeroRuby
2787
2781
  # @param xero_tenant_id [String] Xero identifier for Tenant
2788
2782
  # @param payments [Payments] Payments array with Payment object in body of request
2789
2783
  # @param [Hash] opts the optional parameters
2784
+ # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors (default to false)
2790
2785
  # @return [Payments]
2791
2786
  def create_payments(xero_tenant_id, payments, opts = {})
2792
2787
  data, _status_code, _headers = create_payments_with_http_info(xero_tenant_id, payments, opts)
@@ -2797,6 +2792,7 @@ module XeroRuby
2797
2792
  # @param xero_tenant_id [String] Xero identifier for Tenant
2798
2793
  # @param payments [Payments] Payments array with Payment object in body of request
2799
2794
  # @param [Hash] opts the optional parameters
2795
+ # @option opts [Boolean] :summarize_errors If false return 200 OK and mix of successfully created obejcts and any with validation errors
2800
2796
  # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
2801
2797
  def create_payments_with_http_info(xero_tenant_id, payments, opts = {})
2802
2798
  if @api_client.config.debugging
@@ -2815,6 +2811,7 @@ module XeroRuby
2815
2811
 
2816
2812
  # query parameters
2817
2813
  query_params = opts[:query_params] || {}
2814
+ query_params[:'summarizeErrors'] = opts[:'summarize_errors'] if !opts[:'summarize_errors'].nil?
2818
2815
 
2819
2816
  # header parameters
2820
2817
  header_params = opts[:header_params] || {}
@@ -6173,7 +6170,7 @@ module XeroRuby
6173
6170
  return data, status_code, headers
6174
6171
  end
6175
6172
 
6176
- # Allows you to retrieve, add and update contacts in a Xero organisation
6173
+ # Allows you to retrieve a single contacts in a Xero organisation
6177
6174
  # @param xero_tenant_id [String] Xero identifier for Tenant
6178
6175
  # @param contact_id [String] Unique identifier for a Contact
6179
6176
  # @param [Hash] opts the optional parameters
@@ -6183,7 +6180,7 @@ module XeroRuby
6183
6180
  data
6184
6181
  end
6185
6182
 
6186
- # Allows you to retrieve, add and update contacts in a Xero organisation
6183
+ # Allows you to retrieve a single contacts in a Xero organisation
6187
6184
  # @param xero_tenant_id [String] Xero identifier for Tenant
6188
6185
  # @param contact_id [String] Unique identifier for a Contact
6189
6186
  # @param [Hash] opts the optional parameters
@@ -6467,6 +6464,73 @@ module XeroRuby
6467
6464
  return data, status_code, headers
6468
6465
  end
6469
6466
 
6467
+ # Allows you to retrieve a single contact by Contact Number in a Xero organisation
6468
+ # @param xero_tenant_id [String] Xero identifier for Tenant
6469
+ # @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length &#x3D; 50).
6470
+ # @param [Hash] opts the optional parameters
6471
+ # @return [Contacts]
6472
+ def get_contact_by_contact_number(xero_tenant_id, contact_number, opts = {})
6473
+ data, _status_code, _headers = get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts)
6474
+ data
6475
+ end
6476
+
6477
+ # Allows you to retrieve a single contact by Contact Number in a Xero organisation
6478
+ # @param xero_tenant_id [String] Xero identifier for Tenant
6479
+ # @param contact_number [String] This field is read only on the Xero contact screen, used to identify contacts in external systems (max length &#x3D; 50).
6480
+ # @param [Hash] opts the optional parameters
6481
+ # @return [Array<(Contacts, Integer, Hash)>] Contacts data, response status code and response headers
6482
+ def get_contact_by_contact_number_with_http_info(xero_tenant_id, contact_number, opts = {})
6483
+ if @api_client.config.debugging
6484
+ @api_client.config.logger.debug 'Calling API: AccountingApi.get_contact_by_contact_number ...'
6485
+ end
6486
+ # verify the required parameter 'xero_tenant_id' is set
6487
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
6488
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_contact_by_contact_number"
6489
+ end
6490
+ # verify the required parameter 'contact_number' is set
6491
+ if @api_client.config.client_side_validation && contact_number.nil?
6492
+ fail ArgumentError, "Missing the required parameter 'contact_number' when calling AccountingApi.get_contact_by_contact_number"
6493
+ end
6494
+ # resource path
6495
+ local_var_path = '/Contacts/{ContactNumber}'.sub('{' + 'ContactNumber' + '}', contact_number.to_s)
6496
+
6497
+ # query parameters
6498
+ query_params = opts[:query_params] || {}
6499
+
6500
+ # header parameters
6501
+ header_params = opts[:header_params] || {}
6502
+ # HTTP header 'Accept' (if needed)
6503
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
6504
+ header_params[:'xero-tenant-id'] = xero_tenant_id
6505
+
6506
+ # form parameters
6507
+ form_params = opts[:form_params] || {}
6508
+
6509
+ # http body (model)
6510
+ post_body = opts[:body]
6511
+
6512
+ # return_type
6513
+ return_type = opts[:return_type] || 'Contacts'
6514
+
6515
+ # auth_names
6516
+ auth_names = opts[:auth_names] || ['OAuth2']
6517
+
6518
+ new_options = opts.merge(
6519
+ :header_params => header_params,
6520
+ :query_params => query_params,
6521
+ :form_params => form_params,
6522
+ :body => post_body,
6523
+ :auth_names => auth_names,
6524
+ :return_type => return_type
6525
+ )
6526
+
6527
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
6528
+ if @api_client.config.debugging
6529
+ @api_client.config.logger.debug "API called: AccountingApi#get_contact_by_contact_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
6530
+ end
6531
+ return data, status_code, headers
6532
+ end
6533
+
6470
6534
  # Allows you to retrieve CISSettings for a contact in a Xero organisation
6471
6535
  # @param xero_tenant_id [String] Xero identifier for Tenant
6472
6536
  # @param contact_id [String] Unique identifier for a Contact
@@ -6735,7 +6799,7 @@ module XeroRuby
6735
6799
  return data, status_code, headers
6736
6800
  end
6737
6801
 
6738
- # Allows you to retrieve, add and update contacts in a Xero organisation
6802
+ # Allows you to retrieve all contacts in a Xero organisation
6739
6803
  # @param xero_tenant_id [String] Xero identifier for Tenant
6740
6804
  # @param [Hash] opts the optional parameters
6741
6805
  # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
@@ -6750,7 +6814,7 @@ module XeroRuby
6750
6814
  data
6751
6815
  end
6752
6816
 
6753
- # Allows you to retrieve, add and update contacts in a Xero organisation
6817
+ # Allows you to retrieve all contacts in a Xero organisation
6754
6818
  # @param xero_tenant_id [String] Xero identifier for Tenant
6755
6819
  # @param [Hash] opts the optional parameters
6756
6820
  # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
@@ -9781,6 +9845,7 @@ module XeroRuby
9781
9845
  # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
9782
9846
  # @option opts [String] :where Filter by an any element
9783
9847
  # @option opts [String] :order Order by an any element
9848
+ # @option opts [Integer] :page Up to 100 payments will be returned in a single API call
9784
9849
  # @return [Payments]
9785
9850
  def get_payments(xero_tenant_id, opts = {})
9786
9851
  data, _status_code, _headers = get_payments_with_http_info(xero_tenant_id, opts)
@@ -9793,6 +9858,7 @@ module XeroRuby
9793
9858
  # @option opts [DateTime] :if_modified_since Only records created or modified since this timestamp will be returned
9794
9859
  # @option opts [String] :where Filter by an any element
9795
9860
  # @option opts [String] :order Order by an any element
9861
+ # @option opts [Integer] :page Up to 100 payments will be returned in a single API call
9796
9862
  # @return [Array<(Payments, Integer, Hash)>] Payments data, response status code and response headers
9797
9863
  def get_payments_with_http_info(xero_tenant_id, opts = {})
9798
9864
  if @api_client.config.debugging
@@ -9809,6 +9875,7 @@ module XeroRuby
9809
9875
  query_params = opts[:query_params] || {}
9810
9876
  query_params[:'where'] = opts[:'where'] if !opts[:'where'].nil?
9811
9877
  query_params[:'order'] = opts[:'order'] if !opts[:'order'].nil?
9878
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
9812
9879
 
9813
9880
  # header parameters
9814
9881
  header_params = opts[:header_params] || {}
@@ -10122,6 +10189,73 @@ module XeroRuby
10122
10189
  return data, status_code, headers
10123
10190
  end
10124
10191
 
10192
+ # Allows you to retrieve purchase orders as PDF files
10193
+ # @param xero_tenant_id [String] Xero identifier for Tenant
10194
+ # @param purchase_order_id [String] Unique identifier for an Purchase Order
10195
+ # @param [Hash] opts the optional parameters
10196
+ # @return [File]
10197
+ def get_purchase_order_as_pdf(xero_tenant_id, purchase_order_id, opts = {})
10198
+ data, _status_code, _headers = get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts)
10199
+ data
10200
+ end
10201
+
10202
+ # Allows you to retrieve purchase orders as PDF files
10203
+ # @param xero_tenant_id [String] Xero identifier for Tenant
10204
+ # @param purchase_order_id [String] Unique identifier for an Purchase Order
10205
+ # @param [Hash] opts the optional parameters
10206
+ # @return [Array<(File, Integer, Hash)>] File data, response status code and response headers
10207
+ def get_purchase_order_as_pdf_with_http_info(xero_tenant_id, purchase_order_id, opts = {})
10208
+ if @api_client.config.debugging
10209
+ @api_client.config.logger.debug 'Calling API: AccountingApi.get_purchase_order_as_pdf ...'
10210
+ end
10211
+ # verify the required parameter 'xero_tenant_id' is set
10212
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
10213
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.get_purchase_order_as_pdf"
10214
+ end
10215
+ # verify the required parameter 'purchase_order_id' is set
10216
+ if @api_client.config.client_side_validation && purchase_order_id.nil?
10217
+ fail ArgumentError, "Missing the required parameter 'purchase_order_id' when calling AccountingApi.get_purchase_order_as_pdf"
10218
+ end
10219
+ # resource path
10220
+ local_var_path = '/PurchaseOrders/{PurchaseOrderID}'.sub('{' + 'PurchaseOrderID' + '}', purchase_order_id.to_s)
10221
+
10222
+ # query parameters
10223
+ query_params = opts[:query_params] || {}
10224
+
10225
+ # header parameters
10226
+ header_params = opts[:header_params] || {}
10227
+ # HTTP header 'Accept' (if needed)
10228
+ header_params['Accept'] = @api_client.select_header_accept(['application/pdf'])
10229
+ header_params[:'xero-tenant-id'] = xero_tenant_id
10230
+
10231
+ # form parameters
10232
+ form_params = opts[:form_params] || {}
10233
+
10234
+ # http body (model)
10235
+ post_body = opts[:body]
10236
+
10237
+ # return_type
10238
+ return_type = opts[:return_type] || 'File'
10239
+
10240
+ # auth_names
10241
+ auth_names = opts[:auth_names] || ['OAuth2']
10242
+
10243
+ new_options = opts.merge(
10244
+ :header_params => header_params,
10245
+ :query_params => query_params,
10246
+ :form_params => form_params,
10247
+ :body => post_body,
10248
+ :auth_names => auth_names,
10249
+ :return_type => return_type
10250
+ )
10251
+
10252
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
10253
+ if @api_client.config.debugging
10254
+ @api_client.config.logger.debug "API called: AccountingApi#get_purchase_order_as_pdf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
10255
+ end
10256
+ return data, status_code, headers
10257
+ end
10258
+
10125
10259
  # Allows you to retrieve a specified purchase orders
10126
10260
  # @param xero_tenant_id [String] Xero identifier for Tenant
10127
10261
  # @param purchase_order_number [String] Unique identifier for a PurchaseOrder
@@ -13015,26 +13149,20 @@ module XeroRuby
13015
13149
  return data, status_code, headers
13016
13150
  end
13017
13151
 
13018
- # Allows you to update a single spend or receive money transaction
13019
13152
  # @param xero_tenant_id [String] Xero identifier for Tenant
13020
- # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
13021
13153
  # @param bank_transactions [BankTransactions]
13022
13154
  # @param [Hash] opts the optional parameters
13023
- # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
13024
13155
  # @return [BankTransactions]
13025
- def update_bank_transaction(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {})
13026
- data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts)
13156
+ def update_bank_transaction(xero_tenant_id, bank_transactions, opts = {})
13157
+ data, _status_code, _headers = update_bank_transaction_with_http_info(xero_tenant_id, bank_transactions, opts)
13027
13158
  data
13028
13159
  end
13029
13160
 
13030
- # Allows you to update a single spend or receive money transaction
13031
13161
  # @param xero_tenant_id [String] Xero identifier for Tenant
13032
- # @param bank_transaction_id [String] Xero generated unique identifier for a bank transaction
13033
13162
  # @param bank_transactions [BankTransactions]
13034
13163
  # @param [Hash] opts the optional parameters
13035
- # @option opts [Integer] :unitdp e.g. unitdp&#x3D;4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
13036
13164
  # @return [Array<(BankTransactions, Integer, Hash)>] BankTransactions data, response status code and response headers
13037
- def update_bank_transaction_with_http_info(xero_tenant_id, bank_transaction_id, bank_transactions, opts = {})
13165
+ def update_bank_transaction_with_http_info(xero_tenant_id, bank_transactions, opts = {})
13038
13166
  if @api_client.config.debugging
13039
13167
  @api_client.config.logger.debug 'Calling API: AccountingApi.update_bank_transaction ...'
13040
13168
  end
@@ -13042,20 +13170,15 @@ module XeroRuby
13042
13170
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
13043
13171
  fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AccountingApi.update_bank_transaction"
13044
13172
  end
13045
- # verify the required parameter 'bank_transaction_id' is set
13046
- if @api_client.config.client_side_validation && bank_transaction_id.nil?
13047
- fail ArgumentError, "Missing the required parameter 'bank_transaction_id' when calling AccountingApi.update_bank_transaction"
13048
- end
13049
13173
  # verify the required parameter 'bank_transactions' is set
13050
13174
  if @api_client.config.client_side_validation && bank_transactions.nil?
13051
13175
  fail ArgumentError, "Missing the required parameter 'bank_transactions' when calling AccountingApi.update_bank_transaction"
13052
13176
  end
13053
13177
  # resource path
13054
- local_var_path = '/BankTransactions/{BankTransactionID}'.sub('{' + 'BankTransactionID' + '}', bank_transaction_id.to_s)
13178
+ local_var_path = '/BankTransactions/{BankTransactionID}'
13055
13179
 
13056
13180
  # query parameters
13057
13181
  query_params = opts[:query_params] || {}
13058
- query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil?
13059
13182
 
13060
13183
  # header parameters
13061
13184
  header_params = opts[:header_params] || {}
@@ -0,0 +1,452 @@
1
+ =begin
2
+ #Xero Assets API
3
+
4
+ #This is the Xero Assets API
5
+
6
+ The version of the OpenAPI document: 2.2.6
7
+ Contact: api@xero.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module XeroRuby
16
+ class AssetApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.new)
20
+ @api_client = api_client
21
+ end
22
+ # adds a fixed asset
23
+ # Adds an asset to the system
24
+ # @param xero_tenant_id [String] Xero identifier for Tenant
25
+ # @param asset [Asset] Fixed asset you are creating
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [Asset]
28
+ def create_asset(xero_tenant_id, asset, opts = {})
29
+ data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts)
30
+ data
31
+ end
32
+
33
+ # adds a fixed asset
34
+ # Adds an asset to the system
35
+ # @param xero_tenant_id [String] Xero identifier for Tenant
36
+ # @param asset [Asset] Fixed asset you are creating
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
39
+ def create_asset_with_http_info(xero_tenant_id, asset, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: AssetApi.create_asset ...'
42
+ end
43
+ # verify the required parameter 'xero_tenant_id' is set
44
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset"
46
+ end
47
+ # verify the required parameter 'asset' is set
48
+ if @api_client.config.client_side_validation && asset.nil?
49
+ fail ArgumentError, "Missing the required parameter 'asset' when calling AssetApi.create_asset"
50
+ end
51
+ # resource path
52
+ local_var_path = '/Assets'
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
61
+ # HTTP header 'Content-Type'
62
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
63
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:body] || @api_client.object_to_http_body(asset)
70
+
71
+ # return_type
72
+ return_type = opts[:return_type] || 'Asset'
73
+
74
+ # auth_names
75
+ auth_names = opts[:auth_names] || ['OAuth2']
76
+
77
+ new_options = opts.merge(
78
+ :header_params => header_params,
79
+ :query_params => query_params,
80
+ :form_params => form_params,
81
+ :body => post_body,
82
+ :auth_names => auth_names,
83
+ :return_type => return_type
84
+ )
85
+
86
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
87
+ if @api_client.config.debugging
88
+ @api_client.config.logger.debug "API called: AssetApi#create_asset\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
89
+ end
90
+ return data, status_code, headers
91
+ end
92
+
93
+ # adds a fixed asset type
94
+ # Adds an fixed asset type to the system
95
+ # @param xero_tenant_id [String] Xero identifier for Tenant
96
+ # @param [Hash] opts the optional parameters
97
+ # @option opts [AssetType] :asset_type Asset type to add
98
+ # @return [AssetType]
99
+ def create_asset_type(xero_tenant_id, opts = {})
100
+ data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts)
101
+ data
102
+ end
103
+
104
+ # adds a fixed asset type
105
+ # Adds an fixed asset type to the system
106
+ # @param xero_tenant_id [String] Xero identifier for Tenant
107
+ # @param [Hash] opts the optional parameters
108
+ # @option opts [AssetType] :asset_type Asset type to add
109
+ # @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers
110
+ def create_asset_type_with_http_info(xero_tenant_id, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...'
113
+ end
114
+ # verify the required parameter 'xero_tenant_id' is set
115
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
116
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type"
117
+ end
118
+ # resource path
119
+ local_var_path = '/AssetTypes'
120
+
121
+ # query parameters
122
+ query_params = opts[:query_params] || {}
123
+
124
+ # header parameters
125
+ header_params = opts[:header_params] || {}
126
+ # HTTP header 'Accept' (if needed)
127
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
128
+ # HTTP header 'Content-Type'
129
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
130
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type'])
137
+
138
+ # return_type
139
+ return_type = opts[:return_type] || 'AssetType'
140
+
141
+ # auth_names
142
+ auth_names = opts[:auth_names] || ['OAuth2']
143
+
144
+ new_options = opts.merge(
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: AssetApi#create_asset_type\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+
160
+ # retrieves fixed asset by id
161
+ # By passing in the appropriate asset id, you can search for a specific fixed asset in the system
162
+ # @param xero_tenant_id [String] Xero identifier for Tenant
163
+ # @param id [String] fixed asset id for single object
164
+ # @param [Hash] opts the optional parameters
165
+ # @return [Asset]
166
+ def get_asset_by_id(xero_tenant_id, id, opts = {})
167
+ data, _status_code, _headers = get_asset_by_id_with_http_info(xero_tenant_id, id, opts)
168
+ data
169
+ end
170
+
171
+ # retrieves fixed asset by id
172
+ # By passing in the appropriate asset id, you can search for a specific fixed asset in the system
173
+ # @param xero_tenant_id [String] Xero identifier for Tenant
174
+ # @param id [String] fixed asset id for single object
175
+ # @param [Hash] opts the optional parameters
176
+ # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
177
+ def get_asset_by_id_with_http_info(xero_tenant_id, id, opts = {})
178
+ if @api_client.config.debugging
179
+ @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_by_id ...'
180
+ end
181
+ # verify the required parameter 'xero_tenant_id' is set
182
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
183
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_by_id"
184
+ end
185
+ # verify the required parameter 'id' is set
186
+ if @api_client.config.client_side_validation && id.nil?
187
+ fail ArgumentError, "Missing the required parameter 'id' when calling AssetApi.get_asset_by_id"
188
+ end
189
+ # resource path
190
+ local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s)
191
+
192
+ # query parameters
193
+ query_params = opts[:query_params] || {}
194
+
195
+ # header parameters
196
+ header_params = opts[:header_params] || {}
197
+ # HTTP header 'Accept' (if needed)
198
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
199
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
200
+
201
+ # form parameters
202
+ form_params = opts[:form_params] || {}
203
+
204
+ # http body (model)
205
+ post_body = opts[:body]
206
+
207
+ # return_type
208
+ return_type = opts[:return_type] || 'Asset'
209
+
210
+ # auth_names
211
+ auth_names = opts[:auth_names] || ['OAuth2']
212
+
213
+ new_options = opts.merge(
214
+ :header_params => header_params,
215
+ :query_params => query_params,
216
+ :form_params => form_params,
217
+ :body => post_body,
218
+ :auth_names => auth_names,
219
+ :return_type => return_type
220
+ )
221
+
222
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
223
+ if @api_client.config.debugging
224
+ @api_client.config.logger.debug "API called: AssetApi#get_asset_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
225
+ end
226
+ return data, status_code, headers
227
+ end
228
+
229
+ # searches fixed asset settings
230
+ # By passing in the appropriate options, you can search for available fixed asset types in the system
231
+ # @param xero_tenant_id [String] Xero identifier for Tenant
232
+ # @param [Hash] opts the optional parameters
233
+ # @return [Setting]
234
+ def get_asset_settings(xero_tenant_id, opts = {})
235
+ data, _status_code, _headers = get_asset_settings_with_http_info(xero_tenant_id, opts)
236
+ data
237
+ end
238
+
239
+ # searches fixed asset settings
240
+ # By passing in the appropriate options, you can search for available fixed asset types in the system
241
+ # @param xero_tenant_id [String] Xero identifier for Tenant
242
+ # @param [Hash] opts the optional parameters
243
+ # @return [Array<(Setting, Integer, Hash)>] Setting data, response status code and response headers
244
+ def get_asset_settings_with_http_info(xero_tenant_id, opts = {})
245
+ if @api_client.config.debugging
246
+ @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_settings ...'
247
+ end
248
+ # verify the required parameter 'xero_tenant_id' is set
249
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
250
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_settings"
251
+ end
252
+ # resource path
253
+ local_var_path = '/Settings'
254
+
255
+ # query parameters
256
+ query_params = opts[:query_params] || {}
257
+
258
+ # header parameters
259
+ header_params = opts[:header_params] || {}
260
+ # HTTP header 'Accept' (if needed)
261
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
262
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
263
+
264
+ # form parameters
265
+ form_params = opts[:form_params] || {}
266
+
267
+ # http body (model)
268
+ post_body = opts[:body]
269
+
270
+ # return_type
271
+ return_type = opts[:return_type] || 'Setting'
272
+
273
+ # auth_names
274
+ auth_names = opts[:auth_names] || ['OAuth2']
275
+
276
+ new_options = opts.merge(
277
+ :header_params => header_params,
278
+ :query_params => query_params,
279
+ :form_params => form_params,
280
+ :body => post_body,
281
+ :auth_names => auth_names,
282
+ :return_type => return_type
283
+ )
284
+
285
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
286
+ if @api_client.config.debugging
287
+ @api_client.config.logger.debug "API called: AssetApi#get_asset_settings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
288
+ end
289
+ return data, status_code, headers
290
+ end
291
+
292
+ # searches fixed asset types
293
+ # By passing in the appropriate options, you can search for available fixed asset types in the system
294
+ # @param xero_tenant_id [String] Xero identifier for Tenant
295
+ # @param [Hash] opts the optional parameters
296
+ # @return [Array<AssetType>]
297
+ def get_asset_types(xero_tenant_id, opts = {})
298
+ data, _status_code, _headers = get_asset_types_with_http_info(xero_tenant_id, opts)
299
+ data
300
+ end
301
+
302
+ # searches fixed asset types
303
+ # By passing in the appropriate options, you can search for available fixed asset types in the system
304
+ # @param xero_tenant_id [String] Xero identifier for Tenant
305
+ # @param [Hash] opts the optional parameters
306
+ # @return [Array<(Array<AssetType>, Integer, Hash)>] Array<AssetType> data, response status code and response headers
307
+ def get_asset_types_with_http_info(xero_tenant_id, opts = {})
308
+ if @api_client.config.debugging
309
+ @api_client.config.logger.debug 'Calling API: AssetApi.get_asset_types ...'
310
+ end
311
+ # verify the required parameter 'xero_tenant_id' is set
312
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
313
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_asset_types"
314
+ end
315
+ # resource path
316
+ local_var_path = '/AssetTypes'
317
+
318
+ # query parameters
319
+ query_params = opts[:query_params] || {}
320
+
321
+ # header parameters
322
+ header_params = opts[:header_params] || {}
323
+ # HTTP header 'Accept' (if needed)
324
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
325
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
326
+
327
+ # form parameters
328
+ form_params = opts[:form_params] || {}
329
+
330
+ # http body (model)
331
+ post_body = opts[:body]
332
+
333
+ # return_type
334
+ return_type = opts[:return_type] || 'Array<AssetType>'
335
+
336
+ # auth_names
337
+ auth_names = opts[:auth_names] || ['OAuth2']
338
+
339
+ new_options = opts.merge(
340
+ :header_params => header_params,
341
+ :query_params => query_params,
342
+ :form_params => form_params,
343
+ :body => post_body,
344
+ :auth_names => auth_names,
345
+ :return_type => return_type
346
+ )
347
+
348
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
349
+ if @api_client.config.debugging
350
+ @api_client.config.logger.debug "API called: AssetApi#get_asset_types\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
351
+ end
352
+ return data, status_code, headers
353
+ end
354
+
355
+ # searches fixed asset
356
+ # By passing in the appropriate options, you can search for available fixed asset in the system
357
+ # @param xero_tenant_id [String] Xero identifier for Tenant
358
+ # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes
359
+ # @param [Hash] opts the optional parameters
360
+ # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1.
361
+ # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10.
362
+ # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
363
+ # @option opts [String] :sort_direction ASC or DESC
364
+ # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.
365
+ # @return [Assets]
366
+ def get_assets(xero_tenant_id, status, opts = {})
367
+ data, _status_code, _headers = get_assets_with_http_info(xero_tenant_id, status, opts)
368
+ data
369
+ end
370
+
371
+ # searches fixed asset
372
+ # By passing in the appropriate options, you can search for available fixed asset in the system
373
+ # @param xero_tenant_id [String] Xero identifier for Tenant
374
+ # @param status [AssetStatusQueryParam] Required when retrieving a collection of assets. See Asset Status Codes
375
+ # @param [Hash] opts the optional parameters
376
+ # @option opts [Integer] :page Results are paged. This specifies which page of the results to return. The default page is 1.
377
+ # @option opts [Integer] :page_size The number of records returned per page. By default the number of records returned is 10.
378
+ # @option opts [String] :order_by Requests can be ordered by AssetType, AssetName, AssetNumber, PurchaseDate and PurchasePrice. If the asset status is DISPOSED it also allows DisposalDate and DisposalPrice.
379
+ # @option opts [String] :sort_direction ASC or DESC
380
+ # @option opts [String] :filter_by A string that can be used to filter the list to only return assets containing the text. Checks it against the AssetName, AssetNumber, Description and AssetTypeName fields.
381
+ # @return [Array<(Assets, Integer, Hash)>] Assets data, response status code and response headers
382
+ def get_assets_with_http_info(xero_tenant_id, status, opts = {})
383
+ if @api_client.config.debugging
384
+ @api_client.config.logger.debug 'Calling API: AssetApi.get_assets ...'
385
+ end
386
+ # verify the required parameter 'xero_tenant_id' is set
387
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
388
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.get_assets"
389
+ end
390
+ # verify the required parameter 'status' is set
391
+ if @api_client.config.client_side_validation && status.nil?
392
+ fail ArgumentError, "Missing the required parameter 'status' when calling AssetApi.get_assets"
393
+ end
394
+ allowable_values = ["AssetType", "AssetName", "AssetNumber", "PurchaseDate", "PurchasePrice", "DisposalDate", "DisposalPrice"]
395
+ if @api_client.config.client_side_validation && opts[:'order_by'] && !allowable_values.include?(opts[:'order_by'])
396
+ fail ArgumentError, "invalid value for \"order_by\", must be one of #{allowable_values}"
397
+ end
398
+ allowable_values = ["asc", "desc"]
399
+ if @api_client.config.client_side_validation && opts[:'sort_direction'] && !allowable_values.include?(opts[:'sort_direction'])
400
+ fail ArgumentError, "invalid value for \"sort_direction\", must be one of #{allowable_values}"
401
+ end
402
+ allowable_values = ["AssetName", "AssetNumber", "Description", "AssetTypeName"]
403
+ if @api_client.config.client_side_validation && opts[:'filter_by'] && !allowable_values.include?(opts[:'filter_by'])
404
+ fail ArgumentError, "invalid value for \"filter_by\", must be one of #{allowable_values}"
405
+ end
406
+ # resource path
407
+ local_var_path = '/Assets'
408
+
409
+ # query parameters
410
+ query_params = opts[:query_params] || {}
411
+ query_params[:'status'] = status
412
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
413
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
414
+ query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?
415
+ query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
416
+ query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?
417
+
418
+ # header parameters
419
+ header_params = opts[:header_params] || {}
420
+ # HTTP header 'Accept' (if needed)
421
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
422
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
423
+
424
+ # form parameters
425
+ form_params = opts[:form_params] || {}
426
+
427
+ # http body (model)
428
+ post_body = opts[:body]
429
+
430
+ # return_type
431
+ return_type = opts[:return_type] || 'Assets'
432
+
433
+ # auth_names
434
+ auth_names = opts[:auth_names] || ['OAuth2']
435
+
436
+ new_options = opts.merge(
437
+ :header_params => header_params,
438
+ :query_params => query_params,
439
+ :form_params => form_params,
440
+ :body => post_body,
441
+ :auth_names => auth_names,
442
+ :return_type => return_type
443
+ )
444
+
445
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
446
+ if @api_client.config.debugging
447
+ @api_client.config.logger.debug "API called: AssetApi#get_assets\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
448
+ end
449
+ return data, status_code, headers
450
+ end
451
+ end
452
+ end