xero-ruby 12.0.0 → 16.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 (54) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xero-ruby/api/accounting_api.rb +6 -319
  3. data/lib/xero-ruby/api/files_api.rb +2 -2
  4. data/lib/xero-ruby/api/finance_api.rb +0 -299
  5. data/lib/xero-ruby/api/payroll_au_v2_api.rb +751 -0
  6. data/lib/xero-ruby/api/payroll_nz_api.rb +0 -86
  7. data/lib/xero-ruby/api/payroll_uk_api.rb +0 -86
  8. data/lib/xero-ruby/models/accounting/contact.rb +27 -1
  9. data/lib/xero-ruby/models/accounting/organisation.rb +23 -6
  10. data/lib/xero-ruby/models/accounting/overpayment.rb +11 -1
  11. data/lib/xero-ruby/models/accounting/prepayment.rb +21 -1
  12. data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +54 -4
  13. data/lib/xero-ruby/models/files/association.rb +21 -1
  14. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +11 -1
  15. data/lib/xero-ruby/models/payroll_au/employee.rb +1 -13
  16. data/lib/xero-ruby/models/payroll_au/leave_line.rb +11 -1
  17. data/lib/xero-ruby/models/payroll_au/leave_type.rb +14 -4
  18. data/lib/xero-ruby/models/payroll_au/opening_balance_leave_line.rb +232 -0
  19. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +1 -1
  20. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +14 -4
  21. data/lib/xero-ruby/models/payroll_au_v2/invalid_field.rb +232 -0
  22. data/lib/xero-ruby/models/payroll_au_v2/pagination.rb +252 -0
  23. data/lib/xero-ruby/models/payroll_au_v2/problem.rb +275 -0
  24. data/lib/xero-ruby/models/payroll_au_v2/timesheet.rb +361 -0
  25. data/lib/xero-ruby/models/payroll_au_v2/timesheet_line.rb +277 -0
  26. data/lib/xero-ruby/models/payroll_au_v2/timesheet_line_object.rb +242 -0
  27. data/lib/xero-ruby/models/payroll_au_v2/timesheet_object.rb +242 -0
  28. data/lib/xero-ruby/models/payroll_au_v2/timesheets.rb +244 -0
  29. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +1 -21
  30. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +3 -13
  31. data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +5 -0
  32. data/lib/xero-ruby/models/payroll_uk/contract_type.rb +38 -0
  33. data/lib/xero-ruby/models/payroll_uk/contracts.rb +297 -0
  34. data/lib/xero-ruby/models/payroll_uk/developmental_role_details.rb +267 -0
  35. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -2
  36. data/lib/xero-ruby/models/payroll_uk/employee.rb +16 -4
  37. data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +5 -0
  38. data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +3 -2
  39. data/lib/xero-ruby/models/payroll_uk/employment.rb +16 -4
  40. data/lib/xero-ruby/models/payroll_uk/employment_status.rb +37 -0
  41. data/lib/xero-ruby/version.rb +2 -2
  42. data/lib/xero-ruby.rb +14 -10
  43. data/spec/finance/api/finance_api_spec.rb +0 -53
  44. metadata +374 -380
  45. data/spec/finance/models/account_usage_response_spec.rb +0 -58
  46. data/spec/finance/models/account_usage_spec.rb +0 -112
  47. data/spec/finance/models/history_record_response_spec.rb +0 -64
  48. data/spec/finance/models/lock_history_model_spec.rb +0 -52
  49. data/spec/finance/models/lock_history_response_spec.rb +0 -52
  50. data/spec/finance/models/practice_response_spec.rb +0 -64
  51. data/spec/finance/models/report_history_model_spec.rb +0 -52
  52. data/spec/finance/models/report_history_response_spec.rb +0 -52
  53. data/spec/finance/models/user_activities_response_spec.rb +0 -52
  54. data/spec/finance/models/user_response_spec.rb +0 -106
@@ -5477,92 +5477,6 @@ module XeroRuby
5477
5477
  return data, status_code, headers
5478
5478
  end
5479
5479
 
