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
@@ -70,8 +70,8 @@ describe XeroRuby::ApiClient do
70
70
  state: "custom-state"
71
71
  }
72
72
  api_client = XeroRuby::ApiClient.new(credentials: creds)
73
- altered_state = {'state': 'not-original-state'}
74
- expect{api_client.validate_state(altered_state)}.to raise_error(StandardError, 'WARNING: @config.state: custom-state and OAuth callback state: do not match!')
73
+ altered_state = { 'state': 'not-original-state' }
74
+ expect { api_client.validate_state(altered_state) }.to raise_error(StandardError, 'WARNING: @config.state: custom-state and OAuth callback state: do not match!')
75
75
  end
76
76
  end
77
77
 
@@ -102,16 +102,16 @@ describe XeroRuby::ApiClient do
102
102
 
103
103
  describe 'api_client helper functions' do
104
104
  let(:api_client) { XeroRuby::ApiClient.new }
105
- let(:token_set) { {'access_token': 'eyx.authorization.data', 'id_token': 'eyx.authentication.data', 'refresh_token': 'REFRESHMENTS'} }
105
+ let(:token_set) { { 'access_token': 'eyx.authorization.data', 'id_token': 'eyx.authentication.data', 'refresh_token': 'REFRESHMENTS' } }
106
106
  let(:connections) {
107
- [{
108
- "id" => "xxx-yyy-zzz",
109
- "tenantId" => "xxx-yyy-zzz",
110
- "tenantType" => "ORGANISATION",
111
- "tenantName" => "Demo Company (US)",
112
- "createdDateUtc" => "2019-11-01T20:08:03.0766400",
113
- "updatedDateUtc" => "2020-04-15T22:37:10.4943410"
114
- }]
107
+ [{
108
+ "id" => "xxx-yyy-zzz",
109
+ "tenantId" => "xxx-yyy-zzz",
110
+ "tenantType" => "ORGANISATION",
111
+ "tenantName" => "Demo Company (US)",
112
+ "createdDateUtc" => "2019-11-01T20:08:03.0766400",
113
+ "updatedDateUtc" => "2020-04-15T22:37:10.4943410"
114
+ }]
115
115
  }
116
116
 
117
117
  before do
@@ -190,7 +190,7 @@ describe XeroRuby::ApiClient do
190
190
  }
191
191
  }
192
192
  api_client.accounting_api.get_invoices('active_tenant_id', opts)
193
- expect(opts).to eq({:where=>{:invoice_number=>["=", "INV-0060"]}})
193
+ expect(opts).to eq({ :where => { :invoice_number => ["=", "INV-0060"] } })
194
194
  end
195
195
  end
196
196
 
@@ -224,10 +224,10 @@ describe XeroRuby::ApiClient do
224
224
  end
225
225
 
226
226
  describe "#object_to_hash modifies a hash from snake_case to PascalCase" do
227
- contact_after = {:Contacts=>[{:Name=>"Bruce Banner", :EmailAddress=>"hulk@avengers.com", :Phones=>[{:PhoneType=>"MOBILE", :PhoneNumber=>"555-1212", :PhoneAreaCode=>"415"}], :PaymentTerms=>{:Bills=>{:Day=>15, :Type=>"OFCURRENTMONTH"}, :Sales=>{:Day=>10, :Type=>"DAYSAFTERBILLMONTH"}}}]}
227
+ contact_after = { :Contacts => [{ :Name => "Bruce Banner", :EmailAddress => "hulk@avengers.com", :Phones => [{ :PhoneType => "MOBILE", :PhoneNumber => "555-1212", :PhoneAreaCode => "415" }], :PaymentTerms => { :Bills => { :Day => 15, :Type => "OFCURRENTMONTH" }, :Sales => { :Day => 10, :Type => "DAYSAFTERBILLMONTH" } } }] }
228
228
 
229
229
  it 'Serializes snake_case object correctly' do
