xero-ruby 3.16.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xero-ruby/api/accounting_api.rb +645 -3
  3. data/lib/xero-ruby/api/app_store_api.rb +6 -0
  4. data/lib/xero-ruby/api/asset_api.rb +16 -6
  5. data/lib/xero-ruby/api/files_api.rb +156 -20
  6. data/lib/xero-ruby/api/payroll_au_api.rb +326 -30
  7. data/lib/xero-ruby/api/payroll_nz_api.rb +417 -7
  8. data/lib/xero-ruby/api/payroll_uk_api.rb +81 -0
  9. data/lib/xero-ruby/api/project_api.rb +21 -0
  10. data/lib/xero-ruby/api_client.rb +7 -7
  11. data/lib/xero-ruby/models/accounting/account_type.rb +0 -4
  12. data/lib/xero-ruby/models/accounting/allocation.rb +21 -1
  13. data/lib/xero-ruby/models/accounting/bank_transactions.rb +23 -1
  14. data/lib/xero-ruby/models/accounting/contact.rb +1 -11
  15. data/lib/xero-ruby/models/accounting/contacts.rb +23 -1
  16. data/lib/xero-ruby/models/accounting/credit_note.rb +17 -5
  17. data/lib/xero-ruby/models/accounting/credit_notes.rb +23 -1
  18. data/lib/xero-ruby/models/accounting/currency_code.rb +10 -8
  19. data/lib/xero-ruby/models/accounting/invoice.rb +16 -4
  20. data/lib/xero-ruby/models/accounting/invoice_address.rb +338 -0
  21. data/lib/xero-ruby/models/accounting/invoices.rb +23 -1
  22. data/lib/xero-ruby/models/accounting/journals.rb +13 -1
  23. data/lib/xero-ruby/models/accounting/line_item.rb +75 -4
  24. data/lib/xero-ruby/models/accounting/manual_journals.rb +23 -1
  25. data/lib/xero-ruby/models/accounting/organisation.rb +9 -2
  26. data/lib/xero-ruby/models/accounting/overpayments.rb +23 -1
  27. data/lib/xero-ruby/models/accounting/pagination.rb +252 -0
  28. data/lib/xero-ruby/models/accounting/payment.rb +16 -4
  29. data/lib/xero-ruby/models/accounting/payments.rb +23 -1
  30. data/lib/xero-ruby/models/accounting/prepayments.rb +23 -1
  31. data/lib/xero-ruby/models/accounting/purchase_orders.rb +23 -1
  32. data/lib/xero-ruby/models/accounting/tax_breakdown_component.rb +351 -0
  33. data/lib/xero-ruby/models/accounting/tax_rate.rb +13 -6
  34. data/lib/xero-ruby/models/accounting/tax_type.rb +45 -4
  35. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +75 -4
  36. data/lib/xero-ruby/models/files/association.rb +31 -1
  37. data/lib/xero-ruby/models/finance/current_statement_response.rb +1 -1
  38. data/lib/xero-ruby/models/finance/data_source_response.rb +13 -43
  39. data/lib/xero-ruby/models/finance/problem_type.rb +1 -0
  40. data/lib/xero-ruby/models/finance/statement_line_response.rb +11 -1
  41. data/lib/xero-ruby/models/finance/statement_response.rb +24 -4
  42. data/lib/xero-ruby/models/payroll_au/allowance_type.rb +0 -1
  43. data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +0 -1
  44. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +21 -1
  45. data/lib/xero-ruby/models/payroll_au/leave_application.rb +11 -1
  46. data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +14 -4
  47. data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +0 -1
  48. data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +2 -0
  49. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +16 -4
  50. data/lib/xero-ruby/models/payroll_au/paid_leave_earnings_line.rb +272 -0
  51. data/lib/xero-ruby/models/payroll_au/pay_out_type.rb +36 -0
  52. data/lib/xero-ruby/models/payroll_nz/employee.rb +34 -4
  53. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +56 -6
  54. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +47 -7
  55. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb +242 -0
  56. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb +254 -0
  57. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb +242 -0
  58. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb +244 -0
  59. data/lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb +244 -0
  60. data/lib/xero-ruby/models/payroll_nz/employment.rb +24 -4
  61. data/lib/xero-ruby/models/payroll_nz/leave_period.rb +35 -4
  62. data/lib/xero-ruby/models/payroll_nz/leave_type.rb +24 -4
  63. data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +28 -4
  64. data/lib/xero-ruby/models/payroll_nz/working_week.rb +317 -0
  65. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -3
  66. data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +14 -4
  67. data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
  68. data/lib/xero-ruby/version.rb +2 -2
  69. data/lib/xero-ruby/where.rb +37 -37
  70. data/lib/xero-ruby.rb +11 -0
  71. data/spec/api_client_spec.rb +56 -56
  72. data/spec/api_error_spec.rb +1 -1
  73. data/spec/configuration_spec.rb +2 -2
  74. data/spec/helper_methods_spec.rb +3 -3
  75. data/spec/where_spec.rb +2 -2
  76. metadata +38 -27
