xero-ruby 3.16.0 → 10.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/lib/xero-ruby/api/accounting_api.rb +645 -3
  3. data/lib/xero-ruby/api/app_store_api.rb +6 -0
  4. data/lib/xero-ruby/api/asset_api.rb +16 -6
  5. data/lib/xero-ruby/api/files_api.rb +156 -20
  6. data/lib/xero-ruby/api/payroll_au_api.rb +326 -30
  7. data/lib/xero-ruby/api/payroll_nz_api.rb +417 -7
  8. data/lib/xero-ruby/api/payroll_uk_api.rb +81 -0
  9. data/lib/xero-ruby/api/project_api.rb +21 -0
  10. data/lib/xero-ruby/api_client.rb +7 -7
  11. data/lib/xero-ruby/models/accounting/account_type.rb +0 -4
  12. data/lib/xero-ruby/models/accounting/allocation.rb +21 -1
  13. data/lib/xero-ruby/models/accounting/bank_transactions.rb +23 -1
  14. data/lib/xero-ruby/models/accounting/contact.rb +1 -11
  15. data/lib/xero-ruby/models/accounting/contacts.rb +23 -1
  16. data/lib/xero-ruby/models/accounting/credit_note.rb +17 -5
  17. data/lib/xero-ruby/models/accounting/credit_notes.rb +23 -1
  18. data/lib/xero-ruby/models/accounting/currency_code.rb +10 -8
  19. data/lib/xero-ruby/models/accounting/invoice.rb +16 -4
  20. data/lib/xero-ruby/models/accounting/invoice_address.rb +338 -0
  21. data/lib/xero-ruby/models/accounting/invoices.rb +23 -1
  22. data/lib/xero-ruby/models/accounting/journals.rb +13 -1
  23. data/lib/xero-ruby/models/accounting/line_item.rb +75 -4
  24. data/lib/xero-ruby/models/accounting/manual_journals.rb +23 -1
  25. data/lib/xero-ruby/models/accounting/organisation.rb +9 -2
  26. data/lib/xero-ruby/models/accounting/overpayments.rb +23 -1
  27. data/lib/xero-ruby/models/accounting/pagination.rb +252 -0
  28. data/lib/xero-ruby/models/accounting/payment.rb +16 -4
  29. data/lib/xero-ruby/models/accounting/payments.rb +23 -1
  30. data/lib/xero-ruby/models/accounting/prepayments.rb +23 -1
  31. data/lib/xero-ruby/models/accounting/purchase_orders.rb +23 -1
  32. data/lib/xero-ruby/models/accounting/tax_breakdown_component.rb +351 -0
  33. data/lib/xero-ruby/models/accounting/tax_rate.rb +13 -6
  34. data/lib/xero-ruby/models/accounting/tax_type.rb +45 -4
  35. data/lib/xero-ruby/models/accounting/ten_ninety_nine_contact.rb +75 -4
  36. data/lib/xero-ruby/models/files/association.rb +31 -1
  37. data/lib/xero-ruby/models/finance/current_statement_response.rb +1 -1
  38. data/lib/xero-ruby/models/finance/data_source_response.rb +13 -43
  39. data/lib/xero-ruby/models/finance/problem_type.rb +1 -0
  40. data/lib/xero-ruby/models/finance/statement_line_response.rb +11 -1
  41. data/lib/xero-ruby/models/finance/statement_response.rb +24 -4
  42. data/lib/xero-ruby/models/payroll_au/allowance_type.rb +0 -1
  43. data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +0 -1
  44. data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +21 -1
  45. data/lib/xero-ruby/models/payroll_au/leave_application.rb +11 -1
  46. data/lib/xero-ruby/models/payroll_au/leave_earnings_line.rb +14 -4
  47. data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +0 -1
  48. data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +2 -0
  49. data/lib/xero-ruby/models/payroll_au/opening_balances.rb +16 -4
  50. data/lib/xero-ruby/models/payroll_au/paid_leave_earnings_line.rb +272 -0
  51. data/lib/xero-ruby/models/payroll_au/pay_out_type.rb +36 -0
  52. data/lib/xero-ruby/models/payroll_nz/employee.rb +34 -4
  53. data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +56 -6
  54. data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +47 -7
  55. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb +242 -0
  56. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks.rb +254 -0
  57. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb +242 -0
  58. data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_request.rb +244 -0
  59. data/lib/xero-ruby/models/payroll_nz/employee_working_patterns_object.rb +244 -0
  60. data/lib/xero-ruby/models/payroll_nz/employment.rb +24 -4
  61. data/lib/xero-ruby/models/payroll_nz/leave_period.rb +35 -4
  62. data/lib/xero-ruby/models/payroll_nz/leave_type.rb +24 -4
  63. data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +28 -4
  64. data/lib/xero-ruby/models/payroll_nz/working_week.rb +317 -0
  65. data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +3 -3
  66. data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +14 -4
  67. data/lib/xero-ruby/models/projects/currency_code.rb +0 -1
  68. data/lib/xero-ruby/version.rb +2 -2
  69. data/lib/xero-ruby/where.rb +37 -37
  70. data/lib/xero-ruby.rb +11 -0
  71. data/spec/api_client_spec.rb +56 -56
  72. data/spec/api_error_spec.rb +1 -1
  73. data/spec/configuration_spec.rb +2 -2
  74. data/spec/helper_methods_spec.rb +3 -3
  75. data/spec/where_spec.rb +2 -2
  76. metadata +38 -27