230
- contact_before = {:contacts=>[{:name=>"Bruce Banner", :email_address=>"hulk@avengers.com", :phones=>[{:phone_type=>"MOBILE", :phone_number=>"555-1212", :phone_area_code=>"415"}], :payment_terms=>{:bills=>{:day=>15, :type=>"OFCURRENTMONTH"}, :sales=>{:day=>10, :type=>"DAYSAFTERBILLMONTH"}}}]}
230
+ contact_before = { :contacts => [{ :name => "Bruce Banner", :email_address => "hulk@avengers.com", :phones => [{ :phone_type => "MOBILE", :phone_number => "555-1212", :phone_area_code => "415" }], :payment_terms => { :bills => { :day => 15, :type => "OFCURRENTMONTH" }, :sales => { :day => 10, :type => "DAYSAFTERBILLMONTH" } } }] }
231
231
  api_client = XeroRuby::ApiClient.new
232
232
  expect(api_client.object_to_hash(contact_before)).to eq(contact_after)
233
233
  end
@@ -255,26 +255,26 @@ describe XeroRuby::ApiClient do
255
255
 
256
256
  it 'Serializes json with multiple nested objects correctly' do
257
257
  json_before = {
258
- "line_Items":[
258
+ "line_Items": [
259
259
  {
260
- "quantity":1.0,
261
- "unit_amount":20,
262
- "sub_Items":[
260
+ "quantity": 1.0,
261
+ "unit_amount": 20,
262
+ "sub_Items": [
263
263
  {
264
- "quantity":1.0,
265
- "unit_amount":20
264
+ "quantity": 1.0,
265
+ "unit_amount": 20
266
266
  },
267
267
  {
268
- "quantity":1.0,
269
- "Unit_amount":20,
270
- "Deep_Items":[
268
+ "quantity": 1.0,
269
+ "Unit_amount": 20,
270
+ "Deep_Items": [
271
271
  {
272
- "quantity":1.0,
273
- "unit_amount":20
272
+ "quantity": 1.0,
273
+ "unit_amount": 20
274
274
  },
275
275
  {
276
- "quantity":1.0,
277
- "unit_Amount":20
276
+ "quantity": 1.0,
277
+ "unit_Amount": 20
278
278
  }
279
279
  ]
280
280
  }
@@ -284,26 +284,26 @@ describe XeroRuby::ApiClient do
284
284
  }
285
285
 
286
286
  json_after = {
287
- "LineItems":[
287
+ "LineItems": [
288
288
  {
289
- "UnitAmount":20,
290
- "Quantity":1.0,
291
- "SubItems":[
289
+ "UnitAmount": 20,
290
+ "Quantity": 1.0,
291
+ "SubItems": [
292
292
  {
293
- "UnitAmount":20,
294
- "Quantity":1.0
293
+ "UnitAmount": 20,
294
+ "Quantity": 1.0
295
295
  },
296
296
  {
297
- "UnitAmount":20,
298
- "Quantity":1.0,
299
- "DeepItems":[
297
+ "UnitAmount": 20,
298
+ "Quantity": 1.0,
299
+ "DeepItems": [
300
300
  {
301
- "UnitAmount":20,
302
- "Quantity":1.0
301
+ "UnitAmount": 20,
302
+ "Quantity": 1.0
303
303
  },
304
304
  {
305
- "UnitAmount":20,
306
- "Quantity":1.0
305
+ "UnitAmount": 20,
306
+ "Quantity": 1.0
307
307
  }
308
308
  ]
309
309
  }
@@ -316,8 +316,8 @@ describe XeroRuby::ApiClient do
316
316
  end
317
317
 
318
318
  it 'Serializes mixed cased keys correctly' do
319
- contact_after = { :Contacts=>[{:Name=>"Bruce Banner", :EmailAddress=>"hulk@avengers.com", :Phones=>[{:PhoneType=>"MOBILE", :PhoneNumber=>"555-1212", :PhoneAreaCode=>"415"}], :PaymentTerms=>{:Bills=>{:Day=>15, :Type=>"OFCURRENTMONTH"}, :Sales=>{:Day=>10, :Type=>"DAYSAFTERBILLMONTH"}}}]}
320
- contact_before = {:contacts=>[{:name=>"Bruce Banner", :emailAddress=>"hulk@avengers.com", :phones=>[{:phoneType=>"MOBILE", :phone_number=>"555-1212", :phone_areaCode=>"415"}], :Payment_terms=>{:bills=>{:day=>15, :type=>"OFCURRENTMONTH"}, :sales=>{:day=>10, :type=>"DAYSAFTERBILLMONTH"}}}]}
319
+ contact_after = { :Contacts => [{ :Name => "Bruce Banner", :EmailAddress => "hulk@avengers.com", :Phones => [{ :PhoneType => "MOBILE", :PhoneNumber => "555-1212", :PhoneAreaCode => "415" }], :PaymentTerms => { :Bills => { :Day => 15, :Type => "OFCURRENTMONTH" }, :Sales => { :Day => 10, :Type => "DAYSAFTERBILLMONTH" } } }] }
320
+ contact_before = { :contacts => [{ :name => "Bruce Banner", :emailAddress => "hulk@avengers.com", :phones => [{ :phoneType => "MOBILE", :phone_number => "555-1212", :phone_areaCode => "415" }], :Payment_terms => { :bills => { :day => 15, :type => "OFCURRENTMONTH" }, :sales => { :day => 10, :type => "DAYSAFTERBILLMONTH" } } }] }
321
321
  api_client = XeroRuby::ApiClient.new
322
322
  expect(api_client.object_to_hash(contact_before)).to eq(contact_after)
323
323
  end
@@ -418,9 +418,9 @@ describe XeroRuby::ApiClient do
418
418
 
419
419
  describe 'token helper methods' do
420
420
  let(:api_client) { XeroRuby::ApiClient.new }
421
- let(:id_token){'eyJhbGciOiJSUzI1NiIsImtpZCI6IjFDQUY4RTY2NzcyRDZEQzAyOEQ2NzI2RkQwMjYxNTgxNTcwRUZDMTkiLCJ0eXAiOiJKV1QiLCJ4NXQiOiJISy1PWm5jdGJjQW8xbkp2MENZVmdWY09fQmsifQ.eyJuYmYiOjE2MTk3MTQwNDMsImV4cCI6MTYxOTcxNDM0MywiaXNzIjoiaHR0cHM6Ly9pZGVudGl0eS54ZXJvLmNvbSIsImF1ZCI6IkFEQjVBNzdEQTZCNjRFOTI4RDg0MDkwOTlBMzlDQTdCIiwiaWF0IjoxNjE5NzE0MDQzLCJhdF9oYXNoIjoiMXJNamVvUTJiOUxUNFU0ZlBXbEZJZyIsInNpZCI6ImY0YTY4ZDc0ZmM3OTQzMjc4YTgzMTg0NGM5ZWRmNzFiIiwic3ViIjoiZGI0ZjBmMzdiNTg1NTMwZTkxZjNiOWNiYjUwMzQwZTgiLCJhdXRoX3RpbWUiOjE2MTk3MTM5ODcsInhlcm9fdXNlcmlkIjoiZmFhODNlYzktZjZhNy00ODlmLTg5MTEtZTNmY2UwM2ExMTg2IiwiZ2xvYmFs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F5cnVucyIsInBheXJvbGwucGF5c2xpcCIsInBheXJvbGwudGltZXNoZWV0cyIsInByb2plY3RzLnJlYWQiLCJwcm9qZWN0cyIsImFjY291bnRpbmcuc2V0dGluZ3MiLCJhY2NvdW50aW5nLmF0dGFjaG1lbnRzIiwiYWNjb3VudGluZy50cmFuc2FjdGlvbnMiLCJhY2NvdW50aW5nLmpvdXJuYWxzLnJlYWQiLCJhc3NldHMucmVhZCIsImFzc2V0cyIsImFjY291bnRpbmcuY29udGFjdHMiLCJwYXlyb2xsLnNldHRpbmdzIiwib2ZmbGluZV9hY2Nlc3MiXX0.vNV-YsgHFWKFBmyYdhg7tztdsPc9ykObadQcGFoFXJ8qCBerR3h7XXKzWAP3KzFzhOCcIpWU8Q081zuYBNxahPeeLRLUuc_3MwgwE72esE5vGuxa2_-_QidtNvMCgsX-ie_LcX7FE_KI-sXB_EZ8fDk6WAMIPC9d3GejgeuH5Uh6rZkhowN2jm5pZjEOEy_QE7PScBO0XEbiZNUsarvBUSdKuSTvVVLHzHzs0bHMRfgKEkqZySNtZlac-oyaL3PVba1S7A_vbRcNWpYR_VrKGf2g9LHSI3EA5j3Beto4pKukU-bk6rLBGul37u4tM17U-wyJLsFmt6ZC_SEJKgmluQ' }
423
+ let(:tkn_set) { { 'id_token': id_token, 'access_token': access_token, 'refresh_token': 'abc123xyz' } }
424
424
 
425
425
  before do
426
426
  api_client.set_token_set(tkn_set)
@@ -431,17 +431,17 @@ describe XeroRuby::ApiClient do
431
431
  end
432
432
 
433
433
  it '#token_expired? for a just expired token' do
434
- allow(api_client).to receive(:decoded_access_token).and_return({"exp"=>Time.now.to_i})
434
+ allow(api_client).to receive(:decoded_access_token).and_return({ "exp" => Time.now.to_i })
435
435
  expect(api_client.token_expired?).to eq(true)
436
436
  end
437
437
 
438
438
  it '#token_expired? for a non-expired token' do
439
- allow(api_client).to receive(:decoded_access_token).and_return({"exp"=>(Time.now + 30.minutes).to_i})
439
+ allow(api_client).to receive(:decoded_access_token).and_return({ "exp" => (Time.now + 30.minutes).to_i })
440
440
  expect(api_client.token_expired?).to eq(false)
441
441
  end
442
442
 
443
443
  it '#token_expired? for an almost expired token' do
444
- allow(api_client).to receive(:decoded_access_token).and_return({"exp"=>(Time.now + 30.seconds).to_i})
444
+ allow(api_client).to receive(:decoded_access_token).and_return({ "exp" => (Time.now + 30.seconds).to_i })
445
445
  expect(api_client.token_expired?).to eq(false)
446
446
  end
447
447
 
@@ -463,29 +463,29 @@ describe XeroRuby::ApiClient do
463
463
 
464
464
  it 'decoding an invalid access_token' do
465
465
  api_client.set_access_token("#{access_token}.NotAValidJWTstring")
466
- expect{api_client.decoded_access_token}.to raise_error(JSON::JWT::InvalidFormat)
466
+ expect { api_client.decoded_access_token }.to raise_error(JSON::JWT::InvalidFormat)
467
467
  end
468
468
 
469
469
  it 'decoding an invalid id_token' do
470
470
  api_client.set_id_token("#{id_token}.NotAValidJWTstring")
471
- expect{api_client.decoded_id_token}.to raise_error(JSON::JWT::InvalidFormat)
471
+ expect { api_client.decoded_id_token }.to raise_error(JSON::JWT::InvalidFormat)
472
472
  end
473
473
  end
474
474
 
475
475
 
476
476
  describe 'thread safety in the XeroClient' do
477
- let(:creds) {{
477
+ let(:creds) { {
478
478
  client_id: 'abc',
479
479
  client_secret: '123',
480
480
  redirect_uri: 'https://mydomain.com/callback',
481
481
  scopes: 'openid profile email accounting.transactions'
482
482
  }}
483
- let(:api_client_1) {XeroRuby::ApiClient.new(credentials: creds)}
484
- let(:api_client_2) {XeroRuby::ApiClient.new(credentials: creds)}
485
- let(:api_client_3) {XeroRuby::ApiClient.new(credentials: creds)}
483
+ let(:api_client_1) { XeroRuby::ApiClient.new(credentials: creds) }
484
+ let(:api_client_2) { XeroRuby::ApiClient.new(credentials: creds) }
485
+ let(:api_client_3) { XeroRuby::ApiClient.new(credentials: creds) }
486
486
 
487
- let(:tkn_set_1){{'id_token': "abc.123.1", 'access_token': "xxx.yyy.zzz.111"}}
488
- let(:tkn_set_2){{'id_token': "efg.456.2", 'access_token': "xxx.yyy.zzz.222"}}
487
+ let(:tkn_set_1) { { 'id_token': "abc.123.1", 'access_token': "xxx.yyy.zzz.111" } }
488
+ let(:tkn_set_2) { { 'id_token': "efg.456.2", 'access_token': "xxx.yyy.zzz.222" } }
489
489
 
490
490
  describe 'when configuration is changed, other instantiations of the client are not affected' do
491
491
  it 'applies to #set_access_token' do
@@ -29,7 +29,7 @@ describe XeroRuby::ApiError do
29
29
  }
30
30
  api_error = XeroRuby::ApiError.new(
31
31
  :code => 400,
32
- :response_headers => {"content-type"=>"application/json; charset=utf-8", "content-length"=>"1700", "server"=>"nginx", "xero-correlation-id"=>"31e2c94e-3ae4-402a-a374-b7a94ef9445c", "x-appminlimit-remaining"=>"9988", "x-minlimit-remaining"=>"58", "x-daylimit-remaining"=>"4998", "expires"=>"Fri, 18 Dec 2020 17:56:29 GMT", "cache-control"=>"max-age=0, no-cache, no-store", "pragma"=>"no-cache", "date"=>"Fri, 18 Dec 2020 17:56:29 GMT", "connection"=>"close", "x-client-tls-ver"=>"tls1.3"},
32
+ :response_headers => { "content-type" => "application/json; charset=utf-8", "content-length" => "1700", "server" => "nginx", "xero-correlation-id" => "31e2c94e-3ae4-402a-a374-b7a94ef9445c", "x-appminlimit-remaining" => "9988", "x-minlimit-remaining" => "58", "x-daylimit-remaining" => "4998", "expires" => "Fri, 18 Dec 2020 17:56:29 GMT", "cache-control" => "max-age=0, no-cache, no-store", "pragma" => "no-cache", "date" => "Fri, 18 Dec 2020 17:56:29 GMT", "connection" => "close", "x-client-tls-ver" => "tls1.3" },
33
33
  :response_body => error_body
34
34
  )
35
35
  expect(api_error.message).to include("The TaxType code NONE does not exist or cannot be used for this type of transaction")
@@ -25,12 +25,12 @@ describe XeroRuby::Configuration do
25
25
  end
26
26
 
27
27
  it 'should allow you to overwrite the default configuration options' do
28
- client = XeroRuby::ApiClient.new(credentials: {}, config: {login_url: 'ngrok.login.xero.test'})
28
+ client = XeroRuby::ApiClient.new(credentials: {}, config: { login_url: 'ngrok.login.xero.test' })
29
29
  expect(client.config.login_url).to eq('ngrok.login.xero.test')
30
30
  end
31
31
 
32
32
  it 'should allow you to set the timeout config option' do
33
- client = XeroRuby::ApiClient.new(credentials: {}, config: {timeout: 30})
33
+ client = XeroRuby::ApiClient.new(credentials: {}, config: { timeout: 30 })
34
34
  expect(client.config.timeout).to eq(30)
35
35
  end
36
36
  end
@@ -3,7 +3,7 @@ require 'spec_helper'
3
3
  describe 'shared helper methods' do
4
4
 
5
5
  describe '#parse_date' do
6
- let(:model_instance) {XeroRuby::Accounting::Account.new}
6
+ let(:model_instance) { XeroRuby::Accounting::Account.new }
7
7
 
8
8
  it 'can parse from ms date with backslash' do
9
9
  datestring = "\/Date(1519851689297+0000)\/"
@@ -85,11 +85,11 @@ describe 'shared helper methods' do
85
85
 
86
86
  describe '#attributes' do
87
87
  it 'can serialize invoice attributes into a snake_case hash' do
88
- expect(invoice.to_attributes).to eq({currency_code: "USD", has_attachments: false, has_errors: false, invoice_number: "abc-123", total_discount: 100, type: "ACCPAY"})
88
+ expect(invoice.to_attributes).to eq({ currency_code: "USD", has_attachments: false, has_errors: false, invoice_number: "abc-123", total_discount: 100, type: "ACCPAY" })
89
89
  end
90
90
 
91
91
  it 'can serialize contact attributes into a snake_case hash' do
92
- expect(contact.to_attributes).to eq({account_number: "abc-123", contact_status: "ACTIVE", email_address: "email@gmail.com", first_name: 'Contact', has_attachments: false, has_validation_errors: false, last_name: "Name", name: "Contact Name"})
92
+ expect(contact.to_attributes).to eq({ account_number: "abc-123", contact_status: "ACTIVE", email_address: "email@gmail.com", first_name: 'Contact', has_attachments: false, has_validation_errors: false, last_name: "Name", name: "Contact Name" })
93
93
  end
94
94
 
95
95
  it 'can serialize nested attributes into a snake_case hash' do
data/spec/where_spec.rb CHANGED
@@ -69,13 +69,13 @@ describe XeroRuby::Where do
69
69
  end
70
70
 
71
71
  describe "operators starting with a dot" do
72
- let(:opts) { {a: '.Test("Hello")' } }
72
+ let(:opts) { { a: '.Test("Hello")' } }
73
73
 
74
74
  it { is_expected.to eq %{A.Test("Hello")} }
75
75
  end
76
76
 
77
77
  describe "unmatched operators" do
78
- let(:opts) { {a: 'something unusual'} }
78
+ let(:opts) { { a: 'something unusual' } }
79
79
 
80
80
  it { is_expected.to eq %{A something unusual} }
81
81
  end
metadata CHANGED
@@ -1,95 +1,95 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xero-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.16.0
4
+ version: 10.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Xero API Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-01 00:00:00.000000000 Z
11
+ date: 2025-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
18
- - !ruby/object:Gem::Version
19
- version: '1.0'
20
17
  - - ">="
21
18
  - !ruby/object:Gem::Version
22
- version: 1.0.1
19
+ version: '2.0'
20
+ - - "<"
21
+ - !ruby/object:Gem::Version
22
+ version: '3.0'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - "~>"
28
- - !ruby/object:Gem::Version
29
- version: '1.0'
30
27
  - - ">="
31
28
  - !ruby/object:Gem::Version
32
- version: 1.0.1
29
+ version: '2.0'
30
+ - - "<"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.0'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: json
35
35
  requirement: !ruby/object:Gem::Requirement
36
36
  requirements:
37
- - - "~>"
38
- - !ruby/object:Gem::Version
39
- version: '2.1'
40
37
  - - ">="
41
38
  - !ruby/object:Gem::Version
42
39
  version: 2.1.0
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '2.1'
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - "~>"
48
- - !ruby/object:Gem::Version
49
- version: '2.1'
50
47
  - - ">="
51
48
  - !ruby/object:Gem::Version
52
49
  version: 2.1.0
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '2.1'
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: json-jwt
55
55
  requirement: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '1.5'
59
+ version: '1.16'
60
60
  - - ">="
61
61
  - !ruby/object:Gem::Version
62
- version: 1.5.2
62
+ version: 1.16.3
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
67
  - - "~>"
68
68
  - !ruby/object:Gem::Version
69
- version: '1.5'
69
+ version: '1.16'
70
70
  - - ">="
71
71
  - !ruby/object:Gem::Version
72
- version: 1.5.2
72
+ version: 1.16.3
73
73
  - !ruby/object:Gem::Dependency
74
74
  name: rspec
75
75
  requirement: !ruby/object:Gem::Requirement
76
76
  requirements:
77
- - - "~>"
78
- - !ruby/object:Gem::Version
79
- version: '3.6'
80
77
  - - ">="
81
78
  - !ruby/object:Gem::Version
82
79
  version: 3.6.0
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.6'
83
83
  type: :development
84
84
  prerelease: false
85
85
  version_requirements: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
88
- - !ruby/object:Gem::Version
89
- version: '3.6'
90
87
  - - ">="
91
88
  - !ruby/object:Gem::Version
92
89
  version: 3.6.0
90
+ - - "~>"
91
+ - !ruby/object:Gem::Version
92
+ version: '3.6'
93
93
  description: Xero API OAuth2.0 SDK - Ruby Gem
94
94
  email:
95
95
  - api@xero.com
@@ -173,6 +173,7 @@ files:
173
173
  - lib/xero-ruby/models/accounting/import_summary_object.rb
174
174
  - lib/xero-ruby/models/accounting/import_summary_organisation.rb
175
175
  - lib/xero-ruby/models/accounting/invoice.rb
176
+ - lib/xero-ruby/models/accounting/invoice_address.rb
176
177
  - lib/xero-ruby/models/accounting/invoice_reminder.rb
177
178
  - lib/xero-ruby/models/accounting/invoice_reminders.rb
178
179
  - lib/xero-ruby/models/accounting/invoices.rb
@@ -196,6 +197,7 @@ files:
196
197
  - lib/xero-ruby/models/accounting/organisations.rb
197
198
  - lib/xero-ruby/models/accounting/overpayment.rb
198
199
  - lib/xero-ruby/models/accounting/overpayments.rb
200
+ - lib/xero-ruby/models/accounting/pagination.rb
199
201
  - lib/xero-ruby/models/accounting/payment.rb
200
202
  - lib/xero-ruby/models/accounting/payment_delete.rb
201
203
  - lib/xero-ruby/models/accounting/payment_service.rb
@@ -231,6 +233,7 @@ files:
231
233
  - lib/xero-ruby/models/accounting/sales_tracking_category.rb
232
234
  - lib/xero-ruby/models/accounting/schedule.rb
233
235
  - lib/xero-ruby/models/accounting/setup.rb
236
+ - lib/xero-ruby/models/accounting/tax_breakdown_component.rb
234
237
  - lib/xero-ruby/models/accounting/tax_component.rb
235
238
  - lib/xero-ruby/models/accounting/tax_rate.rb
236
239
  - lib/xero-ruby/models/accounting/tax_rates.rb
@@ -368,8 +371,10 @@ files:
368
371
  - lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb
369
372
  - lib/xero-ruby/models/payroll_au/manual_tax_type.rb
370
373
  - lib/xero-ruby/models/payroll_au/opening_balances.rb
374
+ - lib/xero-ruby/models/payroll_au/paid_leave_earnings_line.rb
371
375
  - lib/xero-ruby/models/payroll_au/pay_item.rb
372
376
  - lib/xero-ruby/models/payroll_au/pay_items.rb
377
+ - lib/xero-ruby/models/payroll_au/pay_out_type.rb
373
378
  - lib/xero-ruby/models/payroll_au/pay_run.rb
374
379
  - lib/xero-ruby/models/payroll_au/pay_run_status.rb
375
380
  - lib/xero-ruby/models/payroll_au/pay_runs.rb
@@ -461,6 +466,11 @@ files:
461
466
  - lib/xero-ruby/models/payroll_nz/employee_statutory_sick_leaves.rb
462
467
  - lib/xero-ruby/models/payroll_nz/employee_tax.rb
463
468
  - lib/xero-ruby/models/payroll_nz/employee_tax_object.rb
469
+ - lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb
470
+ - lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb
471
+ - lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb
472
+ - lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb
473
+ - lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb
464
474
  - lib/xero-ruby/models/payroll_nz/employees.rb
465
475
  - lib/xero-ruby/models/payroll_nz/employment.rb
466
476
  - lib/xero-ruby/models/payroll_nz/employment_object.rb
@@ -514,6 +524,7 @@ files:
514
524
  - lib/xero-ruby/models/payroll_nz/timesheets.rb
515
525
  - lib/xero-ruby/models/payroll_nz/tracking_categories.rb
516
526
  - lib/xero-ruby/models/payroll_nz/tracking_category.rb
527
+ - lib/xero-ruby/models/payroll_nz/working_week.rb
517
528
  - lib/xero-ruby/models/payroll_uk/account.rb
518
529
  - lib/xero-ruby/models/payroll_uk/accounts.rb
519
530
  - lib/xero-ruby/models/payroll_uk/address.rb
@@ -1120,7 +1131,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
1120
1131
  - !ruby/object:Gem::Version
1121
1132
  version: '0'
1122
1133
  requirements: []
1123
- rubygems_version: 3.2.3
1134
+ rubygems_version: 3.0.3.1
1124
1135
  signing_key:
1125
1136
  specification_version: 4
1126
1137
  summary: Xero Accounting API Ruby Gem