@@ -20,6 +20,7 @@ module XeroRuby
20
20
  # @param xero_tenant_id [String] Xero identifier for Tenant
21
21
  # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
22
22
  # @param [Hash] opts the optional parameters
23
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
23
24
  # @return [Project]
24
25
  def create_project(xero_tenant_id, project_create_or_update, opts = {})
25
26
  data, _status_code, _headers = create_project_with_http_info(xero_tenant_id, project_create_or_update, opts)
@@ -30,6 +31,7 @@ module XeroRuby
30
31
  # @param xero_tenant_id [String] Xero identifier for Tenant
31
32
  # @param project_create_or_update [ProjectCreateOrUpdate] Create a new project with ProjectCreateOrUpdate object
32
33
  # @param [Hash] opts the optional parameters
34
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
33
35
  # @return [Array<(Project, Integer, Hash)>] Project data, response status code and response headers
34
36
  def create_project_with_http_info(xero_tenant_id, project_create_or_update, options = {})
35
37
  opts = options.dup
@@ -64,6 +66,7 @@ module XeroRuby
64
66
  # HTTP header 'Content-Type'
65
67
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
66
68
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
69
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
67
70
 
68
71
  # form parameters
69
72
  form_params = opts[:form_params] || {}
@@ -99,6 +102,7 @@ module XeroRuby
99
102
  # @param project_id [String] You can create a task on a specified projectId
100
103
  # @param task_create_or_update [TaskCreateOrUpdate] The task object you are creating
101
104
  # @param [Hash] opts the optional parameters
105
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
102
106
  # @return [Task]
103
107
  def create_task(xero_tenant_id, project_id, task_create_or_update, opts = {})
104
108
  data, _status_code, _headers = create_task_with_http_info(xero_tenant_id, project_id, task_create_or_update, opts)
@@ -111,6 +115,7 @@ module XeroRuby
111
115
  # @param project_id [String] You can create a task on a specified projectId
112
116
  # @param task_create_or_update [TaskCreateOrUpdate] The task object you are creating
113
117
  # @param [Hash] opts the optional parameters
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<(Task, Integer, Hash)>] Task data, response status code and response headers
115
120
  def create_task_with_http_info(xero_tenant_id, project_id, task_create_or_update, options = {})
116
121
  opts = options.dup
@@ -149,6 +154,7 @@ module XeroRuby
149
154
  # HTTP header 'Content-Type'
150
155
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
151
156
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
157
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
152
158
 
153
159
  # form parameters
154
160
  form_params = opts[:form_params] || {}
@@ -184,6 +190,7 @@ module XeroRuby
184
190
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
185
191
  # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
186
192
  # @param [Hash] opts the optional parameters
193
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
187
194
  # @return [TimeEntry]
188
195
  def create_time_entry(xero_tenant_id, project_id, time_entry_create_or_update, opts = {})
189
196
  data, _status_code, _headers = create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, opts)
@@ -196,6 +203,7 @@ module XeroRuby
196
203
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
197
204
  # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are creating
198
205
  # @param [Hash] opts the optional parameters
206
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
199
207
  # @return [Array<(TimeEntry, Integer, Hash)>] TimeEntry data, response status code and response headers
200
208
  def create_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_create_or_update, options = {})
201
209
  opts = options.dup
@@ -234,6 +242,7 @@ module XeroRuby
234
242
  # HTTP header 'Content-Type'
235
243
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
236
244
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
245
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
237
246
 
238
247
  # form parameters
239
248
  form_params = opts[:form_params] || {}
@@ -1053,6 +1062,7 @@ module XeroRuby
1053
1062
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1054
1063
  # @param project_patch [ProjectPatch] Update the status of an existing Project
1055
1064
  # @param [Hash] opts the optional parameters
1065
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1056
1066
  # @return [nil]