5480
- # Updates a pay run
5481
- # @param xero_tenant_id [String] Xero identifier for Tenant
5482
- # @param pay_run_id [String] Identifier for the pay run
5483
- # @param pay_run [PayRun]
5484
- # @param [Hash] opts the optional parameters
5485
- # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
5486
- # @return [PayRunObject]
5487
- def update_pay_run(xero_tenant_id, pay_run_id, pay_run, opts = {})
5488
- data, _status_code, _headers = update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts)
5489
- data
5490
- end
5491
-
5492
- # Updates a pay run
5493
- # @param xero_tenant_id [String] Xero identifier for Tenant
5494
- # @param pay_run_id [String] Identifier for the pay run
5495
- # @param pay_run [PayRun]
5496
- # @param [Hash] opts the optional parameters
5497
- # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
5498
- # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers
5499
- def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, options = {})
5500
- opts = options.dup
5501
- if @api_client.config.debugging
5502
- @api_client.config.logger.debug 'Calling API: PayrollNzApi.update_pay_run ...'
5503
- end
5504
- # verify the required parameter 'xero_tenant_id' is set
5505
- if @api_client.config.client_side_validation && xero_tenant_id.nil?
5506
- fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollNzApi.update_pay_run"
5507
- end
5508
- # verify the required parameter 'pay_run_id' is set
5509
- if @api_client.config.client_side_validation && pay_run_id.nil?
5510
- fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollNzApi.update_pay_run"
5511
- end
5512
- # verify the required parameter 'pay_run' is set
5513
- if @api_client.config.client_side_validation && pay_run.nil?
5514
- fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollNzApi.update_pay_run"
5515
- end
5516
- # resource path
5517
- local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s)
5518
-
5519
- # camelize keys of incoming `where` opts
5520
- opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
5521
-
5522
- # query parameters
5523
- query_params = opts[:query_params] || {}
5524
-
5525
- # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
5526
- query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
5527
- query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
5528
-
5529
- # header parameters
5530
- header_params = opts[:header_params] || {}
5531
- # HTTP header 'Accept' (if needed)
5532
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5533
- # HTTP header 'Content-Type'
5534
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5535
- header_params[:'Xero-Tenant-Id'] = xero_tenant_id
5536
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
5537
-
5538
- # form parameters
5539
- form_params = opts[:form_params] || {}
5540
-
5541
- # http body (model)
5542
- post_body = opts[:body] || @api_client.object_to_http_body(pay_run)
5543
-
5544
- # return_type
5545
- return_type = opts[:return_type] || 'PayRunObject'
5546
-
5547
- # auth_names
5548
- auth_names = opts[:auth_names] || ['OAuth2']
5549
-
5550
- new_options = opts.merge(
5551
- :header_params => header_params,
5552
- :query_params => query_params,
5553
- :form_params => form_params,
5554
- :body => post_body,
5555
- :auth_names => auth_names,
5556
- :return_type => return_type
5557
- )
5558
-
5559
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollNzApi", new_options)
5560
- if @api_client.config.debugging
5561
- @api_client.config.logger.debug "API called: PayrollNzApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5562
- end
5563
- return data, status_code, headers
5564
- end
5565
-
5566
5480
  # Creates an employee pay slip
5567
5481
  # @param xero_tenant_id [String] Xero identifier for Tenant
5568
5482
  # @param pay_slip_id [String] Identifier for the payslip
@@ -5379,92 +5379,6 @@ module XeroRuby
5379
5379
  return data, status_code, headers
5380
5380
  end
5381
5381
 