@@ -25,12 +25,16 @@ module XeroRuby::PayrollAu
25
25
  # Earnings rate number of units.
26
26
  attr_accessor :number_of_units
27
27
 
28
+
29
+ attr_accessor :pay_out_type
30
+
28
31
  # Attribute mapping from ruby-style variable name to JSON key.
29
32
  def self.attribute_map
30
33
  {
31
34
  :'earnings_rate_id' => :'EarningsRateID',
32
35
  :'rate_per_unit' => :'RatePerUnit',
33
- :'number_of_units' => :'NumberOfUnits'
36
+ :'number_of_units' => :'NumberOfUnits',
37
+ :'pay_out_type' => :'PayOutType'
34
38
  }
35
39
  end
36
40
 
@@ -39,7 +43,8 @@ module XeroRuby::PayrollAu
39
43
  {
40
44
  :'earnings_rate_id' => :'String',
41
45
  :'rate_per_unit' => :'BigDecimal',
42
- :'number_of_units' => :'BigDecimal'
46
+ :'number_of_units' => :'BigDecimal',
47
+ :'pay_out_type' => :'PayOutType'
43
48
  }
44
49
  end
45
50
 
@@ -69,6 +74,10 @@ module XeroRuby::PayrollAu
69
74
  if attributes.key?(:'number_of_units')
70
75
  self.number_of_units = attributes[:'number_of_units']
71
76
  end
77
+
78
+ if attributes.key?(:'pay_out_type')
79
+ self.pay_out_type = attributes[:'pay_out_type']
80
+ end
72
81
  end
73
82
 
74
83
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -91,7 +100,8 @@ module XeroRuby::PayrollAu
91
100
  self.class == o.class &&
92
101
  earnings_rate_id == o.earnings_rate_id &&
93
102
  rate_per_unit == o.rate_per_unit &&
94
- number_of_units == o.number_of_units
103
+ number_of_units == o.number_of_units &&
104
+ pay_out_type == o.pay_out_type
95
105
  end
96
106
 
97
107
  # @see the `==` method
@@ -103,7 +113,7 @@ module XeroRuby::PayrollAu
103
113
  # Calculates hash code according to all attributes.
104
114
  # @return [Integer] Hash code
105
115
  def hash
106
- [earnings_rate_id, rate_per_unit, number_of_units].hash
116
+ [earnings_rate_id, rate_per_unit, number_of_units, pay_out_type].hash
107
117
  end