1057
1067
  def patch_project(xero_tenant_id, project_id, project_patch, opts = {})
1058
1068
  patch_project_with_http_info(xero_tenant_id, project_id, project_patch, opts)
@@ -1065,6 +1075,7 @@ module XeroRuby
1065
1075
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1066
1076
  # @param project_patch [ProjectPatch] Update the status of an existing Project
1067
1077
  # @param [Hash] opts the optional parameters
1078
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1068
1079
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1069
1080
  def patch_project_with_http_info(xero_tenant_id, project_id, project_patch, options = {})
1070
1081
  opts = options.dup
@@ -1103,6 +1114,7 @@ module XeroRuby
1103
1114
  # HTTP header 'Content-Type'
1104
1115
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1105
1116
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1117
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1106
1118
 
1107
1119
  # form parameters
1108
1120
  form_params = opts[:form_params] || {}
@@ -1138,6 +1150,7 @@ module XeroRuby
1138
1150
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1139
1151
  # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
1140
1152
  # @param [Hash] opts the optional parameters
1153
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1141
1154
  # @return [nil]
1142
1155
  def update_project(xero_tenant_id, project_id, project_create_or_update, opts = {})
1143
1156
  update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, opts)
@@ -1150,6 +1163,7 @@ module XeroRuby
1150
1163
  # @param project_id [String] You can specify an individual project by appending the projectId to the endpoint
1151
1164
  # @param project_create_or_update [ProjectCreateOrUpdate] Request of type ProjectCreateOrUpdate
1152
1165
  # @param [Hash] opts the optional parameters
1166
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1153
1167
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1154
1168
  def update_project_with_http_info(xero_tenant_id, project_id, project_create_or_update, options = {})
1155
1169
  opts = options.dup
@@ -1188,6 +1202,7 @@ module XeroRuby
1188
1202
  # HTTP header 'Content-Type'
1189
1203
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1190
1204
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1205
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1191
1206
 
1192
1207
  # form parameters
1193
1208
  form_params = opts[:form_params] || {}
@@ -1224,6 +1239,7 @@ module XeroRuby
1224
1239
  # @param task_id [String] You can specify an individual task by appending the id to the endpoint
1225
1240
  # @param task_create_or_update [TaskCreateOrUpdate] The task object you are updating
1226
1241
  # @param [Hash] opts the optional parameters
1242
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1227
1243
  # @return [nil]
1228
1244
  def update_task(xero_tenant_id, project_id, task_id, task_create_or_update, opts = {})
1229
1245
  update_task_with_http_info(xero_tenant_id, project_id, task_id, task_create_or_update, opts)
@@ -1237,6 +1253,7 @@ module XeroRuby
1237
1253
  # @param task_id [String] You can specify an individual task by appending the id to the endpoint
1238
1254
  # @param task_create_or_update [TaskCreateOrUpdate] The task object you are updating
1239
1255
  # @param [Hash] opts the optional parameters
1256
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1240
1257
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1241
1258
  def update_task_with_http_info(xero_tenant_id, project_id, task_id, task_create_or_update, options = {})
1242
1259
  opts = options.dup
@@ -1279,6 +1296,7 @@ module XeroRuby
1279
1296
  # HTTP header 'Content-Type'
1280
1297
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1281
1298
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1299
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1282
1300
 
1283
1301
  # form parameters
1284
1302
  form_params = opts[:form_params] || {}
@@ -1315,6 +1333,7 @@ module XeroRuby
1315
1333
  # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
1316
1334
  # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
1317
1335
  # @param [Hash] opts the optional parameters
1336
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1318
1337
  # @return [nil]
1319
1338
  def update_time_entry(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts = {})
1320
1339
  update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, opts)
@@ -1328,6 +1347,7 @@ module XeroRuby
1328
1347
  # @param time_entry_id [String] You can specify an individual time entry by appending the id to the endpoint
1329
1348
  # @param time_entry_create_or_update [TimeEntryCreateOrUpdate] The time entry object you are updating
1330
1349
  # @param [Hash] opts the optional parameters
1350
+ # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
1331
1351
  # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
1332
1352
  def update_time_entry_with_http_info(xero_tenant_id, project_id, time_entry_id, time_entry_create_or_update, options = {})
1333
1353
  opts = options.dup
@@ -1370,6 +1390,7 @@ module XeroRuby
1370
1390
  # HTTP header 'Content-Type'