5382
- # Updates a specific pay run
5383
- # @param xero_tenant_id [String] Xero identifier for Tenant
5384
- # @param pay_run_id [String] Identifier for the pay run
5385
- # @param pay_run [PayRun]
5386
- # @param [Hash] opts the optional parameters
5387
- # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
5388
- # @return [PayRunObject]
5389
- def update_pay_run(xero_tenant_id, pay_run_id, pay_run, opts = {})
5390
- data, _status_code, _headers = update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, opts)
5391
- data
5392
- end
5393
-
5394
- # Updates a specific pay run
5395
- # @param xero_tenant_id [String] Xero identifier for Tenant
5396
- # @param pay_run_id [String] Identifier for the pay run
5397
- # @param pay_run [PayRun]
5398
- # @param [Hash] opts the optional parameters
5399
- # @option opts [String] :idempotency_key This allows you to safely retry requests without the risk of duplicate processing. 128 character max.
5400
- # @return [Array<(PayRunObject, Integer, Hash)>] PayRunObject data, response status code and response headers
5401
- def update_pay_run_with_http_info(xero_tenant_id, pay_run_id, pay_run, options = {})
5402
- opts = options.dup
5403
- if @api_client.config.debugging
5404
- @api_client.config.logger.debug 'Calling API: PayrollUkApi.update_pay_run ...'
5405
- end
5406
- # verify the required parameter 'xero_tenant_id' is set
5407
- if @api_client.config.client_side_validation && xero_tenant_id.nil?
5408
- fail ArgumentError, "Missing the required parameter 'xero_tenant_id' when calling PayrollUkApi.update_pay_run"
5409
- end
5410
- # verify the required parameter 'pay_run_id' is set
5411
- if @api_client.config.client_side_validation && pay_run_id.nil?
5412
- fail ArgumentError, "Missing the required parameter 'pay_run_id' when calling PayrollUkApi.update_pay_run"
5413
- end
5414
- # verify the required parameter 'pay_run' is set
5415
- if @api_client.config.client_side_validation && pay_run.nil?
5416
- fail ArgumentError, "Missing the required parameter 'pay_run' when calling PayrollUkApi.update_pay_run"
5417
- end
5418
- # resource path
5419
- local_var_path = '/PayRuns/{PayRunID}'.sub('{' + 'PayRunID' + '}', pay_run_id.to_s)
5420
-
5421
- # camelize keys of incoming `where` opts
5422
- opts[:'where'] = @api_client.parameterize_where(opts[:'where']) if !opts[:'where'].nil?
5423
-
5424
- # query parameters
5425
- query_params = opts[:query_params] || {}
5426
-
5427
- # XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
5428
- query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
5429
- query_params[:'ContactIDs'] = @api_client.build_collection_param(opts[:'contact_ids'], :csv) if !opts[:'contact_ids'].nil?
5430
-
5431
- # header parameters
5432
- header_params = opts[:header_params] || {}
5433
- # HTTP header 'Accept' (if needed)
5434
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
5435
- # HTTP header 'Content-Type'
5436
- header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
5437
- header_params[:'Xero-Tenant-Id'] = xero_tenant_id
5438
- header_params[:'Idempotency-Key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
5439
-
5440
- # form parameters
5441
- form_params = opts[:form_params] || {}
5442
-
5443
- # http body (model)
5444
- post_body = opts[:body] || @api_client.object_to_http_body(pay_run)
5445
-
5446
- # return_type
5447
- return_type = opts[:return_type] || 'PayRunObject'
5448
-
5449
- # auth_names
5450
- auth_names = opts[:auth_names] || ['OAuth2']
5451
-
5452
- new_options = opts.merge(
5453
- :header_params => header_params,
5454
- :query_params => query_params,
5455
- :form_params => form_params,
5456
- :body => post_body,
5457
- :auth_names => auth_names,
5458
- :return_type => return_type
5459
- )
5460
-
5461
- data, status_code, headers = @api_client.call_api(:PUT, local_var_path, "PayrollUkApi", new_options)
5462
- if @api_client.config.debugging
5463
- @api_client.config.logger.debug "API called: PayrollUkApi#update_pay_run\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
5464
- end
5465
- return data, status_code, headers
5466
- end
5467
-
5468
5382
  # Updates a specific timesheet line for a specific timesheet
5469
5383
  # @param xero_tenant_id [String] Xero identifier for Tenant
5470
5384
  # @param timesheet_id [String] Identifier for the timesheet
@@ -58,6 +58,13 @@ module XeroRuby::Accounting
58
58
  # Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50)
59
59
  attr_accessor :tax_number
60
60
 
61
+ # Identifier of the regional type of tax number, such as US, UK, or other regional tax identifiers
62
+ attr_accessor :tax_number_type
63
+ SSN ||= "SSN".freeze
64
+ EIN ||= "EIN".freeze
65
+ ITIN ||= "ITIN".freeze
66
+ ATIN ||= "ATIN".freeze
67
+
61
68
  # The tax type from TaxRates
62
69
  attr_accessor :accounts_receivable_tax_type
63
70
 
@@ -189,6 +196,7 @@ module XeroRuby::Accounting
189
196
  :'contact_persons' => :'ContactPersons',
190
197
  :'bank_account_details' => :'BankAccountDetails',
191
198
  :'tax_number' => :'TaxNumber',
199
+ :'tax_number_type' => :'TaxNumberType',
192
200
  :'accounts_receivable_tax_type' => :'AccountsReceivableTaxType',
193
201
  :'accounts_payable_tax_type' => :'AccountsPayableTaxType',
194
202
  :'addresses' => :'Addresses',
@@ -237,6 +245,7 @@ module XeroRuby::Accounting
237
245
  :'contact_persons' => :'Array<ContactPerson>',
238
246
  :'bank_account_details' => :'String',
239
247
  :'tax_number' => :'String',
248
+ :'tax_number_type' => :'String',
240
249
  :'accounts_receivable_tax_type' => :'String',
241
250
  :'accounts_payable_tax_type' => :'String',
242
251
  :'addresses' => :'Array<Address>',
@@ -338,6 +347,10 @@ module XeroRuby::Accounting
338
347
  self.tax_number = attributes[:'tax_number']
339
348
  end
340
349
 
350
+ if attributes.key?(:'tax_number_type')
351
+ self.tax_number_type = attributes[:'tax_number_type']
352
+ end
353
+
341
354
  if attributes.key?(:'accounts_receivable_tax_type')
342
355
  self.accounts_receivable_tax_type = attributes[:'accounts_receivable_tax_type']
343
356
  end
@@ -525,6 +538,8 @@ module XeroRuby::Accounting
525
538
  return false if !@company_number.nil? && @company_number.to_s.length > 50
526
539
  return false if !@email_address.nil? && @email_address.to_s.length > 255
527
540
  return false if !@tax_number.nil? && @tax_number.to_s.length > 50
541
+ tax_number_type_validator = EnumAttributeValidator.new('String', ["SSN", "EIN", "ITIN", "ATIN"])
542
+ return false unless tax_number_type_validator.valid?(@tax_number_type)
528
543
  sales_default_line_amount_type_validator = EnumAttributeValidator.new('String', ["INCLUSIVE", "EXCLUSIVE", "NONE"])
529
544
  return false unless sales_default_line_amount_type_validator.valid?(@sales_default_line_amount_type)
530
545
  purchases_default_line_amount_type_validator = EnumAttributeValidator.new('String', ["INCLUSIVE", "EXCLUSIVE", "NONE"])
@@ -622,6 +637,16 @@ module XeroRuby::Accounting
622
637
  @tax_number = tax_number
623
638
  end
624
639
 
640
+ # Custom attribute writer method checking allowed values (enum).
641
+ # @param [Object] tax_number_type Object to be assigned
642
+ def tax_number_type=(tax_number_type)
643
+ validator = EnumAttributeValidator.new('String', ["SSN", "EIN", "ITIN", "ATIN"])
644
+ unless validator.valid?(tax_number_type)
645
+ fail ArgumentError, "invalid value for \"tax_number_type\", must be one of #{validator.allowable_values}."
646
+ end
647
+ @tax_number_type = tax_number_type
648
+ end
649
+
625
650
  # Custom attribute writer method checking allowed values (enum).
626
651
  # @param [Object] sales_default_line_amount_type Object to be assigned
627
652
  def sales_default_line_amount_type=(sales_default_line_amount_type)
@@ -660,6 +685,7 @@ module XeroRuby::Accounting
660
685
  contact_persons == o.contact_persons &&
661
686
  bank_account_details == o.bank_account_details &&
662
687
  tax_number == o.tax_number &&
688
+ tax_number_type == o.tax_number_type &&
663
689
  accounts_receivable_tax_type == o.accounts_receivable_tax_type &&
664
690
  accounts_payable_tax_type == o.accounts_payable_tax_type &&
665
691
  addresses == o.addresses &&
@@ -700,7 +726,7 @@ module XeroRuby::Accounting
700
726
  # Calculates hash code according to all attributes.
701
727
  # @return [Integer] Hash code
702
728
  def 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
729
+ [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, tax_number_type, 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
704
730
  end
705
731
 
706
732
  # Builds the object from hash
@@ -59,6 +59,14 @@ module XeroRuby::Accounting
59
59
  SOLE_TRADER ||= "SOLE_TRADER".freeze
60
60
  SUPERANNUATION_FUND ||= "SUPERANNUATION_FUND".freeze
61
61
  TRUST ||= "TRUST".freeze
62
+ PERSONAL ||= "PERSONAL".freeze
63
+ SINGLEMEMBERLLC ||= "SINGLEMEMBERLLC".freeze
64
+ CCORPORATIONLLC ||= "CCORPORATIONLLC".freeze
65
+ PARTNERSHIPLLC ||= "PARTNERSHIPLLC".freeze
66
+ SCORPORATIONLLC ||= "SCORPORATIONLLC".freeze
67
+ LLC ||= "LLC".freeze
68
+ NOTLLC ||= "NOTLLC".freeze
69
+ UNSPECIFIED ||= "UNSPECIFIED".freeze
62
70
 
63
71
 
64
72
  attr_accessor :base_currency
@@ -149,6 +157,14 @@ module XeroRuby::Accounting
149
157
  SOLE_TRADER ||= "SOLE_TRADER".freeze
150
158
  SUPERANNUATION_FUND ||= "SUPERANNUATION_FUND".freeze
151
159
  TRUST ||= "TRUST".freeze
160
+ PERSONAL ||= "PERSONAL".freeze
161
+ SINGLEMEMBERLLC ||= "SINGLEMEMBERLLC".freeze
162
+ CCORPORATIONLLC ||= "CCORPORATIONLLC".freeze
163
+ PARTNERSHIPLLC ||= "PARTNERSHIPLLC".freeze
164
+ SCORPORATIONLLC ||= "SCORPORATIONLLC".freeze
165
+ LLC ||= "LLC".freeze
166
+ NOTLLC ||= "NOTLLC".freeze
167
+ UNSPECIFIED ||= "UNSPECIFIED".freeze
152
168
 
153
169
  # A unique identifier for the organisation. Potential uses.
154
170
  attr_accessor :short_code
@@ -176,6 +192,7 @@ module XeroRuby::Accounting
176
192
  GROW ||= "GROW".freeze
177
193
  COMPREHENSIVE ||= "COMPREHENSIVE".freeze
178
194
  SIMPLE ||= "SIMPLE".freeze
195
+ BASICLITE ||= "BASICLITE".freeze
179
196
 
180
197
  # BUSINESS or PARTNER. Partner edition organisations are sold exclusively through accounting partners and have restricted functionality (e.g. no access to invoicing)
181
198
  attr_accessor :edition
@@ -463,15 +480,15 @@ module XeroRuby::Accounting
463
480
  def valid?
464
481
  version_validator = EnumAttributeValidator.new('String', ["AU", "NZ", "GLOBAL", "UK", "US", "AUONRAMP", "NZONRAMP", "GLOBALONRAMP", "UKONRAMP", "USONRAMP"])
465
482
  return false unless version_validator.valid?(@version)
466
- organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
483
+ organisation_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
467
484
  return false unless organisation_type_validator.valid?(@organisation_type)
468
485
  sales_tax_basis_validator = EnumAttributeValidator.new('String', ["PAYMENTS", "INVOICE", "NONE", "CASH", "ACCRUAL", "FLATRATECASH", "FLATRATEACCRUAL", "ACCRUALS"])
469
486
  return false unless sales_tax_basis_validator.valid?(@sales_tax_basis)
470
487
  sales_tax_period_validator = EnumAttributeValidator.new('String', ["MONTHLY", "QUARTERLY1", "QUARTERLY2", "QUARTERLY3", "ANNUALLY", "ONEMONTHS", "TWOMONTHS", "SIXMONTHS", "1MONTHLY", "2MONTHLY", "3MONTHLY", "6MONTHLY", "QUARTERLY", "YEARLY", "NONE"])
471
488
  return false unless sales_tax_period_validator.valid?(@sales_tax_period)
472
- organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
489
+ organisation_entity_type_validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
473
490
  return false unless organisation_entity_type_validator.valid?(@organisation_entity_type)
474
- _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE"])
491
+ _class_validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE"])
475
492
  return false unless _class_validator.valid?(@_class)
476
493
  edition_validator = EnumAttributeValidator.new('String', ["BUSINESS", "PARTNER"])
477
494
  return false unless edition_validator.valid?(@edition)
@@ -491,7 +508,7 @@ module XeroRuby::Accounting
491
508
  # Custom attribute writer method checking allowed values (enum).
492
509
  # @param [Object] organisation_type Object to be assigned
493
510
  def organisation_type=(organisation_type)
494
- validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
511
+ validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
495
512
  unless validator.valid?(organisation_type)
496
513
  fail ArgumentError, "invalid value for \"organisation_type\", must be one of #{validator.allowable_values}."
497
514
  end
@@ -521,7 +538,7 @@ module XeroRuby::Accounting
521
538
  # Custom attribute writer method checking allowed values (enum).
522
539
  # @param [Object] organisation_entity_type Object to be assigned
523
540
  def organisation_entity_type=(organisation_entity_type)
524
- validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST"])
541
+ validator = EnumAttributeValidator.new('String', ["ACCOUNTING_PRACTICE", "COMPANY", "CHARITY", "CLUB_OR_SOCIETY", "INDIVIDUAL", "LOOK_THROUGH_COMPANY", "NOT_FOR_PROFIT", "PARTNERSHIP", "S_CORPORATION", "SELF_MANAGED_SUPERANNUATION_FUND", "SOLE_TRADER", "SUPERANNUATION_FUND", "TRUST", "PERSONAL", "SINGLEMEMBERLLC", "CCORPORATIONLLC", "PARTNERSHIPLLC", "SCORPORATIONLLC", "LLC", "NOTLLC", "UNSPECIFIED"])
525
542
  unless validator.valid?(organisation_entity_type)
526
543
  fail ArgumentError, "invalid value for \"organisation_entity_type\", must be one of #{validator.allowable_values}."
527
544
  end
@@ -531,7 +548,7 @@ module XeroRuby::Accounting
531
548
  # Custom attribute writer method checking allowed values (enum).
532
549
  # @param [Object] _class Object to be assigned
533
550
  def _class=(_class)
534
- validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE"])
551
+ validator = EnumAttributeValidator.new('String', ["DEMO", "TRIAL", "STARTER", "STANDARD", "PREMIUM", "PREMIUM_20", "PREMIUM_50", "PREMIUM_100", "LEDGER", "GST_CASHBOOK", "NON_GST_CASHBOOK", "ULTIMATE", "LITE", "ULTIMATE_10", "ULTIMATE_20", "ULTIMATE_50", "ULTIMATE_100", "IGNITE", "GROW", "COMPREHENSIVE", "SIMPLE", "BASICLITE"])
535
552
  unless validator.valid?(_class)
536
553
  fail ArgumentError, "invalid value for \"_class\", must be one of #{validator.allowable_values}."
537
554
  end
@@ -76,6 +76,9 @@ module XeroRuby::Accounting
76
76
  # boolean to indicate if a overpayment has an attachment
77
77
  attr_accessor :has_attachments
78
78
 
79
+ # An optional description for Overpayment
80
+ attr_accessor :reference
81
+
79
82
  # See Attachments
80
83
  attr_accessor :attachments
81
84
 
@@ -122,6 +125,7 @@ module XeroRuby::Accounting
122
125
  :'applied_amount' => :'AppliedAmount',
123
126
  :'payments' => :'Payments',
124
127
  :'has_attachments' => :'HasAttachments',
128
+ :'reference' => :'Reference',
125
129
  :'attachments' => :'Attachments'
126
130
  }
127
131
  end
@@ -147,6 +151,7 @@ module XeroRuby::Accounting
147
151
  :'applied_amount' => :'Float',
148
152
  :'payments' => :'Array<Payment>',
149
153
  :'has_attachments' => :'Boolean',
154
+ :'reference' => :'String',
150
155
  :'attachments' => :'Array<Attachment>'
151
156
  }
