xero-ruby 1.1.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (218) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +181 -72
  3. data/build_notes.md +43 -0
  4. data/docs/accounting/AccountingApi.md +1503 -779
  5. data/docs/accounting/Allocation.md +11 -1
  6. data/docs/accounting/Attachment.md +1 -1
  7. data/docs/accounting/BankTransfer.md +1 -1
  8. data/docs/accounting/BatchPayment.md +1 -1
  9. data/docs/accounting/Contact.md +2 -2
  10. data/docs/accounting/CreditNote.md +2 -2
  11. data/docs/accounting/Invoice.md +2 -2
  12. data/docs/accounting/ManualJournalLine.md +2 -0
  13. data/docs/accounting/Organisation.md +3 -1
  14. data/docs/accounting/Payment.md +4 -4
  15. data/docs/accounting/Quote.md +5 -1
  16. data/docs/accounting/Report.md +1 -1
  17. data/docs/accounting/{TenNinteyNineContact.md → TenNinetyNineContact.md} +2 -2
  18. data/docs/assets/AssetApi.md +40 -16
  19. data/docs/assets/AssetType.md +1 -1
  20. data/docs/projects/Amount.md +19 -0
  21. data/docs/projects/ChargeType.md +16 -0
  22. data/docs/projects/CurrencyCode.md +16 -0
  23. data/docs/projects/Error.md +19 -0
  24. data/docs/projects/Pagination.md +23 -0
  25. data/docs/projects/Project.md +59 -0
  26. data/docs/projects/ProjectApi.md +979 -0
  27. data/docs/projects/ProjectCreateOrUpdate.md +23 -0
  28. data/docs/projects/ProjectPatch.md +17 -0
  29. data/docs/projects/ProjectStatus.md +16 -0
  30. data/docs/projects/ProjectUser.md +21 -0
  31. data/docs/projects/ProjectUsers.md +19 -0
  32. data/docs/projects/Projects.md +19 -0
  33. data/docs/projects/Task.md +45 -0
  34. data/docs/projects/TaskCreateOrUpdate.md +23 -0
  35. data/docs/projects/Tasks.md +19 -0
  36. data/docs/projects/TimeEntries.md +19 -0
  37. data/docs/projects/TimeEntry.md +33 -0
  38. data/docs/projects/TimeEntryCreateOrUpdate.md +25 -0
  39. data/lib/xero-ruby.rb +22 -3
  40. data/lib/xero-ruby/api/accounting_api.rb +1368 -72
  41. data/lib/xero-ruby/api/asset_api.rb +39 -3
  42. data/lib/xero-ruby/api/project_api.rb +1113 -0
  43. data/lib/xero-ruby/api_client.rb +104 -38
  44. data/lib/xero-ruby/api_error.rb +2 -2
  45. data/lib/xero-ruby/configuration.rb +4 -5
  46. data/lib/xero-ruby/models/accounting/account.rb +61 -20
  47. data/lib/xero-ruby/models/accounting/account_type.rb +2 -2
  48. data/lib/xero-ruby/models/accounting/accounts.rb +8 -3
  49. data/lib/xero-ruby/models/accounting/accounts_payable.rb +11 -5
  50. data/lib/xero-ruby/models/accounting/accounts_receivable.rb +11 -5
  51. data/lib/xero-ruby/models/accounting/address.rb +19 -12
  52. data/lib/xero-ruby/models/accounting/allocation.rb +66 -9
  53. data/lib/xero-ruby/models/accounting/allocations.rb +8 -3
  54. data/lib/xero-ruby/models/accounting/attachment.rb +13 -9
  55. data/lib/xero-ruby/models/accounting/attachments.rb +8 -3
  56. data/lib/xero-ruby/models/accounting/balances.rb +9 -3
  57. data/lib/xero-ruby/models/accounting/bank_transaction.rb +43 -24
  58. data/lib/xero-ruby/models/accounting/bank_transactions.rb +8 -3
  59. data/lib/xero-ruby/models/accounting/bank_transfer.rb +20 -14
  60. data/lib/xero-ruby/models/accounting/bank_transfers.rb +8 -3
  61. data/lib/xero-ruby/models/accounting/batch_payment.rb +29 -19
  62. data/lib/xero-ruby/models/accounting/batch_payment_details.rb +11 -7
  63. data/lib/xero-ruby/models/accounting/batch_payments.rb +8 -3
  64. data/lib/xero-ruby/models/accounting/bill.rb +8 -3
  65. data/lib/xero-ruby/models/accounting/branding_theme.rb +13 -8
  66. data/lib/xero-ruby/models/accounting/branding_themes.rb +8 -3
  67. data/lib/xero-ruby/models/accounting/cis_org_setting.rb +9 -5
  68. data/lib/xero-ruby/models/accounting/cis_setting.rb +8 -4
  69. data/lib/xero-ruby/models/accounting/cis_settings.rb +8 -3
  70. data/lib/xero-ruby/models/accounting/contact.rb +51 -37
  71. data/lib/xero-ruby/models/accounting/contact_group.rb +12 -6
  72. data/lib/xero-ruby/models/accounting/contact_groups.rb +8 -3
  73. data/lib/xero-ruby/models/accounting/contact_person.rb +10 -6
  74. data/lib/xero-ruby/models/accounting/contacts.rb +8 -3
  75. data/lib/xero-ruby/models/accounting/country_code.rb +2 -2
  76. data/lib/xero-ruby/models/accounting/credit_note.rb +47 -30
  77. data/lib/xero-ruby/models/accounting/credit_notes.rb +8 -3
  78. data/lib/xero-ruby/models/accounting/currencies.rb +8 -3
  79. data/lib/xero-ruby/models/accounting/currency.rb +9 -4
  80. data/lib/xero-ruby/models/accounting/currency_code.rb +2 -2
  81. data/lib/xero-ruby/models/accounting/element.rb +14 -4
  82. data/lib/xero-ruby/models/accounting/employee.rb +17 -8
  83. data/lib/xero-ruby/models/accounting/employees.rb +8 -3
  84. data/lib/xero-ruby/models/accounting/error.rb +10 -6
  85. data/lib/xero-ruby/models/accounting/expense_claim.rb +26 -15
  86. data/lib/xero-ruby/models/accounting/expense_claims.rb +8 -3
  87. data/lib/xero-ruby/models/accounting/external_link.rb +14 -4
  88. data/lib/xero-ruby/models/accounting/history_record.rb +10 -6
  89. data/lib/xero-ruby/models/accounting/history_records.rb +8 -3
  90. data/lib/xero-ruby/models/accounting/invoice.rb +69 -46
  91. data/lib/xero-ruby/models/accounting/invoice_reminder.rb +7 -3
  92. data/lib/xero-ruby/models/accounting/invoice_reminders.rb +8 -3
  93. data/lib/xero-ruby/models/accounting/invoices.rb +8 -3
  94. data/lib/xero-ruby/models/accounting/item.rb +24 -18
  95. data/lib/xero-ruby/models/accounting/items.rb +8 -3
  96. data/lib/xero-ruby/models/accounting/journal.rb +39 -10
  97. data/lib/xero-ruby/models/accounting/journal_line.rb +21 -16
  98. data/lib/xero-ruby/models/accounting/journals.rb +8 -3
  99. data/lib/xero-ruby/models/accounting/line_amount_types.rb +2 -2
  100. data/lib/xero-ruby/models/accounting/line_item.rb +25 -21
  101. data/lib/xero-ruby/models/accounting/line_item_tracking.rb +10 -6
  102. data/lib/xero-ruby/models/accounting/linked_transaction.rb +25 -13
  103. data/lib/xero-ruby/models/accounting/linked_transactions.rb +8 -3
  104. data/lib/xero-ruby/models/accounting/manual_journal.rb +25 -15
  105. data/lib/xero-ruby/models/accounting/manual_journal_line.rb +26 -12
  106. data/lib/xero-ruby/models/accounting/manual_journals.rb +8 -3
  107. data/lib/xero-ruby/models/accounting/online_invoice.rb +7 -3
  108. data/lib/xero-ruby/models/accounting/online_invoices.rb +8 -3
  109. data/lib/xero-ruby/models/accounting/organisation.rb +122 -32
  110. data/lib/xero-ruby/models/accounting/organisations.rb +8 -3
  111. data/lib/xero-ruby/models/accounting/overpayment.rb +36 -23
  112. data/lib/xero-ruby/models/accounting/overpayments.rb +8 -3
  113. data/lib/xero-ruby/models/accounting/payment.rb +47 -24
  114. data/lib/xero-ruby/models/accounting/payment_delete.rb +7 -3
  115. data/lib/xero-ruby/models/accounting/payment_service.rb +12 -8
  116. data/lib/xero-ruby/models/accounting/payment_services.rb +8 -3
  117. data/lib/xero-ruby/models/accounting/payment_term.rb +9 -3
  118. data/lib/xero-ruby/models/accounting/payment_term_type.rb +2 -2
  119. data/lib/xero-ruby/models/accounting/payments.rb +8 -3
  120. data/lib/xero-ruby/models/accounting/phone.rb +16 -6
  121. data/lib/xero-ruby/models/accounting/prepayment.rb +37 -23
  122. data/lib/xero-ruby/models/accounting/prepayments.rb +8 -3
  123. data/lib/xero-ruby/models/accounting/purchase.rb +11 -7
  124. data/lib/xero-ruby/models/accounting/purchase_order.rb +45 -33
  125. data/lib/xero-ruby/models/accounting/purchase_orders.rb +8 -3
  126. data/lib/xero-ruby/models/accounting/quote.rb +58 -28
  127. data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +2 -2
  128. data/lib/xero-ruby/models/accounting/quote_status_codes.rb +3 -2
  129. data/lib/xero-ruby/models/accounting/quotes.rb +8 -3
  130. data/lib/xero-ruby/models/accounting/receipt.rb +32 -19
  131. data/lib/xero-ruby/models/accounting/receipts.rb +8 -3
  132. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +30 -17
  133. data/lib/xero-ruby/models/accounting/repeating_invoices.rb +8 -3
  134. data/lib/xero-ruby/models/accounting/report.rb +15 -9
  135. data/lib/xero-ruby/models/accounting/report_attribute.rb +9 -3
  136. data/lib/xero-ruby/models/accounting/report_cell.rb +9 -3
  137. data/lib/xero-ruby/models/accounting/report_fields.rb +10 -3
  138. data/lib/xero-ruby/models/accounting/report_row.rb +10 -3
  139. data/lib/xero-ruby/models/accounting/report_rows.rb +11 -3
  140. data/lib/xero-ruby/models/accounting/report_with_row.rb +15 -9
  141. data/lib/xero-ruby/models/accounting/report_with_rows.rb +8 -3
  142. data/lib/xero-ruby/models/accounting/reports.rb +8 -3
  143. data/lib/xero-ruby/models/accounting/request_empty.rb +7 -3
  144. data/lib/xero-ruby/models/accounting/row_type.rb +2 -2
  145. data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +8 -4
  146. data/lib/xero-ruby/models/accounting/schedule.rb +23 -11
  147. data/lib/xero-ruby/models/accounting/tax_component.rb +11 -7
  148. data/lib/xero-ruby/models/accounting/tax_rate.rb +100 -18
  149. data/lib/xero-ruby/models/accounting/tax_rates.rb +8 -3
  150. data/lib/xero-ruby/models/accounting/tax_type.rb +2 -2
  151. data/lib/xero-ruby/models/accounting/{ten_nintey_nine_contact.rb → ten_ninety_nine_contact.rb} +44 -40
  152. data/lib/xero-ruby/models/accounting/time_zone.rb +2 -2
  153. data/lib/xero-ruby/models/accounting/tracking_categories.rb +8 -3
  154. data/lib/xero-ruby/models/accounting/tracking_category.rb +15 -8
  155. data/lib/xero-ruby/models/accounting/tracking_option.rb +13 -6
  156. data/lib/xero-ruby/models/accounting/tracking_options.rb +8 -3
  157. data/lib/xero-ruby/models/accounting/user.rb +20 -9
  158. data/lib/xero-ruby/models/accounting/users.rb +8 -3
  159. data/lib/xero-ruby/models/accounting/validation_error.rb +7 -3
  160. data/lib/xero-ruby/models/assets/asset.rb +24 -17
  161. data/lib/xero-ruby/models/assets/asset_status.rb +2 -2
  162. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +2 -2
  163. data/lib/xero-ruby/models/assets/asset_type.rb +13 -13
  164. data/lib/xero-ruby/models/assets/assets.rb +9 -3
  165. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +19 -15
  166. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +26 -11
  167. data/lib/xero-ruby/models/assets/error.rb +11 -7
  168. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +12 -8
  169. data/lib/xero-ruby/models/assets/pagination.rb +11 -3
  170. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +11 -7
  171. data/lib/xero-ruby/models/assets/setting.rb +14 -10
  172. data/lib/xero-ruby/models/projects/amount.rb +218 -0
  173. data/lib/xero-ruby/models/projects/charge_type.rb +38 -0
  174. data/lib/xero-ruby/models/projects/currency_code.rb +199 -0
  175. data/lib/xero-ruby/models/projects/error.rb +218 -0
  176. data/lib/xero-ruby/models/projects/pagination.rb +238 -0
  177. data/lib/xero-ruby/models/projects/project.rb +423 -0
  178. data/lib/xero-ruby/models/projects/project_create_or_update.rb +243 -0
  179. data/lib/xero-ruby/models/projects/project_patch.rb +213 -0
  180. data/lib/xero-ruby/models/projects/project_status.rb +37 -0
  181. data/lib/xero-ruby/models/projects/project_user.rb +228 -0
  182. data/lib/xero-ruby/models/projects/project_users.rb +220 -0
  183. data/lib/xero-ruby/models/projects/projects.rb +220 -0
  184. data/lib/xero-ruby/models/projects/task.rb +385 -0
  185. data/lib/xero-ruby/models/projects/task_create_or_update.rb +253 -0
  186. data/lib/xero-ruby/models/projects/tasks.rb +220 -0
  187. data/lib/xero-ruby/models/projects/time_entries.rb +220 -0
  188. data/lib/xero-ruby/models/projects/time_entry.rb +324 -0
  189. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +268 -0
  190. data/lib/xero-ruby/version.rb +3 -3
  191. data/spec/accounting/api/accounting_api_spec.rb +3 -3
  192. data/spec/accounting/models/ten_nintey_nine_contact_spec.rb +6 -6
  193. data/spec/api_client_spec.rb +125 -38
  194. data/spec/assets/api/asset_api_spec.rb +3 -3
  195. data/spec/configuration_spec.rb +7 -23
  196. data/spec/projects/api/project_api_spec.rb +229 -0
  197. data/spec/projects/models/amount_spec.rb +47 -0
  198. data/spec/projects/models/charge_type_spec.rb +35 -0
  199. data/spec/projects/models/currency_code_spec.rb +35 -0
  200. data/spec/projects/models/error_spec.rb +47 -0
  201. data/spec/projects/models/pagination_spec.rb +59 -0
  202. data/spec/projects/models/project_create_or_update_spec.rb +59 -0
  203. data/spec/projects/models/project_patch_spec.rb +41 -0
  204. data/spec/projects/models/project_spec.rb +167 -0
  205. data/spec/projects/models/project_status_spec.rb +35 -0
  206. data/spec/projects/models/project_user_spec.rb +53 -0
  207. data/spec/projects/models/project_users_spec.rb +47 -0
  208. data/spec/projects/models/projects_spec.rb +47 -0
  209. data/spec/projects/models/task_create_or_update_spec.rb +59 -0
  210. data/spec/projects/models/task_spec.rb +129 -0
  211. data/spec/projects/models/tasks_spec.rb +47 -0
  212. data/spec/projects/models/time_entries_spec.rb +47 -0
  213. data/spec/projects/models/time_entry_create_or_update_spec.rb +65 -0
  214. data/spec/projects/models/time_entry_spec.rb +93 -0
  215. data/xero-ruby.gemspec +3 -4
  216. metadata +85 -10
  217. data/xero-ruby-1.0.gem +0 -0
  218. data/xero-ruby.gem +0 -0
