xero-ruby 3.9.0 → 7.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/lib/xero-ruby/api/accounting_api.rb +1136 -46
  4. data/lib/xero-ruby/api/app_store_api.rb +244 -0
  5. data/lib/xero-ruby/api/asset_api.rb +16 -6
  6. data/lib/xero-ruby/api/files_api.rb +156 -20
  7. data/lib/xero-ruby/api/payroll_au_api.rb +326 -30
  8. data/lib/xero-ruby/api/payroll_nz_api.rb +87 -0
  9. data/lib/xero-ruby/api/payroll_uk_api.rb +81 -0
  10. data/lib/xero-ruby/api/project_api.rb +286 -2
  11. data/lib/xero-ruby/api_client.rb +9 -3
  12. data/lib/xero-ruby/models/accounting/account.rb +1 -1
  13. data/lib/xero-ruby/models/accounting/account_type.rb +0 -4
  14. data/lib/xero-ruby/models/accounting/allocation.rb +21 -1
  15. data/lib/xero-ruby/models/accounting/batch_payment.rb +2 -2
  16. data/lib/xero-ruby/models/accounting/batch_payment_delete.rb +244 -0
  17. data/lib/xero-ruby/models/accounting/batch_payment_delete_by_url_param.rb +229 -0
  18. data/lib/xero-ruby/models/accounting/contact.rb +1 -11
  19. data/lib/xero-ruby/models/accounting/currency_code.rb +10 -8
  20. data/lib/xero-ruby/models/accounting/journal_line.rb +1 -1
  21. data/lib/xero-ruby/models/accounting/line_item.rb +2 -2
  22. data/lib/xero-ruby/models/accounting/organisation.rb +6 -2
  23. data/lib/xero-ruby/models/accounting/payment.rb +26 -4
  24. data/lib/xero-ruby/models/accounting/repeating_invoice.rb +53 -5
  25. data/lib/xero-ruby/models/accounting/tax_rate.rb +23 -5
  26. data/lib/xero-ruby/models/accounting/tax_type.rb +60 -3
  27. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +75 -4
  28. data/lib/xero-ruby/models/accounting/time_zone.rb +123 -91
  29. data/lib/xero-ruby/models/app_store/create_usage_record.rb +243 -0
  30. data/lib/xero-ruby/models/app_store/update_usage_record.rb +228 -0
  31. data/lib/xero-ruby/models/app_store/usage_record.rb +332 -0
  32. data/lib/xero-ruby/models/app_store/usage_records_list.rb +230 -0
  33. data/lib/xero-ruby/models/files/association.rb +31 -1
  34. data/lib/xero-ruby/models/finance/problem_type.rb +1 -0
  35. data/lib/xero-ruby/models/finance/statement_line_response.rb +11 -1
  36. data/lib/xero-ruby/models/finance/statement_response.rb +24 -4
  37. data/lib/xero-ruby/models/payroll_au/allowance_type.rb +0 -1
  38. data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +284 -0
  39. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +21 -1
  40. data/lib/xero-ruby/models/payroll_au/earnings_type.rb +2 -0
  41. data/lib/xero-ruby/models/payroll_au/employee.rb +42 -2
  42. data/lib/xero-ruby/models/payroll_au/employment_basis.rb +1 -0
  43. data/lib/xero-ruby/models/payroll_au/employment_type.rb +36 -0
  44. data/lib/xero-ruby/models/payroll_au/income_type.rb +39 -0
  45. data/lib/xero-ruby/models/payroll_au/leave_application.rb +11 -1
  46. data/lib/xero-ruby/models/payroll_au/leave_category_code.rb +46 -0
  47. data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +14 -4
  48. data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +0 -1
  49. data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +2 -0
  50. data/lib/xero-ruby/models/payroll_au/leave_type.rb +24 -4
  51. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +16 -4
  52. data/lib/xero-ruby/models/payroll_au/paid_leave_earnings_line.rb +272 -0
  53. data/lib/xero-ruby/models/payroll_au/pay_out_type.rb +36 -0
  54. data/lib/xero-ruby/models/payroll_au/senior_marital_status.rb +37 -0
  55. data/lib/xero-ruby/models/payroll_au/settings.rb +14 -4
  56. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +51 -1
  57. data/lib/xero-ruby/models/payroll_au/tax_scale_type.rb +40 -0
  58. data/lib/xero-ruby/models/payroll_au/work_condition.rb +37 -0
  59. data/lib/xero-ruby/models/payroll_nz/employee.rb +14 -4
  60. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -3
  61. data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
  62. data/lib/xero-ruby/models/projects/task.rb +6 -6
  63. data/lib/xero-ruby/models/projects/task_create_or_update.rb +1 -1
  64. data/lib/xero-ruby/version.rb +2 -2
  65. data/lib/xero-ruby/where.rb +2 -0
  66. data/lib/xero-ruby.rb +15 -0
  67. metadata +30 -15