152
157
  end
@@ -246,6 +251,10 @@ module XeroRuby::Accounting
246
251
  self.has_attachments = false
247
252
  end
248
253
 
254
+ if attributes.key?(:'reference')
255
+ self.reference = attributes[:'reference']
256
+ end
257
+
249
258
  if attributes.key?(:'attachments')
250
259
  if (value = attributes[:'attachments']).is_a?(Array)
251
260
  self.attachments = value
@@ -313,6 +322,7 @@ module XeroRuby::Accounting
313
322
  applied_amount == o.applied_amount &&
314
323
  payments == o.payments &&
315
324
  has_attachments == o.has_attachments &&
325
+ reference == o.reference &&
316
326
  attachments == o.attachments
317
327
  end
318
328
 
@@ -325,7 +335,7 @@ module XeroRuby::Accounting
325
335
  # Calculates hash code according to all attributes.
326
336
  # @return [Integer] Hash code
327
337
  def hash
328
- [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, attachments].hash
338
+ [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, updated_date_utc, currency_code, overpayment_id, currency_rate, remaining_credit, allocations, applied_amount, payments, has_attachments, reference, attachments].hash
329
339
  end
330
340
 
331
341
  # Builds the object from hash
@@ -53,6 +53,9 @@ module XeroRuby::Accounting
53
53
  # Returns Invoice number field. Reference field isn't available.
