xero-ruby 9.3.0 → 18.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/xero-ruby/api/accounting_api.rb +178 -319
- data/lib/xero-ruby/api/files_api.rb +9 -2
- data/lib/xero-ruby/api/finance_api.rb +0 -299
- data/lib/xero-ruby/api/payroll_au_v2_api.rb +751 -0
- data/lib/xero-ruby/api/payroll_nz_api.rb +0 -86
- data/lib/xero-ruby/api/payroll_uk_api.rb +0 -86
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +71 -1
- data/lib/xero-ruby/models/accounting/bank_transfer_delete.rb +244 -0
- data/lib/xero-ruby/models/accounting/bank_transfer_delete_by_url_param.rb +229 -0
- data/lib/xero-ruby/models/accounting/bank_transfers_delete.rb +224 -0
- data/lib/xero-ruby/models/accounting/contact.rb +27 -1
- data/lib/xero-ruby/models/accounting/credit_note.rb +11 -1
- data/lib/xero-ruby/models/accounting/invoice.rb +12 -2
- data/lib/xero-ruby/models/accounting/organisation.rb +25 -6
- data/lib/xero-ruby/models/accounting/overpayment.rb +21 -1
- data/lib/xero-ruby/models/accounting/payment.rb +11 -1
- data/lib/xero-ruby/models/accounting/prepayment.rb +31 -1
- data/lib/xero-ruby/models/accounting/tracking_reference.rb +277 -0
- data/lib/xero-ruby/models/accounting/user.rb +3 -2
- data/lib/xero-ruby/models/app_store/product.rb +4 -3
- data/lib/xero-ruby/models/assets/book_depreciation_detail.rb +54 -4
- data/lib/xero-ruby/models/files/association.rb +21 -1
- data/lib/xero-ruby/models/finance/current_statement_response.rb +1 -1
- data/lib/xero-ruby/models/finance/data_source_response.rb +1 -31
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +16 -1
- data/lib/xero-ruby/models/payroll_au/employee.rb +1 -13
- data/lib/xero-ruby/models/payroll_au/leave_line.rb +16 -1
- data/lib/xero-ruby/models/payroll_au/leave_type.rb +19 -4
- data/lib/xero-ruby/models/payroll_au/opening_balance_leave_line.rb +232 -0
- data/lib/xero-ruby/models/payroll_au/opening_balances.rb +1 -1
- data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +14 -4
- data/lib/xero-ruby/models/payroll_au_v2/invalid_field.rb +232 -0
- data/lib/xero-ruby/models/payroll_au_v2/pagination.rb +252 -0
- data/lib/xero-ruby/models/payroll_au_v2/problem.rb +275 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet.rb +361 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_line.rb +277 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_line_object.rb +242 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheet_object.rb +242 -0
- data/lib/xero-ruby/models/payroll_au_v2/timesheets.rb +244 -0
- data/lib/xero-ruby/models/payroll_nz/employee.rb +20 -0
- data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +29 -19
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +31 -11
- data/lib/xero-ruby/models/payroll_nz/employee_pay_template.rb +5 -0
- data/lib/xero-ruby/models/payroll_nz/employment.rb +15 -0
- data/lib/xero-ruby/models/payroll_nz/leave_period.rb +35 -4
- data/lib/xero-ruby/models/payroll_nz/leave_type.rb +24 -4
- 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/earnings_rate.rb +5 -2
- data/lib/xero-ruby/models/payroll_uk/employee.rb +68 -4
- data/lib/xero-ruby/models/payroll_uk/employee_pay_template.rb +5 -0
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +4 -2
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +5 -2
- data/lib/xero-ruby/models/payroll_uk/employment.rb +49 -52
- data/lib/xero-ruby/models/payroll_uk/employment_status.rb +37 -0
- data/lib/xero-ruby/models/payroll_uk/ni_category.rb +318 -0
- data/lib/xero-ruby/models/payroll_uk/ni_category_letter.rb +51 -0
- data/lib/xero-ruby/models/payroll_uk/ni_category_one_of.rb +264 -0
- data/lib/xero-ruby/models/payroll_uk/ni_category_one_of1.rb +257 -0
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +22 -10
- data/spec/finance/api/finance_api_spec.rb +0 -53
- metadata +393 -391
- data/spec/finance/models/account_usage_response_spec.rb +0 -58
- data/spec/finance/models/account_usage_spec.rb +0 -112
- data/spec/finance/models/history_record_response_spec.rb +0 -64
- data/spec/finance/models/lock_history_model_spec.rb +0 -52
- data/spec/finance/models/lock_history_response_spec.rb +0 -52
- data/spec/finance/models/practice_response_spec.rb +0 -64
- data/spec/finance/models/report_history_model_spec.rb +0 -52
- data/spec/finance/models/report_history_response_spec.rb +0 -52
- data/spec/finance/models/user_activities_response_spec.rb +0 -52
- data/spec/finance/models/user_response_spec.rb +0 -106
|
@@ -47,6 +47,9 @@ module XeroRuby::PayrollUk
|
|
|
47
47
|
TIPS_NON_DIRECT ||= "TipsNonDirect".freeze
|
|
48
48
|
TIPS_DIRECT ||= "TipsDirect".freeze
|
|
49
49
|
TERMINATION_PAY ||= "TerminationPay".freeze
|
|
50
|
+
STATUTORY_NEONATAL_CARE_PAY ||= "StatutoryNeonatalCarePay".freeze
|
|
51
|
+
STATUTORY_NEONATAL_CARE_PAY_NON_PENSIONABLE ||= "StatutoryNeonatalCarePayNonPensionable".freeze
|
|
52
|
+
STATUTORY_BEREAVEMENT_PAY_NORTHERN_IRELAND ||= "StatutoryBereavementPayNorthernIreland".freeze
|
|
50
53
|
|
|
51
54
|
# Indicates the type of the earning rate
|
|
52
55
|
attr_accessor :rate_type
|
|
@@ -214,7 +217,7 @@ module XeroRuby::PayrollUk
|
|
|
214
217
|
def valid?
|
|
215
218
|
return false if @name.nil?
|
|
216
219
|
return false if @earnings_type.nil?
|
|
217
|
-
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "BackPay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay"])
|
|
220
|
+
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "BackPay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay", "StatutoryNeonatalCarePay", "StatutoryNeonatalCarePayNonPensionable", "StatutoryBereavementPayNorthernIreland"])
|
|
218
221
|
return false unless earnings_type_validator.valid?(@earnings_type)
|
|
219
222
|
return false if @rate_type.nil?
|
|
220
223
|
rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"])
|
|
@@ -227,7 +230,7 @@ module XeroRuby::PayrollUk
|
|
|
227
230
|
# Custom attribute writer method checking allowed values (enum).
|
|
228
231
|
# @param [Object] earnings_type Object to be assigned
|
|
229
232
|
def earnings_type=(earnings_type)
|
|
230
|
-
validator = EnumAttributeValidator.new('String', ["Allowance", "BackPay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay"])
|
|
233
|
+
validator = EnumAttributeValidator.new('String', ["Allowance", "BackPay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay", "StatutoryNeonatalCarePay", "StatutoryNeonatalCarePayNonPensionable", "StatutoryBereavementPayNorthernIreland"])
|
|
231
234
|
unless validator.valid?(earnings_type)
|
|
232
235
|
fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}."
|
|
233
236
|
end
|
|
@@ -60,12 +60,21 @@ module XeroRuby::PayrollUk
|
|
|
60
60
|
# UTC timestamp when the employee was created in Xero
|
|
61
61
|
attr_accessor :created_date_utc
|
|
62
62
|
|
|
63
|
+
|
|
64
|
+
attr_accessor :ni_category
|
|
65
|
+
|
|
66
|
+
# The employee's NI categories
|
|
67
|
+
attr_accessor :ni_categories
|
|
68
|
+
|
|
63
69
|
# National insurance number of the employee
|
|
64
70
|
attr_accessor :national_insurance_number
|
|
65
71
|
|
|
66
72
|
# Whether the employee is an off payroll worker
|
|
67
73
|
attr_accessor :is_off_payroll_worker
|
|
68
74
|
|
|
75
|
+
# The employee's contracts
|
|
76
|
+
attr_accessor :contracts
|
|
77
|
+
|
|
69
78
|
class EnumAttributeValidator
|
|
70
79
|
attr_reader :datatype
|
|
71
80
|
attr_reader :allowable_values
|
|
@@ -105,8 +114,11 @@ module XeroRuby::PayrollUk
|
|
|
105
114
|
:'payroll_calendar_id' => :'payrollCalendarID',
|
|
106
115
|
:'updated_date_utc' => :'updatedDateUTC',
|
|
107
116
|
:'created_date_utc' => :'createdDateUTC',
|
|
117
|
+
:'ni_category' => :'niCategory',
|
|
118
|
+
:'ni_categories' => :'niCategories',
|
|
108
119
|
:'national_insurance_number' => :'nationalInsuranceNumber',
|
|
109
|
-
:'is_off_payroll_worker' => :'isOffPayrollWorker'
|
|
120
|
+
:'is_off_payroll_worker' => :'isOffPayrollWorker',
|
|
121
|
+
:'contracts' => :'contracts'
|
|
110
122
|
}
|
|
111
123
|
end
|
|
112
124
|
|
|
@@ -127,8 +139,11 @@ module XeroRuby::PayrollUk
|
|
|
127
139
|
:'payroll_calendar_id' => :'String',
|
|
128
140
|
:'updated_date_utc' => :'DateTime',
|
|
129
141
|
:'created_date_utc' => :'DateTime',
|
|
142
|
+
:'ni_category' => :'NICategoryLetter',
|
|
143
|
+
:'ni_categories' => :'Array<NICategory>',
|
|
130
144
|
:'national_insurance_number' => :'String',
|
|
131
|
-
:'is_off_payroll_worker' => :'Boolean'
|
|
145
|
+
:'is_off_payroll_worker' => :'Boolean',
|
|
146
|
+
:'contracts' => :'Array<Contracts>'
|
|
132
147
|
}
|
|
133
148
|
end
|
|
134
149
|
|
|
@@ -203,6 +218,16 @@ module XeroRuby::PayrollUk
|
|
|
203
218
|
self.created_date_utc = attributes[:'created_date_utc']
|
|
204
219
|
end
|
|
205
220
|
|
|
221
|
+
if attributes.key?(:'ni_category')
|
|
222
|
+
self.ni_category = attributes[:'ni_category']
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
if attributes.key?(:'ni_categories')
|
|
226
|
+
if (value = attributes[:'ni_categories']).is_a?(Array)
|
|
227
|
+
self.ni_categories = value
|
|
228
|
+
end
|
|
229
|
+
end
|
|
230
|
+
|
|
206
231
|
if attributes.key?(:'national_insurance_number')
|
|
207
232
|
self.national_insurance_number = attributes[:'national_insurance_number']
|
|
208
233
|
end
|
|
@@ -210,18 +235,54 @@ module XeroRuby::PayrollUk
|
|
|
210
235
|
if attributes.key?(:'is_off_payroll_worker')
|
|
211
236
|
self.is_off_payroll_worker = attributes[:'is_off_payroll_worker']
|
|
212
237
|
end
|
|
238
|
+
|
|
239
|
+
if attributes.key?(:'contracts')
|
|
240
|
+
if (value = attributes[:'contracts']).is_a?(Array)
|
|
241
|
+
self.contracts = value
|
|
242
|
+
end
|
|
243
|
+
end
|
|
213
244
|
end
|
|
214
245
|
|
|
215
246
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
216
247
|
# @return Array for valid properties with the reasons
|
|
217
248
|
def list_invalid_properties
|
|
218
249
|
invalid_properties = Array.new
|
|
250
|
+
if @title.nil?
|
|
251
|
+
invalid_properties.push('invalid value for "title", title cannot be nil.')
|
|
252
|
+
end
|
|
253
|
+
|
|
254
|
+
if @first_name.nil?
|
|
255
|
+
invalid_properties.push('invalid value for "first_name", first_name cannot be nil.')
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
if @last_name.nil?
|
|
259
|
+
invalid_properties.push('invalid value for "last_name", last_name cannot be nil.')
|
|
260
|
+
end
|
|
261
|
+
|
|
262
|
+
if @date_of_birth.nil?
|
|
263
|
+
invalid_properties.push('invalid value for "date_of_birth", date_of_birth cannot be nil.')
|
|
264
|
+
end
|
|
265
|
+
|
|
266
|
+
if @address.nil?
|
|
267
|
+
invalid_properties.push('invalid value for "address", address cannot be nil.')
|
|
268
|
+
end
|
|
269
|
+
|
|
270
|
+
if @gender.nil?
|
|
271
|
+
invalid_properties.push('invalid value for "gender", gender cannot be nil.')
|
|
272
|
+
end
|
|
273
|
+
|
|
219
274
|
invalid_properties
|
|
220
275
|
end
|
|
221
276
|
|
|
222
277
|
# Check to see if the all the properties in the model are valid
|
|
223
278
|
# @return true if the model is valid
|
|
224
279
|
def valid?
|
|
280
|
+
return false if @title.nil?
|
|
281
|
+
return false if @first_name.nil?
|
|
282
|
+
return false if @last_name.nil?
|
|
283
|
+
return false if @date_of_birth.nil?
|
|
284
|
+
return false if @address.nil?
|
|
285
|
+
return false if @gender.nil?
|
|
225
286
|
gender_validator = EnumAttributeValidator.new('String', ["M", "F"])
|
|
226
287
|
return false unless gender_validator.valid?(@gender)
|
|
227
288
|
true
|
|
@@ -256,8 +317,11 @@ module XeroRuby::PayrollUk
|
|
|
256
317
|
payroll_calendar_id == o.payroll_calendar_id &&
|
|
257
318
|
updated_date_utc == o.updated_date_utc &&
|
|
258
319
|
created_date_utc == o.created_date_utc &&
|
|
320
|
+
ni_category == o.ni_category &&
|
|
321
|
+
ni_categories == o.ni_categories &&
|
|
259
322
|
national_insurance_number == o.national_insurance_number &&
|
|
260
|
-
is_off_payroll_worker == o.is_off_payroll_worker
|
|
323
|
+
is_off_payroll_worker == o.is_off_payroll_worker &&
|
|
324
|
+
contracts == o.contracts
|
|
261
325
|
end
|
|
262
326
|
|
|
263
327
|
# @see the `==` method
|
|
@@ -269,7 +333,7 @@ module XeroRuby::PayrollUk
|
|
|
269
333
|
# Calculates hash code according to all attributes.
|
|
270
334
|
# @return [Integer] Hash code
|
|
271
335
|
def hash
|
|
272
|
-
[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, 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
|
|
273
337
|
end
|
|
274
338
|
|
|
275
339
|
# Builds the object from hash
|
|
@@ -68,12 +68,17 @@ module XeroRuby::PayrollUk
|
|
|
68
68
|
# @return Array for valid properties with the reasons
|
|
69
69
|
def list_invalid_properties
|
|
70
70
|
invalid_properties = Array.new
|
|
71
|
+
if @earning_templates.nil?
|
|
72
|
+
invalid_properties.push('invalid value for "earning_templates", earning_templates cannot be nil.')
|
|
73
|
+
end
|
|
74
|
+
|
|
71
75
|
invalid_properties
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
# Check to see if the all the properties in the model are valid
|
|
75
79
|
# @return true if the model is valid
|
|
76
80
|
def valid?
|
|
81
|
+
return false if @earning_templates.nil?
|
|
77
82
|
true
|
|
78
83
|
end
|
|
79
84
|
|
|
@@ -23,6 +23,8 @@ module XeroRuby::PayrollUk
|
|
|
23
23
|
MATERNITY ||= "Maternity".freeze
|
|
24
24
|
PATERNITY ||= "Paternity".freeze
|
|
25
25
|
SHAREDPARENTAL ||= "Sharedparental".freeze
|
|
26
|
+
BEREAVEMENT ||= "Bereavement".freeze
|
|
27
|
+
NEONATAL_CARE ||= "NeonatalCare".freeze
|
|
26
28
|
|
|
27
29
|
# The balance remaining for the corresponding leave type as of specified date.
|
|
28
30
|
attr_accessor :balance_remaining
|
|
@@ -109,7 +111,7 @@ module XeroRuby::PayrollUk
|
|
|
109
111
|
# Check to see if the all the properties in the model are valid
|
|
110
112
|
# @return true if the model is valid
|
|
111
113
|
def valid?
|
|
112
|
-
leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
|
|
114
|
+
leave_type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement", "NeonatalCare"])
|
|
113
115
|
return false unless leave_type_validator.valid?(@leave_type)
|
|
114
116
|
units_validator = EnumAttributeValidator.new('String', ["Hours"])
|
|
115
117
|
return false unless units_validator.valid?(@units)
|
|
@@ -119,7 +121,7 @@ module XeroRuby::PayrollUk
|
|
|
119
121
|
# Custom attribute writer method checking allowed values (enum).
|
|
120
122
|
# @param [Object] leave_type Object to be assigned
|
|
121
123
|
def leave_type=(leave_type)
|
|
122
|
-
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
|
|
124
|
+
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement", "NeonatalCare"])
|
|
123
125
|
unless validator.valid?(leave_type)
|
|
124
126
|
fail ArgumentError, "invalid value for \"leave_type\", must be one of #{validator.allowable_values}."
|
|
125
127
|
end
|
|
@@ -29,6 +29,9 @@ module XeroRuby::PayrollUk
|
|
|
29
29
|
MATERNITY ||= "Maternity".freeze
|
|
30
30
|
PATERNITY ||= "Paternity".freeze
|
|
31
31
|
SHAREDPARENTAL ||= "Sharedparental".freeze
|
|
32
|
+
BEREAVEMENT ||= "Bereavement".freeze
|
|
33
|
+
NEONATAL_CARE ||= "NeonatalCare".freeze
|
|
34
|
+
BEREAVEMENT_NIRE ||= "BereavementNire".freeze
|
|
32
35
|
|
|
33
36
|
# The date when the leave starts
|
|
34
37
|
attr_accessor :start_date
|
|
@@ -147,7 +150,7 @@ module XeroRuby::PayrollUk
|
|
|
147
150
|
# Check to see if the all the properties in the model are valid
|
|
148
151
|
# @return true if the model is valid
|
|
149
152
|
def valid?
|
|
150
|
-
type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
|
|
153
|
+
type_validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement", "NeonatalCare", "BereavementNire"])
|
|
151
154
|
return false unless type_validator.valid?(@type)
|
|
152
155
|
status_validator = EnumAttributeValidator.new('String', ["Pending", "In-Progress", "Completed"])
|
|
153
156
|
return false unless status_validator.valid?(@status)
|
|
@@ -157,7 +160,7 @@ module XeroRuby::PayrollUk
|
|
|
157
160
|
# Custom attribute writer method checking allowed values (enum).
|
|
158
161
|
# @param [Object] type Object to be assigned
|
|
159
162
|
def type=(type)
|
|
160
|
-
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental"])
|
|
163
|
+
validator = EnumAttributeValidator.new('String', ["Sick", "Adoption", "Maternity", "Paternity", "Sharedparental", "Bereavement", "NeonatalCare", "BereavementNire"])
|
|
161
164
|
unless validator.valid?(type)
|
|
162
165
|
fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
|
|
163
166
|
end
|
|
@@ -25,51 +25,24 @@ module XeroRuby::PayrollUk
|
|
|
25
25
|
# The employment number of the employee
|
|
26
26
|
attr_accessor :employee_number
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
|
|
29
29
|
attr_accessor :ni_category
|
|
30
|
-
A ||= "A".freeze
|
|
31
|
-
B ||= "B".freeze
|
|
32
|
-
C ||= "C".freeze
|
|
33
|
-
F ||= "F".freeze
|
|
34
|
-
H ||= "H".freeze
|
|
35
|
-
I ||= "I".freeze
|
|
36
|
-
J ||= "J".freeze
|
|
37
|
-
L ||= "L".freeze
|
|
38
|
-
M ||= "M".freeze
|
|
39
|
-
S ||= "S".freeze
|
|
40
|
-
V ||= "V".freeze
|
|
41
|
-
X ||= "X".freeze
|
|
42
|
-
Z ||= "Z".freeze
|
|
43
30
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
case datatype.to_s
|
|
51
|
-
when /Integer/i
|
|
52
|
-
value.to_i
|
|
53
|
-
when /Float/i
|
|
54
|
-
value.to_f
|
|
55
|
-
else
|
|
56
|
-
value
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
def valid?(value)
|
|
62
|
-
!value || allowable_values.include?(value)
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
|
|
31
|
+
# The employee's NI categories
|
|
32
|
+
attr_accessor :ni_categories
|
|
33
|
+
|
|
34
|
+
# The employee's contracts
|
|
35
|
+
attr_accessor :contracts
|
|
36
|
+
|
|
66
37
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
67
38
|
def self.attribute_map
|
|
68
39
|
{
|
|
69
40
|
:'payroll_calendar_id' => :'payrollCalendarID',
|
|
70
41
|
:'start_date' => :'startDate',
|
|
71
42
|
:'employee_number' => :'employeeNumber',
|
|
72
|
-
:'ni_category' => :'niCategory'
|
|
43
|
+
:'ni_category' => :'niCategory',
|
|
44
|
+
:'ni_categories' => :'niCategories',
|
|
45
|
+
:'contracts' => :'contracts'
|
|
73
46
|
}
|
|
74
47
|
end
|
|
75
48
|
|
|
@@ -79,7 +52,9 @@ module XeroRuby::PayrollUk
|
|
|
79
52
|
:'payroll_calendar_id' => :'String',
|
|
80
53
|
:'start_date' => :'Date',
|
|
81
54
|
:'employee_number' => :'String',
|
|
82
|
-
:'ni_category' => :'
|
|
55
|
+
:'ni_category' => :'NICategoryLetter',
|
|
56
|
+
:'ni_categories' => :'Array<NICategory>',
|
|
57
|
+
:'contracts' => :'Array<Contracts>'
|
|
83
58
|
}
|
|
84
59
|
end
|
|
85
60
|
|
|
@@ -113,33 +88,53 @@ module XeroRuby::PayrollUk
|
|
|
113
88
|
if attributes.key?(:'ni_category')
|
|
114
89
|
self.ni_category = attributes[:'ni_category']
|
|
115
90
|
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'ni_categories')
|
|
93
|
+
if (value = attributes[:'ni_categories']).is_a?(Array)
|
|
94
|
+
self.ni_categories = value
|
|
95
|
+
end
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
if attributes.key?(:'contracts')
|
|
99
|
+
if (value = attributes[:'contracts']).is_a?(Array)
|
|
100
|
+
self.contracts = value
|
|
101
|
+
end
|
|
102
|
+
end
|
|
116
103
|
end
|
|
117
104
|
|
|
118
105
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
119
106
|
# @return Array for valid properties with the reasons
|
|
120
107
|
def list_invalid_properties
|
|
121
108
|
invalid_properties = Array.new
|
|
109
|
+
if @payroll_calendar_id.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "payroll_calendar_id", payroll_calendar_id cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if @start_date.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "start_date", start_date cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @employee_number.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "employee_number", employee_number cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @ni_categories.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "ni_categories", ni_categories cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
122
125
|
invalid_properties
|
|
123
126
|
end
|
|
124
127
|
|
|
125
128
|
# Check to see if the all the properties in the model are valid
|
|
126
129
|
# @return true if the model is valid
|
|
127
130
|
def valid?
|
|
128
|
-
|
|
129
|
-
return false
|
|
131
|
+
return false if @payroll_calendar_id.nil?
|
|
132
|
+
return false if @start_date.nil?
|
|
133
|
+
return false if @employee_number.nil?
|
|
134
|
+
return false if @ni_categories.nil?
|
|
130
135
|
true
|
|
131
136
|
end
|
|
132
137
|
|
|
133
|
-
# Custom attribute writer method checking allowed values (enum).
|
|
134
|
-
# @param [Object] ni_category Object to be assigned
|
|
135
|
-
def ni_category=(ni_category)
|
|
136
|
-
validator = EnumAttributeValidator.new('String', ["A", "B", "C", "F", "H", "I", "J", "L", "M", "S", "V", "X", "Z"])
|
|
137
|
-
unless validator.valid?(ni_category)
|
|
138
|
-
fail ArgumentError, "invalid value for \"ni_category\", must be one of #{validator.allowable_values}."
|
|
139
|
-
end
|
|
140
|
-
@ni_category = ni_category
|
|
141
|
-
end
|
|
142
|
-
|
|
143
138
|
# Checks equality by comparing each attribute.
|
|
144
139
|
# @param [Object] Object to be compared
|
|
145
140
|
def ==(o)
|
|
@@ -148,7 +143,9 @@ module XeroRuby::PayrollUk
|
|
|
148
143
|
payroll_calendar_id == o.payroll_calendar_id &&
|
|
149
144
|
start_date == o.start_date &&
|
|
150
145
|
employee_number == o.employee_number &&
|
|
151
|
-
ni_category == o.ni_category
|
|
146
|
+
ni_category == o.ni_category &&
|
|
147
|
+
ni_categories == o.ni_categories &&
|
|
148
|
+
contracts == o.contracts
|
|
152
149
|
end
|
|
153
150
|
|
|
154
151
|
# @see the `==` method
|
|
@@ -160,7 +157,7 @@ module XeroRuby::PayrollUk
|
|
|
160
157
|
# Calculates hash code according to all attributes.
|
|
161
158
|
# @return [Integer] Hash code
|
|
162
159
|
def hash
|
|
163
|
-
[payroll_calendar_id, start_date, employee_number, ni_category].hash
|
|
160
|
+
[payroll_calendar_id, start_date, employee_number, ni_category, ni_categories, contracts].hash
|
|
164
161
|
end
|
|
165
162
|
|
|
166
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
|