108
118
 
109
119
  # Builds the object from hash
@@ -18,7 +18,6 @@ module XeroRuby::PayrollAu
18
18
  FIXEDAMOUNTEACHPERIOD ||= "FIXEDAMOUNTEACHPERIOD".freeze
19
19
  ENTERRATEINPAYTEMPLATE ||= "ENTERRATEINPAYTEMPLATE".freeze
20
20
  BASEDONORDINARYEARNINGS ||= "BASEDONORDINARYEARNINGS".freeze
21
- EMPTY ||= "".freeze
22
21
 
23
22
  # Builds the enum from string
24
23
  # @param [String] The enum value in the form of the string
@@ -16,6 +16,8 @@ module XeroRuby::PayrollAu
16
16
  class LeavePeriodStatus
17
17
  SCHEDULED ||= "SCHEDULED".freeze
18
18
  PROCESSED ||= "PROCESSED".freeze
19
+ REQUESTED ||= "REQUESTED".freeze
20
+ REJECTED ||= "REJECTED".freeze
19
21
 
20
22
  # Builds the enum from string
21
23
  # @param [String] The enum value in the form of the string
@@ -37,6 +37,9 @@ module XeroRuby::PayrollAu
37
37
 
38
38
  attr_accessor :leave_lines
39
39
 
40
+
41
+ attr_accessor :paid_leave_earnings_lines
42
+
40
43
  # Attribute mapping from ruby-style variable name to JSON key.
41
44
  def self.attribute_map
42
45
  {
@@ -46,7 +49,8 @@ module XeroRuby::PayrollAu
46
49
  :'deduction_lines' => :'DeductionLines',
47
50
  :'super_lines' => :'SuperLines',
48
51
  :'reimbursement_lines' => :'ReimbursementLines',
49
- :'leave_lines' => :'LeaveLines'
52
+ :'leave_lines' => :'LeaveLines',
53
+ :'paid_leave_earnings_lines' => :'PaidLeaveEarningsLines'
50
54
  }
51
55
  end
52
56
 
@@ -59,7 +63,8 @@ module XeroRuby::PayrollAu
59
63
  :'deduction_lines' => :'Array<DeductionLine>',
60
64
  :'super_lines' => :'Array<SuperLine>',
61
65
  :'reimbursement_lines' => :'Array<ReimbursementLine>',
62
- :'leave_lines' => :'Array<LeaveLine>'
66
+ :'leave_lines' => :'Array<LeaveLine>',
67
+ :'paid_leave_earnings_lines' => :'Array<PaidLeaveEarningsLine>'
63
68
  }
64
69
  end
65
70
 
@@ -115,6 +120,12 @@ module XeroRuby::PayrollAu
115
120
  self.leave_lines = value
116
121
  end
117
122
  end
123
+
124
+ if attributes.key?(:'paid_leave_earnings_lines')
125
+ if (value = attributes[:'paid_leave_earnings_lines']).is_a?(Array)
126
+ self.paid_leave_earnings_lines = value
127
+ end
128
+ end
118
129
  end
119
130
 
120
131
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -141,7 +152,8 @@ module XeroRuby::PayrollAu
141
152
  deduction_lines == o.deduction_lines &&
142
153
  super_lines == o.super_lines &&
143
154
  reimbursement_lines == o.reimbursement_lines &&
144
- leave_lines == o.leave_lines
155
+ leave_lines == o.leave_lines &&
156
+ paid_leave_earnings_lines == o.paid_leave_earnings_lines
145
157
  end
146
158
 
147
159
  # @see the `==` method
@@ -153,7 +165,7 @@ module XeroRuby::PayrollAu
153
165
  # Calculates hash code according to all attributes.
154
166
  # @return [Integer] Hash code
155
167
  def hash
156
- [opening_balance_date, tax, earnings_lines, deduction_lines, super_lines, reimbursement_lines, leave_lines].hash
168
+ [opening_balance_date, tax, earnings_lines, deduction_lines, super_lines, reimbursement_lines, leave_lines, paid_leave_earnings_lines].hash
157
169
  end