@@ -83,5 +83,249 @@ module XeroRuby
83
83
  end
84
84
  return data, status_code, headers
85
85
  end
86
+
87
+ # Gets all usage records related to the subscription
88
+ # @param subscription_id [String] Unique identifier for Subscription object
89
+ # @param [Hash] opts the optional parameters
90
+ # @return [UsageRecordsList]
91
+ def get_usage_records(subscription_id, opts = {})
92
+ data, _status_code, _headers = get_usage_records_with_http_info(subscription_id, opts)
93
+ data
94
+ end
95
+
96
+ # Gets all usage records related to the subscription
97
+ # @param subscription_id [String] Unique identifier for Subscription object
98
+ # @param [Hash] opts the optional parameters
99
+ # @return [Array<(UsageRecordsList, Integer, Hash)>] UsageRecordsList data, response status code and response headers
100
+ def get_usage_records_with_http_info(subscription_id, options = {})
101
+ opts = options.dup
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug 'Calling API: AppStoreApi.get_usage_records ...'
104
+ end
105
+ # verify the required parameter 'subscription_id' is set
106
+ if @api_client.config.client_side_validation && subscription_id.nil?
107
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.get_usage_records"
108
+ end
109
+ # resource path
110
+ local_var_path = '/subscriptions/{subscriptionId}/usage-records'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s)
111
+
112
+ # camelize keys of incoming `where` opts
113
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
114
+
115
+ # query parameters
116
+ query_params = opts[:query_params] || {}
117
+
118
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
119
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
120
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
126
+
127
+ # form parameters
128
+ form_params = opts[:form_params] || {}
129
+
130
+ # http body (model)
131
+ post_body = opts[:body]
132
+
133
+ # return_type
134
+ return_type = opts[:return_type] || 'UsageRecordsList'
135
+
136
+ # auth_names
137
+ auth_names = opts[:auth_names] || ['OAuth2']
138
+
139
+ new_options = opts.merge(
140
+ :header_params => header_params,
141
+ :query_params => query_params,
142
+ :form_params => form_params,
143
+ :body => post_body,
144
+ :auth_names => auth_names,
145
+ :return_type => return_type
146
+ )
147
+
148
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, "AppStoreApi", new_options)
149
+ if @api_client.config.debugging
150
+ @api_client.config.logger.debug "API called: AppStoreApi#get_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
151
+ end
152
+ return data, status_code, headers
153
+ end
154
+
155
+ # Send metered usage belonging to this subscription and subscription item
156
+ # @param subscription_id [String] Unique identifier for Subscription object
157
+ # @param subscription_item_id [String] The unique identifier of the subscriptionItem
158
+ # @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
159
+ # @param [Hash] opts the optional parameters
160
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
161
+ # @return [UsageRecord]
162
+ def post_usage_records(subscription_id, subscription_item_id, create_usage_record, opts = {})
163
+ data, _status_code, _headers = post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, opts)
164
+ data
165
+ end
166
+
167
+ # Send metered usage belonging to this subscription and subscription item
168
+ # @param subscription_id [String] Unique identifier for Subscription object
169
+ # @param subscription_item_id [String] The unique identifier of the subscriptionItem
170
+ # @param create_usage_record [CreateUsageRecord] Contains the quantity for the usage record to create
171
+ # @param [Hash] opts the optional parameters
172
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
173
+ # @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
174
+ def post_usage_records_with_http_info(subscription_id, subscription_item_id, create_usage_record, options = {})
175
+ opts = options.dup
176
+ if @api_client.config.debugging
177
+ @api_client.config.logger.debug 'Calling API: AppStoreApi.post_usage_records ...'
178
+ end
179
+ # verify the required parameter 'subscription_id' is set
180
+ if @api_client.config.client_side_validation && subscription_id.nil?
181
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.post_usage_records"
182
+ end
183
+ # verify the required parameter 'subscription_item_id' is set
184
+ if @api_client.config.client_side_validation && subscription_item_id.nil?
185
+ fail ArgumentError, "Missing the required parameter 'subscription_item_id' when calling AppStoreApi.post_usage_records"
186
+ end
187
+ # verify the required parameter 'create_usage_record' is set
188
+ if @api_client.config.client_side_validation && create_usage_record.nil?
189
+ fail ArgumentError, "Missing the required parameter 'create_usage_record' when calling AppStoreApi.post_usage_records"
190
+ end
191
+ # resource path
192
+ local_var_path = '/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'subscriptionItemId' + '}', subscription_item_id.to_s)
193
+
194
+ # camelize keys of incoming `where` opts
195
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
196
+
197
+ # query parameters
198
+ query_params = opts[:query_params] || {}
199
+
200
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
201
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
202
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
203
+
204
+ # header parameters
205
+ header_params = opts[:header_params] || {}
206
+ # HTTP header 'Accept' (if needed)
207
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
208
+ # HTTP header 'Content-Type'
209
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
210
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
211
+
212
+ # form parameters
213
+ form_params = opts[:form_params] || {}
214
+
215
+ # http body (model)
216
+ post_body = opts[:body] || @api_client.object_to_http_body(create_usage_record)
217
+
218
+ # return_type
219
+ return_type = opts[:return_type] || 'UsageRecord'
220
+
221
+ # auth_names
222
+ auth_names = opts[:auth_names] || ['OAuth2']
223
+
224
+ new_options = opts.merge(
225
+ :header_params => header_params,
226
+ :query_params => query_params,
227
+ :form_params => form_params,
228
+ :body => post_body,
229
+ :auth_names => auth_names,
230
+ :return_type => return_type
231
+ )
232
+
233
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, "AppStoreApi", new_options)
234
+ if @api_client.config.debugging
235
+ @api_client.config.logger.debug "API called: AppStoreApi#post_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
236
+ end
237
+ return data, status_code, headers
238
+ end
239
+
240
+ # Update and existing metered usage belonging to this subscription and subscription item
241
+ # @param subscription_id [String] Unique identifier for Subscription object
242
+ # @param subscription_item_id [String] The unique identifier of the subscriptionItem
243
+ # @param usage_record_id [String] The unique identifier of the usage record
244
+ # @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
245
+ # @param [Hash] opts the optional parameters
246
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
247
+ # @return [UsageRecord]
248
+ def put_usage_records(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts = {})
249
+ data, _status_code, _headers = put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, opts)
250
+ data
251
+ end
252
+
253
+ # Update and existing metered usage belonging to this subscription and subscription item
254
+ # @param subscription_id [String] Unique identifier for Subscription object
255
+ # @param subscription_item_id [String] The unique identifier of the subscriptionItem
256
+ # @param usage_record_id [String] The unique identifier of the usage record
257
+ # @param update_usage_record [UpdateUsageRecord] Contains the quantity for the usage record to update
258
+ # @param [Hash] opts the optional parameters
259
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
260
+ # @return [Array<(UsageRecord, Integer, Hash)>] UsageRecord data, response status code and response headers
261
+ def put_usage_records_with_http_info(subscription_id, subscription_item_id, usage_record_id, update_usage_record, options = {})
262
+ opts = options.dup
263
+ if @api_client.config.debugging
264
+ @api_client.config.logger.debug 'Calling API: AppStoreApi.put_usage_records ...'
265
+ end
266
+ # verify the required parameter 'subscription_id' is set
267
+ if @api_client.config.client_side_validation && subscription_id.nil?
268
+ fail ArgumentError, "Missing the required parameter 'subscription_id' when calling AppStoreApi.put_usage_records"
269
+ end
270
+ # verify the required parameter 'subscription_item_id' is set
271
+ if @api_client.config.client_side_validation && subscription_item_id.nil?
272
+ fail ArgumentError, "Missing the required parameter 'subscription_item_id' when calling AppStoreApi.put_usage_records"
273
+ end
274
+ # verify the required parameter 'usage_record_id' is set
275
+ if @api_client.config.client_side_validation && usage_record_id.nil?
276
+ fail ArgumentError, "Missing the required parameter 'usage_record_id' when calling AppStoreApi.put_usage_records"
277
+ end
278
+ # verify the required parameter 'update_usage_record' is set
279
+ if @api_client.config.client_side_validation && update_usage_record.nil?
280
+ fail ArgumentError, "Missing the required parameter 'update_usage_record' when calling AppStoreApi.put_usage_records"
281
+ end
282
+ # resource path
283
+ local_var_path = '/subscriptions/{subscriptionId}/items/{subscriptionItemId}/usage-records/{usageRecordId}'.sub('{' + 'subscriptionId' + '}', subscription_id.to_s).sub('{' + 'subscriptionItemId' + '}', subscription_item_id.to_s).sub('{' + 'usageRecordId' + '}', usage_record_id.to_s)
284
+
285
+ # camelize keys of incoming `where` opts
286
+ opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
287
+
288
+ # query parameters
289
+ query_params = opts[:query_params] || {}
290
+
291
+ # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
292
+ query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
293
+ query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
294
+
295
+ # header parameters
296
+ header_params = opts[:header_params] || {}
297
+ # HTTP header 'Accept' (if needed)
298
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
299
+ # HTTP header 'Content-Type'
300
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
301
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
302
+
303
+ # form parameters
304
+ form_params = opts[:form_params] || {}
305
+
306
+ # http body (model)
307
+ post_body = opts[:body] || @api_client.object_to_http_body(update_usage_record)
308
+
309
+ # return_type
310
+ return_type = opts[:return_type] || 'UsageRecord'
311
+
312
+ # auth_names
313
+ auth_names = opts[:auth_names] || ['OAuth2']
314
+
315
+ new_options = opts.merge(
316
+ :header_params => header_params,
317
+ :query_params => query_params,
318
+ :form_params => form_params,
319
+ :body => post_body,
320
+ :auth_names => auth_names,
321
+ :return_type => return_type
322
+ )
323
+
324
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "AppStoreApi", new_options)
325
+ if @api_client.config.debugging
326
+ @api_client.config.logger.debug "API called: AppStoreApi#put_usage_records\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
327
+ end
328
+ return data, status_code, headers
329
+ end
86
330
  end