54
54
  attr_accessor :reference
55
55
 
56
+ # Returns Invoice number for prepayment receive document only.
57
+ attr_accessor :invoice_number
58
+
56
59
  # UTC timestamp of last update to the prepayment
57
60
  attr_accessor :updated_date_utc
58
61
 
@@ -62,6 +65,9 @@ module XeroRuby::Accounting
62
65
  # Xero generated unique identifier
63
66
  attr_accessor :prepayment_id
64
67
 
68
+ # The unique identifier of the branding template applied to a receive prepayment
69
+ attr_accessor :branding_theme_id
70
+
65
71
  # The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used
66
72
  attr_accessor :currency_rate
67
73
 
@@ -118,9 +124,11 @@ module XeroRuby::Accounting
118
124
  :'total_tax' => :'TotalTax',
119
125
  :'total' => :'Total',
120
126
  :'reference' => :'Reference',
127
+ :'invoice_number' => :'InvoiceNumber',
121
128
  :'updated_date_utc' => :'UpdatedDateUTC',
122
129
  :'currency_code' => :'CurrencyCode',
123
130
  :'prepayment_id' => :'PrepaymentID',
131
+ :'branding_theme_id' => :'BrandingThemeID',
124
132
  :'currency_rate' => :'CurrencyRate',
