xero-ruby 12.1.0 → 12.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6505e40fee1bff64ce7ec54dd54c90beb1385cc090ba73017ef61140aa2c9133
4
- data.tar.gz: '0882d7fb9feb1410b879f8cafa7e53e15570382194c8652caf251851349c24cc'
3
+ metadata.gz: ed19b96582ad3c96a1154ae2e19aa8f0d385cca2d2f577b027e485100aba9034
4
+ data.tar.gz: 5b2bdc6302be1144075cbbd27f8d587b4a18151013676ea85065ab2e6f3e3cc1
5
5
  SHA512:
6
- metadata.gz: d25721425f53c01b22bfe98794424ac44cf5626701bdaa2fd7aaa4d667d953e657b0a7bdf6052608339e48eaaf6ef7d9c03bb4d5cc032996ec73b9996245255f
7
- data.tar.gz: 60e5ed1725276292e7b9708b8205c410286839675ec442823adef5d4f115f49fda6a0eb6732a688323614f65ca8632072322ff99f9cc72c10b27bad30eea3d29
6
+ metadata.gz: 3749eac943f2fc868d09e9842d2c436a9699df00ceac496f2de05f79892c9fd128e7cf76ebf2e26deded7579a23969dccbf4a05bb1f8240e2f98c4b735322a7e
7
+ data.tar.gz: de3e5c5b9fc310ba1987753ada7988500680c7079a1f5f6bce4ab31e41f1871872dca7970e036efa0a9e070345b0a224ef4b555b04d4c66beadb22b39f8c8dc9
@@ -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
@@ -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
@@ -0,0 +1,38 @@
1
+ =begin
2
+ #Xero Payroll UK
3
+
4
+ #This is the Xero Payroll API for orgs in the UK region.
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::PayrollUk
16
+ class ContractType
17
+ FULL_TIME ||= "FullTime".freeze
18
+ PART_TIME ||= "PartTime".freeze
19
+ ZERO_HOUR ||= "ZeroHour".freeze
20
+ UNSPECIFIED ||= "Unspecified".freeze
21
+
22
+ # Builds the enum from string
23
+ # @param [String] The enum value in the form of the string
24
+ # @return [String] The enum value
25
+ def self.build_from_hash(value)
26
+ new.build_from_hash(value)
27
+ end
28
+
29
+ # Builds the enum from string
30
+ # @param [String] The enum value in the form of the string
31
+ # @return [String] The enum value
32
+ def build_from_hash(value)
33
+ constantValues = ContractType.constants.select { |c| ContractType::const_get(c) == value }
34
+ raise "Invalid ENUM value #{value} for class #ContractType" if constantValues.empty?
35
+ value
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,297 @@
1
+ =begin
2
+ #Xero Payroll UK
3
+
4
+ #This is the Xero Payroll API for orgs in the UK region.
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::PayrollUk
16
+ require 'bigdecimal'
17
+
18
+ class Contracts
19
+ # The contract start date of the employee. This will be locked once an employee has been paid and cannot be changed (YYYY-MM-DD)
20
+ attr_accessor :start_date
21
+
22
+
23
+ attr_accessor :employment_status
24
+
25
+
26
+ attr_accessor :contract_type
27
+
28
+ # The public key of the contract. Public key is required if the intention is to edit an existing contract. If no key is supplied a new contract will be created
29
+ attr_accessor :public_key
30
+
31
+ # describes whether the contract is fixed term (required if trying to create Fixed term contract)
32
+ attr_accessor :is_fixed_term
33
+
34
+ # The fixed term end date of the employee. Not required if isFixedTerm is false or not provided (required if trying to create Fixed term contract)
35
+ attr_accessor :fixed_term_end_date
36
+
37
+
38
+ attr_accessor :developmental_role_details
39
+
40
+ # Attribute mapping from ruby-style variable name to JSON key.
41
+ def self.attribute_map
42
+ {
43
+ :'start_date' => :'startDate',
44
+ :'employment_status' => :'employmentStatus',
45
+ :'contract_type' => :'contractType',
46
+ :'public_key' => :'publicKey',
47
+ :'is_fixed_term' => :'isFixedTerm',
48
+ :'fixed_term_end_date' => :'fixedTermEndDate',
49
+ :'developmental_role_details' => :'developmentalRoleDetails'
50
+ }
51
+ end
52
+
53
+ # Attribute type mapping.
54
+ def self.openapi_types
55
+ {
56
+ :'start_date' => :'Date',
57
+ :'employment_status' => :'EmploymentStatus',
58
+ :'contract_type' => :'ContractType',
59
+ :'public_key' => :'String',
60
+ :'is_fixed_term' => :'Boolean',
61
+ :'fixed_term_end_date' => :'Date',
62
+ :'developmental_role_details' => :'DevelopmentalRoleDetails'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::Contracts` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::Contracts`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'start_date')
82
+ self.start_date = attributes[:'start_date']
83
+ end
84
+
85
+ if attributes.key?(:'employment_status')
86
+ self.employment_status = attributes[:'employment_status']
87
+ end
88
+
89
+ if attributes.key?(:'contract_type')
90
+ self.contract_type = attributes[:'contract_type']
91
+ end
92
+
93
+ if attributes.key?(:'public_key')
94
+ self.public_key = attributes[:'public_key']
95
+ end
96
+
97
+ if attributes.key?(:'is_fixed_term')
98
+ self.is_fixed_term = attributes[:'is_fixed_term']
99
+ end
100
+
101
+ if attributes.key?(:'fixed_term_end_date')
102
+ self.fixed_term_end_date = attributes[:'fixed_term_end_date']
103
+ end
104
+
105
+ if attributes.key?(:'developmental_role_details')
106
+ self.developmental_role_details = attributes[:'developmental_role_details']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ invalid_properties = Array.new
114
+ if @start_date.nil?
115
+ invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
116
+ end
117
+
118
+ if @employment_status.nil?
119
+ invalid_properties.push('invalid value for "employment_status", employment_status cannot be nil.')
120
+ end
121
+
122
+ if @contract_type.nil?
123
+ invalid_properties.push('invalid value for "contract_type", contract_type cannot be nil.')
124
+ end
125
+
126
+ invalid_properties
127
+ end
128
+
129
+ # Check to see if the all the properties in the model are valid
130
+ # @return true if the model is valid
131
+ def valid?
132
+ return false if @start_date.nil?
133
+ return false if @employment_status.nil?
134
+ return false if @contract_type.nil?
135
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ start_date == o.start_date &&
144
+ employment_status == o.employment_status &&
145
+ contract_type == o.contract_type &&
146
+ public_key == o.public_key &&
147
+ is_fixed_term == o.is_fixed_term &&
148
+ fixed_term_end_date == o.fixed_term_end_date &&
149
+ developmental_role_details == o.developmental_role_details
150
+ end
151
+
152
+ # @see the `==` method
153
+ # @param [Object] Object to be compared
154
+ def eql?(o)
155
+ self == o
156
+ end
157
+
158
+ # Calculates hash code according to all attributes.
159
+ # @return [Integer] Hash code
160
+ def hash
161
+ [start_date, employment_status, contract_type, public_key, is_fixed_term, fixed_term_end_date, developmental_role_details].hash
162
+ end
163
+
164
+ # Builds the object from hash
165
+ # @param [Hash] attributes Model attributes in the form of hash
166
+ # @return [Object] Returns the model itself
167
+ def self.build_from_hash(attributes)
168
+ new.build_from_hash(attributes)
169
+ end
170
+
171
+ # Builds the object from hash
172
+ # @param [Hash] attributes Model attributes in the form of hash
173
+ # @return [Object] Returns the model itself
174
+ def build_from_hash(attributes)
175
+ return nil unless attributes.is_a?(Hash)
176
+ self.class.openapi_types.each_pair do |key, type|
177
+ if type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :DateTime
198
+ DateTime.parse(parse_date(value))
199
+ when :Date
200
+ Date.parse(parse_date(value))
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :BigDecimal
208
+ BigDecimal(value.to_s)
209
+ when :Boolean
210
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
211
+ true
212
+ else
213
+ false
214
+ end
215
+ when :Object
216
+ # generic object (usually a Hash), return directly
217
+ value
218
+ when /\AArray<(?<inner_type>.+)>\z/
219
+ inner_type = Regexp.last_match[:inner_type]
220
+ value.map { |v| _deserialize(inner_type, v) }
221
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
222
+ k_type = Regexp.last_match[:k_type]
223
+ v_type = Regexp.last_match[:v_type]
224
+ {}.tap do |hash|
225
+ value.each do |k, v|
226
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
227
+ end
228
+ end
229
+ else # model
230
+ XeroRuby::PayrollUk.const_get(type).build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash(downcase: false)
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ next if value.nil?
253
+ key = downcase ? attr : param
254
+ hash[key] = _to_hash(value, downcase: downcase)
255
+ end
256
+ hash
257
+ end
258
+
259
+ # Returns the object in the form of hash with snake_case
260
+ def to_attributes
261
+ to_hash(downcase: true)
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value, downcase: false)
269
+ if value.is_a?(Array)
270
+ value.map do |v|
271
+ v.to_hash(downcase: downcase)
272
+ end
273
+ elsif value.is_a?(Hash)
274
+ {}.tap do |hash|
275
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
276
+ end
277
+ elsif value.respond_to? :to_hash
278
+ value.to_hash(downcase: downcase)
279
+ else
280
+ value
281
+ end
282
+ end
283
+
284
+ def parse_date(datestring)
285
+ if datestring.include?('Date')
286
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
287
+ original, date, timezone = *date_pattern.match(datestring)
288
+ date = (date.to_i / 1000)
289
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
290
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
291
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
292
+ else # handle date 'types' for small subset of payroll API's
293
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
294
+ end
295
+ end
296
+ end
297
+ end
@@ -0,0 +1,267 @@
1
+ =begin
2
+ #Xero Payroll UK
3
+
4
+ #This is the Xero Payroll API for orgs in the UK region.
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::PayrollUk
16
+ require 'bigdecimal'
17
+
18
+ class DevelopmentalRoleDetails
19
+ # The start date of the developmental role
20
+ attr_accessor :start_date
21
+
22
+ # The end date of the developmental role
23
+ attr_accessor :end_date
24
+
25
+ # The developmental role type - \"Apprentice\" is the only supported role currently
26
+ attr_accessor :developmental_role
27
+
28
+ # The public key of the developmental role. Public key is required if the intention is to edit an existing developmental role. If no key is supplied a new developmental role will be created
29
+ attr_accessor :public_key
30
+
31
+ # Attribute mapping from ruby-style variable name to JSON key.
32
+ def self.attribute_map
33
+ {
34
+ :'start_date' => :'startDate',
35
+ :'end_date' => :'endDate',
36
+ :'developmental_role' => :'developmentalRole',
37
+ :'public_key' => :'publicKey'
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'start_date' => :'Date',
45
+ :'end_date' => :'Date',
46
+ :'developmental_role' => :'String',
47
+ :'public_key' => :'String'
48
+ }
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollUk::DevelopmentalRoleDetails` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollUk::DevelopmentalRoleDetails`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'start_date')
67
+ self.start_date = attributes[:'start_date']
68
+ end
69
+
70
+ if attributes.key?(:'end_date')
71
+ self.end_date = attributes[:'end_date']
72
+ end
73
+
74
+ if attributes.key?(:'developmental_role')
75
+ self.developmental_role = attributes[:'developmental_role']
76
+ end
77
+
78
+ if attributes.key?(:'public_key')
79
+ self.public_key = attributes[:'public_key']
80
+ end
81
+ end
82
+
83
+ # Show invalid properties with the reasons. Usually used together with valid?
84
+ # @return Array for valid properties with the reasons
85
+ def list_invalid_properties
86
+ invalid_properties = Array.new
87
+ if @start_date.nil?
88
+ invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
89
+ end
90
+
91
+ if @end_date.nil?
92
+ invalid_properties.push('invalid value for "end_date", end_date cannot be nil.')
93
+ end
94
+
95
+ if @developmental_role.nil?
96
+ invalid_properties.push('invalid value for "developmental_role", developmental_role cannot be nil.')
97
+ end
98
+
99
+ invalid_properties
100
+ end
101
+
102
+ # Check to see if the all the properties in the model are valid
103
+ # @return true if the model is valid
104
+ def valid?
105
+ return false if @start_date.nil?
106
+ return false if @end_date.nil?
107
+ return false if @developmental_role.nil?
108
+ true
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ start_date == o.start_date &&
117
+ end_date == o.end_date &&
118
+ developmental_role == o.developmental_role &&
119
+ public_key == o.public_key
120
+ end
121
+
122
+ # @see the `==` method
123
+ # @param [Object] Object to be compared
124
+ def eql?(o)
125
+ self == o
126
+ end
127
+
128
+ # Calculates hash code according to all attributes.
129
+ # @return [Integer] Hash code
130
+ def hash
131
+ [start_date, end_date, developmental_role, public_key].hash
132
+ end
133
+
134
+ # Builds the object from hash
135
+ # @param [Hash] attributes Model attributes in the form of hash
136
+ # @return [Object] Returns the model itself
137
+ def self.build_from_hash(attributes)
138
+ new.build_from_hash(attributes)
139
+ end
140
+
141
+ # Builds the object from hash
142
+ # @param [Hash] attributes Model attributes in the form of hash
143
+ # @return [Object] Returns the model itself
144
+ def build_from_hash(attributes)
145
+ return nil unless attributes.is_a?(Hash)
146
+ self.class.openapi_types.each_pair do |key, type|
147
+ if type =~ /\AArray<(.*)>/i
148
+ # check to ensure the input is an array given that the attribute
149
+ # is documented as an array but the input is not
150
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
151
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
152
+ end
153
+ elsif !attributes[self.class.attribute_map[key]].nil?
154
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
155
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
156
+ end
157
+
158
+ self
159
+ end
160
+
161
+ # Deserializes the data based on type
162
+ # @param string type Data type
163
+ # @param string value Value to be deserialized
164
+ # @return [Object] Deserialized data
165
+ def _deserialize(type, value)
166
+ case type.to_sym
167
+ when :DateTime
168
+ DateTime.parse(parse_date(value))
169
+ when :Date
170
+ Date.parse(parse_date(value))
171
+ when :String
172
+ value.to_s
173
+ when :Integer
174
+ value.to_i
175
+ when :Float
176
+ value.to_f
177
+ when :BigDecimal
178
+ BigDecimal(value.to_s)
179
+ when :Boolean
180
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
181
+ true
182
+ else
183
+ false
184
+ end
185
+ when :Object
186
+ # generic object (usually a Hash), return directly
187
+ value
188
+ when /\AArray<(?<inner_type>.+)>\z/
189
+ inner_type = Regexp.last_match[:inner_type]
190
+ value.map { |v| _deserialize(inner_type, v) }
191
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
192
+ k_type = Regexp.last_match[:k_type]
193
+ v_type = Regexp.last_match[:v_type]
194
+ {}.tap do |hash|
195
+ value.each do |k, v|
196
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
197
+ end
198
+ end
199
+ else # model
200
+ XeroRuby::PayrollUk.const_get(type).build_from_hash(value)
201
+ end
202
+ end
203
+
204
+ # Returns the string representation of the object
205
+ # @return [String] String presentation of the object
206
+ def to_s
207
+ to_hash.to_s
208
+ end
209
+
210
+ # to_body is an alias to to_hash (backward compatibility)
211
+ # @return [Hash] Returns the object in the form of hash
212
+ def to_body
213
+ to_hash
214
+ end
215
+
216
+ # Returns the object in the form of hash
217
+ # @return [Hash] Returns the object in the form of hash
218
+ def to_hash(downcase: false)
219
+ hash = {}
220
+ self.class.attribute_map.each_pair do |attr, param|
221
+ value = self.send(attr)
222
+ next if value.nil?
223
+ key = downcase ? attr : param
224
+ hash[key] = _to_hash(value, downcase: downcase)
225
+ end
226
+ hash
227
+ end
228
+
229
+ # Returns the object in the form of hash with snake_case
230
+ def to_attributes
231
+ to_hash(downcase: true)
232
+ end
233
+
234
+ # Outputs non-array value in the form of hash
235
+ # For object, use to_hash. Otherwise, just return the value
236
+ # @param [Object] value Any valid value
237
+ # @return [Hash] Returns the value in the form of hash
238
+ def _to_hash(value, downcase: false)
239
+ if value.is_a?(Array)
240
+ value.map do |v|
241
+ v.to_hash(downcase: downcase)
242
+ end
243
+ elsif value.is_a?(Hash)
244
+ {}.tap do |hash|
245
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
246
+ end
247
+ elsif value.respond_to? :to_hash
248
+ value.to_hash(downcase: downcase)
249
+ else
250
+ value
251
+ end
252
+ end
253
+
254
+ def parse_date(datestring)
255
+ if datestring.include?('Date')
256
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
257
+ original, date, timezone = *date_pattern.match(datestring)
258
+ date = (date.to_i / 1000)
259
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
260
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
261
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
262
+ else # handle date 'types' for small subset of payroll API's
263
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
264
+ end
265
+ end
266
+ end
267
+ end
@@ -72,6 +72,9 @@ module XeroRuby::PayrollUk
72
72
  # Whether the employee is an off payroll worker