87
331
  end
@@ -21,6 +21,7 @@ module XeroRuby
21
21
  # @param xero_tenant_id [String] Xero identifier for Tenant
22
22
  # @param asset [Asset] Fixed asset you are creating
23
23
  # @param [Hash] opts the optional parameters
24
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
24
25
  # @return [Asset]
25
26
  def create_asset(xero_tenant_id, asset, opts = {})
26
27
  data, _status_code, _headers = create_asset_with_http_info(xero_tenant_id, asset, opts)
@@ -32,6 +33,7 @@ module XeroRuby
32
33
  # @param xero_tenant_id [String] Xero identifier for Tenant
33
34
  # @param asset [Asset] Fixed asset you are creating
34
35
  # @param [Hash] opts the optional parameters
36
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
35
37
  # @return [Array<(Asset, Integer, Hash)>] Asset data, response status code and response headers
36
38
  def create_asset_with_http_info(xero_tenant_id, asset, options = {})
37
39
  opts = options.dup
@@ -66,6 +68,7 @@ module XeroRuby
66
68
  # HTTP header 'Content-Type'
67
69
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
68
70
  header_params[:'xero-tenant-id'] = xero_tenant_id
71
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
69
72
 
70
73
  # form parameters
71
74
  form_params = opts[:form_params] || {}