125
133
  :'remaining_credit' => :'RemainingCredit',
126
134
  :'allocations' => :'Allocations',
@@ -144,9 +152,11 @@ module XeroRuby::Accounting
144
152
  :'total_tax' => :'BigDecimal',
145
153
  :'total' => :'BigDecimal',
146
154
  :'reference' => :'String',
155
+ :'invoice_number' => :'String',
147
156
  :'updated_date_utc' => :'DateTime',
148
157
  :'currency_code' => :'CurrencyCode',
149
158
  :'prepayment_id' => :'String',
159
+ :'branding_theme_id' => :'String',
150
160
  :'currency_rate' => :'BigDecimal',
151
161
  :'remaining_credit' => :'BigDecimal',
152
162
  :'allocations' => :'Array<Allocation>',
@@ -214,6 +224,10 @@ module XeroRuby::Accounting
214
224
  self.reference = attributes[:'reference']
215
225
  end
216
226
 
227
+ if attributes.key?(:'invoice_number')
228
+ self.invoice_number = attributes[:'invoice_number']
229
+ end
230
+
217
231
  if attributes.key?(:'updated_date_utc')
218
232
  self.updated_date_utc = attributes[:'updated_date_utc']
219
233
  end
@@ -226,6 +240,10 @@ module XeroRuby::Accounting
226
240
  self.prepayment_id = attributes[:'prepayment_id']