73
73
  attr_accessor :is_off_payroll_worker
74
74
 
75
+ # The employee's contracts
76
+ attr_accessor :contracts
77
+
75
78
  class EnumAttributeValidator
76
79
  attr_reader :datatype
77
80
  attr_reader :allowable_values
@@ -114,7 +117,8 @@ module XeroRuby::PayrollUk
114
117
  :'ni_category' => :'niCategory',
115
118
  :'ni_categories' => :'niCategories',
116
119
  :'national_insurance_number' => :'nationalInsuranceNumber',
117
- :'is_off_payroll_worker' => :'isOffPayrollWorker'
120
+ :'is_off_payroll_worker' => :'isOffPayrollWorker',
121
+ :'contracts' => :'contracts'
118
122
  }
119
123
  end
120
124
 
@@ -138,7 +142,8 @@ module XeroRuby::PayrollUk
138
142
  :'ni_category' => :'NICategoryLetter',
139
143
  :'ni_categories' => :'Array<NICategory>',
140
144
  :'national_insurance_number' => :'String',
141
- :'is_off_payroll_worker' => :'Boolean'
145
+ :'is_off_payroll_worker' => :'Boolean',
146
+ :'contracts' => :'Array<Contracts>'
142
147
  }
143
148
  end
144
149
 
