xero-ruby 0.2.4 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
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 +155 -436
  7. data/build_notes.md +17 -0
  8. data/docs/{Account.md → accounting/Account.md} +3 -3
  9. data/docs/accounting/AccountType.md +16 -0
  10. data/docs/{AccountingApi.md → accounting/AccountingApi.md} +4990 -1787
  11. data/docs/{Accounts.md → accounting/Accounts.md} +3 -3
  12. data/docs/{AccountsPayable.md → accounting/AccountsPayable.md} +3 -3
  13. data/docs/{AccountsReceivable.md → accounting/AccountsReceivable.md} +3 -3
  14. data/docs/{Address.md → accounting/Address.md} +3 -3
  15. data/docs/accounting/Allocation.md +31 -0
  16. data/docs/{Allocations.md → accounting/Allocations.md} +3 -3
  17. data/docs/{Attachment.md → accounting/Attachment.md} +3 -3
  18. data/docs/{Attachments.md → accounting/Attachments.md} +3 -3
  19. data/docs/{Balances.md → accounting/Balances.md} +3 -3
  20. data/docs/{BankTransaction.md → accounting/BankTransaction.md} +3 -3
  21. data/docs/{BankTransactions.md → accounting/BankTransactions.md} +3 -3
  22. data/docs/{BankTransfer.md → accounting/BankTransfer.md} +4 -4
  23. data/docs/{BankTransfers.md → accounting/BankTransfers.md} +3 -3
  24. data/docs/{BatchPayment.md → accounting/BatchPayment.md} +4 -4
  25. data/docs/{BatchPaymentDetails.md → accounting/BatchPaymentDetails.md} +3 -3
  26. data/docs/{BatchPayments.md → accounting/BatchPayments.md} +3 -3
  27. data/docs/{Bill.md → accounting/Bill.md} +3 -3
  28. data/docs/{BrandingTheme.md → accounting/BrandingTheme.md} +3 -3
  29. data/docs/{BrandingThemes.md → accounting/BrandingThemes.md} +3 -3
  30. data/docs/{CISOrgSetting.md → accounting/CISOrgSetting.md} +3 -3
  31. data/docs/{CISSetting.md → accounting/CISSetting.md} +3 -3
  32. data/docs/{CISSettings.md → accounting/CISSettings.md} +3 -3
  33. data/docs/{Contact.md → accounting/Contact.md} +5 -5
  34. data/docs/{ContactGroup.md → accounting/ContactGroup.md} +3 -3
  35. data/docs/{ContactGroups.md → accounting/ContactGroups.md} +3 -3
  36. data/docs/{ContactPerson.md → accounting/ContactPerson.md} +3 -3
  37. data/docs/{Contacts.md → accounting/Contacts.md} +3 -3
  38. data/docs/accounting/CountryCode.md +16 -0
  39. data/docs/{CreditNote.md → accounting/CreditNote.md} +5 -5
  40. data/docs/{CreditNotes.md → accounting/CreditNotes.md} +3 -3
  41. data/docs/{Currencies.md → accounting/Currencies.md} +3 -3
  42. data/docs/{Currency.md → accounting/Currency.md} +3 -3
  43. data/docs/accounting/CurrencyCode.md +16 -0
  44. data/docs/{Element.md → accounting/Element.md} +3 -3
  45. data/docs/{Employee.md → accounting/Employee.md} +3 -3
  46. data/docs/{Employees.md → accounting/Employees.md} +3 -3
  47. data/docs/{Error.md → accounting/Error.md} +3 -3
  48. data/docs/{ExpenseClaim.md → accounting/ExpenseClaim.md} +3 -3
  49. data/docs/{ExpenseClaims.md → accounting/ExpenseClaims.md} +3 -3
  50. data/docs/{ExternalLink.md → accounting/ExternalLink.md} +3 -3
  51. data/docs/{HistoryRecord.md → accounting/HistoryRecord.md} +3 -3
  52. data/docs/{HistoryRecords.md → accounting/HistoryRecords.md} +3 -3
  53. data/docs/{Invoice.md → accounting/Invoice.md} +5 -5
  54. data/docs/{InvoiceReminder.md → accounting/InvoiceReminder.md} +3 -3
  55. data/docs/{InvoiceReminders.md → accounting/InvoiceReminders.md} +3 -3
  56. data/docs/{Invoices.md → accounting/Invoices.md} +3 -3
  57. data/docs/{Item.md → accounting/Item.md} +3 -3
  58. data/docs/{Items.md → accounting/Items.md} +3 -3
  59. data/docs/{Journal.md → accounting/Journal.md} +4 -4
  60. data/docs/{JournalLine.md → accounting/JournalLine.md} +3 -3
  61. data/docs/{Journals.md → accounting/Journals.md} +3 -3
  62. data/docs/accounting/LineAmountTypes.md +16 -0
  63. data/docs/{LineItem.md → accounting/LineItem.md} +3 -3
  64. data/docs/{LineItemTracking.md → accounting/LineItemTracking.md} +3 -3
  65. data/docs/{LinkedTransaction.md → accounting/LinkedTransaction.md} +3 -3
  66. data/docs/{LinkedTransactions.md → accounting/LinkedTransactions.md} +3 -3
  67. data/docs/{ManualJournal.md → accounting/ManualJournal.md} +3 -3
  68. data/docs/{ManualJournalLine.md → accounting/ManualJournalLine.md} +5 -3
  69. data/docs/{ManualJournals.md → accounting/ManualJournals.md} +3 -3
  70. data/docs/{OnlineInvoice.md → accounting/OnlineInvoice.md} +3 -3
  71. data/docs/{OnlineInvoices.md → accounting/OnlineInvoices.md} +3 -3
  72. data/docs/{Organisation.md → accounting/Organisation.md} +6 -4
  73. data/docs/{Organisations.md → accounting/Organisations.md} +3 -3
  74. data/docs/{Overpayment.md → accounting/Overpayment.md} +3 -3
  75. data/docs/{Overpayments.md → accounting/Overpayments.md} +3 -3
  76. data/docs/{Payment.md → accounting/Payment.md} +9 -7
  77. data/docs/{PaymentDelete.md → accounting/PaymentDelete.md} +3 -3
  78. data/docs/{PaymentService.md → accounting/PaymentService.md} +3 -3
  79. data/docs/{PaymentServices.md → accounting/PaymentServices.md} +3 -3
  80. data/docs/{PaymentTerm.md → accounting/PaymentTerm.md} +3 -3
  81. data/docs/{PaymentTermType.md → accounting/PaymentTermType.md} +3 -3
  82. data/docs/{Payments.md → accounting/Payments.md} +3 -3
  83. data/docs/{Phone.md → accounting/Phone.md} +3 -3
  84. data/docs/{Prepayment.md → accounting/Prepayment.md} +3 -3
  85. data/docs/{Prepayments.md → accounting/Prepayments.md} +3 -3
  86. data/docs/{Purchase.md → accounting/Purchase.md} +3 -3
  87. data/docs/{PurchaseOrder.md → accounting/PurchaseOrder.md} +3 -3
  88. data/docs/{PurchaseOrders.md → accounting/PurchaseOrders.md} +3 -3
  89. data/docs/{Quote.md → accounting/Quote.md} +10 -6
  90. data/docs/{QuoteLineAmountTypes.md → accounting/QuoteLineAmountTypes.md} +3 -3
  91. data/docs/{QuoteStatusCodes.md → accounting/QuoteStatusCodes.md} +3 -3
  92. data/docs/{Quotes.md → accounting/Quotes.md} +3 -3
  93. data/docs/{Receipt.md → accounting/Receipt.md} +3 -3
  94. data/docs/{Receipts.md → accounting/Receipts.md} +3 -3
  95. data/docs/{RepeatingInvoice.md → accounting/RepeatingInvoice.md} +3 -3
  96. data/docs/{RepeatingInvoices.md → accounting/RepeatingInvoices.md} +3 -3
  97. data/docs/{Report.md → accounting/Report.md} +4 -4
  98. data/docs/{ReportAttribute.md → accounting/ReportAttribute.md} +3 -3
  99. data/docs/{ReportCell.md → accounting/ReportCell.md} +3 -3
  100. data/docs/{ReportFields.md → accounting/ReportFields.md} +3 -3
  101. data/docs/{ReportRow.md → accounting/ReportRow.md} +3 -3
  102. data/docs/{ReportRows.md → accounting/ReportRows.md} +3 -3
  103. data/docs/{ReportWithRow.md → accounting/ReportWithRow.md} +3 -3
  104. data/docs/{ReportWithRows.md → accounting/ReportWithRows.md} +3 -3
  105. data/docs/{Reports.md → accounting/Reports.md} +3 -3
  106. data/docs/{RequestEmpty.md → accounting/RequestEmpty.md} +3 -3
  107. data/docs/{RowType.md → accounting/RowType.md} +3 -3
  108. data/docs/{SalesTrackingCategory.md → accounting/SalesTrackingCategory.md} +3 -3
  109. data/docs/{Schedule.md → accounting/Schedule.md} +3 -3
  110. data/docs/{TaxComponent.md → accounting/TaxComponent.md} +3 -3
  111. data/docs/{TaxRate.md → accounting/TaxRate.md} +3 -3
  112. data/docs/{TaxRates.md → accounting/TaxRates.md} +3 -3
  113. data/docs/{TaxType.md → accounting/TaxType.md} +3 -3
  114. data/docs/{TenNinteyNineContact.md → accounting/TenNinetyNineContact.md} +3 -3
  115. data/docs/{TimeZone.md → accounting/TimeZone.md} +3 -3
  116. data/docs/{TrackingCategories.md → accounting/TrackingCategories.md} +3 -3
  117. data/docs/{TrackingCategory.md → accounting/TrackingCategory.md} +3 -3
  118. data/docs/{TrackingOption.md → accounting/TrackingOption.md} +3 -3
  119. data/docs/{TrackingOptions.md → accounting/TrackingOptions.md} +3 -3
  120. data/docs/{User.md → accounting/User.md} +3 -3
  121. data/docs/{Users.md → accounting/Users.md} +3 -3
  122. data/docs/{ValidationError.md → accounting/ValidationError.md} +3 -3
  123. data/docs/assets/Asset.md +45 -0
  124. data/docs/assets/AssetApi.md +438 -0
  125. data/docs/{CurrencyCode.md → assets/AssetStatus.md} +3 -3
  126. data/docs/assets/AssetStatusQueryParam.md +16 -0
  127. data/docs/assets/AssetType.md +29 -0
  128. data/docs/assets/Assets.md +19 -0
  129. data/docs/assets/BookDepreciationDetail.md +29 -0
  130. data/docs/assets/BookDepreciationSetting.md +31 -0
  131. data/docs/assets/Error.md +25 -0
  132. data/docs/assets/FieldValidationErrorsElement.md +27 -0
  133. data/docs/assets/Pagination.md +23 -0
  134. data/docs/assets/ResourceValidationErrorsElement.md +25 -0
  135. data/docs/assets/Setting.md +31 -0
  136. data/docs/projects/Amount.md +19 -0
  137. data/docs/{AccountType.md → projects/ChargeType.md} +3 -3
  138. data/docs/{CountryCode.md → projects/CurrencyCode.md} +3 -3
  139. data/docs/projects/Error.md +19 -0
  140. data/docs/projects/Pagination.md +23 -0
  141. data/docs/projects/Project.md +59 -0
  142. data/docs/projects/ProjectApi.md +979 -0
  143. data/docs/projects/ProjectCreateOrUpdate.md +23 -0
  144. data/docs/projects/ProjectPatch.md +17 -0
  145. data/docs/{LineAmountTypes.md → projects/ProjectStatus.md} +3 -3
  146. data/docs/projects/ProjectUser.md +21 -0
  147. data/docs/projects/ProjectUsers.md +19 -0
  148. data/docs/projects/Projects.md +19 -0
  149. data/docs/projects/Task.md +45 -0
  150. data/docs/projects/TaskCreateOrUpdate.md +23 -0
  151. data/docs/projects/Tasks.md +19 -0
  152. data/docs/projects/TimeEntries.md +19 -0
  153. data/docs/projects/TimeEntry.md +33 -0
  154. data/docs/projects/TimeEntryCreateOrUpdate.md +25 -0
  155. data/lib/xero-ruby.rb +148 -122
  156. data/lib/xero-ruby/api/accounting_api.rb +166 -29
  157. data/lib/xero-ruby/api/asset_api.rb +452 -0
  158. data/lib/xero-ruby/api/project_api.rb +1035 -0
  159. data/lib/xero-ruby/api_client.rb +237 -74
  160. data/lib/xero-ruby/api_error.rb +2 -2
  161. data/lib/xero-ruby/configuration.rb +35 -25
  162. data/lib/xero-ruby/models/{account.rb → accounting/account.rb} +65 -24
  163. data/lib/xero-ruby/models/{account_type.rb → accounting/account_type.rb} +3 -3
  164. data/lib/xero-ruby/models/{accounts.rb → accounting/accounts.rb} +12 -7
  165. data/lib/xero-ruby/models/{accounts_payable.rb → accounting/accounts_payable.rb} +15 -9
  166. data/lib/xero-ruby/models/{accounts_receivable.rb → accounting/accounts_receivable.rb} +15 -9
  167. data/lib/xero-ruby/models/{address.rb → accounting/address.rb} +23 -16
  168. data/lib/xero-ruby/models/accounting/allocation.rb +295 -0
  169. data/lib/xero-ruby/models/{allocations.rb → accounting/allocations.rb} +12 -7
  170. data/lib/xero-ruby/models/{attachment.rb → accounting/attachment.rb} +16 -12
  171. data/lib/xero-ruby/models/{attachments.rb → accounting/attachments.rb} +12 -7
  172. data/lib/xero-ruby/models/{balances.rb → accounting/balances.rb} +13 -7
  173. data/lib/xero-ruby/models/{bank_transaction.rb → accounting/bank_transaction.rb} +47 -28
  174. data/lib/xero-ruby/models/{bank_transactions.rb → accounting/bank_transactions.rb} +12 -7
  175. data/lib/xero-ruby/models/{bank_transfer.rb → accounting/bank_transfer.rb} +24 -18
  176. data/lib/xero-ruby/models/{bank_transfers.rb → accounting/bank_transfers.rb} +12 -7
  177. data/lib/xero-ruby/models/{batch_payment.rb → accounting/batch_payment.rb} +33 -23
  178. data/lib/xero-ruby/models/{batch_payment_details.rb → accounting/batch_payment_details.rb} +15 -11
  179. data/lib/xero-ruby/models/{batch_payments.rb → accounting/batch_payments.rb} +12 -7
  180. data/lib/xero-ruby/models/{bill.rb → accounting/bill.rb} +12 -7
  181. data/lib/xero-ruby/models/{branding_theme.rb → accounting/branding_theme.rb} +17 -12
  182. data/lib/xero-ruby/models/{branding_themes.rb → accounting/branding_themes.rb} +12 -7
  183. data/lib/xero-ruby/models/{cis_org_setting.rb → accounting/cis_org_setting.rb} +13 -9
  184. data/lib/xero-ruby/models/{cis_setting.rb → accounting/cis_setting.rb} +12 -8
  185. data/lib/xero-ruby/models/{cis_settings.rb → accounting/cis_settings.rb} +12 -7
  186. data/lib/xero-ruby/models/{contact.rb → accounting/contact.rb} +55 -41
  187. data/lib/xero-ruby/models/{contact_group.rb → accounting/contact_group.rb} +16 -10
  188. data/lib/xero-ruby/models/{contact_groups.rb → accounting/contact_groups.rb} +12 -7
  189. data/lib/xero-ruby/models/{contact_person.rb → accounting/contact_person.rb} +14 -10
  190. data/lib/xero-ruby/models/{contacts.rb → accounting/contacts.rb} +12 -7
  191. data/lib/xero-ruby/models/{country_code.rb → accounting/country_code.rb} +3 -3
  192. data/lib/xero-ruby/models/{credit_note.rb → accounting/credit_note.rb} +51 -34
  193. data/lib/xero-ruby/models/{credit_notes.rb → accounting/credit_notes.rb} +12 -7
  194. data/lib/xero-ruby/models/{currencies.rb → accounting/currencies.rb} +12 -7
  195. data/lib/xero-ruby/models/{currency.rb → accounting/currency.rb} +13 -8
  196. data/lib/xero-ruby/models/{currency_code.rb → accounting/currency_code.rb} +5 -5
  197. data/lib/xero-ruby/models/{element.rb → accounting/element.rb} +18 -8
  198. data/lib/xero-ruby/models/{employee.rb → accounting/employee.rb} +21 -12
  199. data/lib/xero-ruby/models/{employees.rb → accounting/employees.rb} +12 -7
  200. data/lib/xero-ruby/models/{error.rb → accounting/error.rb} +14 -10
  201. data/lib/xero-ruby/models/{expense_claim.rb → accounting/expense_claim.rb} +30 -19
  202. data/lib/xero-ruby/models/{expense_claims.rb → accounting/expense_claims.rb} +12 -7
  203. data/lib/xero-ruby/models/{external_link.rb → accounting/external_link.rb} +18 -8
  204. data/lib/xero-ruby/models/{history_record.rb → accounting/history_record.rb} +14 -10
  205. data/lib/xero-ruby/models/{history_records.rb → accounting/history_records.rb} +12 -7
  206. data/lib/xero-ruby/models/{invoice.rb → accounting/invoice.rb} +73 -50
  207. data/lib/xero-ruby/models/{invoice_reminder.rb → accounting/invoice_reminder.rb} +11 -7
  208. data/lib/xero-ruby/models/{invoice_reminders.rb → accounting/invoice_reminders.rb} +12 -7
  209. data/lib/xero-ruby/models/{invoices.rb → accounting/invoices.rb} +12 -7
  210. data/lib/xero-ruby/models/{item.rb → accounting/item.rb} +28 -22
  211. data/lib/xero-ruby/models/{items.rb → accounting/items.rb} +12 -7
  212. data/lib/xero-ruby/models/{journal.rb → accounting/journal.rb} +44 -15
  213. data/lib/xero-ruby/models/{journal_line.rb → accounting/journal_line.rb} +25 -20
  214. data/lib/xero-ruby/models/{journals.rb → accounting/journals.rb} +12 -7
  215. data/lib/xero-ruby/models/{line_amount_types.rb → accounting/line_amount_types.rb} +3 -3
  216. data/lib/xero-ruby/models/{line_item.rb → accounting/line_item.rb} +29 -25
  217. data/lib/xero-ruby/models/{line_item_tracking.rb → accounting/line_item_tracking.rb} +14 -10
  218. data/lib/xero-ruby/models/{linked_transaction.rb → accounting/linked_transaction.rb} +29 -17
  219. data/lib/xero-ruby/models/{linked_transactions.rb → accounting/linked_transactions.rb} +12 -7
  220. data/lib/xero-ruby/models/{manual_journal.rb → accounting/manual_journal.rb} +29 -19
  221. data/lib/xero-ruby/models/{manual_journal_line.rb → accounting/manual_journal_line.rb} +30 -16
  222. data/lib/xero-ruby/models/{manual_journals.rb → accounting/manual_journals.rb} +12 -7
  223. data/lib/xero-ruby/models/{online_invoice.rb → accounting/online_invoice.rb} +11 -7
  224. data/lib/xero-ruby/models/{online_invoices.rb → accounting/online_invoices.rb} +12 -7
  225. data/lib/xero-ruby/models/{organisation.rb → accounting/organisation.rb} +126 -36
  226. data/lib/xero-ruby/models/{organisations.rb → accounting/organisations.rb} +12 -7
  227. data/lib/xero-ruby/models/{overpayment.rb → accounting/overpayment.rb} +40 -27
  228. data/lib/xero-ruby/models/{overpayments.rb → accounting/overpayments.rb} +12 -7
  229. data/lib/xero-ruby/models/{payment.rb → accounting/payment.rb} +61 -28
  230. data/lib/xero-ruby/models/{payment_delete.rb → accounting/payment_delete.rb} +11 -7
  231. data/lib/xero-ruby/models/{payment_service.rb → accounting/payment_service.rb} +16 -12
  232. data/lib/xero-ruby/models/{payment_services.rb → accounting/payment_services.rb} +12 -7
  233. data/lib/xero-ruby/models/{payment_term.rb → accounting/payment_term.rb} +13 -7
  234. data/lib/xero-ruby/models/{payment_term_type.rb → accounting/payment_term_type.rb} +3 -3
  235. data/lib/xero-ruby/models/{payments.rb → accounting/payments.rb} +12 -7
  236. data/lib/xero-ruby/models/{phone.rb → accounting/phone.rb} +20 -10
  237. data/lib/xero-ruby/models/{prepayment.rb → accounting/prepayment.rb} +41 -27
  238. data/lib/xero-ruby/models/{prepayments.rb → accounting/prepayments.rb} +12 -7
  239. data/lib/xero-ruby/models/{purchase.rb → accounting/purchase.rb} +15 -11
  240. data/lib/xero-ruby/models/{purchase_order.rb → accounting/purchase_order.rb} +49 -37
  241. data/lib/xero-ruby/models/{purchase_orders.rb → accounting/purchase_orders.rb} +12 -7
  242. data/lib/xero-ruby/models/{quote.rb → accounting/quote.rb} +63 -33
  243. data/lib/xero-ruby/models/{quote_line_amount_types.rb → accounting/quote_line_amount_types.rb} +3 -3
  244. data/lib/xero-ruby/models/{quote_status_codes.rb → accounting/quote_status_codes.rb} +4 -3
  245. data/lib/xero-ruby/models/{quotes.rb → accounting/quotes.rb} +12 -7
  246. data/lib/xero-ruby/models/{receipt.rb → accounting/receipt.rb} +36 -23
  247. data/lib/xero-ruby/models/{receipts.rb → accounting/receipts.rb} +12 -7
  248. data/lib/xero-ruby/models/{repeating_invoice.rb → accounting/repeating_invoice.rb} +34 -21
  249. data/lib/xero-ruby/models/{repeating_invoices.rb → accounting/repeating_invoices.rb} +12 -7
  250. data/lib/xero-ruby/models/{report.rb → accounting/report.rb} +19 -13
  251. data/lib/xero-ruby/models/{report_attribute.rb → accounting/report_attribute.rb} +13 -7
  252. data/lib/xero-ruby/models/{report_cell.rb → accounting/report_cell.rb} +13 -7
  253. data/lib/xero-ruby/models/{report_fields.rb → accounting/report_fields.rb} +14 -7
  254. data/lib/xero-ruby/models/{report_row.rb → accounting/report_row.rb} +14 -7
  255. data/lib/xero-ruby/models/{report_rows.rb → accounting/report_rows.rb} +15 -7
  256. data/lib/xero-ruby/models/{report_with_row.rb → accounting/report_with_row.rb} +19 -13
  257. data/lib/xero-ruby/models/{report_with_rows.rb → accounting/report_with_rows.rb} +12 -7
  258. data/lib/xero-ruby/models/{reports.rb → accounting/reports.rb} +12 -7
  259. data/lib/xero-ruby/models/{request_empty.rb → accounting/request_empty.rb} +11 -7
  260. data/lib/xero-ruby/models/{row_type.rb → accounting/row_type.rb} +3 -3
  261. data/lib/xero-ruby/models/{sales_tracking_category.rb → accounting/sales_tracking_category.rb} +12 -8
  262. data/lib/xero-ruby/models/{schedule.rb → accounting/schedule.rb} +27 -15
  263. data/lib/xero-ruby/models/{tax_component.rb → accounting/tax_component.rb} +15 -11
  264. data/lib/xero-ruby/models/{tax_rate.rb → accounting/tax_rate.rb} +104 -22
  265. data/lib/xero-ruby/models/{tax_rates.rb → accounting/tax_rates.rb} +12 -7
  266. data/lib/xero-ruby/models/{tax_type.rb → accounting/tax_type.rb} +7 -3
  267. data/lib/xero-ruby/models/{ten_nintey_nine_contact.rb → accounting/ten_ninety_nine_contact.rb} +46 -42
  268. data/lib/xero-ruby/models/{time_zone.rb → accounting/time_zone.rb} +3 -3
  269. data/lib/xero-ruby/models/{tracking_categories.rb → accounting/tracking_categories.rb} +12 -7
  270. data/lib/xero-ruby/models/{tracking_category.rb → accounting/tracking_category.rb} +19 -12
  271. data/lib/xero-ruby/models/{tracking_option.rb → accounting/tracking_option.rb} +17 -10
  272. data/lib/xero-ruby/models/{tracking_options.rb → accounting/tracking_options.rb} +12 -7
  273. data/lib/xero-ruby/models/{user.rb → accounting/user.rb} +24 -13
  274. data/lib/xero-ruby/models/{users.rb → accounting/users.rb} +12 -7
  275. data/lib/xero-ruby/models/{validation_error.rb → accounting/validation_error.rb} +11 -7
  276. data/lib/xero-ruby/models/assets/asset.rb +353 -0
  277. data/lib/xero-ruby/models/assets/asset_status.rb +38 -0
  278. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +38 -0
  279. data/lib/xero-ruby/models/assets/asset_type.rb +278 -0
  280. data/lib/xero-ruby/models/assets/assets.rb +220 -0
  281. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +268 -0
  282. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +347 -0
  283. data/lib/xero-ruby/models/assets/error.rb +252 -0
  284. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +258 -0
  285. data/lib/xero-ruby/models/assets/pagination.rb +238 -0
  286. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +248 -0
  287. data/lib/xero-ruby/models/assets/setting.rb +278 -0
  288. data/lib/xero-ruby/models/projects/amount.rb +218 -0
  289. data/lib/xero-ruby/models/projects/charge_type.rb +38 -0
  290. data/lib/xero-ruby/models/projects/currency_code.rb +199 -0
  291. data/lib/xero-ruby/models/projects/error.rb +218 -0
  292. data/lib/xero-ruby/models/{allocation.rb → projects/pagination.rb} +48 -48
  293. data/lib/xero-ruby/models/projects/project.rb +423 -0
  294. data/lib/xero-ruby/models/projects/project_create_or_update.rb +243 -0
  295. data/lib/xero-ruby/models/projects/project_patch.rb +213 -0
  296. data/lib/xero-ruby/models/projects/project_status.rb +37 -0
  297. data/lib/xero-ruby/models/projects/project_user.rb +228 -0
  298. data/lib/xero-ruby/models/projects/project_users.rb +220 -0
  299. data/lib/xero-ruby/models/projects/projects.rb +220 -0
  300. data/lib/xero-ruby/models/projects/task.rb +385 -0
  301. data/lib/xero-ruby/models/projects/task_create_or_update.rb +253 -0
  302. data/lib/xero-ruby/models/projects/tasks.rb +220 -0
  303. data/lib/xero-ruby/models/projects/time_entries.rb +220 -0
  304. data/lib/xero-ruby/models/projects/time_entry.rb +324 -0
  305. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +268 -0
  306. data/lib/xero-ruby/version.rb +3 -3
  307. data/spec/{api → accounting/api}/accounting_api_spec.rb +31 -6
  308. data/spec/{models → accounting/models}/account_spec.rb +5 -5
  309. data/spec/{models → accounting/models}/account_type_spec.rb +5 -5
  310. data/spec/{models → accounting/models}/accounts_payable_spec.rb +5 -5
  311. data/spec/{models → accounting/models}/accounts_receivable_spec.rb +5 -5
  312. data/spec/{models → accounting/models}/accounts_spec.rb +5 -5
  313. data/spec/{models → accounting/models}/address_spec.rb +5 -5
  314. data/spec/{models → accounting/models}/allocation_spec.rb +5 -5
  315. data/spec/{models → accounting/models}/allocations_spec.rb +5 -5
  316. data/spec/{models → accounting/models}/attachment_spec.rb +5 -5
  317. data/spec/{models → accounting/models}/attachments_spec.rb +5 -5
  318. data/spec/{models → accounting/models}/balances_spec.rb +5 -5
  319. data/spec/{models → accounting/models}/bank_transaction_spec.rb +5 -5
  320. data/spec/{models → accounting/models}/bank_transactions_spec.rb +5 -5
  321. data/spec/{models → accounting/models}/bank_transfer_spec.rb +5 -5
  322. data/spec/{models → accounting/models}/bank_transfers_spec.rb +5 -5
  323. data/spec/{models → accounting/models}/batch_payment_details_spec.rb +5 -5
  324. data/spec/{models → accounting/models}/batch_payment_spec.rb +5 -5
  325. data/spec/{models → accounting/models}/batch_payments_spec.rb +5 -5
  326. data/spec/{models → accounting/models}/bill_spec.rb +5 -5
  327. data/spec/{models → accounting/models}/branding_theme_spec.rb +5 -5
  328. data/spec/{models → accounting/models}/branding_themes_spec.rb +5 -5
  329. data/spec/{models → accounting/models}/cis_org_setting_spec.rb +5 -5
  330. data/spec/{models → accounting/models}/cis_setting_spec.rb +5 -5
  331. data/spec/{models → accounting/models}/cis_settings_spec.rb +5 -5
  332. data/spec/{models → accounting/models}/contact_group_spec.rb +5 -5
  333. data/spec/{models → accounting/models}/contact_groups_spec.rb +5 -5
  334. data/spec/{models → accounting/models}/contact_person_spec.rb +5 -5
  335. data/spec/{models → accounting/models}/contact_spec.rb +5 -5
  336. data/spec/{models → accounting/models}/contacts_spec.rb +5 -5
  337. data/spec/{models → accounting/models}/country_code_spec.rb +5 -5
  338. data/spec/{models → accounting/models}/credit_note_spec.rb +5 -5
  339. data/spec/{models → accounting/models}/credit_notes_spec.rb +5 -5
  340. data/spec/{models → accounting/models}/currencies_spec.rb +5 -5
  341. data/spec/{models → accounting/models}/currency_code_spec.rb +5 -5
  342. data/spec/{models → accounting/models}/currency_spec.rb +5 -5
  343. data/spec/{models → accounting/models}/element_spec.rb +5 -5
  344. data/spec/{models → accounting/models}/employee_spec.rb +5 -5
  345. data/spec/{models → accounting/models}/employees_spec.rb +5 -5
  346. data/spec/{models → accounting/models}/error_spec.rb +5 -5
  347. data/spec/{models → accounting/models}/expense_claim_spec.rb +5 -5
  348. data/spec/{models → accounting/models}/expense_claims_spec.rb +5 -5
  349. data/spec/{models → accounting/models}/external_link_spec.rb +5 -5
  350. data/spec/{models → accounting/models}/history_record_spec.rb +5 -5
  351. data/spec/{models → accounting/models}/history_records_spec.rb +5 -5
  352. data/spec/{models → accounting/models}/invoice_reminder_spec.rb +5 -5
  353. data/spec/{models → accounting/models}/invoice_reminders_spec.rb +5 -5
  354. data/spec/{models → accounting/models}/invoice_spec.rb +5 -5
  355. data/spec/{models → accounting/models}/invoices_spec.rb +5 -5
  356. data/spec/{models → accounting/models}/item_spec.rb +5 -5
  357. data/spec/{models → accounting/models}/items_spec.rb +5 -5
  358. data/spec/{models → accounting/models}/journal_line_spec.rb +5 -5
  359. data/spec/{models → accounting/models}/journal_spec.rb +5 -5
  360. data/spec/{models → accounting/models}/journals_spec.rb +5 -5
  361. data/spec/{models → accounting/models}/line_amount_types_spec.rb +5 -5
  362. data/spec/{models → accounting/models}/line_item_spec.rb +5 -5
  363. data/spec/{models → accounting/models}/line_item_tracking_spec.rb +5 -5
  364. data/spec/{models → accounting/models}/linked_transaction_spec.rb +5 -5
  365. data/spec/{models → accounting/models}/linked_transactions_spec.rb +5 -5
  366. data/spec/{models → accounting/models}/manual_journal_line_spec.rb +5 -5
  367. data/spec/{models → accounting/models}/manual_journal_spec.rb +5 -5
  368. data/spec/{models → accounting/models}/manual_journals_spec.rb +5 -5
  369. data/spec/{models → accounting/models}/online_invoice_spec.rb +5 -5
  370. data/spec/{models → accounting/models}/online_invoices_spec.rb +5 -5
  371. data/spec/{models → accounting/models}/organisation_spec.rb +5 -5
  372. data/spec/{models → accounting/models}/organisations_spec.rb +5 -5
  373. data/spec/{models → accounting/models}/overpayment_spec.rb +5 -5
  374. data/spec/{models → accounting/models}/overpayments_spec.rb +5 -5
  375. data/spec/{models → accounting/models}/payment_delete_spec.rb +5 -5
  376. data/spec/{models → accounting/models}/payment_service_spec.rb +5 -5
  377. data/spec/{models → accounting/models}/payment_services_spec.rb +5 -5
  378. data/spec/{models → accounting/models}/payment_spec.rb +11 -5
  379. data/spec/{models → accounting/models}/payment_term_spec.rb +5 -5
  380. data/spec/{models → accounting/models}/payment_term_type_spec.rb +5 -5
  381. data/spec/{models → accounting/models}/payments_spec.rb +5 -5
  382. data/spec/{models → accounting/models}/phone_spec.rb +5 -5
  383. data/spec/{models → accounting/models}/prepayment_spec.rb +5 -5
  384. data/spec/{models → accounting/models}/prepayments_spec.rb +5 -5
  385. data/spec/{models → accounting/models}/purchase_order_spec.rb +5 -5
  386. data/spec/{models → accounting/models}/purchase_orders_spec.rb +5 -5
  387. data/spec/{models → accounting/models}/purchase_spec.rb +5 -5
  388. data/spec/{models → accounting/models}/quote_line_amount_types_spec.rb +5 -5
  389. data/spec/{models → accounting/models}/quote_spec.rb +5 -5
  390. data/spec/{models → accounting/models}/quote_status_codes_spec.rb +5 -5
  391. data/spec/{models → accounting/models}/quotes_spec.rb +5 -5
  392. data/spec/{models → accounting/models}/receipt_spec.rb +5 -5
  393. data/spec/{models → accounting/models}/receipts_spec.rb +5 -5
  394. data/spec/{models → accounting/models}/repeating_invoice_spec.rb +5 -5
  395. data/spec/{models → accounting/models}/repeating_invoices_spec.rb +5 -5
  396. data/spec/{models → accounting/models}/report_attribute_spec.rb +5 -5
  397. data/spec/{models → accounting/models}/report_cell_spec.rb +5 -5
  398. data/spec/{models → accounting/models}/report_fields_spec.rb +5 -5
  399. data/spec/{models → accounting/models}/report_row_spec.rb +5 -5
  400. data/spec/{models → accounting/models}/report_rows_spec.rb +5 -5
  401. data/spec/{models → accounting/models}/report_spec.rb +5 -5
  402. data/spec/{models → accounting/models}/report_with_row_spec.rb +5 -5
  403. data/spec/{models → accounting/models}/report_with_rows_spec.rb +5 -5
  404. data/spec/{models → accounting/models}/reports_spec.rb +5 -5
  405. data/spec/{models → accounting/models}/request_empty_spec.rb +5 -5
  406. data/spec/{models → accounting/models}/row_type_spec.rb +5 -5
  407. data/spec/{models → accounting/models}/sales_tracking_category_spec.rb +5 -5
  408. data/spec/{models → accounting/models}/schedule_spec.rb +5 -5
  409. data/spec/{models → accounting/models}/tax_component_spec.rb +5 -5
  410. data/spec/{models → accounting/models}/tax_rate_spec.rb +6 -6
  411. data/spec/{models → accounting/models}/tax_rates_spec.rb +5 -5
  412. data/spec/{models → accounting/models}/tax_type_spec.rb +5 -5
  413. data/spec/{models → accounting/models}/ten_nintey_nine_contact_spec.rb +8 -8
  414. data/spec/{models → accounting/models}/time_zone_spec.rb +5 -5
  415. data/spec/{models → accounting/models}/tracking_categories_spec.rb +5 -5
  416. data/spec/{models → accounting/models}/tracking_category_spec.rb +5 -5
  417. data/spec/{models → accounting/models}/tracking_option_spec.rb +5 -5
  418. data/spec/{models → accounting/models}/tracking_options_spec.rb +5 -5
  419. data/spec/{models → accounting/models}/user_spec.rb +5 -5
  420. data/spec/{models → accounting/models}/users_spec.rb +5 -5
  421. data/spec/{models → accounting/models}/validation_error_spec.rb +5 -5
  422. data/spec/api_client_spec.rb +12 -52
  423. data/spec/assets/api/asset_api_spec.rb +116 -0
  424. data/spec/assets/models/asset_spec.rb +125 -0
  425. data/spec/assets/models/asset_status_query_param_spec.rb +35 -0
  426. data/spec/assets/models/asset_status_spec.rb +35 -0
  427. data/spec/assets/models/asset_type_spec.rb +77 -0
  428. data/spec/assets/models/assets_spec.rb +47 -0
  429. data/spec/assets/models/book_depreciation_detail_spec.rb +77 -0
  430. data/spec/assets/models/book_depreciation_setting_spec.rb +95 -0
  431. data/spec/assets/models/error_spec.rb +65 -0
  432. data/spec/assets/models/field_validation_errors_element_spec.rb +71 -0
  433. data/spec/assets/models/pagination_spec.rb +59 -0
  434. data/spec/assets/models/resource_validation_errors_element_spec.rb +65 -0
  435. data/spec/assets/models/setting_spec.rb +83 -0
  436. data/spec/configuration_spec.rb +7 -23
  437. data/spec/projects/api/project_api_spec.rb +229 -0
  438. data/spec/projects/models/amount_spec.rb +47 -0
  439. data/spec/projects/models/charge_type_spec.rb +35 -0
  440. data/spec/projects/models/currency_code_spec.rb +35 -0
  441. data/spec/projects/models/error_spec.rb +47 -0
  442. data/spec/projects/models/pagination_spec.rb +59 -0
  443. data/spec/projects/models/project_create_or_update_spec.rb +59 -0
  444. data/spec/projects/models/project_patch_spec.rb +41 -0
  445. data/spec/projects/models/project_spec.rb +167 -0
  446. data/spec/projects/models/project_status_spec.rb +35 -0
  447. data/spec/projects/models/project_user_spec.rb +53 -0
  448. data/spec/projects/models/project_users_spec.rb +47 -0
  449. data/spec/projects/models/projects_spec.rb +47 -0
  450. data/spec/projects/models/task_create_or_update_spec.rb +59 -0
  451. data/spec/projects/models/task_spec.rb +129 -0
  452. data/spec/projects/models/tasks_spec.rb +47 -0
  453. data/spec/projects/models/time_entries_spec.rb +47 -0
  454. data/spec/projects/models/time_entry_create_or_update_spec.rb +65 -0
  455. data/spec/projects/models/time_entry_spec.rb +93 -0
  456. data/spec/spec_helper.rb +2 -2
  457. data/xero-ruby.gemspec +4 -5
  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