158
170
 
159
171
  # Builds the object from hash
@@ -0,0 +1,272 @@
1
+ =begin
2
+ #Xero Payroll AU API
3
+
4
+ #This is the Xero Payroll API for orgs in Australia 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::PayrollAu
16
+ require 'bigdecimal'
17
+
18
+ class PaidLeaveEarningsLine
19
+ # Xero leave type identifier
20
+ attr_accessor :leave_type_id
21
+
22
+ # Paid leave amount
23
+ attr_accessor :amount
24
+
25
+ # The amount of leave loading applied for the leave type that is subject to Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories
26
+ attr_accessor :sgc_applied_leave_loading_amount
27
+
28
+ # The amount of leave loading applied for the leave type that is exempt from Superannuation Guarantee Contributions. *Only applicable for Leave Types with Annual Leave Categories
29
+ attr_accessor :sgc_exempted_leave_loading_amount
30
+
31
+ # Reset the STP categorisations for the leave type. *Only applicable for Leave Types with Annual Leave Categories
32
+ attr_accessor :reset_stp_categorisation
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'leave_type_id' => :'LeaveTypeID',
38
+ :'amount' => :'Amount',
39
+ :'sgc_applied_leave_loading_amount' => :'SGCAppliedLeaveLoadingAmount',
40
+ :'sgc_exempted_leave_loading_amount' => :'SGCExemptedLeaveLoadingAmount',
41
+ :'reset_stp_categorisation' => :'ResetSTPCategorisation'
42
+ }
43
+ end
44
+
45
+ # Attribute type mapping.
46
+ def self.openapi_types
47
+ {
48
+ :'leave_type_id' => :'String',
49
+ :'amount' => :'BigDecimal',
50
+ :'sgc_applied_leave_loading_amount' => :'BigDecimal',
51
+ :'sgc_exempted_leave_loading_amount' => :'BigDecimal',
52
+ :'reset_stp_categorisation' => :'Boolean'
53
+ }
54
+ end
55
+
56
+ # Initializes the object
57
+ # @param [Hash] attributes Model attributes in the form of hash
58
+ def initialize(attributes = {})
59
+ if (!attributes.is_a?(Hash))
60
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollAu::PaidLeaveEarningsLine` initialize method"
61
+ end
62
+
63
+ # check to see if the attribute exists and convert string to symbol for hash key
64
+ attributes = attributes.each_with_object({}) { |(k, v), h|
65
+ if (!self.class.attribute_map.key?(k.to_sym))
66
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollAu::PaidLeaveEarningsLine`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
67
+ end
68
+ h[k.to_sym] = v
69
+ }
70
+
71
+ if attributes.key?(:'leave_type_id')
72
+ self.leave_type_id = attributes[:'leave_type_id']
73
+ end
74
+
75
+ if attributes.key?(:'amount')
76
+ self.amount = attributes[:'amount']
77
+ end
78
+
79
+ if attributes.key?(:'sgc_applied_leave_loading_amount')
80
+ self.sgc_applied_leave_loading_amount = attributes[:'sgc_applied_leave_loading_amount']
81
+ end
82
+
83
+ if attributes.key?(:'sgc_exempted_leave_loading_amount')
84
+ self.sgc_exempted_leave_loading_amount = attributes[:'sgc_exempted_leave_loading_amount']
85
+ end
86
+
87
+ if attributes.key?(:'reset_stp_categorisation')
88
+ self.reset_stp_categorisation = attributes[:'reset_stp_categorisation']
89
+ end
90
+ end
91
+
92
+ # Show invalid properties with the reasons. Usually used together with valid?
93
+ # @return Array for valid properties with the reasons
94
+ def list_invalid_properties
95
+ invalid_properties = Array.new
96
+ if @leave_type_id.nil?
97
+ invalid_properties.push('invalid value for "leave_type_id", leave_type_id cannot be nil.')
98
+ end
99
+
100
+ if @amount.nil?
101
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
102
+ end
103
+
104
+ invalid_properties
105
+ end
106
+
107
+ # Check to see if the all the properties in the model are valid
108
+ # @return true if the model is valid
109
+ def valid?
110
+ return false if @leave_type_id.nil?
111
+ return false if @amount.nil?
112
+ true
113
+ end
114
+
115
+ # Checks equality by comparing each attribute.
116
+ # @param [Object] Object to be compared
117
+ def ==(o)
118
+ return true if self.equal?(o)
119
+ self.class == o.class &&
120
+ leave_type_id == o.leave_type_id &&
121
+ amount == o.amount &&
122
+ sgc_applied_leave_loading_amount == o.sgc_applied_leave_loading_amount &&
123
+ sgc_exempted_leave_loading_amount == o.sgc_exempted_leave_loading_amount &&
124
+ reset_stp_categorisation == o.reset_stp_categorisation
125
+ end
126
+
127
+ # @see the `==` method
128
+ # @param [Object] Object to be compared
129
+ def eql?(o)
130
+ self == o
131
+ end
132
+
133
+ # Calculates hash code according to all attributes.
134
+ # @return [Integer] Hash code
135
+ def hash
136
+ [leave_type_id, amount, sgc_applied_leave_loading_amount, sgc_exempted_leave_loading_amount, reset_stp_categorisation].hash
137
+ end
138
+
139
+ # Builds the object from hash
140
+ # @param [Hash] attributes Model attributes in the form of hash
141
+ # @return [Object] Returns the model itself
142
+ def self.build_from_hash(attributes)
143
+ new.build_from_hash(attributes)
144
+ end
145
+
146
+ # Builds the object from hash
147
+ # @param [Hash] attributes Model attributes in the form of hash
148
+ # @return [Object] Returns the model itself
149
+ def build_from_hash(attributes)
150
+ return nil unless attributes.is_a?(Hash)
151
+ self.class.openapi_types.each_pair do |key, type|
152
+ if type =~ /\AArray<(.*)>/i
153
+ # check to ensure the input is an array given that the attribute
154
+ # is documented as an array but the input is not
155
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
156
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
157
+ end
158
+ elsif !attributes[self.class.attribute_map[key]].nil?
159
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
160
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
161
+ end
162
+
163
+ self
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def _deserialize(type, value)
171
+ case type.to_sym
172
+ when :DateTime
173
+ DateTime.parse(parse_date(value))
174
+ when :Date
175
+ Date.parse(parse_date(value))
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :BigDecimal
183
+ BigDecimal(value.to_s)
184
+ when :Boolean
185
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
186
+ true
187
+ else
188
+ false
189
+ end
190
+ when :Object
191
+ # generic object (usually a Hash), return directly
192
+ value
193
+ when /\AArray<(?<inner_type>.+)>\z/
194
+ inner_type = Regexp.last_match[:inner_type]
195
+ value.map { |v| _deserialize(inner_type, v) }
196
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
197
+ k_type = Regexp.last_match[:k_type]
198
+ v_type = Regexp.last_match[:v_type]
199
+ {}.tap do |hash|
200
+ value.each do |k, v|
201
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
202
+ end
203
+ end
204
+ else # model
205
+ XeroRuby::PayrollAu.const_get(type).build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash(downcase: false)
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ next if value.nil?
228
+ key = downcase ? attr : param
229
+ hash[key] = _to_hash(value, downcase: downcase)
230
+ end
231
+ hash
232
+ end
233
+
234
+ # Returns the object in the form of hash with snake_case
235
+ def to_attributes
236
+ to_hash(downcase: true)
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value, downcase: false)
244
+ if value.is_a?(Array)
245
+ value.map do |v|
246
+ v.to_hash(downcase: downcase)
247
+ end
248
+ elsif value.is_a?(Hash)
249
+ {}.tap do |hash|
250
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
251
+ end
252
+ elsif value.respond_to? :to_hash
253
+ value.to_hash(downcase: downcase)
254
+ else
255
+ value
256
+ end
257
+ end
258
+
259
+ def parse_date(datestring)
260
+ if datestring.include?('Date')
261
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
262
+ original, date, timezone = *date_pattern.match(datestring)
263
+ date = (date.to_i / 1000)
264
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
265
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
266
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
267
+ else # handle date 'types' for small subset of payroll API's
268
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
269
+ end
270
+ end
271
+ end
272
+ end
@@ -0,0 +1,36 @@
1
+ =begin
2
+ #Xero Payroll AU API
3
+
4
+ #This is the Xero Payroll API for orgs in Australia 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::PayrollAu
16
+ class PayOutType
17
+ DEFAULT ||= "DEFAULT".freeze
18
+ CASHED_OUT ||= "CASHED_OUT".freeze
19
+
20
+ # Builds the enum from string
21
+ # @param [String] The enum value in the form of the string
22
+ # @return [String] The enum value
23
+ def self.build_from_hash(value)
24
+ new.build_from_hash(value)
25
+ end
26
+
27
+ # Builds the enum from string
28
+ # @param [String] The enum value in the form of the string
29
+ # @return [String] The enum value
30
+ def build_from_hash(value)
31
+ constantValues = PayOutType.constants.select { |c| PayOutType::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #PayOutType" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end
@@ -60,6 +60,15 @@ module XeroRuby::PayrollNz
60
60
  # UTC timestamp when the employee was created in Xero
61
61
  attr_accessor :created_date_utc
62
62
 
63
+ # Employee's job title
64
+ attr_accessor :job_title
65
+
66
+ # Engagement type of the employee
67
+ attr_accessor :engagement_type
68
+
69
+ # End date for an employee with a fixed-term engagement type
70
+ attr_accessor :fixed_term_end_date
71
+
63
72
  class EnumAttributeValidator
64
73
  attr_reader :datatype
65
74
  attr_reader :allowable_values
@@ -98,7 +107,10 @@ module XeroRuby::PayrollNz
98
107
  :'end_date' => :'endDate',
99
108
  :'payroll_calendar_id' => :'payrollCalendarID',
100
109
  :'updated_date_utc' => :'updatedDateUTC',
101
- :'created_date_utc' => :'createdDateUTC'
110
+ :'created_date_utc' => :'createdDateUTC',
111
+ :'job_title' => :'jobTitle',
112
+ :'engagement_type' => :'engagementType',
113
+ :'fixed_term_end_date' => :'fixedTermEndDate'
102
114
  }