1371
1391
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
1372
1392
  header_params[:'Xero-Tenant-Id'] = xero_tenant_id
1393
+ header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
1373
1394
 
1374
1395
  # form parameters
1375
1396
  form_params = opts[:form_params] || {}
@@ -52,7 +52,7 @@ module XeroRuby
52
52
 
53
53
  def append_to_default_config(default_config, user_config)
54
54
  config = default_config
55
- user_config.each{|k,v| config.send("#{k}=", v)}
55
+ user_config.each { |k, v| config.send("#{k}=", v) }
56
56
  config
57
57
  end
58
58
 
@@ -194,7 +194,7 @@ module XeroRuby
194
194
  return true
195
195
  end
196
196
 
197
- def decode_jwt(tkn, verify=true)
197
+ def decode_jwt(tkn, verify = true)
198
198
  if verify == true
199
199
 
200
200
  response = Faraday.get('https://identity.xero.com/.well-known/openid-configuration/jwks') do |req|
@@ -251,18 +251,18 @@ module XeroRuby
251
251
  # Connection heplers
252
252
  def connections
253
253
  @config.base_url = 'https://api.xero.com'
254
- opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
254
+ opts = { :header_params => { 'Content-Type': 'application/json' }, :auth_names => ['OAuth2'] }
255
255
  response = call_api(:GET, "/connections/", nil, opts)
256
256
  response[0]
257
257
  end
258
258
 
259
259
  def last_connection
260
- connections.sort { |a,b| DateTime.parse(a['updatedDateUtc']) <=> DateTime.parse(b['updatedDateUtc'])}.first
260
+ connections.sort { |a, b| DateTime.parse(a['updatedDateUtc']) <=> DateTime.parse(b['updatedDateUtc']) }.last
261
261
  end
262
262
 
263
263
  def disconnect(connection_id)
264
264
  @config.base_url = 'https://api.xero.com'
265
- opts = { :header_params => {'Content-Type': 'application/json'}, :auth_names => ['OAuth2'] }
265
+ opts = { :header_params => { 'Content-Type': 'application/json' }, :auth_names => ['OAuth2'] }
266
266
  call_api(:DELETE, "/connections/#{connection_id}", nil, opts)
267
267
  connections
268
268
  end
@@ -286,7 +286,7 @@ module XeroRuby
286
286
  when "AssetApi"
287
287
  method_base_url = @config.asset_url
288
288
  when "FilesApi"
289
- method_base_url = @config.files_url
289
+ method_base_url = @config.files_url
290
290
  when "PayrollAuApi"
291
291
  method_base_url = @config.payroll_au_url
292
292
  when "PayrollNzApi"
@@ -304,7 +304,7 @@ module XeroRuby
304
304
  end
305
305
 
306
306
  connection = Faraday.new(:url => method_base_url, :ssl => ssl_options) do |conn|
307
- conn.request(:basic_auth, config.username, config.password)
307
+ conn.request(:authorization, :basic, config.username, config.password)
308
308
  if opts[:header_params]["Content-Type"] == "multipart/form-data"
309
309
  conn.request :multipart
310
310
  conn.request :url_encoded
@@ -31,11 +31,7 @@ module XeroRuby::Accounting
31
31
  REVENUE ||= "REVENUE".freeze
32
32
  SALES ||= "SALES".freeze
33
33
  TERMLIAB ||= "TERMLIAB".freeze
34
- PAYGLIABILITY ||= "PAYGLIABILITY".freeze
35
34
  PAYG ||= "PAYG".freeze
36
- SUPERANNUATIONEXPENSE ||= "SUPERANNUATIONEXPENSE".freeze
37
- SUPERANNUATIONLIABILITY ||= "SUPERANNUATIONLIABILITY".freeze
38
- WAGESEXPENSE ||= "WAGESEXPENSE".freeze
39
35
 
40
36
  # Builds the enum from string
41
37
  # @param [String] The enum value in the form of the string
@@ -16,6 +16,9 @@ module XeroRuby::Accounting
16
16
  require 'bigdecimal'
17
17
 
18
18
  class Allocation
19
+ # Xero generated unique identifier
20
+ attr_accessor :allocation_id
21
+
19
22
 
20
23
  attr_accessor :invoice
21
24
 
@@ -34,6 +37,9 @@ module XeroRuby::Accounting
34
37
  # the date the allocation is applied YYYY-MM-DD.
35
38
  attr_accessor :date
36
39
 
