xero-ruby 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +68 -0
  3. data/docs/accounting/AccountingApi.md +1497 -785
  4. data/docs/accounting/Allocation.md +11 -1
  5. data/docs/accounting/BankTransfer.md +1 -1
  6. data/docs/accounting/BatchPayment.md +1 -1
  7. data/docs/accounting/Contact.md +2 -2
  8. data/docs/accounting/CreditNote.md +2 -2
  9. data/docs/accounting/Invoice.md +2 -2
  10. data/docs/accounting/Organisation.md +2 -0
  11. data/docs/accounting/Payment.md +4 -4
  12. data/docs/accounting/Quote.md +5 -1
  13. data/docs/assets/AssetApi.md +40 -16
  14. data/docs/assets/AssetType.md +1 -1
  15. data/docs/projects/Amount.md +19 -0
  16. data/docs/projects/ChargeType.md +16 -0
  17. data/docs/projects/CurrencyCode.md +16 -0
  18. data/docs/projects/Error.md +19 -0
  19. data/docs/projects/Pagination.md +23 -0
  20. data/docs/projects/Project.md +59 -0
  21. data/docs/projects/ProjectApi.md +979 -0
  22. data/docs/projects/ProjectCreateOrUpdate.md +23 -0
  23. data/docs/projects/ProjectPatch.md +17 -0
  24. data/docs/projects/ProjectStatus.md +16 -0
  25. data/docs/projects/ProjectUser.md +21 -0
  26. data/docs/projects/ProjectUsers.md +19 -0
  27. data/docs/projects/Projects.md +19 -0
  28. data/docs/projects/Task.md +45 -0
  29. data/docs/projects/TaskCreateOrUpdate.md +23 -0
  30. data/docs/projects/Tasks.md +19 -0
  31. data/docs/projects/TimeEntries.md +19 -0
  32. data/docs/projects/TimeEntry.md +33 -0
  33. data/docs/projects/TimeEntryCreateOrUpdate.md +25 -0
  34. data/lib/xero-ruby.rb +21 -2
  35. data/lib/xero-ruby/api/accounting_api.rb +77 -85
  36. data/lib/xero-ruby/api/asset_api.rb +3 -3
  37. data/lib/xero-ruby/api/project_api.rb +1035 -0
  38. data/lib/xero-ruby/api_client.rb +33 -7
  39. data/lib/xero-ruby/api_error.rb +2 -2
  40. data/lib/xero-ruby/configuration.rb +4 -2
  41. data/lib/xero-ruby/models/accounting/account.rb +56 -20
  42. data/lib/xero-ruby/models/accounting/account_type.rb +2 -2
  43. data/lib/xero-ruby/models/accounting/accounts.rb +4 -3
  44. data/lib/xero-ruby/models/accounting/accounts_payable.rb +5 -3
  45. data/lib/xero-ruby/models/accounting/accounts_receivable.rb +5 -3
  46. data/lib/xero-ruby/models/accounting/address.rb +15 -12
  47. data/lib/xero-ruby/models/accounting/allocation.rb +61 -8
  48. data/lib/xero-ruby/models/accounting/allocations.rb +4 -3
  49. data/lib/xero-ruby/models/accounting/attachment.rb +8 -8
  50. data/lib/xero-ruby/models/accounting/attachments.rb +4 -3
  51. data/lib/xero-ruby/models/accounting/balances.rb +5 -3
  52. data/lib/xero-ruby/models/accounting/bank_transaction.rb +35 -20
  53. data/lib/xero-ruby/models/accounting/bank_transactions.rb +4 -3
  54. data/lib/xero-ruby/models/accounting/bank_transfer.rb +15 -13
  55. data/lib/xero-ruby/models/accounting/bank_transfers.rb +4 -3
  56. data/lib/xero-ruby/models/accounting/batch_payment.rb +24 -18
  57. data/lib/xero-ruby/models/accounting/batch_payment_details.rb +7 -7
  58. data/lib/xero-ruby/models/accounting/batch_payments.rb +4 -3
  59. data/lib/xero-ruby/models/accounting/bill.rb +4 -3
  60. data/lib/xero-ruby/models/accounting/branding_theme.rb +9 -8
  61. data/lib/xero-ruby/models/accounting/branding_themes.rb +4 -3
  62. data/lib/xero-ruby/models/accounting/cis_org_setting.rb +5 -5
  63. data/lib/xero-ruby/models/accounting/cis_setting.rb +4 -4
  64. data/lib/xero-ruby/models/accounting/cis_settings.rb +4 -3
  65. data/lib/xero-ruby/models/accounting/contact.rb +46 -36
  66. data/lib/xero-ruby/models/accounting/contact_group.rb +8 -6
  67. data/lib/xero-ruby/models/accounting/contact_groups.rb +4 -3
  68. data/lib/xero-ruby/models/accounting/contact_person.rb +6 -6
  69. data/lib/xero-ruby/models/accounting/contacts.rb +4 -3
  70. data/lib/xero-ruby/models/accounting/country_code.rb +2 -2
  71. data/lib/xero-ruby/models/accounting/credit_note.rb +38 -25
  72. data/lib/xero-ruby/models/accounting/credit_notes.rb +4 -3
  73. data/lib/xero-ruby/models/accounting/currencies.rb +4 -3
  74. data/lib/xero-ruby/models/accounting/currency.rb +5 -4
  75. data/lib/xero-ruby/models/accounting/currency_code.rb +2 -2
  76. data/lib/xero-ruby/models/accounting/element.rb +10 -4
  77. data/lib/xero-ruby/models/accounting/employee.rb +13 -8
  78. data/lib/xero-ruby/models/accounting/employees.rb +4 -3
  79. data/lib/xero-ruby/models/accounting/error.rb +6 -6
  80. data/lib/xero-ruby/models/accounting/expense_claim.rb +19 -12
  81. data/lib/xero-ruby/models/accounting/expense_claims.rb +4 -3
  82. data/lib/xero-ruby/models/accounting/external_link.rb +10 -4
  83. data/lib/xero-ruby/models/accounting/history_record.rb +6 -6
  84. data/lib/xero-ruby/models/accounting/history_records.rb +4 -3
  85. data/lib/xero-ruby/models/accounting/invoice.rb +56 -37
  86. data/lib/xero-ruby/models/accounting/invoice_reminder.rb +3 -3
  87. data/lib/xero-ruby/models/accounting/invoice_reminders.rb +4 -3
  88. data/lib/xero-ruby/models/accounting/invoices.rb +4 -3
  89. data/lib/xero-ruby/models/accounting/item.rb +18 -16
  90. data/lib/xero-ruby/models/accounting/items.rb +4 -3
  91. data/lib/xero-ruby/models/accounting/journal.rb +35 -10
  92. data/lib/xero-ruby/models/accounting/journal_line.rb +14 -13
  93. data/lib/xero-ruby/models/accounting/journals.rb +4 -3
  94. data/lib/xero-ruby/models/accounting/line_amount_types.rb +2 -2
  95. data/lib/xero-ruby/models/accounting/line_item.rb +15 -15
  96. data/lib/xero-ruby/models/accounting/line_item_tracking.rb +6 -6
  97. data/lib/xero-ruby/models/accounting/linked_transaction.rb +21 -13
  98. data/lib/xero-ruby/models/accounting/linked_transactions.rb +4 -3
  99. data/lib/xero-ruby/models/accounting/manual_journal.rb +21 -15
  100. data/lib/xero-ruby/models/accounting/manual_journal_line.rb +9 -9
  101. data/lib/xero-ruby/models/accounting/manual_journals.rb +4 -3
  102. data/lib/xero-ruby/models/accounting/online_invoice.rb +3 -3
  103. data/lib/xero-ruby/models/accounting/online_invoices.rb +4 -3
  104. data/lib/xero-ruby/models/accounting/organisation.rb +103 -43
  105. data/lib/xero-ruby/models/accounting/organisations.rb +4 -3
  106. data/lib/xero-ruby/models/accounting/overpayment.rb +27 -18
  107. data/lib/xero-ruby/models/accounting/overpayments.rb +4 -3
  108. data/lib/xero-ruby/models/accounting/payment.rb +41 -22
  109. data/lib/xero-ruby/models/accounting/payment_delete.rb +3 -3
  110. data/lib/xero-ruby/models/accounting/payment_service.rb +8 -8
  111. data/lib/xero-ruby/models/accounting/payment_services.rb +4 -3
  112. data/lib/xero-ruby/models/accounting/payment_term.rb +5 -3
  113. data/lib/xero-ruby/models/accounting/payment_term_type.rb +2 -2
  114. data/lib/xero-ruby/models/accounting/payments.rb +4 -3
  115. data/lib/xero-ruby/models/accounting/phone.rb +12 -6
  116. data/lib/xero-ruby/models/accounting/prepayment.rb +28 -18
  117. data/lib/xero-ruby/models/accounting/prepayments.rb +4 -3
  118. data/lib/xero-ruby/models/accounting/purchase.rb +6 -6
  119. data/lib/xero-ruby/models/accounting/purchase_order.rb +36 -28
  120. data/lib/xero-ruby/models/accounting/purchase_orders.rb +4 -3
  121. data/lib/xero-ruby/models/accounting/quote.rb +50 -24
  122. data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +2 -2
  123. data/lib/xero-ruby/models/accounting/quote_status_codes.rb +2 -2
  124. data/lib/xero-ruby/models/accounting/quotes.rb +4 -3
  125. data/lib/xero-ruby/models/accounting/receipt.rb +25 -16
  126. data/lib/xero-ruby/models/accounting/receipts.rb +4 -3
  127. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +23 -14
  128. data/lib/xero-ruby/models/accounting/repeating_invoices.rb +4 -3
  129. data/lib/xero-ruby/models/accounting/report.rb +10 -8
  130. data/lib/xero-ruby/models/accounting/report_attribute.rb +5 -3
  131. data/lib/xero-ruby/models/accounting/report_cell.rb +5 -3
  132. data/lib/xero-ruby/models/accounting/report_fields.rb +6 -3
  133. data/lib/xero-ruby/models/accounting/report_row.rb +6 -3
  134. data/lib/xero-ruby/models/accounting/report_rows.rb +7 -3
  135. data/lib/xero-ruby/models/accounting/report_with_row.rb +11 -9
  136. data/lib/xero-ruby/models/accounting/report_with_rows.rb +4 -3
  137. data/lib/xero-ruby/models/accounting/reports.rb +4 -3
  138. data/lib/xero-ruby/models/accounting/request_empty.rb +3 -3
  139. data/lib/xero-ruby/models/accounting/row_type.rb +2 -2
  140. data/lib/xero-ruby/models/accounting/sales_tracking_category.rb +4 -4
  141. data/lib/xero-ruby/models/accounting/schedule.rb +19 -11
  142. data/lib/xero-ruby/models/accounting/tax_component.rb +6 -6
  143. data/lib/xero-ruby/models/accounting/tax_rate.rb +94 -16
  144. data/lib/xero-ruby/models/accounting/tax_rates.rb +4 -3
  145. data/lib/xero-ruby/models/accounting/tax_type.rb +2 -2
  146. data/lib/xero-ruby/models/accounting/ten_nintey_nine_contact.rb +24 -24
  147. data/lib/xero-ruby/models/accounting/time_zone.rb +2 -2
  148. data/lib/xero-ruby/models/accounting/tracking_categories.rb +4 -3
  149. data/lib/xero-ruby/models/accounting/tracking_category.rb +11 -8
  150. data/lib/xero-ruby/models/accounting/tracking_option.rb +9 -6
  151. data/lib/xero-ruby/models/accounting/tracking_options.rb +4 -3
  152. data/lib/xero-ruby/models/accounting/user.rb +16 -9
  153. data/lib/xero-ruby/models/accounting/users.rb +4 -3
  154. data/lib/xero-ruby/models/accounting/validation_error.rb +3 -3
  155. data/lib/xero-ruby/models/assets/asset.rb +17 -14
  156. data/lib/xero-ruby/models/assets/asset_status.rb +2 -2
  157. data/lib/xero-ruby/models/assets/asset_status_query_param.rb +2 -2
  158. data/lib/xero-ruby/models/assets/asset_type.rb +9 -13
  159. data/lib/xero-ruby/models/assets/assets.rb +5 -3
  160. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +9 -9
  161. data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +21 -10
  162. data/lib/xero-ruby/models/assets/error.rb +7 -7
  163. data/lib/xero-ruby/models/assets/field_validation_errors_element.rb +8 -8
  164. data/lib/xero-ruby/models/assets/pagination.rb +7 -3
  165. data/lib/xero-ruby/models/assets/resource_validation_errors_element.rb +7 -7
  166. data/lib/xero-ruby/models/assets/setting.rb +10 -10
  167. data/lib/xero-ruby/models/projects/amount.rb +214 -0
  168. data/lib/xero-ruby/models/projects/charge_type.rb +38 -0
  169. data/lib/xero-ruby/models/projects/currency_code.rb +199 -0
  170. data/lib/xero-ruby/models/projects/error.rb +214 -0
  171. data/lib/xero-ruby/models/projects/pagination.rb +234 -0
  172. data/lib/xero-ruby/models/projects/project.rb +419 -0
  173. data/lib/xero-ruby/models/projects/project_create_or_update.rb +239 -0
  174. data/lib/xero-ruby/models/projects/project_patch.rb +209 -0
  175. data/lib/xero-ruby/models/projects/project_status.rb +37 -0
  176. data/lib/xero-ruby/models/projects/project_user.rb +224 -0
  177. data/lib/xero-ruby/models/projects/project_users.rb +216 -0
  178. data/lib/xero-ruby/models/projects/projects.rb +216 -0
  179. data/lib/xero-ruby/models/projects/task.rb +381 -0
  180. data/lib/xero-ruby/models/projects/task_create_or_update.rb +249 -0
  181. data/lib/xero-ruby/models/projects/tasks.rb +216 -0
  182. data/lib/xero-ruby/models/projects/time_entries.rb +216 -0
  183. data/lib/xero-ruby/models/projects/time_entry.rb +320 -0
  184. data/lib/xero-ruby/models/projects/time_entry_create_or_update.rb +264 -0
  185. data/lib/xero-ruby/version.rb +3 -3
  186. data/spec/accounting/api/accounting_api_spec.rb +3 -3
  187. data/spec/api_client_spec.rb +23 -23
  188. data/spec/assets/api/asset_api_spec.rb +3 -3
  189. data/spec/configuration_spec.rb +7 -23
  190. data/spec/projects/api/project_api_spec.rb +229 -0
  191. data/spec/projects/models/amount_spec.rb +47 -0
  192. data/spec/projects/models/charge_type_spec.rb +35 -0
  193. data/spec/projects/models/currency_code_spec.rb +35 -0
  194. data/spec/projects/models/error_spec.rb +47 -0
  195. data/spec/projects/models/pagination_spec.rb +59 -0
  196. data/spec/projects/models/project_create_or_update_spec.rb +59 -0
  197. data/spec/projects/models/project_patch_spec.rb +41 -0
  198. data/spec/projects/models/project_spec.rb +167 -0
  199. data/spec/projects/models/project_status_spec.rb +35 -0
  200. data/spec/projects/models/project_user_spec.rb +53 -0
  201. data/spec/projects/models/project_users_spec.rb +47 -0
  202. data/spec/projects/models/projects_spec.rb +47 -0
  203. data/spec/projects/models/task_create_or_update_spec.rb +59 -0
  204. data/spec/projects/models/task_spec.rb +129 -0
  205. data/spec/projects/models/tasks_spec.rb +47 -0
  206. data/spec/projects/models/time_entries_spec.rb +47 -0
  207. data/spec/projects/models/time_entry_create_or_update_spec.rb +65 -0
  208. data/spec/projects/models/time_entry_spec.rb +93 -0
  209. data/xero-ruby.gem +0 -0
  210. data/xero-ruby.gemspec +3 -3
  211. metadata +83 -7
  212. data/xero-ruby-1.0.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.6
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
@@ -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.6
7
+ Contact: api@xero.com
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 4.3.1
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module XeroRuby
16
+ class 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