103
115
  end
104
116
 
@@ -118,7 +130,10 @@ module XeroRuby::PayrollNz
118
130
  :'end_date' => :'Date',
119
131
  :'payroll_calendar_id' => :'String',
120
132
  :'updated_date_utc' => :'DateTime',
121
- :'created_date_utc' => :'DateTime'
133
+ :'created_date_utc' => :'DateTime',
134
+ :'job_title' => :'String',
135
+ :'engagement_type' => :'String',
136
+ :'fixed_term_end_date' => :'Date'
122
137
  }
123
138
  end
124
139
 
@@ -192,6 +207,18 @@ module XeroRuby::PayrollNz
192
207
  if attributes.key?(:'created_date_utc')
193
208
  self.created_date_utc = attributes[:'created_date_utc']
194
209
  end
210
+
211
+ if attributes.key?(:'job_title')
212
+ self.job_title = attributes[:'job_title']
213
+ end
214
+
215
+ if attributes.key?(:'engagement_type')
216
+ self.engagement_type = attributes[:'engagement_type']
217
+ end
218
+
219
+ if attributes.key?(:'fixed_term_end_date')
220
+ self.fixed_term_end_date = attributes[:'fixed_term_end_date']
221
+ end
195
222
  end
196
223
 
197
224
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -237,7 +264,10 @@ module XeroRuby::PayrollNz
237
264
  end_date == o.end_date &&