40
+ # A flag that returns true when the allocation is succesfully deleted
41
+ attr_accessor :is_deleted
42
+
37
43
  # A string to indicate if a invoice status
38
44
  attr_accessor :status_attribute_string
39
45
 
@@ -43,12 +49,14 @@ module XeroRuby::Accounting
43
49
  # Attribute mapping from ruby-style variable name to JSON key.
44
50
  def self.attribute_map
45
51
  {
52
+ :'allocation_id' => :'AllocationID',
46
53
  :'invoice' => :'Invoice',
47
54
  :'overpayment' => :'Overpayment',
48
55
  :'prepayment' => :'Prepayment',
49
56
  :'credit_note' => :'CreditNote',
50
57
  :'amount' => :'Amount',
51
58
  :'date' => :'Date',
59
+ :'is_deleted' => :'IsDeleted',
52
60
  :'status_attribute_string' => :'StatusAttributeString',
53
61
  :'validation_errors' => :'ValidationErrors'
54
62
  }
@@ -57,12 +65,14 @@ module XeroRuby::Accounting
57
65
  # Attribute type mapping.
58
66
  def self.openapi_types
59
67
  {
68
+ :'allocation_id' => :'String',
60
69
  :'invoice' => :'Invoice',
61
70
  :'overpayment' => :'Overpayment',
62
71
  :'prepayment' => :'Prepayment',
63
72
  :'credit_note' => :'CreditNote',
64
73
  :'amount' => :'BigDecimal',
65
74
  :'date' => :'Date',
75
+ :'is_deleted' => :'Boolean',
66
76
  :'status_attribute_string' => :'String',
67
77
  :'validation_errors' => :'Array<ValidationError>'
68
78
  }
@@ -83,6 +93,10 @@ module XeroRuby::Accounting
83
93
  h[k.to_sym] = v
84
94
  }
85
95
 
96
+ if attributes.key?(:'allocation_id')
97
+ self.allocation_id = attributes[:'allocation_id']
98
+ end
99
+
86
100
  if attributes.key?(:'invoice')
87
101
  self.invoice = attributes[:'invoice']
88
102
  end
@@ -107,6 +121,10 @@ module XeroRuby::Accounting
107
121
  self.date = attributes[:'date']
108
122
  end
109
123
 
124
+ if attributes.key?(:'is_deleted')
125
+ self.is_deleted = attributes[:'is_deleted']
126
+ end
127
+
110
128
  if attributes.key?(:'status_attribute_string')
111
129
  self.status_attribute_string = attributes[:'status_attribute_string']
112
130
  end
@@ -151,12 +169,14 @@ module XeroRuby::Accounting
151
169
  def ==(o)
152
170
  return true if self.equal?(o)
153
171
  self.class == o.class &&
172
+ allocation_id == o.allocation_id &&
154
173
  invoice == o.invoice &&
155
174
  overpayment == o.overpayment &&
156
175
  prepayment == o.prepayment &&
157
176
  credit_note == o.credit_note &&
158
177
  amount == o.amount &&
159
178
  date == o.date &&
179
+ is_deleted == o.is_deleted &&
160
180
  status_attribute_string == o.status_attribute_string &&
161
181
  validation_errors == o.validation_errors
162
182
  end
@@ -170,7 +190,7 @@ module XeroRuby::Accounting
170
190
  # Calculates hash code according to all attributes.
171
191
  # @return [Integer] Hash code
172
192
  def hash
173
- [invoice, overpayment, prepayment, credit_note, amount, date, status_attribute_string, validation_errors].hash
193
+ [allocation_id, invoice, overpayment, prepayment, credit_note, amount, date, is_deleted, status_attribute_string, validation_errors].hash
174
194
  end
175
195
 
176
196
  # Builds the object from hash
@@ -17,11 +17,19 @@ module XeroRuby::Accounting
17
17
 
18
18
  class BankTransactions
19
19
 
20
+ attr_accessor :pagination
21
+
22
+ # Displays array of warning messages from the API
23
+ attr_accessor :warnings
24
+
25
+
20
26
  attr_accessor :bank_transactions
21
27
 
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
31
+ :'pagination' => :'pagination',
32
+ :'warnings' => :'Warnings',
25
33
  :'bank_transactions' => :'BankTransactions'
26
34
  }
27
35
  end
@@ -29,6 +37,8 @@ module XeroRuby::Accounting
29
37
  # Attribute type mapping.
30
38
  def self.openapi_types