@@ -230,6 +235,12 @@ module XeroRuby::PayrollUk
230
235
  if attributes.key?(:'is_off_payroll_worker')
231
236
  self.is_off_payroll_worker = attributes[:'is_off_payroll_worker']
232
237
  end
238
+
239
+ if attributes.key?(:'contracts')
240
+ if (value = attributes[:'contracts']).is_a?(Array)
241
+ self.contracts = value
242
+ end
243
+ end
233
244
  end
234
245
 
235
246
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -309,7 +320,8 @@ module XeroRuby::PayrollUk
309
320
  ni_category == o.ni_category &&
310
321
  ni_categories == o.ni_categories &&
311
322
  national_insurance_number == o.national_insurance_number &&
312
- is_off_payroll_worker == o.is_off_payroll_worker
323
+ is_off_payroll_worker == o.is_off_payroll_worker &&
324
+ contracts == o.contracts
313
325
  end
314
326
 
315
327
  # @see the `==` method
@@ -321,7 +333,7 @@ module XeroRuby::PayrollUk
321
333
  # Calculates hash code according to all attributes.
322
334
  # @return [Integer] Hash code
323
335
  def hash
324
- [employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc, ni_category, ni_categories, national_insurance_number, is_off_payroll_worker].hash
336
+ [employee_id, title, first_name, last_name, date_of_birth, address, email, gender, phone_number, start_date, end_date, payroll_calendar_id, updated_date_utc, created_date_utc, ni_category, ni_categories, national_insurance_number, is_off_payroll_worker, contracts].hash
325
337
  end