@@ -3,10 +3,10 @@
3
3
 
4
4
  #This is the Xero Assets API
5
5
 
6
- The version of the OpenAPI document: 2.1.3
6
+ The version of the OpenAPI document: 2.2.12
7
7
  Contact: api@xero.com
8
8
  Generated by: https://openapi-generator.tech
9
- OpenAPI Generator version: 4.3.0
9
+ OpenAPI Generator version: 4.3.1
10
10
 
11
11
  =end
12
12
 
@@ -16,7 +16,7 @@ module XeroRuby
16
16
  class AssetApi
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
  # adds a fixed asset
@@ -51,8 +51,14 @@ module XeroRuby
51
51
  # resource path
52
52
  local_var_path = '/Assets'
53
53
 
54
+ # camelize keys of incoming `where` opts
55
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
54
56
  # query parameters
55
57
  query_params = opts[:query_params] || {}
58
+
59
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
60
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
61
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
56
62
 
57
63
  # header parameters
58
64
  header_params = opts[:header_params] || {}
@@ -118,8 +124,14 @@ module XeroRuby
118
124
  # resource path
119
125
  local_var_path = '/AssetTypes'
120
126
 
127
+ # camelize keys of incoming `where` opts
128
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
121
129
  # query parameters
122
130
  query_params = opts[:query_params] || {}