@@ -0,0 +1,1035 @@
1
+ =begin
2
+ #Xero Projects API
3
+
4
+ #This is the Xero Projects API
5
+
6
+ The version of the OpenAPI document: 2.2.11
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 ProjectApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.new)
20
+ @api_client = api_client
21
+ end
22
+ # create one or more new projects
23
+ # @param xero_tenant_id [String] Xero identifier for Tenant
24
+ # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [Project]
27
+ def create_project(xero_tenant_id, project_create_or_update, opts = {})
28
+ data, _status_code, _headers = create_project_with_http_info(xero_tenant_id, project_create_or_update, opts)
29
+ data
30
+ end
31
+
32
+ # create one or more new projects
33
+ # @param xero_tenant_id [String] Xero identifier for Tenant
34
+ # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
37
+ def create_project_with_http_info(xero_tenant_id, project_create_or_update, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'
40
+ end
41
+ # verify the required parameter 'xero_tenant_id' is set
42
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
43
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_project"
44
+ end
45
+ # verify the required parameter 'project_create_or_update' is set
46
+ if @api_client.config.client_side_validation && project_create_or_update.nil?
47
+ fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.create_project"
48
+ end
49
+ # resource path
50
+ local_var_path = '/projects'
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
61
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
62
+
63
+ # form parameters
64
+ form_params = opts[:form_params] || {}
65
+
66
+ # http body (model)
67
+ post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
68
+
69
+ # return_type
70
+ return_type = opts[:return_type] || 'Project'
71
+
72
+ # auth_names
73
+ auth_names = opts[:auth_names] || ['OAuth2']
74
+
75
+ new_options = opts.merge(
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Allows you to create a task
92
+ # Allows you to create a specific task
93
+ # @param xero_tenant_id [String] Xero identifier for Tenant
94
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
95
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [TimeEntry]
98
+ def create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
99
+ data, _status_code, _headers = create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts)
100
+ data
101
+ end
102
+
103
+ # Allows you to create a task
104
+ # Allows you to create a specific task
105
+ # @param xero_tenant_id [String] Xero identifier for Tenant
106
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
107
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
108
+ # @param [Hash] opts the optional parameters
109
+ # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
110
+ def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
111
+ if @api_client.config.debugging
112
+ @api_client.config.logger.debug 'Calling API: ProjectApi.create_time_entry ...'
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 ProjectApi.create_time_entry"
117
+ end
118
+ # verify the required parameter 'project_id' is set
119
+ if @api_client.config.client_side_validation && project_id.nil?
120
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_time_entry"
121
+ end
122
+ # verify the required parameter 'time_entry_create_or_update' is set
123
+ if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
124
+ fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.create_time_entry"
125
+ end
126
+ # resource path
127
+ local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
128
+
129
+ # query parameters
130
+ query_params = opts[:query_params] || {}
131
+
132
+ # header parameters
133
+ header_params = opts[:header_params] || {}
134
+ # HTTP header 'Accept' (if needed)
135
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
136
+ # HTTP header 'Content-Type'
137
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
138
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
139
+
140
+ # form parameters
141
+ form_params = opts[:form_params] || {}
142
+
143
+ # http body (model)
144
+ post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
145
+
146
+ # return_type
147
+ return_type = opts[:return_type] || 'TimeEntry'
148
+
149
+ # auth_names
150
+ auth_names = opts[:auth_names] || ['OAuth2']
151
+
152
+ new_options = opts.merge(
153
+ :header_params => header_params,
154
+ :query_params => query_params,
155
+ :form_params => form_params,
156
+ :body => post_body,
157
+ :auth_names => auth_names,
158
+ :return_type => return_type
159
+ )
160
+
161
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug "API called: ProjectApi#create_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
164
+ end
165
+ return data, status_code, headers
166
+ end
167
+
168
+ # Allows you to delete a time entry
169
+ # Allows you to delete a specific time entry
170
+ # @param xero_tenant_id [String] Xero identifier for Tenant
171
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
172
+ # @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint
173
+ # @param [Hash] opts the optional parameters
174
+ # @return [nil]
175
+ def delete_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
176
+ delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
177
+ nil
178
+ end
179
+
180
+ # Allows you to delete a time entry
181
+ # Allows you to delete a specific time entry
182
+ # @param xero_tenant_id [String] Xero identifier for Tenant
183
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
184
+ # @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint
185
+ # @param [Hash] opts the optional parameters
186
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
187
+ def delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug 'Calling API: ProjectApi.delete_time_entry ...'
190
+ end
191
+ # verify the required parameter 'xero_tenant_id' is set
192
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
193
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.delete_time_entry"
194
+ end
195
+ # verify the required parameter 'project_id' is set
196
+ if @api_client.config.client_side_validation && project_id.nil?
197
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_time_entry"
198
+ end
199
+ # verify the required parameter 'time_entry_id' is set
200
+ if @api_client.config.client_side_validation && time_entry_id.nil?
201
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.delete_time_entry"
202
+ end
203
+ # resource path
204
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
205
+
206
+ # query parameters
207
+ query_params = opts[:query_params] || {}
208
+
209
+ # header parameters
210
+ header_params = opts[:header_params] || {}
211
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
212
+
213
+ # form parameters
214
+ form_params = opts[:form_params] || {}
215
+
216
+ # http body (model)
217
+ post_body = opts[:body]
218
+
219
+ # return_type
220
+ return_type = opts[:return_type]
221
+
222
+ # auth_names
223
+ auth_names = opts[:auth_names] || ['OAuth2']
224
+
225
+ new_options = opts.merge(
226
+ :header_params => header_params,
227
+ :query_params => query_params,
228
+ :form_params => form_params,
229
+ :body => post_body,
230
+ :auth_names => auth_names,
231
+ :return_type => return_type
232
+ )
233
+
234
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
235
+ if @api_client.config.debugging
236
+ @api_client.config.logger.debug "API called: ProjectApi#delete_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
237
+ end
238
+ return data, status_code, headers
239
+ end
240
+
241
+ # Allows you to retrieve a single project
242
+ # Allows you to retrieve a specific project
243
+ # @param xero_tenant_id [String] Xero identifier for Tenant
244
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
245
+ # @param [Hash] opts the optional parameters
246
+ # @return [Project]
247
+ def get_project(xero_tenant_id, project_id, opts = {})
248
+ data, _status_code, _headers = get_project_with_http_info(xero_tenant_id, project_id, opts)
249
+ data
250
+ end
251
+
252
+ # Allows you to retrieve a single project
253
+ # Allows you to retrieve a specific project
254
+ # @param xero_tenant_id [String] Xero identifier for Tenant
255
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
256
+ # @param [Hash] opts the optional parameters
257
+ # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
258
+ def get_project_with_http_info(xero_tenant_id, project_id, opts = {})
259
+ if @api_client.config.debugging
260
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...'
261
+ end
262
+ # verify the required parameter 'xero_tenant_id' is set
263
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
264
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project"
265
+ end
266
+ # verify the required parameter 'project_id' is set
267
+ if @api_client.config.client_side_validation && project_id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project"
269
+ end
270
+ # resource path
271
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
272
+
273
+ # query parameters
274
+ query_params = opts[:query_params] || {}
275
+
276
+ # header parameters
277
+ header_params = opts[:header_params] || {}
278
+ # HTTP header 'Accept' (if needed)
279
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
280
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
281
+
282
+ # form parameters
283
+ form_params = opts[:form_params] || {}
284
+
285
+ # http body (model)
286
+ post_body = opts[:body]
287
+
288
+ # return_type
289
+ return_type = opts[:return_type] || 'Project'
290
+
291
+ # auth_names
292
+ auth_names = opts[:auth_names] || ['OAuth2']
293
+
294
+ new_options = opts.merge(
295
+ :header_params => header_params,
296
+ :query_params => query_params,
297
+ :form_params => form_params,
298
+ :body => post_body,
299
+ :auth_names => auth_names,
300
+ :return_type => return_type
301
+ )
302
+
303
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
304
+ if @api_client.config.debugging
305
+ @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
306
+ end
307
+ return data, status_code, headers
308
+ end
309
+
310
+ # list all project users
311
+ # Allows you to retrieve the users on a projects.
312
+ # @param xero_tenant_id [String] Xero identifier for Tenant
313
+ # @param [Hash] opts the optional parameters
314
+ # @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. (default to 1)
315
+ # @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. (default to 50)
316
+ # @return [ProjectUsers]
317
+ def get_project_users(xero_tenant_id, opts = {})
318
+ data, _status_code, _headers = get_project_users_with_http_info(xero_tenant_id, opts)
319
+ data
320
+ end
321
+
322
+ # list all project users
323
+ # Allows you to retrieve the users on a projects.
324
+ # @param xero_tenant_id [String] Xero identifier for Tenant
325
+ # @param [Hash] opts the optional parameters
326
+ # @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.
327
+ # @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.
328
+ # @return [Array<(ProjectUsers, Integer, Hash)>] ProjectUsers data, response status code and response headers
329
+ def get_project_users_with_http_info(xero_tenant_id, opts = {})
330
+ if @api_client.config.debugging
331
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_users ...'
332
+ end
333
+ # verify the required parameter 'xero_tenant_id' is set
334
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
335
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project_users"
336
+ end
337
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
338
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be smaller than or equal to 500.'
339
+ end
340
+
341
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
342
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be greater than or equal to 1.'
343
+ end
344
+
345
+ # resource path
346
+ local_var_path = '/projectsusers'
347
+
348
+ # query parameters
349
+ query_params = opts[:query_params] || {}
350
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
351
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
352
+
353
+ # header parameters
354
+ header_params = opts[:header_params] || {}
355
+ # HTTP header 'Accept' (if needed)
356
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
357
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
358
+
359
+ # form parameters
360
+ form_params = opts[:form_params] || {}
361
+
362
+ # http body (model)
363
+ post_body = opts[:body]
364
+
365
+ # return_type
366
+ return_type = opts[:return_type] || 'ProjectUsers'
367
+
368
+ # auth_names
369
+ auth_names = opts[:auth_names] || ['OAuth2']
370
+
371
+ new_options = opts.merge(
372
+ :header_params => header_params,
373
+ :query_params => query_params,
374
+ :form_params => form_params,
375
+ :body => post_body,
376
+ :auth_names => auth_names,
377
+ :return_type => return_type
378
+ )
379
+
380
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
381
+ if @api_client.config.debugging
382
+ @api_client.config.logger.debug "API called: ProjectApi#get_project_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
383
+ end
384
+ return data, status_code, headers
385
+ end
386
+
387
+ # list all projects
388
+ # Allows you to retrieve, create and update projects.
389
+ # @param xero_tenant_id [String] Xero identifier for Tenant
390
+ # @param [Hash] opts the optional parameters
391
+ # @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
392
+ # @option opts [String] :contact_id Filter for projects for a specific contact
393
+ # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
394
+ # @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. (default to 1)
395
+ # @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. (default to 50)
396
+ # @return [Projects]
397
+ def get_projects(xero_tenant_id, opts = {})
398
+ data, _status_code, _headers = get_projects_with_http_info(xero_tenant_id, opts)
399
+ data
400
+ end
401
+
402
+ # list all projects
403
+ # Allows you to retrieve, create and update projects.
404
+ # @param xero_tenant_id [String] Xero identifier for Tenant
405
+ # @param [Hash] opts the optional parameters
406
+ # @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
407
+ # @option opts [String] :contact_id Filter for projects for a specific contact
408
+ # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
409
+ # @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.
410
+ # @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.
411
+ # @return [Array<(Projects, Integer, Hash)>] Projects data, response status code and response headers
412
+ def get_projects_with_http_info(xero_tenant_id, opts = {})
413
+ if @api_client.config.debugging
414
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...'
415
+ end
416
+ # verify the required parameter 'xero_tenant_id' is set
417
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
418
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_projects"
419
+ end
420
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
421
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be smaller than or equal to 500.'
422
+ end
423
+
424
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
425
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be greater than or equal to 1.'
426
+ end
427
+
428
+ # resource path
429
+ local_var_path = '/projects'
430
+
431
+ # query parameters
432
+ query_params = opts[:query_params] || {}
433
+ query_params[:'projectIds'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
434
+ query_params[:'contactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
435
+ query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
436
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
437
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
438
+
439
+ # header parameters
440
+ header_params = opts[:header_params] || {}
441
+ # HTTP header 'Accept' (if needed)
442
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
443
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
444
+
445
+ # form parameters
446
+ form_params = opts[:form_params] || {}
447
+
448
+ # http body (model)
449
+ post_body = opts[:body]
450
+
451
+ # return_type
452
+ return_type = opts[:return_type] || 'Projects'
453
+
454
+ # auth_names
455
+ auth_names = opts[:auth_names] || ['OAuth2']
456
+
457
+ new_options = opts.merge(
458
+ :header_params => header_params,
459
+ :query_params => query_params,
460
+ :form_params => form_params,
461
+ :body => post_body,
462
+ :auth_names => auth_names,
463
+ :return_type => return_type
464
+ )
465
+
466
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
467
+ if @api_client.config.debugging
468
+ @api_client.config.logger.debug "API called: ProjectApi#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
469
+ end
470
+ return data, status_code, headers
471
+ end
472
+
473
+ # Allows you to retrieve a single project
474
+ # Allows you to retrieve a specific project
475
+ # @param xero_tenant_id [String] Xero identifier for Tenant
476
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
477
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
478
+ # @param [Hash] opts the optional parameters
479
+ # @return [Task]
480
+ def get_task(xero_tenant_id, project_id, task_id, opts = {})
481
+ data, _status_code, _headers = get_task_with_http_info(xero_tenant_id, project_id, task_id, opts)
482
+ data
483
+ end
484
+
485
+ # Allows you to retrieve a single project
486
+ # Allows you to retrieve a specific project
487
+ # @param xero_tenant_id [String] Xero identifier for Tenant
488
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
489
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
490
+ # @param [Hash] opts the optional parameters
491
+ # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers
492
+ def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {})
493
+ if @api_client.config.debugging
494
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_task ...'
495
+ end
496
+ # verify the required parameter 'xero_tenant_id' is set
497
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
498
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_task"
499
+ end
500
+ # verify the required parameter 'project_id' is set
501
+ if @api_client.config.client_side_validation && project_id.nil?
502
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_task"
503
+ end
504
+ # verify the required parameter 'task_id' is set
505
+ if @api_client.config.client_side_validation && task_id.nil?
506
+ fail ArgumentError, "Missing the required parameter 'task_id' when calling ProjectApi.get_task"
507
+ end
508
+ # resource path
509
+ local_var_path = '/projects/{projectId}/tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s)
510
+
511
+ # query parameters
512
+ query_params = opts[:query_params] || {}
513
+
514
+ # header parameters
515
+ header_params = opts[:header_params] || {}
516
+ # HTTP header 'Accept' (if needed)
517
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
518
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
519
+
520
+ # form parameters
521
+ form_params = opts[:form_params] || {}
522
+
523
+ # http body (model)
524
+ post_body = opts[:body]
525
+
526
+ # return_type
527
+ return_type = opts[:return_type] || 'Task'
528
+
529
+ # auth_names
530
+ auth_names = opts[:auth_names] || ['OAuth2']
531
+
532
+ new_options = opts.merge(
533
+ :header_params => header_params,
534
+ :query_params => query_params,
535
+ :form_params => form_params,
536
+ :body => post_body,
537
+ :auth_names => auth_names,
538
+ :return_type => return_type
539
+ )
540
+
541
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
542
+ if @api_client.config.debugging
543
+ @api_client.config.logger.debug "API called: ProjectApi#get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
544
+ end
545
+ return data, status_code, headers
546
+ end
547
+
548
+ # Allows you to retrieve a single project
549
+ # Allows you to retrieve a specific project
550
+ # @param xero_tenant_id [String] Xero identifier for Tenant
551
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
552
+ # @param [Hash] opts the optional parameters
553
+ # @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.
554
+ # @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.
555
+ # @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}
556
+ # @return [Tasks]
557
+ def get_tasks(xero_tenant_id, project_id, opts = {})
558
+ data, _status_code, _headers = get_tasks_with_http_info(xero_tenant_id, project_id, opts)
559
+ data
560
+ end
561
+
562
+ # Allows you to retrieve a single project
563
+ # Allows you to retrieve a specific project
564
+ # @param xero_tenant_id [String] Xero identifier for Tenant
565
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
566
+ # @param [Hash] opts the optional parameters
567
+ # @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.
568
+ # @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.
569
+ # @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}
570
+ # @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers
571
+ def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {})
572
+ if @api_client.config.debugging
573
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_tasks ...'
574
+ end
575
+ # verify the required parameter 'xero_tenant_id' is set
576
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
577
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_tasks"
578
+ end
579
+ # verify the required parameter 'project_id' is set
580
+ if @api_client.config.client_side_validation && project_id.nil?
581
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_tasks"
582
+ end
583
+ # resource path
584
+ local_var_path = '/projects/{projectId}/tasks'.sub('{' + 'projectId' + '}', project_id.to_s)
585
+
586
+ # query parameters
587
+ query_params = opts[:query_params] || {}
588
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
589
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
590
+ query_params[:'taskIds'] = opts[:'task_ids'] if !opts[:'task_ids'].nil?
591
+
592
+ # header parameters
593
+ header_params = opts[:header_params] || {}
594
+ # HTTP header 'Accept' (if needed)
595
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
596
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
597
+
598
+ # form parameters
599
+ form_params = opts[:form_params] || {}
600
+
601
+ # http body (model)
602
+ post_body = opts[:body]
603
+
604
+ # return_type
605
+ return_type = opts[:return_type] || 'Tasks'
606
+
607
+ # auth_names
608
+ auth_names = opts[:auth_names] || ['OAuth2']
609
+
610
+ new_options = opts.merge(
611
+ :header_params => header_params,
612
+ :query_params => query_params,
613
+ :form_params => form_params,
614
+ :body => post_body,
615
+ :auth_names => auth_names,
616
+ :return_type => return_type
617
+ )
618
+
619
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
620
+ if @api_client.config.debugging
621
+ @api_client.config.logger.debug "API called: ProjectApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
622
+ end
623
+ return data, status_code, headers
624
+ end
625
+
626
+ # Allows you to retrieve the time entries associated with a specific project
627
+ # Allows you to retrieve the time entries associated with a specific project
628
+ # @param xero_tenant_id [String] Xero identifier for Tenant
629
+ # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
630
+ # @param [Hash] opts the optional parameters
631
+ # @option opts [String] :user_id The xero user identifier of the person who logged time.
632
+ # @option opts [String] :task_id Identifier of the task that time entry is logged against.
633
+ # @option opts [String] :invoice_id Finds all time entries for this invoice.
634
+ # @option opts [String] :contact_id Finds all time entries for this contact identifier.
635
+ # @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.
636
+ # @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.
637
+ # @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.
638
+ # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
639
+ # @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.
640
+ # @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.
641
+ # @return [TimeEntries]
642
+ def get_time_entries(xero_tenant_id, project_id, opts = {})
643
+ data, _status_code, _headers = get_time_entries_with_http_info(xero_tenant_id, project_id, opts)
644
+ data
645
+ end
646
+
647
+ # Allows you to retrieve the time entries associated with a specific project
648
+ # Allows you to retrieve the time entries associated with a specific project
649
+ # @param xero_tenant_id [String] Xero identifier for Tenant
650
+ # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
651
+ # @param [Hash] opts the optional parameters
652
+ # @option opts [String] :user_id The xero user identifier of the person who logged time.
653
+ # @option opts [String] :task_id Identifier of the task that time entry is logged against.
654
+ # @option opts [String] :invoice_id Finds all time entries for this invoice.
655
+ # @option opts [String] :contact_id Finds all time entries for this contact identifier.
656
+ # @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.
657
+ # @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.
658
+ # @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.
659
+ # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
660
+ # @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.
661
+ # @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.
662
+ # @return [Array<(TimeEntries, Integer, Hash)>] TimeEntries data, response status code and response headers
663
+ def get_time_entries_with_http_info(xero_tenant_id, project_id, opts = {})
664
+ if @api_client.config.debugging
665
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entries ...'
666
+ end
667
+ # verify the required parameter 'xero_tenant_id' is set
668
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
669
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entries"
670
+ end
671
+ # verify the required parameter 'project_id' is set
672
+ if @api_client.config.client_side_validation && project_id.nil?
673
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entries"
674
+ end
675
+ # resource path
676
+ local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
677
+
678
+ # query parameters
679
+ query_params = opts[:query_params] || {}
680
+ query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
681
+ query_params[:'taskId'] = opts[:'task_id'] if !opts[:'task_id'].nil?
682
+ query_params[:'invoiceId'] = opts[:'invoice_id'] if !opts[:'invoice_id'].nil?
683
+ query_params[:'contactId'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
684
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
685
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
686
+ query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
687
+ query_params[:'isChargeable'] = opts[:'is_chargeable'] if !opts[:'is_chargeable'].nil?
688
+ query_params[:'dateAfterUtc'] = opts[:'date_after_utc'] if !opts[:'date_after_utc'].nil?
689
+ query_params[:'dateBeforeUtc'] = opts[:'date_before_utc'] if !opts[:'date_before_utc'].nil?
690
+
691
+ # header parameters
692
+ header_params = opts[:header_params] || {}
693
+ # HTTP header 'Accept' (if needed)
694
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
695
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
696
+
697
+ # form parameters
698
+ form_params = opts[:form_params] || {}
699
+
700
+ # http body (model)
701
+ post_body = opts[:body]
702
+
703
+ # return_type
704
+ return_type = opts[:return_type] || 'TimeEntries'
705
+
706
+ # auth_names
707
+ auth_names = opts[:auth_names] || ['OAuth2']
708
+
709
+ new_options = opts.merge(
710
+ :header_params => header_params,
711
+ :query_params => query_params,
712
+ :form_params => form_params,
713
+ :body => post_body,
714
+ :auth_names => auth_names,
715
+ :return_type => return_type
716
+ )
717
+
718
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
719
+ if @api_client.config.debugging
720
+ @api_client.config.logger.debug "API called: ProjectApi#get_time_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
721
+ end
722
+ return data, status_code, headers
723
+ end
724
+
725
+ # Allows you to get a single time entry in a project
726
+ # Allows you to upget a single time entry in a project
727
+ # @param xero_tenant_id [String] Xero identifier for Tenant
728
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
729
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
730
+ # @param [Hash] opts the optional parameters
731
+ # @return [TimeEntry]
732
+ def get_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
733
+ data, _status_code, _headers = get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
734
+ data
735
+ end
736
+
737
+ # Allows you to get a single time entry in a project
738
+ # Allows you to upget a single time entry in a project
739
+ # @param xero_tenant_id [String] Xero identifier for Tenant
740
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
741
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
742
+ # @param [Hash] opts the optional parameters
743
+ # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
744
+ def get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
745
+ if @api_client.config.debugging
746
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entry ...'
747
+ end
748
+ # verify the required parameter 'xero_tenant_id' is set
749
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
750
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entry"
751
+ end
752
+ # verify the required parameter 'project_id' is set
753
+ if @api_client.config.client_side_validation && project_id.nil?
754
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entry"
755
+ end
756
+ # verify the required parameter 'time_entry_id' is set
757
+ if @api_client.config.client_side_validation && time_entry_id.nil?
758
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.get_time_entry"
759
+ end
760
+ # resource path
761
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
762
+
763
+ # query parameters
764
+ query_params = opts[:query_params] || {}
765
+
766
+ # header parameters
767
+ header_params = opts[:header_params] || {}
768
+ # HTTP header 'Accept' (if needed)
769
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
770
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
771
+
772
+ # form parameters
773
+ form_params = opts[:form_params] || {}
774
+
775
+ # http body (model)
776
+ post_body = opts[:body]
777
+
778
+ # return_type
779
+ return_type = opts[:return_type] || 'TimeEntry'
780
+
781
+ # auth_names
782
+ auth_names = opts[:auth_names] || ['OAuth2']
783
+
784
+ new_options = opts.merge(
785
+ :header_params => header_params,
786
+ :query_params => query_params,
787
+ :form_params => form_params,
788
+ :body => post_body,
789
+ :auth_names => auth_names,
790
+ :return_type => return_type
791
+ )
792
+
793
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
794
+ if @api_client.config.debugging
795
+ @api_client.config.logger.debug "API called: ProjectApi#get_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
796
+ end
797
+ return data, status_code, headers
798
+ end
799
+
800
+ # creates a project for the specified contact
801
+ # Allows you to update a specific projects.
802
+ # @param xero_tenant_id [String] Xero identifier for Tenant
803
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
804
+ # @param project_patch [ProjectPatch] Update the status of an existing Project
805
+ # @param [Hash] opts the optional parameters
806
+ # @return [nil]
807
+ def patch_project(xero_tenant_id, project_id, project_patch, opts = {})
808
+ patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts)
809
+ nil
810
+ end
811
+
812
+ # creates a project for the specified contact
813
+ # Allows you to update a specific projects.
814
+ # @param xero_tenant_id [String] Xero identifier for Tenant
815
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
816
+ # @param project_patch [ProjectPatch] Update the status of an existing Project
817
+ # @param [Hash] opts the optional parameters
818
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
819
+ def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts = {})
820
+ if @api_client.config.debugging
821
+ @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...'
822
+ end
823
+ # verify the required parameter 'xero_tenant_id' is set
824
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
825
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.patch_project"
826
+ end
827
+ # verify the required parameter 'project_id' is set
828
+ if @api_client.config.client_side_validation && project_id.nil?
829
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project"
830
+ end
831
+ # verify the required parameter 'project_patch' is set
832
+ if @api_client.config.client_side_validation && project_patch.nil?
833
+ fail ArgumentError, "Missing the required parameter 'project_patch' when calling ProjectApi.patch_project"
834
+ end
835
+ # resource path
836
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
837
+
838
+ # query parameters
839
+ query_params = opts[:query_params] || {}
840
+
841
+ # header parameters
842
+ header_params = opts[:header_params] || {}
843
+ # HTTP header 'Accept' (if needed)
844
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
845
+ # HTTP header 'Content-Type'
846
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
847
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
848
+
849
+ # form parameters
850
+ form_params = opts[:form_params] || {}
851
+
852
+ # http body (model)
853
+ post_body = opts[:body] || @api_client.object_to_http_body(project_patch)
854
+
855
+ # return_type
856
+ return_type = opts[:return_type]
857
+
858
+ # auth_names
859
+ auth_names = opts[:auth_names] || ['OAuth2']
860
+
861
+ new_options = opts.merge(
862
+ :header_params => header_params,
863
+ :query_params => query_params,
864
+ :form_params => form_params,
865
+ :body => post_body,
866
+ :auth_names => auth_names,
867
+ :return_type => return_type
868
+ )
869
+
870
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
871
+ if @api_client.config.debugging
872
+ @api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
873
+ end
874
+ return data, status_code, headers
875
+ end
876
+
877
+ # update a specific project
878
+ # Allows you to update a specific projects.
879
+ # @param xero_tenant_id [String] Xero identifier for Tenant
880
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
881
+ # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
882
+ # @param [Hash] opts the optional parameters
883
+ # @return [nil]
884
+ def update_project(xero_tenant_id, project_id, project_create_or_update, opts = {})
885
+ update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts)
886
+ nil
887
+ end
888
+
889
+ # update a specific project
890
+ # Allows you to update a specific projects.
891
+ # @param xero_tenant_id [String] Xero identifier for Tenant
892
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
893
+ # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
894
+ # @param [Hash] opts the optional parameters
895
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
896
+ def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts = {})
897
+ if @api_client.config.debugging
898
+ @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...'
899
+ end
900
+ # verify the required parameter 'xero_tenant_id' is set
901
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
902
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_project"
903
+ end
904
+ # verify the required parameter 'project_id' is set
905
+ if @api_client.config.client_side_validation && project_id.nil?
906
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_project"
907
+ end
908
+ # verify the required parameter 'project_create_or_update' is set
909
+ if @api_client.config.client_side_validation && project_create_or_update.nil?
910
+ fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.update_project"
911
+ end
912
+ # resource path
913
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
914
+
915
+ # query parameters
916
+ query_params = opts[:query_params] || {}
917
+
918
+ # header parameters
919
+ header_params = opts[:header_params] || {}
920
+ # HTTP header 'Accept' (if needed)
921
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
922
+ # HTTP header 'Content-Type'
923
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
924
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
925
+
926
+ # form parameters
927
+ form_params = opts[:form_params] || {}
928
+
929
+ # http body (model)
930
+ post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
931
+
932
+ # return_type
933
+ return_type = opts[:return_type]
934
+
935
+ # auth_names
936
+ auth_names = opts[:auth_names] || ['OAuth2']
937
+
938
+ new_options = opts.merge(
939
+ :header_params => header_params,
940
+ :query_params => query_params,
941
+ :form_params => form_params,
942
+ :body => post_body,
943
+ :auth_names => auth_names,
944
+ :return_type => return_type
945
+ )
946
+
947
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
948
+ if @api_client.config.debugging
949
+ @api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
950
+ end
951
+ return data, status_code, headers
952
+ end
953
+
954
+ # Allows you to update time entry in a project
955
+ # Allows you to update time entry in a project
956
+ # @param xero_tenant_id [String] Xero identifier for Tenant
957
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
958
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
959
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
960
+ # @param [Hash] opts the optional parameters
961
+ # @return [nil]
962
+ def update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
963
+ update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts)
964
+ nil
965
+ end
966
+
967
+ # Allows you to update time entry in a project
968
+ # Allows you to update time entry in a project
969
+ # @param xero_tenant_id [String] Xero identifier for Tenant
970
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
971
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
972
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
973
+ # @param [Hash] opts the optional parameters
974
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
975
+ def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
976
+ if @api_client.config.debugging
977
+ @api_client.config.logger.debug 'Calling API: ProjectApi.update_time_entry ...'
978
+ end
979
+ # verify the required parameter 'xero_tenant_id' is set
980
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
981
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_time_entry"
982
+ end
983
+ # verify the required parameter 'project_id' is set
984
+ if @api_client.config.client_side_validation && project_id.nil?
985
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_time_entry"
986
+ end
987
+ # verify the required parameter 'time_entry_id' is set
988
+ if @api_client.config.client_side_validation && time_entry_id.nil?
989
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.update_time_entry"
990
+ end
991
+ # verify the required parameter 'time_entry_create_or_update' is set
992
+ if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
993
+ fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.update_time_entry"
994
+ end
995
+ # resource path
996
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
997
+
998
+ # query parameters
999
+ query_params = opts[:query_params] || {}
1000
+
1001
+ # header parameters
1002
+ header_params = opts[:header_params] || {}
1003
+ # HTTP header 'Content-Type'
1004
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1005
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1006
+
1007
+ # form parameters
1008
+ form_params = opts[:form_params] || {}
1009
+
1010
+ # http body (model)
1011
+ post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
1012
+
1013
+ # return_type
1014
+ return_type = opts[:return_type]
1015
+
1016
+ # auth_names
1017
+ auth_names = opts[:auth_names] || ['OAuth2']
1018
+
1019
+ new_options = opts.merge(
1020
+ :header_params => header_params,
1021
+ :query_params => query_params,
1022
+ :form_params => form_params,
1023
+ :body => post_body,
1024
+ :auth_names => auth_names,
1025
+ :return_type => return_type
1026
+ )
1027
+
1028
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1029
+ if @api_client.config.debugging
1030
+ @api_client.config.logger.debug "API called: ProjectApi#update_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1031
+ end
1032
+ return data, status_code, headers
1033
+ end
1034
+ end
1035
+ end