326
338
 
327
339
  # Builds the object from hash
@@ -31,6 +31,9 @@ module XeroRuby::PayrollUk
31
31
  # The employee's NI categories
32
32
  attr_accessor :ni_categories
33
33
 
34
+ # The employee's contracts
35
+ attr_accessor :contracts
36
+
34
37
  # Attribute mapping from ruby-style variable name to JSON key.
35
38
  def self.attribute_map
36
39
  {
@@ -38,7 +41,8 @@ module XeroRuby::PayrollUk
38
41
  :'start_date' => :'startDate',
39
42
  :'employee_number' => :'employeeNumber',
40
43
  :'ni_category' => :'niCategory',
41
- :'ni_categories' => :'niCategories'
44
+ :'ni_categories' => :'niCategories',
45
+ :'contracts' => :'contracts'
42
46
  }
43
47
  end
44
48
 
@@ -49,7 +53,8 @@ module XeroRuby::PayrollUk
49
53
  :'start_date' => :'Date',
50
54
  :'employee_number' => :'String',
51
55
  :'ni_category' => :'NICategoryLetter',
52
- :'ni_categories' => :'Array<NICategory>'
56
+ :'ni_categories' => :'Array<NICategory>',
57
+ :'contracts' => :'Array<Contracts>'
53
58
  }