238
265
  payroll_calendar_id == o.payroll_calendar_id &&
239
266
  updated_date_utc == o.updated_date_utc &&
240
- created_date_utc == o.created_date_utc
267
+ created_date_utc == o.created_date_utc &&
268
+ job_title == o.job_title &&
269
+ engagement_type == o.engagement_type &&
270
+ fixed_term_end_date == o.fixed_term_end_date
241
271
  end
242
272
 
243
273
  # @see the `==` method
@@ -249,7 +279,7 @@ module XeroRuby::PayrollNz
249
279
  # Calculates hash code according to all attributes.
250
280
  # @return [Integer] Hash code
251
281
  def hash
252
- [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].hash
282
+ [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, job_title, engagement_type, fixed_term_end_date].hash
253
283
  end
254
284
 
255
285
  # Builds the object from hash
@@ -28,15 +28,30 @@ 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
- # Number of hours accrued annually for sick leave. Multiply the number of days they're entitled to by the hours worked per day
31
+ # Deprecated use SickLeaveToAccrueAnnually
32
32
  attr_accessor :sick_leave_hours_to_accrue_annually
33
33
 
34
- # Maximum number of hours accrued annually for sick leave. Multiply the maximum days they can accrue by the hours worked per day
34
+ # Deprecated use SickLeaveMaximumToAccrue
35
35
  attr_accessor :sick_leave_maximum_hours_to_accrue