131
+
132
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
133
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
134
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
123
135
 
124
136
  # header parameters
125
137
  header_params = opts[:header_params] || {}
@@ -189,8 +201,14 @@ module XeroRuby
189
201
  # resource path
190
202
  local_var_path = '/Assets/{id}'.sub('{' + 'id' + '}', id.to_s)
191
203
 
204
+ # camelize keys of incoming `where` opts
205
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
192
206
  # query parameters
193
207
  query_params = opts[:query_params] || {}
208
+
209
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
210
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
211
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
194
212
 
195
213
  # header parameters
196
214
  header_params = opts[:header_params] || {}
@@ -252,8 +270,14 @@ module XeroRuby
252
270
  # resource path
253
271
  local_var_path = '/Settings'
254
272
 
273
+ # camelize keys of incoming `where` opts
274
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
255
275
  # query parameters
256
276
  query_params = opts[:query_params] || {}
277
+
278
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
279
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
280
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
257
281
 
258
282
  # header parameters
259
283
  header_params = opts[:header_params] || {}
@@ -315,8 +339,14 @@ module XeroRuby
315
339
  # resource path
316
340
  local_var_path = '/AssetTypes'
317
341
 
342
+ # camelize keys of incoming `where` opts
343
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
318
344
  # query parameters
319
345
  query_params = opts[:query_params] || {}
346
+
347
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
348
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
349
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
320
350
 
321
351
  # header parameters
322
352
  header_params = opts[:header_params] || {}
@@ -406,6 +436,8 @@ module XeroRuby
406
436
  # resource path
407
437
  local_var_path = '/Assets'
408
438
 
439
+ # camelize keys of incoming `where` opts
440
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
409
441
  # query parameters
410
442
  query_params = opts[:query_params] || {}
411
443
  query_params[:'status'] = status
@@ -414,6 +446,10 @@ module XeroRuby
414
446
  query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?
415
447
  query_params[:'sortDirection'] = opts[:'sort_direction'] if !opts[:'sort_direction'].nil?
416
448
  query_params[:'filterBy'] = opts[:'filter_by'] if !opts[:'filter_by'].nil?
449
+
450
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
451
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
452
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
417
453
 
418
454
  # header parameters
419
455
  header_params = opts[:header_params] || {}