54
59
  end
55
60
 
@@ -89,6 +94,12 @@ module XeroRuby::PayrollUk
89
94
  self.ni_categories = value
90
95
  end
91
96
  end
97
+
98
+ if attributes.key?(:'contracts')
99
+ if (value = attributes[:'contracts']).is_a?(Array)
100
+ self.contracts = value
101
+ end
102
+ end
92
103
  end
93
104
 
94
105
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -133,7 +144,8 @@ module XeroRuby::PayrollUk
133
144
  start_date == o.start_date &&
134
145
  employee_number == o.employee_number &&
135
146
  ni_category == o.ni_category &&
136
- ni_categories == o.ni_categories
147
+ ni_categories == o.ni_categories &&
148
+ contracts == o.contracts
137
149
  end
138
150
 
139
151
  # @see the `==` method
@@ -145,7 +157,7 @@ module XeroRuby::PayrollUk
145
157
  # Calculates hash code according to all attributes.
146
158
  # @return [Integer] Hash code
147
159
  def hash
148
- [payroll_calendar_id, start_date, employee_number, ni_category, ni_categories].hash
160
+ [payroll_calendar_id, start_date, employee_number, ni_category, ni_categories, contracts].hash
149
161
  end
150
162
 
151
163
  # Builds the object from hash