227
241
  end
228
242
 
243
+ if attributes.key?(:'branding_theme_id')
244
+ self.branding_theme_id = attributes[:'branding_theme_id']
245
+ end
246
+
229
247
  if attributes.key?(:'currency_rate')
230
248
  self.currency_rate = attributes[:'currency_rate']
231
249
  end
@@ -315,9 +333,11 @@ module XeroRuby::Accounting
315
333
  total_tax == o.total_tax &&
316
334
  total == o.total &&
317
335
  reference == o.reference &&
336
+ invoice_number == o.invoice_number &&
318
337
  updated_date_utc == o.updated_date_utc &&
319
338
  currency_code == o.currency_code &&
320
339
  prepayment_id == o.prepayment_id &&
340
+ branding_theme_id == o.branding_theme_id &&
321
341
  currency_rate == o.currency_rate &&
322
342
  remaining_credit == o.remaining_credit &&
323
343
  allocations == o.allocations &&
@@ -336,7 +356,7 @@ module XeroRuby::Accounting
336
356
  # Calculates hash code according to all attributes.
337
357
  # @return [Integer] Hash code
338
358
  def hash
339
- [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, updated_date_utc, currency_code, prepayment_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
359
+ [type, contact, date, status, line_amount_types, line_items, sub_total, total_tax, total, reference, invoice_number, updated_date_utc, currency_code, prepayment_id, branding_theme_id, currency_rate, remaining_credit, allocations, payments, applied_amount, has_attachments, attachments].hash
340
360
  end
341
361
 
342
362
  # Builds the object from hash
@@ -37,6 +37,21 @@ module XeroRuby::Assets
37
37
  # All depreciation occurring in the current financial year.
38
38
  attr_accessor :current_accum_depreciation_amount
39
39
 
40
+ # (New Zealand Orgs Only) The portion of capital gain realised from the disposal of a fixed asset that is attributable to its business use.
41
+ attr_accessor :business_use_capital_gain
42
+
43
+ # (New Zealand Orgs Only) Represents the gain or loss from the disposal of the business use portion of a fixed asset. This value records the financial result (profit or loss) related specifically to the asset’s business use.
44
+ attr_accessor :business_use_current_gain_loss
45
+
46
+ # (New Zealand Orgs Only) The portion of capital gain realised from the disposal of a fixed asset that is attributable to its private (non-business) use.
47
+ attr_accessor :private_use_capital_gain
48
+
49
+ # (New Zealand Orgs Only) Represents the gain or loss from the disposal of the private use portion of a fixed asset. This value records the financial result (profit or loss) related specifically to the asset’s private use.
50
+ attr_accessor :private_use_current_gain_loss
51
+
52
+ # (New Zealand Orgs Only) The Investment Boost deduction percentage.
53
+ attr_accessor :initial_deduction_percentage
54
+
40
55
  # Attribute mapping from ruby-style variable name to JSON key.
41
56
  def self.attribute_map
42
57
  {
@@ -46,7 +61,12 @@ module XeroRuby::Assets
46
61
  :'cost_limit' => :'costLimit',
47
62
  :'residual_value' => :'residualValue',
48
63
  :'prior_accum_depreciation_amount' => :'priorAccumDepreciationAmount',
49
- :'current_accum_depreciation_amount' => :'currentAccumDepreciationAmount'
64
+ :'current_accum_depreciation_amount' => :'currentAccumDepreciationAmount',
65
+ :'business_use_capital_gain' => :'businessUseCapitalGain',
66
+ :'business_use_current_gain_loss' => :'businessUseCurrentGainLoss',
67
+ :'private_use_capital_gain' => :'privateUseCapitalGain',
68
+ :'private_use_current_gain_loss' => :'privateUseCurrentGainLoss',
69
+ :'initial_deduction_percentage' => :'initialDeductionPercentage'
50
70
  }
51
71
  end
52
72
 
@@ -59,7 +79,12 @@ module XeroRuby::Assets
59
79
  :'cost_limit' => :'BigDecimal',
60
80
  :'residual_value' => :'BigDecimal',
61
81
  :'prior_accum_depreciation_amount' => :'BigDecimal',
62
- :'current_accum_depreciation_amount' => :'BigDecimal'
82
+ :'current_accum_depreciation_amount' => :'BigDecimal',
83
+ :'business_use_capital_gain' => :'BigDecimal',
84
+ :'business_use_current_gain_loss' => :'BigDecimal',
85
+ :'private_use_capital_gain' => :'BigDecimal',
86
+ :'private_use_current_gain_loss' => :'BigDecimal',
87
+ :'initial_deduction_percentage' => :'Float'
63
88
  }