@@ -0,0 +1,1113 @@
1
+ =begin
2
+ #Xero Projects API
3
+
4
+ #This is the Xero Projects API
5
+
6
+ The version of the OpenAPI document: 2.2.12
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
+ # camelize keys of incoming `where` opts
53
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
58
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
59
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+ # HTTP header 'Content-Type'
66
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
67
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
68
+
69
+ # form parameters
70
+ form_params = opts[:form_params] || {}
71
+
72
+ # http body (model)
73
+ post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
74
+
75
+ # return_type
76
+ return_type = opts[:return_type] || 'Project'
77
+
78
+ # auth_names
79
+ auth_names = opts[:auth_names] || ['OAuth2']
80
+
81
+ new_options = opts.merge(
82
+ :header_params => header_params,
83
+ :query_params => query_params,
84
+ :form_params => form_params,
85
+ :body => post_body,
86
+ :auth_names => auth_names,
87
+ :return_type => return_type
88
+ )
89
+
90
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
91
+ if @api_client.config.debugging
92
+ @api_client.config.logger.debug "API called: ProjectApi#create_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
+ end
94
+ return data, status_code, headers
95
+ end
96
+
97
+ # Allows you to create a task
98
+ # Allows you to create a specific task
99
+ # @param xero_tenant_id [String] Xero identifier for Tenant
100
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
101
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
102
+ # @param [Hash] opts the optional parameters
103
+ # @return [TimeEntry]
104
+ def create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
105
+ data, _status_code, _headers = create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts)
106
+ data
107
+ end
108
+
109
+ # Allows you to create a task
110
+ # Allows you to create a specific task
111
+ # @param xero_tenant_id [String] Xero identifier for Tenant
112
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
113
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
114
+ # @param [Hash] opts the optional parameters
115
+ # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
116
+ def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
117
+ if @api_client.config.debugging
118
+ @api_client.config.logger.debug 'Calling API: ProjectApi.create_time_entry ...'
119
+ end
120
+ # verify the required parameter 'xero_tenant_id' is set
121
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.create_time_entry"
123
+ end
124
+ # verify the required parameter 'project_id' is set
125
+ if @api_client.config.client_side_validation && project_id.nil?
126
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.create_time_entry"
127
+ end
128
+ # verify the required parameter 'time_entry_create_or_update' is set
129
+ if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
130
+ fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.create_time_entry"
131
+ end
132
+ # resource path
133
+ local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
134
+
135
+ # camelize keys of incoming `where` opts
136
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
137
+ # query parameters
138
+ query_params = opts[:query_params] || {}
139
+
140
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
141
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
142
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
143
+
144
+ # header parameters
145
+ header_params = opts[:header_params] || {}
146
+ # HTTP header 'Accept' (if needed)
147
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
148
+ # HTTP header 'Content-Type'
149
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
150
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
151
+
152
+ # form parameters
153
+ form_params = opts[:form_params] || {}
154
+
155
+ # http body (model)
156
+ post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
157
+
158
+ # return_type
159
+ return_type = opts[:return_type] || 'TimeEntry'
160
+
161
+ # auth_names
162
+ auth_names = opts[:auth_names] || ['OAuth2']
163
+
164
+ new_options = opts.merge(
165
+ :header_params => header_params,
166
+ :query_params => query_params,
167
+ :form_params => form_params,
168
+ :body => post_body,
169
+ :auth_names => auth_names,
170
+ :return_type => return_type
171
+ )
172
+
173
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
174
+ if @api_client.config.debugging
175
+ @api_client.config.logger.debug "API called: ProjectApi#create_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
176
+ end
177
+ return data, status_code, headers
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 [nil]
187
+ def delete_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
188
+ delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
189
+ nil
190
+ end
191
+
192
+ # Allows you to delete a time entry
193
+ # Allows you to delete a specific time entry
194
+ # @param xero_tenant_id [String] Xero identifier for Tenant
195
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
196
+ # @param time_entry_id [String] You can specify an individual task by appending the id to the endpoint
197
+ # @param [Hash] opts the optional parameters
198
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
199
+ def delete_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
200
+ if @api_client.config.debugging
201
+ @api_client.config.logger.debug 'Calling API: ProjectApi.delete_time_entry ...'
202
+ end
203
+ # verify the required parameter 'xero_tenant_id' is set
204
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
205
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.delete_time_entry"
206
+ end
207
+ # verify the required parameter 'project_id' is set
208
+ if @api_client.config.client_side_validation && project_id.nil?
209
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.delete_time_entry"
210
+ end
211
+ # verify the required parameter 'time_entry_id' is set
212
+ if @api_client.config.client_side_validation && time_entry_id.nil?
213
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.delete_time_entry"
214
+ end
215
+ # resource path
216
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
217
+
218
+ # camelize keys of incoming `where` opts
219
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
220
+ # query parameters
221
+ query_params = opts[:query_params] || {}
222
+
223
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
224
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
225
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
226
+
227
+ # header parameters
228
+ header_params = opts[:header_params] || {}
229
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
230
+
231
+ # form parameters
232
+ form_params = opts[:form_params] || {}
233
+
234
+ # http body (model)
235
+ post_body = opts[:body]
236
+
237
+ # return_type
238
+ return_type = opts[:return_type]
239
+
240
+ # auth_names
241
+ auth_names = opts[:auth_names] || ['OAuth2']
242
+
243
+ new_options = opts.merge(
244
+ :header_params => header_params,
245
+ :query_params => query_params,
246
+ :form_params => form_params,
247
+ :body => post_body,
248
+ :auth_names => auth_names,
249
+ :return_type => return_type
250
+ )
251
+
252
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
253
+ if @api_client.config.debugging
254
+ @api_client.config.logger.debug "API called: ProjectApi#delete_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
255
+ end
256
+ return data, status_code, headers
257
+ end
258
+
259
+ # Allows you to retrieve a single project
260
+ # Allows you to retrieve a specific project
261
+ # @param xero_tenant_id [String] Xero identifier for Tenant
262
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
263
+ # @param [Hash] opts the optional parameters
264
+ # @return [Project]
265
+ def get_project(xero_tenant_id, project_id, opts = {})
266
+ data, _status_code, _headers = get_project_with_http_info(xero_tenant_id, project_id, opts)
267
+ data
268
+ end
269
+
270
+ # Allows you to retrieve a single project
271
+ # Allows you to retrieve a specific project
272
+ # @param xero_tenant_id [String] Xero identifier for Tenant
273
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
274
+ # @param [Hash] opts the optional parameters
275
+ # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
276
+ def get_project_with_http_info(xero_tenant_id, project_id, opts = {})
277
+ if @api_client.config.debugging
278
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_project ...'
279
+ end
280
+ # verify the required parameter 'xero_tenant_id' is set
281
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
282
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project"
283
+ end
284
+ # verify the required parameter 'project_id' is set
285
+ if @api_client.config.client_side_validation && project_id.nil?
286
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_project"
287
+ end
288
+ # resource path
289
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
290
+
291
+ # camelize keys of incoming `where` opts
292
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
293
+ # query parameters
294
+ query_params = opts[:query_params] || {}
295
+
296
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
297
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
298
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
299
+
300
+ # header parameters
301
+ header_params = opts[:header_params] || {}
302
+ # HTTP header 'Accept' (if needed)
303
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
304
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
305
+
306
+ # form parameters
307
+ form_params = opts[:form_params] || {}
308
+
309
+ # http body (model)
310
+ post_body = opts[:body]
311
+
312
+ # return_type
313
+ return_type = opts[:return_type] || 'Project'
314
+
315
+ # auth_names
316
+ auth_names = opts[:auth_names] || ['OAuth2']
317
+
318
+ new_options = opts.merge(
319
+ :header_params => header_params,
320
+ :query_params => query_params,
321
+ :form_params => form_params,
322
+ :body => post_body,
323
+ :auth_names => auth_names,
324
+ :return_type => return_type
325
+ )
326
+
327
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
328
+ if @api_client.config.debugging
329
+ @api_client.config.logger.debug "API called: ProjectApi#get_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
330
+ end
331
+ return data, status_code, headers
332
+ end
333
+
334
+ # list all project users
335
+ # Allows you to retrieve the users on a projects.
336
+ # @param xero_tenant_id [String] Xero identifier for Tenant
337
+ # @param [Hash] opts the optional parameters
338
+ # @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)
339
+ # @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)
340
+ # @return [ProjectUsers]
341
+ def get_project_users(xero_tenant_id, opts = {})
342
+ data, _status_code, _headers = get_project_users_with_http_info(xero_tenant_id, opts)
343
+ data
344
+ end
345
+
346
+ # list all project users
347
+ # Allows you to retrieve the users on a projects.
348
+ # @param xero_tenant_id [String] Xero identifier for Tenant
349
+ # @param [Hash] opts the optional parameters
350
+ # @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.
351
+ # @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.
352
+ # @return [Array<(ProjectUsers, Integer, Hash)>] ProjectUsers data, response status code and response headers
353
+ def get_project_users_with_http_info(xero_tenant_id, opts = {})
354
+ if @api_client.config.debugging
355
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_project_users ...'
356
+ end
357
+ # verify the required parameter 'xero_tenant_id' is set
358
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
359
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_project_users"
360
+ end
361
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
362
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be smaller than or equal to 500.'
363
+ end
364
+
365
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
366
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_project_users, must be greater than or equal to 1.'
367
+ end
368
+
369
+ # resource path
370
+ local_var_path = '/projectsusers'
371
+
372
+ # camelize keys of incoming `where` opts
373
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
374
+ # query parameters
375
+ query_params = opts[:query_params] || {}
376
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
377
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
378
+
379
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
380
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
381
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
382
+
383
+ # header parameters
384
+ header_params = opts[:header_params] || {}
385
+ # HTTP header 'Accept' (if needed)
386
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
387
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
388
+
389
+ # form parameters
390
+ form_params = opts[:form_params] || {}
391
+
392
+ # http body (model)
393
+ post_body = opts[:body]
394
+
395
+ # return_type
396
+ return_type = opts[:return_type] || 'ProjectUsers'
397
+
398
+ # auth_names
399
+ auth_names = opts[:auth_names] || ['OAuth2']
400
+
401
+ new_options = opts.merge(
402
+ :header_params => header_params,
403
+ :query_params => query_params,
404
+ :form_params => form_params,
405
+ :body => post_body,
406
+ :auth_names => auth_names,
407
+ :return_type => return_type
408
+ )
409
+
410
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
411
+ if @api_client.config.debugging
412
+ @api_client.config.logger.debug "API called: ProjectApi#get_project_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
413
+ end
414
+ return data, status_code, headers
415
+ end
416
+
417
+ # list all projects
418
+ # Allows you to retrieve, create and update projects.
419
+ # @param xero_tenant_id [String] Xero identifier for Tenant
420
+ # @param [Hash] opts the optional parameters
421
+ # @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
422
+ # @option opts [String] :contact_id Filter for projects for a specific contact
423
+ # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
424
+ # @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)
425
+ # @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)
426
+ # @return [Projects]
427
+ def get_projects(xero_tenant_id, opts = {})
428
+ data, _status_code, _headers = get_projects_with_http_info(xero_tenant_id, opts)
429
+ data
430
+ end
431
+
432
+ # list all projects
433
+ # Allows you to retrieve, create and update projects.
434
+ # @param xero_tenant_id [String] Xero identifier for Tenant
435
+ # @param [Hash] opts the optional parameters
436
+ # @option opts [Array<String>] :project_ids Search for all projects that match a comma separated list of projectIds
437
+ # @option opts [String] :contact_id Filter for projects for a specific contact
438
+ # @option opts [String] :states Filter for projects in a particular state (INPROGRESS or CLOSED)
439
+ # @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.
440
+ # @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.
441
+ # @return [Array<(Projects, Integer, Hash)>] Projects data, response status code and response headers
442
+ def get_projects_with_http_info(xero_tenant_id, opts = {})
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_projects ...'
445
+ end
446
+ # verify the required parameter 'xero_tenant_id' is set
447
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
448
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_projects"
449
+ end
450
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 500
451
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be smaller than or equal to 500.'
452
+ end
453
+
454
+ if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1
455
+ fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ProjectApi.get_projects, must be greater than or equal to 1.'
456
+ end
457
+
458
+ # resource path
459
+ local_var_path = '/projects'
460
+
461
+ # camelize keys of incoming `where` opts
462
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
463
+ # query parameters
464
+ query_params = opts[:query_params] || {}
465
+ query_params[:'projectIds'] = @api_client.build_collection_param(opts[:'project_ids'], :multi) if !opts[:'project_ids'].nil?
466
+ query_params[:'contactID'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
467
+ query_params[:'states'] = opts[:'states'] if !opts[:'states'].nil?
468
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
469
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
470
+
471
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
472
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
473
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
474
+
475
+ # header parameters
476
+ header_params = opts[:header_params] || {}
477
+ # HTTP header 'Accept' (if needed)
478
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
479
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
480
+
481
+ # form parameters
482
+ form_params = opts[:form_params] || {}
483
+
484
+ # http body (model)
485
+ post_body = opts[:body]
486
+
487
+ # return_type
488
+ return_type = opts[:return_type] || 'Projects'
489
+
490
+ # auth_names
491
+ auth_names = opts[:auth_names] || ['OAuth2']
492
+
493
+ new_options = opts.merge(
494
+ :header_params => header_params,
495
+ :query_params => query_params,
496
+ :form_params => form_params,
497
+ :body => post_body,
498
+ :auth_names => auth_names,
499
+ :return_type => return_type
500
+ )
501
+
502
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
503
+ if @api_client.config.debugging
504
+ @api_client.config.logger.debug "API called: ProjectApi#get_projects\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
505
+ end
506
+ return data, status_code, headers
507
+ end
508
+
509
+ # Allows you to retrieve a single project
510
+ # Allows you to retrieve a specific project
511
+ # @param xero_tenant_id [String] Xero identifier for Tenant
512
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
513
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
514
+ # @param [Hash] opts the optional parameters
515
+ # @return [Task]
516
+ def get_task(xero_tenant_id, project_id, task_id, opts = {})
517
+ data, _status_code, _headers = get_task_with_http_info(xero_tenant_id, project_id, task_id, opts)
518
+ data
519
+ end
520
+
521
+ # Allows you to retrieve a single project
522
+ # Allows you to retrieve a specific project
523
+ # @param xero_tenant_id [String] Xero identifier for Tenant
524
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
525
+ # @param task_id [String] You can specify an individual task by appending the taskId to the endpoint, i.e. GET https://.../tasks/{taskId}
526
+ # @param [Hash] opts the optional parameters
527
+ # @return [Array<(Task, Integer, Hash)>] Task data, response status code and response headers
528
+ def get_task_with_http_info(xero_tenant_id, project_id, task_id, opts = {})
529
+ if @api_client.config.debugging
530
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_task ...'
531
+ end
532
+ # verify the required parameter 'xero_tenant_id' is set
533
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
534
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_task"
535
+ end
536
+ # verify the required parameter 'project_id' is set
537
+ if @api_client.config.client_side_validation && project_id.nil?
538
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_task"
539
+ end
540
+ # verify the required parameter 'task_id' is set
541
+ if @api_client.config.client_side_validation && task_id.nil?
542
+ fail ArgumentError, "Missing the required parameter 'task_id' when calling ProjectApi.get_task"
543
+ end
544
+ # resource path
545
+ local_var_path = '/projects/{projectId}/tasks/{taskId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'taskId' + '}', task_id.to_s)
546
+
547
+ # camelize keys of incoming `where` opts
548
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
549
+ # query parameters
550
+ query_params = opts[:query_params] || {}
551
+
552
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
553
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
554
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
555
+
556
+ # header parameters
557
+ header_params = opts[:header_params] || {}
558
+ # HTTP header 'Accept' (if needed)
559
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
560
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
561
+
562
+ # form parameters
563
+ form_params = opts[:form_params] || {}
564
+
565
+ # http body (model)
566
+ post_body = opts[:body]
567
+
568
+ # return_type
569
+ return_type = opts[:return_type] || 'Task'
570
+
571
+ # auth_names
572
+ auth_names = opts[:auth_names] || ['OAuth2']
573
+
574
+ new_options = opts.merge(
575
+ :header_params => header_params,
576
+ :query_params => query_params,
577
+ :form_params => form_params,
578
+ :body => post_body,
579
+ :auth_names => auth_names,
580
+ :return_type => return_type
581
+ )
582
+
583
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
584
+ if @api_client.config.debugging
585
+ @api_client.config.logger.debug "API called: ProjectApi#get_task\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
586
+ end
587
+ return data, status_code, headers
588
+ end
589
+
590
+ # Allows you to retrieve a single project
591
+ # Allows you to retrieve a specific project
592
+ # @param xero_tenant_id [String] Xero identifier for Tenant
593
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
594
+ # @param [Hash] opts the optional parameters
595
+ # @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.
596
+ # @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.
597
+ # @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}
598
+ # @return [Tasks]
599
+ def get_tasks(xero_tenant_id, project_id, opts = {})
600
+ data, _status_code, _headers = get_tasks_with_http_info(xero_tenant_id, project_id, opts)
601
+ data
602
+ end
603
+
604
+ # Allows you to retrieve a single project
605
+ # Allows you to retrieve a specific project
606
+ # @param xero_tenant_id [String] Xero identifier for Tenant
607
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
608
+ # @param [Hash] opts the optional parameters
609
+ # @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.
610
+ # @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.
611
+ # @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}
612
+ # @return [Array<(Tasks, Integer, Hash)>] Tasks data, response status code and response headers
613
+ def get_tasks_with_http_info(xero_tenant_id, project_id, opts = {})
614
+ if @api_client.config.debugging
615
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_tasks ...'
616
+ end
617
+ # verify the required parameter 'xero_tenant_id' is set
618
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
619
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_tasks"
620
+ end
621
+ # verify the required parameter 'project_id' is set
622
+ if @api_client.config.client_side_validation && project_id.nil?
623
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_tasks"
624
+ end
625
+ # resource path
626
+ local_var_path = '/projects/{projectId}/tasks'.sub('{' + 'projectId' + '}', project_id.to_s)
627
+
628
+ # camelize keys of incoming `where` opts
629
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
630
+ # query parameters
631
+ query_params = opts[:query_params] || {}
632
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
633
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
634
+ query_params[:'taskIds'] = opts[:'task_ids'] if !opts[:'task_ids'].nil?
635
+
636
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
637
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
638
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
639
+
640
+ # header parameters
641
+ header_params = opts[:header_params] || {}
642
+ # HTTP header 'Accept' (if needed)
643
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
644
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
645
+
646
+ # form parameters
647
+ form_params = opts[:form_params] || {}
648
+
649
+ # http body (model)
650
+ post_body = opts[:body]
651
+
652
+ # return_type
653
+ return_type = opts[:return_type] || 'Tasks'
654
+
655
+ # auth_names
656
+ auth_names = opts[:auth_names] || ['OAuth2']
657
+
658
+ new_options = opts.merge(
659
+ :header_params => header_params,
660
+ :query_params => query_params,
661
+ :form_params => form_params,
662
+ :body => post_body,
663
+ :auth_names => auth_names,
664
+ :return_type => return_type
665
+ )
666
+
667
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
668
+ if @api_client.config.debugging
669
+ @api_client.config.logger.debug "API called: ProjectApi#get_tasks\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
670
+ end
671
+ return data, status_code, headers
672
+ end
673
+
674
+ # Allows you to retrieve the time entries associated with a specific project
675
+ # Allows you to retrieve the time entries associated with a specific project
676
+ # @param xero_tenant_id [String] Xero identifier for Tenant
677
+ # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
678
+ # @param [Hash] opts the optional parameters
679
+ # @option opts [String] :user_id The xero user identifier of the person who logged time.
680
+ # @option opts [String] :task_id Identifier of the task that time entry is logged against.
681
+ # @option opts [String] :invoice_id Finds all time entries for this invoice.
682
+ # @option opts [String] :contact_id Finds all time entries for this contact identifier.
683
+ # @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.
684
+ # @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.
685
+ # @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.
686
+ # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
687
+ # @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.
688
+ # @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.
689
+ # @return [TimeEntries]
690
+ def get_time_entries(xero_tenant_id, project_id, opts = {})
691
+ data, _status_code, _headers = get_time_entries_with_http_info(xero_tenant_id, project_id, opts)
692
+ data
693
+ end
694
+
695
+ # Allows you to retrieve the time entries associated with a specific project
696
+ # Allows you to retrieve the time entries associated with a specific project
697
+ # @param xero_tenant_id [String] Xero identifier for Tenant
698
+ # @param project_id [String] Identifier of the project, that the task (which the time entry is logged against) belongs to.
699
+ # @param [Hash] opts the optional parameters
700
+ # @option opts [String] :user_id The xero user identifier of the person who logged time.
701
+ # @option opts [String] :task_id Identifier of the task that time entry is logged against.
702
+ # @option opts [String] :invoice_id Finds all time entries for this invoice.
703
+ # @option opts [String] :contact_id Finds all time entries for this contact identifier.
704
+ # @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.
705
+ # @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.
706
+ # @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.
707
+ # @option opts [Boolean] :is_chargeable Finds all time entries which relate to tasks with the charge type &#x60;TIME&#x60; or &#x60;FIXED&#x60;.
708
+ # @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.
709
+ # @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.
710
+ # @return [Array<(TimeEntries, Integer, Hash)>] TimeEntries data, response status code and response headers
711
+ def get_time_entries_with_http_info(xero_tenant_id, project_id, opts = {})
712
+ if @api_client.config.debugging
713
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entries ...'
714
+ end
715
+ # verify the required parameter 'xero_tenant_id' is set
716
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
717
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entries"
718
+ end
719
+ # verify the required parameter 'project_id' is set
720
+ if @api_client.config.client_side_validation && project_id.nil?
721
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entries"
722
+ end
723
+ # resource path
724
+ local_var_path = '/projects/{projectId}/time'.sub('{' + 'projectId' + '}', project_id.to_s)
725
+
726
+ # camelize keys of incoming `where` opts
727
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
728
+ # query parameters
729
+ query_params = opts[:query_params] || {}
730
+ query_params[:'userId'] = opts[:'user_id'] if !opts[:'user_id'].nil?
731
+ query_params[:'taskId'] = opts[:'task_id'] if !opts[:'task_id'].nil?
732
+ query_params[:'invoiceId'] = opts[:'invoice_id'] if !opts[:'invoice_id'].nil?
733
+ query_params[:'contactId'] = opts[:'contact_id'] if !opts[:'contact_id'].nil?
734
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
735
+ query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
736
+ query_params[:'states'] = @api_client.build_collection_param(opts[:'states'], :multi) if !opts[:'states'].nil?
737
+ query_params[:'isChargeable'] = opts[:'is_chargeable'] if !opts[:'is_chargeable'].nil?
738
+ query_params[:'dateAfterUtc'] = opts[:'date_after_utc'] if !opts[:'date_after_utc'].nil?
739
+ query_params[:'dateBeforeUtc'] = opts[:'date_before_utc'] if !opts[:'date_before_utc'].nil?
740
+
741
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
742
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
743
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
744
+
745
+ # header parameters
746
+ header_params = opts[:header_params] || {}
747
+ # HTTP header 'Accept' (if needed)
748
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
749
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
750
+
751
+ # form parameters
752
+ form_params = opts[:form_params] || {}
753
+
754
+ # http body (model)
755
+ post_body = opts[:body]
756
+
757
+ # return_type
758
+ return_type = opts[:return_type] || 'TimeEntries'
759
+
760
+ # auth_names
761
+ auth_names = opts[:auth_names] || ['OAuth2']
762
+
763
+ new_options = opts.merge(
764
+ :header_params => header_params,
765
+ :query_params => query_params,
766
+ :form_params => form_params,
767
+ :body => post_body,
768
+ :auth_names => auth_names,
769
+ :return_type => return_type
770
+ )
771
+
772
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
773
+ if @api_client.config.debugging
774
+ @api_client.config.logger.debug "API called: ProjectApi#get_time_entries\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
775
+ end
776
+ return data, status_code, headers
777
+ end
778
+
779
+ # Allows you to get a single time entry in a project
780
+ # Allows you to upget a single time entry in a project
781
+ # @param xero_tenant_id [String] Xero identifier for Tenant
782
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
783
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
784
+ # @param [Hash] opts the optional parameters
785
+ # @return [TimeEntry]
786
+ def get_time_entry(xero_tenant_id, project_id, time_entry_id, opts = {})
787
+ data, _status_code, _headers = get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts)
788
+ data
789
+ end
790
+
791
+ # Allows you to get a single time entry in a project
792
+ # Allows you to upget a single time entry in a project
793
+ # @param xero_tenant_id [String] Xero identifier for Tenant
794
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
795
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
796
+ # @param [Hash] opts the optional parameters
797
+ # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
798
+ def get_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, opts = {})
799
+ if @api_client.config.debugging
800
+ @api_client.config.logger.debug 'Calling API: ProjectApi.get_time_entry ...'
801
+ end
802
+ # verify the required parameter 'xero_tenant_id' is set
803
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
804
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.get_time_entry"
805
+ end
806
+ # verify the required parameter 'project_id' is set
807
+ if @api_client.config.client_side_validation && project_id.nil?
808
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.get_time_entry"
809
+ end
810
+ # verify the required parameter 'time_entry_id' is set
811
+ if @api_client.config.client_side_validation && time_entry_id.nil?
812
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.get_time_entry"
813
+ end
814
+ # resource path
815
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
816
+
817
+ # camelize keys of incoming `where` opts
818
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
819
+ # query parameters
820
+ query_params = opts[:query_params] || {}
821
+
822
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
823
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
824
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
825
+
826
+ # header parameters
827
+ header_params = opts[:header_params] || {}
828
+ # HTTP header 'Accept' (if needed)
829
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
830
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
831
+
832
+ # form parameters
833
+ form_params = opts[:form_params] || {}
834
+
835
+ # http body (model)
836
+ post_body = opts[:body]
837
+
838
+ # return_type
839
+ return_type = opts[:return_type] || 'TimeEntry'
840
+
841
+ # auth_names
842
+ auth_names = opts[:auth_names] || ['OAuth2']
843
+
844
+ new_options = opts.merge(
845
+ :header_params => header_params,
846
+ :query_params => query_params,
847
+ :form_params => form_params,
848
+ :body => post_body,
849
+ :auth_names => auth_names,
850
+ :return_type => return_type
851
+ )
852
+
853
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
854
+ if @api_client.config.debugging
855
+ @api_client.config.logger.debug "API called: ProjectApi#get_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
856
+ end
857
+ return data, status_code, headers
858
+ end
859
+
860
+ # creates a project for the specified contact
861
+ # Allows you to update a specific projects.
862
+ # @param xero_tenant_id [String] Xero identifier for Tenant
863
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
864
+ # @param project_patch [ProjectPatch] Update the status of an existing Project
865
+ # @param [Hash] opts the optional parameters
866
+ # @return [nil]
867
+ def patch_project(xero_tenant_id, project_id, project_patch, opts = {})
868
+ patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts)
869
+ nil
870
+ end
871
+
872
+ # creates a project for the specified contact
873
+ # Allows you to update a specific projects.
874
+ # @param xero_tenant_id [String] Xero identifier for Tenant
875
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
876
+ # @param project_patch [ProjectPatch] Update the status of an existing Project
877
+ # @param [Hash] opts the optional parameters
878
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
879
+ def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts = {})
880
+ if @api_client.config.debugging
881
+ @api_client.config.logger.debug 'Calling API: ProjectApi.patch_project ...'
882
+ end
883
+ # verify the required parameter 'xero_tenant_id' is set
884
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
885
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.patch_project"
886
+ end
887
+ # verify the required parameter 'project_id' is set
888
+ if @api_client.config.client_side_validation && project_id.nil?
889
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.patch_project"
890
+ end
891
+ # verify the required parameter 'project_patch' is set
892
+ if @api_client.config.client_side_validation && project_patch.nil?
893
+ fail ArgumentError, "Missing the required parameter 'project_patch' when calling ProjectApi.patch_project"
894
+ end
895
+ # resource path
896
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
897
+
898
+ # camelize keys of incoming `where` opts
899
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
900
+ # query parameters
901
+ query_params = opts[:query_params] || {}
902
+
903
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
904
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
905
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
906
+
907
+ # header parameters
908
+ header_params = opts[:header_params] || {}
909
+ # HTTP header 'Accept' (if needed)
910
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
911
+ # HTTP header 'Content-Type'
912
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
913
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
914
+
915
+ # form parameters
916
+ form_params = opts[:form_params] || {}
917
+
918
+ # http body (model)
919
+ post_body = opts[:body] || @api_client.object_to_http_body(project_patch)
920
+
921
+ # return_type
922
+ return_type = opts[:return_type]
923
+
924
+ # auth_names
925
+ auth_names = opts[:auth_names] || ['OAuth2']
926
+
927
+ new_options = opts.merge(
928
+ :header_params => header_params,
929
+ :query_params => query_params,
930
+ :form_params => form_params,
931
+ :body => post_body,
932
+ :auth_names => auth_names,
933
+ :return_type => return_type
934
+ )
935
+
936
+ data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
937
+ if @api_client.config.debugging
938
+ @api_client.config.logger.debug "API called: ProjectApi#patch_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
939
+ end
940
+ return data, status_code, headers
941
+ end
942
+
943
+ # update a specific project
944
+ # Allows you to update a specific projects.
945
+ # @param xero_tenant_id [String] Xero identifier for Tenant
946
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
947
+ # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
948
+ # @param [Hash] opts the optional parameters
949
+ # @return [nil]
950
+ def update_project(xero_tenant_id, project_id, project_create_or_update, opts = {})
951
+ update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts)
952
+ nil
953
+ end
954
+
955
+ # update a specific project
956
+ # Allows you to update a specific projects.
957
+ # @param xero_tenant_id [String] Xero identifier for Tenant
958
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
959
+ # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
960
+ # @param [Hash] opts the optional parameters
961
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
962
+ def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts = {})
963
+ if @api_client.config.debugging
964
+ @api_client.config.logger.debug 'Calling API: ProjectApi.update_project ...'
965
+ end
966
+ # verify the required parameter 'xero_tenant_id' is set
967
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
968
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_project"
969
+ end
970
+ # verify the required parameter 'project_id' is set
971
+ if @api_client.config.client_side_validation && project_id.nil?
972
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_project"
973
+ end
974
+ # verify the required parameter 'project_create_or_update' is set
975
+ if @api_client.config.client_side_validation && project_create_or_update.nil?
976
+ fail ArgumentError, "Missing the required parameter 'project_create_or_update' when calling ProjectApi.update_project"
977
+ end
978
+ # resource path
979
+ local_var_path = '/projects/{projectId}'.sub('{' + 'projectId' + '}', project_id.to_s)
980
+
981
+ # camelize keys of incoming `where` opts
982
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
983
+ # query parameters
984
+ query_params = opts[:query_params] || {}
985
+
986
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
987
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
988
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
989
+
990
+ # header parameters
991
+ header_params = opts[:header_params] || {}
992
+ # HTTP header 'Accept' (if needed)
993
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
994
+ # HTTP header 'Content-Type'
995
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
996
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
997
+
998
+ # form parameters
999
+ form_params = opts[:form_params] || {}
1000
+
1001
+ # http body (model)
1002
+ post_body = opts[:body] || @api_client.object_to_http_body(project_create_or_update)
1003
+
1004
+ # return_type
1005
+ return_type = opts[:return_type]
1006
+
1007
+ # auth_names
1008
+ auth_names = opts[:auth_names] || ['OAuth2']
1009
+
1010
+ new_options = opts.merge(
1011
+ :header_params => header_params,
1012
+ :query_params => query_params,
1013
+ :form_params => form_params,
1014
+ :body => post_body,
1015
+ :auth_names => auth_names,
1016
+ :return_type => return_type
1017
+ )
1018
+
1019
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1020
+ if @api_client.config.debugging
1021
+ @api_client.config.logger.debug "API called: ProjectApi#update_project\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1022
+ end
1023
+ return data, status_code, headers
1024
+ end
1025
+
1026
+ # Allows you to update time entry in a project
1027
+ # Allows you to update time entry in a project
1028
+ # @param xero_tenant_id [String] Xero identifier for Tenant
1029
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1030
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
1031
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
1032
+ # @param [Hash] opts the optional parameters
1033
+ # @return [nil]
1034
+ def update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
1035
+ update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts)
1036
+ nil
1037
+ end
1038
+
1039
+ # Allows you to update time entry in a project
1040
+ # Allows you to update time entry in a project
1041
+ # @param xero_tenant_id [String] Xero identifier for Tenant
1042
+ # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1043
+ # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
1044
+ # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
1045
+ # @param [Hash] opts the optional parameters
1046
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1047
+ def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
1048
+ if @api_client.config.debugging
1049
+ @api_client.config.logger.debug 'Calling API: ProjectApi.update_time_entry ...'
1050
+ end
1051
+ # verify the required parameter 'xero_tenant_id' is set
1052
+ if @api_client.config.client_side_validation && xero_tenant_id.nil?
1053
+ fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling ProjectApi.update_time_entry"
1054
+ end
1055
+ # verify the required parameter 'project_id' is set
1056
+ if @api_client.config.client_side_validation && project_id.nil?
1057
+ fail ArgumentError, "Missing the required parameter 'project_id' when calling ProjectApi.update_time_entry"
1058
+ end
1059
+ # verify the required parameter 'time_entry_id' is set
1060
+ if @api_client.config.client_side_validation && time_entry_id.nil?
1061
+ fail ArgumentError, "Missing the required parameter 'time_entry_id' when calling ProjectApi.update_time_entry"
1062
+ end
1063
+ # verify the required parameter 'time_entry_create_or_update' is set
1064
+ if @api_client.config.client_side_validation && time_entry_create_or_update.nil?
1065
+ fail ArgumentError, "Missing the required parameter 'time_entry_create_or_update' when calling ProjectApi.update_time_entry"
1066
+ end
1067
+ # resource path
1068
+ local_var_path = '/projects/{projectId}/time/{timeEntryId}'.sub('{' + 'projectId' + '}', project_id.to_s).sub('{' + 'timeEntryId' + '}', time_entry_id.to_s)
1069
+
1070
+ # camelize keys of incoming `where` opts
1071
+ opts[:'where'] = opts[:'where'].map{|k,v| "#{@api_client.camelize_key(k)}#{v}"}.join(' AND ') if !opts[:'where'].nil?
1072
+ # query parameters
1073
+ query_params = opts[:query_params] || {}
1074
+
1075
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
1076
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
1077
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
1078
+
1079
+ # header parameters
1080
+ header_params = opts[:header_params] || {}
1081
+ # HTTP header 'Content-Type'
1082
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1083
+ header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1084
+
1085
+ # form parameters
1086
+ form_params = opts[:form_params] || {}
1087
+
1088
+ # http body (model)
1089
+ post_body = opts[:body] || @api_client.object_to_http_body(time_entry_create_or_update)
1090
+
1091
+ # return_type
1092
+ return_type = opts[:return_type]
1093
+
1094
+ # auth_names
1095
+ auth_names = opts[:auth_names] || ['OAuth2']
1096
+
1097
+ new_options = opts.merge(
1098
+ :header_params => header_params,
1099
+ :query_params => query_params,
1100
+ :form_params => form_params,
1101
+ :body => post_body,
1102
+ :auth_names => auth_names,
1103
+ :return_type => return_type
1104
+ )
1105
+
1106
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
1107
+ if @api_client.config.debugging
1108
+ @api_client.config.logger.debug "API called: ProjectApi#update_time_entry\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
1109
+ end
1110
+ return data, status_code, headers
1111
+ end
1112
+ end
1113
+ end