@@ -98,21 +101,23 @@ module XeroRuby
98
101
  # adds a fixed asset type
99
102
  # Adds an fixed asset type to the system
100
103
  # @param xero_tenant_id [String] Xero identifier for Tenant
104
+ # @param asset_type [AssetType] Asset type to add
101
105
  # @param [Hash] opts the optional parameters
102
- # @option opts [AssetType] :asset_type Asset type to add
106
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
103
107
  # @return [AssetType]
104
- def create_asset_type(xero_tenant_id, opts = {})
105
- data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, opts)
108
+ def create_asset_type(xero_tenant_id, asset_type, opts = {})
109
+ data, _status_code, _headers = create_asset_type_with_http_info(xero_tenant_id, asset_type, opts)
106
110
  data
107
111
  end
108
112
 
109
113
  # adds a fixed asset type
110
114
  # Adds an fixed asset type to the system
111
115
  # @param xero_tenant_id [String] Xero identifier for Tenant
116
+ # @param asset_type [AssetType] Asset type to add
112
117
  # @param [Hash] opts the optional parameters
113
- # @option opts [AssetType] :asset_type Asset type to add
118
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
114
119
  # @return [Array<(AssetType, Integer, Hash)>] AssetType data, response status code and response headers
115
- def create_asset_type_with_http_info(xero_tenant_id, options = {})
120
+ def create_asset_type_with_http_info(xero_tenant_id, asset_type, options = {})
116
121
  opts = options.dup
117
122
  if @api_client.config.debugging
118
123
  @api_client.config.logger.debug 'Calling API: AssetApi.create_asset_type ...'
@@ -121,6 +126,10 @@ module XeroRuby
121
126
  if @api_client.config.client_side_validation && xero_tenant_id.nil?
122
127
  fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling AssetApi.create_asset_type"
123
128
  end
129
+ # verify the required parameter 'asset_type' is set
130
+ if @api_client.config.client_side_validation && asset_type.nil?
131
+ fail ArgumentError, "Missing the required parameter 'asset_type' when calling AssetApi.create_asset_type"
132
+ end
124
133
  # resource path
125
134
  local_var_path = '/AssetTypes'
126
135
 
@@ -141,12 +150,13 @@ module XeroRuby
141
150
  # HTTP header 'Content-Type'
142
151
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
143
152
  header_params[:'xero-tenant-id'] = xero_tenant_id
153
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
144
154
 
145
155
  # form parameters
146
156
  form_params = opts[:form_params] || {}
147
157
 
148
158
  # http body (model)
149
- post_body = opts[:body] || @api_client.object_to_http_body(opts[:'asset_type'])
159
+ post_body = opts[:body] || @api_client.object_to_http_body(asset_type)
150
160
 
151
161
  # return_type
152
162
  return_type = opts[:return_type] || 'AssetType'