31
39
  {
40
+ :'pagination' => :'Pagination',
41
+ :'warnings' => :'Array<ValidationError>',
32
42
  :'bank_transactions' => :'Array<BankTransaction>'
33
43
  }
34
44
  end
@@ -48,6 +58,16 @@ module XeroRuby::Accounting
48
58
  h[k.to_sym] = v
49
59
  }
50
60
 
61
+ if attributes.key?(:'pagination')
62
+ self.pagination = attributes[:'pagination']
63
+ end
64
+
65
+ if attributes.key?(:'warnings')
66
+ if (value = attributes[:'warnings']).is_a?(Array)
67
+ self.warnings = value
68
+ end
69
+ end
70
+
51
71
  if attributes.key?(:'bank_transactions')
52
72
  if (value = attributes[:'bank_transactions']).is_a?(Array)
53
73
  self.bank_transactions = value
@@ -73,6 +93,8 @@ module XeroRuby::Accounting
73
93
  def ==(o)
74
94
  return true if self.equal?(o)
75
95
  self.class == o.class &&
96
+ pagination == o.pagination &&
97
+ warnings == o.warnings &&
76
98
  bank_transactions == o.bank_transactions
77
99
  end
78
100
 
@@ -85,7 +107,7 @@ module XeroRuby::Accounting
85
107
  # Calculates hash code according to all attributes.
86
108
  # @return [Integer] Hash code
87
109
  def hash
88
- [bank_transactions].hash
110
+ [pagination, warnings, bank_transactions].hash
89
111
  end
90
112
 
91
113
  # Builds the object from hash
@@ -49,9 +49,6 @@ module XeroRuby::Accounting
49
49
  # Email address of contact person (umlauts not supported) (max length = 255)
50
50
  attr_accessor :email_address
51
51
 
52
- # Skype user name of contact
53
- attr_accessor :skype_user_name
54
-
55
52
  # See contact persons
56
53
  attr_accessor :contact_persons
57
54
 
@@ -189,7 +186,6 @@ module XeroRuby::Accounting
189
186
  :'last_name' => :'LastName',
190
187
  :'company_number' => :'CompanyNumber',
191
188
  :'email_address' => :'EmailAddress',
192
- :'skype_user_name' => :'SkypeUserName',
193
189
  :'contact_persons' => :'ContactPersons',
194
190
  :'bank_account_details' => :'BankAccountDetails',
195
191
  :'tax_number' => :'TaxNumber',
@@ -238,7 +234,6 @@ module XeroRuby::Accounting
238
234
  :'last_name' => :'String',
239
235
  :'company_number' => :'String',
240
236
  :'email_address' => :'String',
241
- :'skype_user_name' => :'String',
242
237
  :'contact_persons' => :'Array<ContactPerson>',
243
238
  :'bank_account_details' => :'String',
244
239
  :'tax_number' => :'String',
@@ -329,10 +324,6 @@ module XeroRuby::Accounting
329
324
  self.email_address = attributes[:'email_address']
330
325
  end
331
326
 
332
- if attributes.key?(:'skype_user_name')
333
- self.skype_user_name = attributes[:'skype_user_name']
334
- end
335
-
336
327
  if attributes.key?(:'contact_persons')
337
328
  if (value = attributes[:'contact_persons']).is_a?(Array)
338
329
  self.contact_persons = value
@@ -666,7 +657,6 @@ module XeroRuby::Accounting
666
657
  last_name == o.last_name &&
667
658
  company_number == o.company_number &&
668
659
  email_address == o.email_address &&
669
- skype_user_name == o.skype_user_name &&
670
660
  contact_persons == o.contact_persons &&
671
661
  bank_account_details == o.bank_account_details &&
672
662
  tax_number == o.tax_number &&
@@ -710,7 +700,7 @@ module XeroRuby::Accounting
710
700
  # Calculates hash code according to all attributes.
711
701
  # @return [Integer] Hash code
712
702
  def hash