36
36
 
37
+ # 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
+ attr_accessor :sick_leave_to_accrue_annually
39
+
40
+ # Maximum number of units accrued annually for sick leave. The type of units is determined by the property \"TypeOfUnitsToAccrue\" on the \"Sick Leave\" leave type
41
+ attr_accessor :sick_leave_maximum_to_accrue
42
+
37
43
  # Initial sick leave balance. This will be positive unless they've taken sick leave in advance
38
44
  attr_accessor :sick_leave_opening_balance
39
45
 
46
+ # Set Schedule of Accrual Type for Sick Leave
47
+ attr_accessor :sick_leave_schedule_of_accrual
48
+
49
+ # If Sick Leave Schedule of Accrual is \"OnAnniversaryDate\", this is the date when entitled to Sick Leave. When null the Employee's start date is used as the anniversary date
50
+ attr_accessor :sick_leave_anniversary_date
51
+
52
+ # The first date the employee will accrue Annual Leave. When null the Employee's start date is used as the anniversary date
53
+ attr_accessor :annual_leave_anniversary_date
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::PayrollNz
46
61
  :'negative_annual_leave_balance_paid_amount' => :'negativeAnnualLeaveBalancePaidAmount',
47
62
  :'sick_leave_hours_to_accrue_annually' => :'sickLeaveHoursToAccrueAnnually',
48
63
  :'sick_leave_maximum_hours_to_accrue' => :'sickLeaveMaximumHoursToAccrue',
49
- :'sick_leave_opening_balance' => :'sickLeaveOpeningBalance'
64
+ :'sick_leave_to_accrue_annually' => :'SickLeaveToAccrueAnnually',
65
+ :'sick_leave_maximum_to_accrue' => :'SickLeaveMaximumToAccrue',
66
+ :'sick_leave_opening_balance' => :'sickLeaveOpeningBalance',
67
+ :'sick_leave_schedule_of_accrual' => :'SickLeaveScheduleOfAccrual',
68
+ :'sick_leave_anniversary_date' => :'SickLeaveAnniversaryDate',
69
+ :'annual_leave_anniversary_date' => :'AnnualLeaveAnniversaryDate'
50
70
  }
51
71
  end
52
72
 
@@ -59,7 +79,12 @@ module XeroRuby::PayrollNz
59
79
  :'negative_annual_leave_balance_paid_amount' => :'BigDecimal',
60
80
  :'sick_leave_hours_to_accrue_annually' => :'BigDecimal',