@@ -0,0 +1,37 @@
1
+ =begin
2
+ #Xero Payroll UK
3
+
4
+ #This is the Xero Payroll API for orgs in the UK region.
5
+
6
+ Contact: api@xero.com
7
+ Generated by: https://openapi-generator.tech
8
+ OpenAPI Generator version: 4.3.1
9
+
10
+ =end
11
+
12
+ require 'time'
13
+ require 'date'
14
+
15
+ module XeroRuby::PayrollUk
16
+ class EmploymentStatus
17
+ EMPLOYEE ||= "Employee".freeze
18
+ WORKER ||= "Worker".freeze
19
+ UNSPECIFIED ||= "Unspecified".freeze
20
+
21
+ # Builds the enum from string
22
+ # @param [String] The enum value in the form of the string
23
+ # @return [String] The enum value
24
+ def self.build_from_hash(value)
25
+ new.build_from_hash(value)
26
+ end
27
+
28
+ # Builds the enum from string
29
+ # @param [String] The enum value in the form of the string
30
+ # @return [String] The enum value
31
+ def build_from_hash(value)
32
+ constantValues = EmploymentStatus.constants.select { |c| EmploymentStatus::const_get(c) == value }
33
+ raise "Invalid ENUM value #{value} for class #EmploymentStatus" if constantValues.empty?
34
+ value
35
+ end
36
+ end
37
+ end
@@ -7,9 +7,9 @@ Contact: api@xero.com
7
7
  Generated by: https://openapi-generator.tech
8
8
  OpenAPI Generator version: 4.3.1
9
9
 