713
- [contact_id, merged_to_contact_id, contact_number, account_number, contact_status, name, first_name, last_name, company_number, email_address, skype_user_name, contact_persons, bank_account_details, tax_number, accounts_receivable_tax_type, accounts_payable_tax_type, addresses, phones, is_supplier, is_customer, sales_default_line_amount_type, purchases_default_line_amount_type, default_currency, xero_network_key, sales_default_account_code, purchases_default_account_code, sales_tracking_categories, purchases_tracking_categories, tracking_category_name, tracking_category_option, payment_terms, updated_date_utc, contact_groups, website, branding_theme, batch_payments, discount, balances, attachments, has_attachments, validation_errors, has_validation_errors, status_attribute_string].hash
703
+ [contact_id, merged_to_contact_id, contact_number, account_number, contact_status, name, first_name, last_name, company_number, email_address, contact_persons, bank_account_details, tax_number, accounts_receivable_tax_type, accounts_payable_tax_type, addresses, phones, is_supplier, is_customer, sales_default_line_amount_type, purchases_default_line_amount_type, default_currency, xero_network_key, sales_default_account_code, purchases_default_account_code, sales_tracking_categories, purchases_tracking_categories, tracking_category_name, tracking_category_option, payment_terms, updated_date_utc, contact_groups, website, branding_theme, batch_payments, discount, balances, attachments, has_attachments, validation_errors, has_validation_errors, status_attribute_string].hash
714
704
  end
715
705
 
716
706
  # Builds the object from hash
@@ -17,11 +17,19 @@ module XeroRuby::Accounting
17
17
 
18
18
  class Contacts
19
19
 
20
+ attr_accessor :pagination
21
+
22
+ # Displays array of warning messages from the API
23
+ attr_accessor :warnings
24
+
25
+
20
26
  attr_accessor :contacts
21
27
 
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
31
+ :'pagination' => :'pagination',
32
+ :'warnings' => :'Warnings',
25
33
  :'contacts' => :'Contacts'
26
34
  }
27
35
  end
@@ -29,6 +37,8 @@ module XeroRuby::Accounting
29
37
  # Attribute type mapping.
30
38
  def self.openapi_types
31
39
  {
40
+ :'pagination' => :'Pagination',
41
+ :'warnings' => :'Array<ValidationError>',
32
42
  :'contacts' => :'Array<Contact>'
33
43
  }
34
44
  end
@@ -48,6 +58,16 @@ module XeroRuby::Accounting
48
58
  h[k.to_sym] = v
49
59
  }
50
60
 
61
+ if attributes.key?(:'pagination')
62
+ self.pagination = attributes[:'pagination']
63
+ end
64
+
65
+ if attributes.key?(:'warnings')
66
+ if (value = attributes[:'warnings']).is_a?(Array)
67
+ self.warnings = value
68
+ end
69
+ end
70
+
51
71
  if attributes.key?(:'contacts')
52
72
  if (value = attributes[:'contacts']).is_a?(Array)
53
73
  self.contacts = value
@@ -73,6 +93,8 @@ module XeroRuby::Accounting
73
93
  def ==(o)
74
94
  return true if self.equal?(o)
75
95
  self.class == o.class &&
96
+ pagination == o.pagination &&
97
+ warnings == o.warnings &&
76
98
  contacts == o.contacts
77
99
  end
78
100
 
@@ -85,7 +107,7 @@ module XeroRuby::Accounting
85
107
  # Calculates hash code according to all attributes.
86
108
  # @return [Integer] Hash code
87
109
  def hash
88
- [contacts].hash
110
+ [pagination, warnings, contacts].hash
89
111
  end
90
112
 
91
113
  # Builds the object from hash
@@ -78,7 +78,7 @@ module XeroRuby::Accounting
78
78
  # ACCRECCREDIT only – additional reference number
79
79
  attr_accessor :reference
80
80
 
81
- # boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only)
81
+ # Boolean to set whether the credit note in the Xero app should be marked as “sent”. This can be set only on credit notes that have been approved
82
82
  attr_accessor :sent_to_contact
83
83
 
84
84
  # The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used
@@ -114,6 +114,9 @@ module XeroRuby::Accounting
114
114
  # Displays array of warning messages from the API
115
115
  attr_accessor :warnings
116
116
 
117
+ # An array of addresses used to auto calculate sales tax
118
+ attr_accessor :invoice_addresses
119
+
117
120
  class EnumAttributeValidator
118
121
  attr_reader :datatype
119
122
  attr_reader :allowable_values
@@ -168,7 +171,8 @@ module XeroRuby::Accounting
168
171
  :'has_attachments' => :'HasAttachments',
169
172
  :'has_errors' => :'HasErrors',
170
173
  :'validation_errors' => :'ValidationErrors',
171
- :'warnings' => :'Warnings'
174
+ :'warnings' => :'Warnings',
175
+ :'invoice_addresses' => :'InvoiceAddresses'
172
176
  }
173
177
  end
