xero-ruby 12.2.0 → 12.4.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 +4 -4
- data/lib/xero-ruby/api/accounting_api.rb +3 -0
- data/lib/xero-ruby/models/accounting/overpayment.rb +11 -1
- data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +1 -21
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +3 -13
- data/lib/xero-ruby/models/payroll_uk/contract_type.rb +38 -0
- data/lib/xero-ruby/models/payroll_uk/contracts.rb +297 -0
- data/lib/xero-ruby/models/payroll_uk/developmental_role_details.rb +267 -0
- data/lib/xero-ruby/models/payroll_uk/employee.rb +16 -4
- data/lib/xero-ruby/models/payroll_uk/employment.rb +16 -4
- data/lib/xero-ruby/models/payroll_uk/employment_status.rb +37 -0
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +4 -0
- metadata +6 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fb934d84d2ae53b0239b45ec344af16f2c862369bae478f3fb15f9a7caf2d36a
|
|
4
|
+
data.tar.gz: f84af0bc72f79fa7396742ace8e2e2c2b41e0e66a0f60632da34876cb06ef773
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f5505cde298fd14eb3b2212701d20c1b49575e7faaa27bd4e6908c8d21a19e02a23eda70bc8e39bf0fbe69ca8faa1e97be92d1af153c18352b872c4c118bea74
|
|
7
|
+
data.tar.gz: 5a350f8f23d3f18bdb6bd7b2d07111785a6030dc390773bd0938c2fa8d353667e94f1339e7491a8c5a012946571a040170906d529c93d51fa800e6f83c1bd67f
|
|
@@ -11958,6 +11958,7 @@ module XeroRuby
|
|
|
11958
11958
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
|
|
11959
11959
|
# @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
|
|
11960
11960
|
# @option opts [Integer] :page_size Number of records to retrieve per page
|
|
11961
|
+
# @option opts [Array<String>] :references Filter by a comma-separated list of References
|
|
11961
11962
|
# @return [Overpayments]
|
|
11962
11963
|
def get_overpayments(xero_tenant_id, opts = {})
|
|
11963
11964
|
data, _status_code, _headers = get_overpayments_with_http_info(xero_tenant_id, opts)
|
|
@@ -11973,6 +11974,7 @@ module XeroRuby
|
|
|
11973
11974
|
# @option opts [Integer] :page e.g. page=1 – Up to 100 overpayments will be returned in a single API call with line items shown for each overpayment
|
|
11974
11975
|
# @option opts [Integer] :unitdp e.g. unitdp=4 – (Unit Decimal Places) You can opt in to use four decimal places for unit amounts
|
|
11975
11976
|
# @option opts [Integer] :page_size Number of records to retrieve per page
|
|
11977
|
+
# @option opts [Array<String>] :references Filter by a comma-separated list of References
|
|
11976
11978
|
# @return [Array<(Overpayments, Integer, Hash)>] Overpayments data, response status code and response headers
|
|
11977
11979
|
def get_overpayments_with_http_info(xero_tenant_id, options = {})
|
|
11978
11980
|
opts = options.dup
|
|
@@ -11996,6 +11998,7 @@ module XeroRuby
|
|
|
11996
11998
|
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
11997
11999
|
query_params[:'unitdp'] = opts[:'unitdp'] if !opts[:'unitdp'].nil?
|
|
11998
12000
|
query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?
|
|
12001
|
+
query_params[:'References'] = @api_client.build_collection_param(opts[:'references'], :csv) if !opts[:'references'].nil?
|
|
11999
12002
|
|
|
12000
12003
|
# XeroAPI's `IDs` convention openapi-generator does not snake_case properly.. manual over-riding `i_ds` malformations:
|
|
12001
12004
|
query_params[:'IDs'] = @api_client.build_collection_param(opts[:'ids'], :csv) if !opts[:'ids'].nil?
|
|
@@ -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
|
|
@@ -28,12 +28,6 @@ module XeroRuby::PayrollNz
|
|
|
28
28
|
# The dollar value of annual leave opening balance if negative.
|
|
29
29
|
attr_accessor :negative_annual_leave_balance_paid_amount
|
|
30
30
|
|
|
31
|
-
# Deprecated use SickLeaveToAccrueAnnually
|
|
32
|
-
attr_accessor :sick_leave_hours_to_accrue_annually
|
|
33
|
-
|
|
34
|
-
# Deprecated use SickLeaveMaximumToAccrue
|
|
35
|
-
attr_accessor :sick_leave_maximum_hours_to_accrue
|
|
36
|
-
|
|
37
31
|
# Number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type
|
|
38
32
|
attr_accessor :sick_leave_to_accrue_annually
|
|
39
33
|
|
|
@@ -59,8 +53,6 @@ module XeroRuby::PayrollNz
|
|
|
59
53
|
:'holiday_pay_opening_balance' => :'holidayPayOpeningBalance',
|
|
60
54
|
:'annual_leave_opening_balance' => :'annualLeaveOpeningBalance',
|
|
61
55
|
:'negative_annual_leave_balance_paid_amount' => :'negativeAnnualLeaveBalancePaidAmount',
|
|
62
|
-
:'sick_leave_hours_to_accrue_annually' => :'sickLeaveHoursToAccrueAnnually',
|
|
63
|
-
:'sick_leave_maximum_hours_to_accrue' => :'sickLeaveMaximumHoursToAccrue',
|
|
64
56
|
:'sick_leave_to_accrue_annually' => :'SickLeaveToAccrueAnnually',
|
|
65
57
|
:'sick_leave_maximum_to_accrue' => :'SickLeaveMaximumToAccrue',
|
|
66
58
|
:'sick_leave_opening_balance' => :'sickLeaveOpeningBalance',
|
|
@@ -77,8 +69,6 @@ module XeroRuby::PayrollNz
|
|
|
77
69
|
:'holiday_pay_opening_balance' => :'BigDecimal',
|
|
78
70
|
:'annual_leave_opening_balance' => :'BigDecimal',
|
|
79
71
|
:'negative_annual_leave_balance_paid_amount' => :'BigDecimal',
|
|
80
|
-
:'sick_leave_hours_to_accrue_annually' => :'BigDecimal',
|
|
81
|
-
:'sick_leave_maximum_hours_to_accrue' => :'BigDecimal',
|
|
82
72
|
:'sick_leave_to_accrue_annually' => :'BigDecimal',
|
|
83
73
|
:'sick_leave_maximum_to_accrue' => :'BigDecimal',
|
|
84
74
|
:'sick_leave_opening_balance' => :'BigDecimal',
|
|
@@ -119,14 +109,6 @@ module XeroRuby::PayrollNz
|
|
|
119
109
|
self.negative_annual_leave_balance_paid_amount = attributes[:'negative_annual_leave_balance_paid_amount']
|
|
120
110
|
end
|
|
121
111
|
|
|
122
|
-
if attributes.key?(:'sick_leave_hours_to_accrue_annually')
|
|
123
|
-
self.sick_leave_hours_to_accrue_annually = attributes[:'sick_leave_hours_to_accrue_annually']
|
|
124
|
-
end
|
|
125
|
-
|
|
126
|
-
if attributes.key?(:'sick_leave_maximum_hours_to_accrue')
|
|
127
|
-
self.sick_leave_maximum_hours_to_accrue = attributes[:'sick_leave_maximum_hours_to_accrue']
|
|
128
|
-
end
|
|
129
|
-
|
|
130
112
|
if attributes.key?(:'sick_leave_to_accrue_annually')
|
|
131
113
|
self.sick_leave_to_accrue_annually = attributes[:'sick_leave_to_accrue_annually']
|
|
132
114
|
end
|
|
@@ -174,8 +156,6 @@ module XeroRuby::PayrollNz
|
|
|
174
156
|
holiday_pay_opening_balance == o.holiday_pay_opening_balance &&
|
|
175
157
|
annual_leave_opening_balance == o.annual_leave_opening_balance &&
|
|
176
158
|
negative_annual_leave_balance_paid_amount == o.negative_annual_leave_balance_paid_amount &&
|
|
177
|
-
sick_leave_hours_to_accrue_annually == o.sick_leave_hours_to_accrue_annually &&
|
|
178
|
-
sick_leave_maximum_hours_to_accrue == o.sick_leave_maximum_hours_to_accrue &&
|
|
179
159
|
sick_leave_to_accrue_annually == o.sick_leave_to_accrue_annually &&
|
|
180
160
|
sick_leave_maximum_to_accrue == o.sick_leave_maximum_to_accrue &&
|
|
181
161
|
sick_leave_opening_balance == o.sick_leave_opening_balance &&
|
|
@@ -193,7 +173,7 @@ module XeroRuby::PayrollNz
|
|
|
193
173
|
# Calculates hash code according to all attributes.
|
|
194
174
|
# @return [Integer] Hash code
|
|
195
175
|
def hash
|
|
196
|
-
[include_holiday_pay, holiday_pay_opening_balance, annual_leave_opening_balance, negative_annual_leave_balance_paid_amount,
|
|
176
|
+
[include_holiday_pay, holiday_pay_opening_balance, annual_leave_opening_balance, negative_annual_leave_balance_paid_amount, sick_leave_to_accrue_annually, sick_leave_maximum_to_accrue, sick_leave_opening_balance, sick_leave_schedule_of_accrual, sick_leave_anniversary_date, annual_leave_anniversary_date].hash
|
|
197
177
|
end
|
|
198
178
|
|
|
199
179
|
# Builds the object from hash
|
|
@@ -26,9 +26,6 @@ module XeroRuby::PayrollNz
|
|
|
26
26
|
PERCENTAGE_OF_GROSS_EARNINGS ||= "PercentageOfGrossEarnings".freeze
|
|
27
27
|
NO_ACCRUALS ||= "NoAccruals".freeze
|
|
28
28
|
|
|
29
|
-
# Deprecated use UnitsAccruedAnnually
|
|
30
|
-
attr_accessor :hours_accrued_annually
|
|
31
|
-
|
|
32
29
|
# The number of units accrued for the leave annually. This is 0 when the ScheduleOfAccrual chosen is \"NoAccruals\"
|
|
33
30
|
attr_accessor :units_accrued_annually
|
|
34
31
|
|
|
@@ -44,7 +41,7 @@ module XeroRuby::PayrollNz
|
|
|
44
41
|
# The type of units for the opening balance
|
|
45
42
|
attr_accessor :opening_balance_type_of_units
|
|
46
43
|
|
|
47
|
-
#
|
|
44
|
+
# not supported in Payroll NZ
|
|
48
45
|
attr_accessor :rate_accrued_hourly
|
|
49
46
|
|
|
50
47
|
# Specific for scheduleOfAccrual having percentage of gross earnings. Identifies how much percentage of gross earnings is accrued per pay period.
|
|
@@ -89,8 +86,7 @@ module XeroRuby::PayrollNz
|
|
|
89
86
|
{
|
|
90
87
|
:'leave_type_id' => :'leaveTypeID',
|
|
91
88
|
:'schedule_of_accrual' => :'scheduleOfAccrual',
|
|
92
|
-
:'
|
|
93
|
-
:'units_accrued_annually' => :'UnitsAccruedAnnually',
|
|
89
|
+
:'units_accrued_annually' => :'unitsAccruedAnnually',
|
|
94
90
|
:'type_of_units_to_accrue' => :'typeOfUnitsToAccrue',
|
|
95
91
|
:'maximum_to_accrue' => :'maximumToAccrue',
|
|
96
92
|
:'opening_balance' => :'openingBalance',
|
|
@@ -109,7 +105,6 @@ module XeroRuby::PayrollNz
|
|
|
109
105
|
{
|
|
110
106
|
:'leave_type_id' => :'String',
|
|
111
107
|
:'schedule_of_accrual' => :'String',
|
|
112
|
-
:'hours_accrued_annually' => :'BigDecimal',
|
|
113
108
|
:'units_accrued_annually' => :'BigDecimal',
|
|
114
109
|
:'type_of_units_to_accrue' => :'String',
|
|
115
110
|
:'maximum_to_accrue' => :'BigDecimal',
|
|
@@ -147,10 +142,6 @@ module XeroRuby::PayrollNz
|
|
|
147
142
|
self.schedule_of_accrual = attributes[:'schedule_of_accrual']
|
|
148
143
|
end
|
|
149
144
|
|
|
150
|
-
if attributes.key?(:'hours_accrued_annually')
|
|
151
|
-
self.hours_accrued_annually = attributes[:'hours_accrued_annually']
|
|
152
|
-
end
|
|
153
|
-
|
|
154
145
|
if attributes.key?(:'units_accrued_annually')
|
|
155
146
|
self.units_accrued_annually = attributes[:'units_accrued_annually']
|
|
156
147
|
end
|
|
@@ -228,7 +219,6 @@ module XeroRuby::PayrollNz
|
|
|
228
219
|
self.class == o.class &&
|
|
229
220
|
leave_type_id == o.leave_type_id &&
|
|
230
221
|
schedule_of_accrual == o.schedule_of_accrual &&
|
|
231
|
-
hours_accrued_annually == o.hours_accrued_annually &&
|
|
232
222
|
units_accrued_annually == o.units_accrued_annually &&
|
|
233
223
|
type_of_units_to_accrue == o.type_of_units_to_accrue &&
|
|
234
224
|
maximum_to_accrue == o.maximum_to_accrue &&
|
|
@@ -251,7 +241,7 @@ module XeroRuby::PayrollNz
|
|
|
251
241
|
# Calculates hash code according to all attributes.
|
|
252
242
|
# @return [Integer] Hash code
|
|
253
243
|
def hash
|
|
254
|
-
[leave_type_id, schedule_of_accrual,
|
|
244
|
+
[leave_type_id, schedule_of_accrual, units_accrued_annually, type_of_units_to_accrue, maximum_to_accrue, opening_balance, opening_balance_type_of_units, rate_accrued_hourly, percentage_of_gross_earnings, include_holiday_pay_every_pay, show_annual_leave_in_advance, annual_leave_total_amount_paid, schedule_of_accrual_date].hash
|
|
255
245
|
end
|
|
256
246
|
|
|
257
247
|
# 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
|
data/lib/xero-ruby/version.rb
CHANGED
|
@@ -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:
|
|
10
|
+
The version of the XeroOpenAPI document: 10.1.0
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module XeroRuby
|
|
14
|
-
VERSION = '12.
|
|
14
|
+
VERSION = '12.4.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.
|
|
4
|
+
version: 12.4.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:
|
|
11
|
+
date: 2026-01-29 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
|