10
- The version of the XeroOpenAPI document: 9.1.0
10
+ The version of the XeroOpenAPI document: 9.3.0
11
11
  =end
12
12
 
13
13
  module XeroRuby
14
- VERSION = '12.1.0'
14
+ VERSION = '12.3.0'
15
15
  end
data/lib/xero-ruby.rb CHANGED
@@ -90,11 +90,14 @@ require 'xero-ruby/models/payroll_uk/benefit'
90
90
  require 'xero-ruby/models/payroll_uk/benefit_line'
91
91
  require 'xero-ruby/models/payroll_uk/benefit_object'
92
92
  require 'xero-ruby/models/payroll_uk/benefits'
93
+ require 'xero-ruby/models/payroll_uk/contract_type'
94
+ require 'xero-ruby/models/payroll_uk/contracts'
93
95
  require 'xero-ruby/models/payroll_uk/court_order_line'
94
96
  require 'xero-ruby/models/payroll_uk/deduction'
95
97
  require 'xero-ruby/models/payroll_uk/deduction_line'
96
98
  require 'xero-ruby/models/payroll_uk/deduction_object'
97
99
  require 'xero-ruby/models/payroll_uk/deductions'
100
+ require 'xero-ruby/models/payroll_uk/developmental_role_details'
98
101
  require 'xero-ruby/models/payroll_uk/earnings_line'
99
102
  require 'xero-ruby/models/payroll_uk/earnings_order'
100
103
  require 'xero-ruby/models/payroll_uk/earnings_order_object'
@@ -131,6 +134,7 @@ require 'xero-ruby/models/payroll_uk/employee_tax_object'
131
134
  require 'xero-ruby/models/payroll_uk/employees'
132
135
  require 'xero-ruby/models/payroll_uk/employment'
133
136
  require 'xero-ruby/models/payroll_uk/employment_object'
137
+ require 'xero-ruby/models/payroll_uk/employment_status'
134
138
  require 'xero-ruby/models/payroll_uk/invalid_field'
135
139
  require 'xero-ruby/models/payroll_uk/leave_accrual_line'
136
140
  require 'xero-ruby/models/payroll_uk/leave_earnings_line'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xero-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 12.1.0
4
+ version: 12.3.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: 2025-09-25 00:00:00.000000000 Z
11
+ date: 2025-11-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -533,11 +533,14 @@ files:
533
533
  - lib/xero-ruby/models/payroll_uk/benefit_line.rb
534
534
  - lib/xero-ruby/models/payroll_uk/benefit_object.rb
535
535
  - lib/xero-ruby/models/payroll_uk/benefits.rb
536
+ - lib/xero-ruby/models/payroll_uk/contract_type.rb
537
+ - lib/xero-ruby/models/payroll_uk/contracts.rb
536
538
  - lib/xero-ruby/models/payroll_uk/court_order_line.rb
537
539
  - lib/xero-ruby/models/payroll_uk/deduction.rb
538
540
  - lib/xero-ruby/models/payroll_uk/deduction_line.rb
539
541
  - lib/xero-ruby/models/payroll_uk/deduction_object.rb
540
542
  - lib/xero-ruby/models/payroll_uk/deductions.rb
543
+ - lib/xero-ruby/models/payroll_uk/developmental_role_details.rb
541
544
  - lib/xero-ruby/models/payroll_uk/earnings_line.rb
542
545
  - lib/xero-ruby/models/payroll_uk/earnings_order.rb
543
546
  - lib/xero-ruby/models/payroll_uk/earnings_order_object.rb
@@ -574,6 +577,7 @@ files:
574
577
  - lib/xero-ruby/models/payroll_uk/employees.rb
575
578
  - lib/xero-ruby/models/payroll_uk/employment.rb
576
579
  - lib/xero-ruby/models/payroll_uk/employment_object.rb
580
+ - lib/xero-ruby/models/payroll_uk/employment_status.rb
577
581
  - lib/xero-ruby/models/payroll_uk/invalid_field.rb
578
582
  - lib/xero-ruby/models/payroll_uk/leave_accrual_line.rb
579
583
  - lib/xero-ruby/models/payroll_uk/leave_earnings_line.rb