174
178
 
@@ -204,7 +208,8 @@ module XeroRuby::Accounting
204
208
  :'has_attachments' => :'Boolean',
205
209
  :'has_errors' => :'Boolean',
206
210
  :'validation_errors' => :'Array<ValidationError>',
207
- :'warnings' => :'Array<ValidationError>'
211
+ :'warnings' => :'Array<ValidationError>',
212
+ :'invoice_addresses' => :'Array<InvoiceAddress>'
208
213
  }
209
214
  end
210
215
 
@@ -356,6 +361,12 @@ module XeroRuby::Accounting
356
361
  self.warnings = value
357
362
  end
358
363
  end
364
+
365
+ if attributes.key?(:'invoice_addresses')
366
+ if (value = attributes[:'invoice_addresses']).is_a?(Array)
367
+ self.invoice_addresses = value
368
+ end
369
+ end
359
370
  end
360
371
 
361
372
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -429,7 +440,8 @@ module XeroRuby::Accounting
429
440
  has_attachments == o.has_attachments &&
430
441
  has_errors == o.has_errors &&
431
442
  validation_errors == o.validation_errors &&
432
- warnings == o.warnings
443
+ warnings == o.warnings &&
444
+ invoice_addresses == o.invoice_addresses
433
445
  end
434
446
 
435
447
  # @see the `==` method
@@ -441,7 +453,7 @@ module XeroRuby::Accounting
441
453
  # Calculates hash code according to all attributes.
442
454
  # @return [Integer] Hash code
443
455
  def hash
444
- [type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings].hash
456
+ [type, contact, date, due_date, status, line_amount_types, line_items, sub_total, total_tax, total, cis_deduction, cis_rate, updated_date_utc, currency_code, fully_paid_on_date, credit_note_id, credit_note_number, reference, sent_to_contact, currency_rate, remaining_credit, allocations, applied_amount, payments, branding_theme_id, status_attribute_string, has_attachments, has_errors, validation_errors, warnings, invoice_addresses].hash
445
457
  end
446
458
 
447
459
  # Builds the object from hash
@@ -17,11 +17,19 @@ module XeroRuby::Accounting
17
17
 
18
18
  class CreditNotes
19
19
 
20
+ attr_accessor :pagination
21
+
22
+ # Displays array of warning messages from the API
23
+ attr_accessor :warnings
24
+
25
+
20
26
  attr_accessor :credit_notes
21
27
 
22
28
  # Attribute mapping from ruby-style variable name to JSON key.
23
29
  def self.attribute_map
24
30
  {
31
+ :'pagination' => :'pagination',
32
+ :'warnings' => :'Warnings',
25
33
  :'credit_notes' => :'CreditNotes'
26
34
  }
27
35
  end
@@ -29,6 +37,8 @@ module XeroRuby::Accounting
29
37
  # Attribute type mapping.
30
38
  def self.openapi_types
31
39
  {
40
+ :'pagination' => :'Pagination',
41
+ :'warnings' => :'Array<ValidationError>',
32
42
  :'credit_notes' => :'Array<CreditNote>'
33
43
  }
34
44
  end
@@ -48,6 +58,16 @@ module XeroRuby::Accounting
48
58
  h[k.to_sym] = v
49
59
  }
50
60
 
61
+ if attributes.key?(:'pagination')
62
+ self.pagination = attributes[:'pagination']
63
+ end
64
+
65
+ if attributes.key?(:'warnings')
66
+ if (value = attributes[:'warnings']).is_a?(Array)
67
+ self.warnings = value
68
+ end
69
+ end
70
+
51
71
  if attributes.key?(:'credit_notes')
52
72
  if (value = attributes[:'credit_notes']).is_a?(Array)
53
73
  self.credit_notes = value
@@ -73,6 +93,8 @@ module XeroRuby::Accounting
73
93
  def ==(o)
74
94
  return true if self.equal?(o)
75
95
  self.class == o.class &&
96
+ pagination == o.pagination &&
97
+ warnings == o.warnings &&
76
98
  credit_notes == o.credit_notes
77
99
  end
78
100
 
@@ -85,7 +107,7 @@ module XeroRuby::Accounting
85
107
  # Calculates hash code according to all attributes.
86
108
  # @return [Integer] Hash code
87
109
  def hash
88
- [credit_notes].hash
110
+ [pagination, warnings, credit_notes].hash
89
111
  end
90
112
 
91
113
  # Builds the object from hash