61
81
  :'sick_leave_maximum_hours_to_accrue' => :'BigDecimal',
62
- :'sick_leave_opening_balance' => :'BigDecimal'
82
+ :'sick_leave_to_accrue_annually' => :'BigDecimal',
83
+ :'sick_leave_maximum_to_accrue' => :'BigDecimal',
84
+ :'sick_leave_opening_balance' => :'BigDecimal',
85
+ :'sick_leave_schedule_of_accrual' => :'String',
86
+ :'sick_leave_anniversary_date' => :'Date',
87
+ :'annual_leave_anniversary_date' => :'Date'
63
88
  }
64
89
  end
65
90
 
@@ -102,9 +127,29 @@ module XeroRuby::PayrollNz
102
127
  self.sick_leave_maximum_hours_to_accrue = attributes[:'sick_leave_maximum_hours_to_accrue']
103
128
  end
104
129
 
130
+ if attributes.key?(:'sick_leave_to_accrue_annually')
131
+ self.sick_leave_to_accrue_annually = attributes[:'sick_leave_to_accrue_annually']
132
+ end
133
+
134
+ if attributes.key?(:'sick_leave_maximum_to_accrue')
135
+ self.sick_leave_maximum_to_accrue = attributes[:'sick_leave_maximum_to_accrue']
136
+ end
137
+
105
138
  if attributes.key?(:'sick_leave_opening_balance')
106
139
  self.sick_leave_opening_balance = attributes[:'sick_leave_opening_balance']
107
140
  end
141
+
142
+ if attributes.key?(:'sick_leave_schedule_of_accrual')
143
+ self.sick_leave_schedule_of_accrual = attributes[:'sick_leave_schedule_of_accrual']
144
+ end
145
+
146
+ if attributes.key?(:'sick_leave_anniversary_date')
147
+ self.sick_leave_anniversary_date = attributes[:'sick_leave_anniversary_date']
148
+ end
149
+
150
+ if attributes.key?(:'annual_leave_anniversary_date')
151
+ self.annual_leave_anniversary_date = attributes[:'annual_leave_anniversary_date']
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::PayrollNz
131
176
  negative_annual_leave_balance_paid_amount == o.negative_annual_leave_balance_paid_amount &&
132
177
  sick_leave_hours_to_accrue_annually == o.sick_leave_hours_to_accrue_annually &&
133
178
  sick_leave_maximum_hours_to_accrue == o.sick_leave_maximum_hours_to_accrue &&
134
- sick_leave_opening_balance == o.sick_leave_opening_balance
179
+ sick_leave_to_accrue_annually == o.sick_leave_to_accrue_annually &&
180
+ sick_leave_maximum_to_accrue == o.sick_leave_maximum_to_accrue &&
181
+ sick_leave_opening_balance == o.sick_leave_opening_balance &&
182
+ sick_leave_schedule_of_accrual == o.sick_leave_schedule_of_accrual &&
183
+ sick_leave_anniversary_date == o.sick_leave_anniversary_date &&
184
+ annual_leave_anniversary_date == o.annual_leave_anniversary_date
135
185
  end
136
186
 
137
187
  # @see the `==` method
@@ -143,7 +193,7 @@ module XeroRuby::PayrollNz
143
193
  # Calculates hash code according to all attributes.
144
194
  # @return [Integer] Hash code
145
195
  def hash
146
- [include_holiday_pay, holiday_pay_opening_balance, annual_leave_opening_balance, negative_annual_leave_balance_paid_amount, sick_leave_hours_to_accrue_annually, sick_leave_maximum_hours_to_accrue, sick_leave_opening_balance].hash
196
+ [include_holiday_pay, holiday_pay_opening_balance, annual_leave_opening_balance, negative_annual_leave_balance_paid_amount, sick_leave_hours_to_accrue_annually, sick_leave_maximum_hours_to_accrue, 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
147
197
  end
148
198
 
149
199
  # Builds the object from hash