64
89
  end
65
90
 
@@ -105,6 +130,26 @@ module XeroRuby::Assets
105
130
  if attributes.key?(:'current_accum_depreciation_amount')
106
131
  self.current_accum_depreciation_amount = attributes[:'current_accum_depreciation_amount']
107
132
  end
133
+
134
+ if attributes.key?(:'business_use_capital_gain')
135
+ self.business_use_capital_gain = attributes[:'business_use_capital_gain']
136
+ end
137
+
138
+ if attributes.key?(:'business_use_current_gain_loss')
139
+ self.business_use_current_gain_loss = attributes[:'business_use_current_gain_loss']
140
+ end
141
+
142
+ if attributes.key?(:'private_use_capital_gain')
143
+ self.private_use_capital_gain = attributes[:'private_use_capital_gain']
144
+ end
145
+
146
+ if attributes.key?(:'private_use_current_gain_loss')
147
+ self.private_use_current_gain_loss = attributes[:'private_use_current_gain_loss']
148
+ end
149
+
150
+ if attributes.key?(:'initial_deduction_percentage')
151
+ self.initial_deduction_percentage = attributes[:'initial_deduction_percentage']
152
+ end
108
153
  end
109
154
 
110
155
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -131,7 +176,12 @@ module XeroRuby::Assets
131
176
  cost_limit == o.cost_limit &&
132
177
  residual_value == o.residual_value &&
133
178
  prior_accum_depreciation_amount == o.prior_accum_depreciation_amount &&
134
- current_accum_depreciation_amount == o.current_accum_depreciation_amount
179
+ current_accum_depreciation_amount == o.current_accum_depreciation_amount &&
180
+ business_use_capital_gain == o.business_use_capital_gain &&
181
+ business_use_current_gain_loss == o.business_use_current_gain_loss &&
182
+ private_use_capital_gain == o.private_use_capital_gain &&
183
+ private_use_current_gain_loss == o.private_use_current_gain_loss &&
184
+ initial_deduction_percentage == o.initial_deduction_percentage
135
185
  end
136
186
 
137
187
  # @see the `==` method
@@ -143,7 +193,7 @@ module XeroRuby::Assets
143
193
  # Calculates hash code according to all attributes.
144
194
  # @return [Integer] Hash code
145
195
  def hash
146
- [current_capital_gain, current_gain_loss, depreciation_start_date, cost_limit, residual_value, prior_accum_depreciation_amount, current_accum_depreciation_amount].hash
196
+ [current_capital_gain, current_gain_loss, depreciation_start_date, cost_limit, residual_value, prior_accum_depreciation_amount, current_accum_depreciation_amount, business_use_capital_gain, business_use_current_gain_loss, private_use_capital_gain, private_use_current_gain_loss, initial_deduction_percentage].hash
147
197
  end
148
198
 
149
199
  # Builds the object from hash