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
@@ -0,0 +1,244 @@
1
+ =begin
2
+ #Xero Payroll NZ
3
+
4
+ #This is the Xero Payroll API for orgs in the NZ 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::PayrollNz
16
+ require 'bigdecimal'
17
+
18
+ class EmployeeWorkingPatternsObject
19
+
20
+ attr_accessor :pagination
21
+
22
+
23
+ attr_accessor :problem
24
+
25
+
26
+ attr_accessor :payee_working_patterns
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'pagination' => :'pagination',
32
+ :'problem' => :'problem',
33
+ :'payee_working_patterns' => :'payeeWorkingPatterns'
34
+ }
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'pagination' => :'Pagination',
41
+ :'problem' => :'Problem',
42
+ :'payee_working_patterns' => :'Array<EmployeeWorkingPattern>'
43
+ }
44
+ end
45
+
46
+ # Initializes the object
47
+ # @param [Hash] attributes Model attributes in the form of hash
48
+ def initialize(attributes = {})
49
+ if (!attributes.is_a?(Hash))
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeWorkingPatternsObject` initialize method"
51
+ end
52
+
53
+ # check to see if the attribute exists and convert string to symbol for hash key
54
+ attributes = attributes.each_with_object({}) { |(k, v), h|
55
+ if (!self.class.attribute_map.key?(k.to_sym))
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeWorkingPatternsObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ end
58
+ h[k.to_sym] = v
59
+ }
60
+
61
+ if attributes.key?(:'pagination')
62
+ self.pagination = attributes[:'pagination']
63
+ end
64
+
65
+ if attributes.key?(:'problem')
66
+ self.problem = attributes[:'problem']
67
+ end
68
+
69
+ if attributes.key?(:'payee_working_patterns')
70
+ if (value = attributes[:'payee_working_patterns']).is_a?(Array)
71
+ self.payee_working_patterns = value
72
+ end
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ invalid_properties = Array.new
80
+ invalid_properties
81
+ end
82
+
83
+ # Check to see if the all the properties in the model are valid
84
+ # @return true if the model is valid
85
+ def valid?
86
+ true
87
+ end
88
+
89
+ # Checks equality by comparing each attribute.
90
+ # @param [Object] Object to be compared
91
+ def ==(o)
92
+ return true if self.equal?(o)
93
+ self.class == o.class &&
94
+ pagination == o.pagination &&
95
+ problem == o.problem &&
96
+ payee_working_patterns == o.payee_working_patterns
97
+ end
98
+
99
+ # @see the `==` method
100
+ # @param [Object] Object to be compared
101
+ def eql?(o)
102
+ self == o
103
+ end
104
+
105
+ # Calculates hash code according to all attributes.
106
+ # @return [Integer] Hash code
107
+ def hash
108
+ [pagination, problem, payee_working_patterns].hash
109
+ end
110
+
111
+ # Builds the object from hash
112
+ # @param [Hash] attributes Model attributes in the form of hash
113
+ # @return [Object] Returns the model itself
114
+ def self.build_from_hash(attributes)
115
+ new.build_from_hash(attributes)
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ self.class.openapi_types.each_pair do |key, type|
124
+ if type =~ /\AArray<(.*)>/i
125
+ # check to ensure the input is an array given that the attribute
126
+ # is documented as an array but the input is not
127
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
128
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
129
+ end
130
+ elsif !attributes[self.class.attribute_map[key]].nil?
131
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
132
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
133
+ end
134
+
135
+ self
136
+ end
137
+
138
+ # Deserializes the data based on type
139
+ # @param string type Data type
140
+ # @param string value Value to be deserialized
141
+ # @return [Object] Deserialized data
142
+ def _deserialize(type, value)
143
+ case type.to_sym
144
+ when :DateTime
145
+ DateTime.parse(parse_date(value))
146
+ when :Date
147
+ Date.parse(parse_date(value))
148
+ when :String
149
+ value.to_s
150
+ when :Integer
151
+ value.to_i
152
+ when :Float
153
+ value.to_f
154
+ when :BigDecimal
155
+ BigDecimal(value.to_s)
156
+ when :Boolean
157
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
158
+ true
159
+ else
160
+ false
161
+ end
162
+ when :Object
163
+ # generic object (usually a Hash), return directly
164
+ value
165
+ when /\AArray<(?<inner_type>.+)>\z/
166
+ inner_type = Regexp.last_match[:inner_type]
167
+ value.map { |v| _deserialize(inner_type, v) }
168
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
169
+ k_type = Regexp.last_match[:k_type]
170
+ v_type = Regexp.last_match[:v_type]
171
+ {}.tap do |hash|
172
+ value.each do |k, v|
173
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
174
+ end
175
+ end
176
+ else # model
177
+ XeroRuby::PayrollNz.const_get(type).build_from_hash(value)
178
+ end
179
+ end
180
+
181
+ # Returns the string representation of the object
182
+ # @return [String] String presentation of the object
183
+ def to_s
184
+ to_hash.to_s
185
+ end
186
+
187
+ # to_body is an alias to to_hash (backward compatibility)
188
+ # @return [Hash] Returns the object in the form of hash
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # Returns the object in the form of hash
194
+ # @return [Hash] Returns the object in the form of hash
195
+ def to_hash(downcase: false)
196
+ hash = {}
197
+ self.class.attribute_map.each_pair do |attr, param|
198
+ value = self.send(attr)
199
+ next if value.nil?
200
+ key = downcase ? attr : param
201
+ hash[key] = _to_hash(value, downcase: downcase)
202
+ end
203
+ hash
204
+ end
205
+
206
+ # Returns the object in the form of hash with snake_case
207
+ def to_attributes
208
+ to_hash(downcase: true)
209
+ end
210
+
211
+ # Outputs non-array value in the form of hash
212
+ # For object, use to_hash. Otherwise, just return the value
213
+ # @param [Object] value Any valid value
214
+ # @return [Hash] Returns the value in the form of hash
215
+ def _to_hash(value, downcase: false)
216
+ if value.is_a?(Array)
217
+ value.map do |v|
218
+ v.to_hash(downcase: downcase)
219
+ end
220
+ elsif value.is_a?(Hash)
221
+ {}.tap do |hash|
222
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
223
+ end
224
+ elsif value.respond_to? :to_hash
225
+ value.to_hash(downcase: downcase)
226
+ else
227
+ value
228
+ end
229
+ end
230
+
231
+ def parse_date(datestring)
232
+ if datestring.include?('Date')
233
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
234
+ original, date, timezone = *date_pattern.match(datestring)
235
+ date = (date.to_i / 1000)
236
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
237
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
238
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
239
+ else # handle date 'types' for small subset of payroll API's
240
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
241
+ end
242
+ end
243
+ end
244
+ end
@@ -25,12 +25,20 @@ module XeroRuby::PayrollNz
25
25
  # Start date of the employment (YYYY-MM-DD)
26
26
  attr_accessor :start_date
27
27
 
28
+ # Engagement type of the employee
29
+ attr_accessor :engagement_type
30
+
31
+ # End date for an employee with a fixed-term engagement type
32
+ attr_accessor :fixed_term_end_date
33
+
28
34
  # Attribute mapping from ruby-style variable name to JSON key.
29
35
  def self.attribute_map
30
36
  {
31
37
  :'payroll_calendar_id' => :'payrollCalendarID',
32
38
  :'pay_run_calendar_id' => :'payRunCalendarID',
33
- :'start_date' => :'startDate'
39
+ :'start_date' => :'startDate',
40
+ :'engagement_type' => :'engagementType',
41
+ :'fixed_term_end_date' => :'fixedTermEndDate'
34
42
  }
35
43
  end
36
44
 
@@ -39,7 +47,9 @@ module XeroRuby::PayrollNz
39
47
  {
40
48
  :'payroll_calendar_id' => :'String',
41
49
  :'pay_run_calendar_id' => :'String',
42
- :'start_date' => :'Date'
50
+ :'start_date' => :'Date',
51
+ :'engagement_type' => :'String',
52
+ :'fixed_term_end_date' => :'Date'
43
53
  }
44
54
  end
45
55
 
@@ -69,6 +79,14 @@ module XeroRuby::PayrollNz
69
79
  if attributes.key?(:'start_date')
70
80
  self.start_date = attributes[:'start_date']
71
81
  end
82
+
83
+ if attributes.key?(:'engagement_type')
84
+ self.engagement_type = attributes[:'engagement_type']
85
+ end
86
+
87
+ if attributes.key?(:'fixed_term_end_date')
88
+ self.fixed_term_end_date = attributes[:'fixed_term_end_date']
89
+ end
72
90
  end
73
91
 
74
92
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -91,7 +109,9 @@ module XeroRuby::PayrollNz
91
109
  self.class == o.class &&
92
110
  payroll_calendar_id == o.payroll_calendar_id &&
93
111
  pay_run_calendar_id == o.pay_run_calendar_id &&
94
- start_date == o.start_date
112
+ start_date == o.start_date &&
113
+ engagement_type == o.engagement_type &&
114
+ fixed_term_end_date == o.fixed_term_end_date
95
115
  end
96
116
 
97
117
  # @see the `==` method
@@ -103,7 +123,7 @@ module XeroRuby::PayrollNz
103
123
  # Calculates hash code according to all attributes.
104
124
  # @return [Integer] Hash code
105
125
  def hash
106
- [payroll_calendar_id, pay_run_calendar_id, start_date].hash
126
+ [payroll_calendar_id, pay_run_calendar_id, start_date, engagement_type, fixed_term_end_date].hash
107
127
  end
108
128
 
109
129
  # Builds the object from hash
@@ -25,10 +25,20 @@ module XeroRuby::PayrollNz
25
25
  # The Number of Units for the leave
26
26
  attr_accessor :number_of_units
27
27
 
28
- # Period Status
28
+ # The number of units taken for the leave
29
+ attr_accessor :number_of_units_taken
30
+
31
+ # The type of units paid for the leave
32
+ attr_accessor :type_of_units
33
+
34
+ # The type of units taken for the leave
35
+ attr_accessor :type_of_units_taken
36
+
37
+ # Status of leave
29
38
  attr_accessor :period_status
30
39
  APPROVED ||= "Approved".freeze
31
40
  COMPLETED ||= "Completed".freeze
41
+ ESTIMATED ||= "Estimated".freeze
32
42
 
33
43
  class EnumAttributeValidator
34
44
  attr_reader :datatype
@@ -58,6 +68,9 @@ module XeroRuby::PayrollNz
58
68
  :'period_start_date' => :'periodStartDate',
59
69
  :'period_end_date' => :'periodEndDate',
60
70
  :'number_of_units' => :'numberOfUnits',
71
+ :'number_of_units_taken' => :'numberOfUnitsTaken',
72
+ :'type_of_units' => :'typeOfUnits',
73
+ :'type_of_units_taken' => :'typeOfUnitsTaken',
61
74
  :'period_status' => :'periodStatus'
62
75
  }
63
76
  end
@@ -68,6 +81,9 @@ module XeroRuby::PayrollNz
68
81
  :'period_start_date' => :'Date',
69
82
  :'period_end_date' => :'Date',
70
83
  :'number_of_units' => :'BigDecimal',
84
+ :'number_of_units_taken' => :'Float',
85
+ :'type_of_units' => :'String',
86
+ :'type_of_units_taken' => :'String',
71
87
  :'period_status' => :'String'
72
88
  }
73
89
  end
@@ -99,6 +115,18 @@ module XeroRuby::PayrollNz
99
115
  self.number_of_units = attributes[:'number_of_units']
100
116
  end
101
117
 
118
+ if attributes.key?(:'number_of_units_taken')
119
+ self.number_of_units_taken = attributes[:'number_of_units_taken']
120
+ end
121
+
122
+ if attributes.key?(:'type_of_units')
123
+ self.type_of_units = attributes[:'type_of_units']
124
+ end
125
+
126
+ if attributes.key?(:'type_of_units_taken')
127
+ self.type_of_units_taken = attributes[:'type_of_units_taken']
128
+ end
129
+
102
130
  if attributes.key?(:'period_status')
103
131
  self.period_status = attributes[:'period_status']
104
132
  end
@@ -114,7 +142,7 @@ module XeroRuby::PayrollNz
114
142
  # Check to see if the all the properties in the model are valid
115
143
  # @return true if the model is valid
116
144
  def valid?
117
- period_status_validator = EnumAttributeValidator.new('String', ["Approved", "Completed"])
145
+ period_status_validator = EnumAttributeValidator.new('String', ["Approved", "Completed", "Estimated"])
118
146
  return false unless period_status_validator.valid?(@period_status)
119
147
  true
120
148
  end
@@ -122,7 +150,7 @@ module XeroRuby::PayrollNz
122
150
  # Custom attribute writer method checking allowed values (enum).
123
151
  # @param [Object] period_status Object to be assigned
124
152
  def period_status=(period_status)
125
- validator = EnumAttributeValidator.new('String', ["Approved", "Completed"])
153
+ validator = EnumAttributeValidator.new('String', ["Approved", "Completed", "Estimated"])
126
154
  unless validator.valid?(period_status)
127
155
  fail ArgumentError, "invalid value for \"period_status\", must be one of #{validator.allowable_values}."
128
156
  end
@@ -137,6 +165,9 @@ module XeroRuby::PayrollNz
137
165
  period_start_date == o.period_start_date &&
138
166
  period_end_date == o.period_end_date &&
139
167
  number_of_units == o.number_of_units &&
168
+ number_of_units_taken == o.number_of_units_taken &&
169
+ type_of_units == o.type_of_units &&
170
+ type_of_units_taken == o.type_of_units_taken &&
140
171
  period_status == o.period_status
141
172
  end
142
173
 
@@ -149,7 +180,7 @@ module XeroRuby::PayrollNz
149
180
  # Calculates hash code according to all attributes.
150
181
  # @return [Integer] Hash code
151
182
  def hash
152
- [period_start_date, period_end_date, number_of_units, period_status].hash
183
+ [period_start_date, period_end_date, number_of_units, number_of_units_taken, type_of_units, type_of_units_taken, period_status].hash
153
184
  end
154
185
 
155
186
  # Builds the object from hash
@@ -34,6 +34,12 @@ module XeroRuby::PayrollNz
34
34
  # Shows whether the leave type is active or not
35
35
  attr_accessor :is_active
36
36
 
37
+ # The type of units to be paid for the leave type
38
+ attr_accessor :type_of_units
39
+
40
+ # The type of units to be accrued for the leave type
41
+ attr_accessor :type_of_units_to_accrue
42
+
37
43
  # Attribute mapping from ruby-style variable name to JSON key.
38
44
  def self.attribute_map
39
45
  {
@@ -42,7 +48,9 @@ module XeroRuby::PayrollNz
42
48
  :'is_paid_leave' => :'isPaidLeave',
43
49
  :'show_on_payslip' => :'showOnPayslip',
44
50
  :'updated_date_utc' => :'updatedDateUTC',
45
- :'is_active' => :'isActive'
51
+ :'is_active' => :'isActive',
52
+ :'type_of_units' => :'typeOfUnits',
53
+ :'type_of_units_to_accrue' => :'typeOfUnitsToAccrue'
46
54
  }
47
55
  end
48
56
 
@@ -54,7 +62,9 @@ module XeroRuby::PayrollNz
54
62
  :'is_paid_leave' => :'Boolean',
55
63
  :'show_on_payslip' => :'Boolean',
56
64
  :'updated_date_utc' => :'DateTime',
57
- :'is_active' => :'Boolean'
65
+ :'is_active' => :'Boolean',
66
+ :'type_of_units' => :'String',
67
+ :'type_of_units_to_accrue' => :'String'
58
68
  }
59
69
  end
60
70
 
@@ -96,6 +106,14 @@ module XeroRuby::PayrollNz
96
106
  if attributes.key?(:'is_active')
97
107
  self.is_active = attributes[:'is_active']
98
108
  end
109
+
110
+ if attributes.key?(:'type_of_units')
111
+ self.type_of_units = attributes[:'type_of_units']
112
+ end
113
+
114
+ if attributes.key?(:'type_of_units_to_accrue')
115
+ self.type_of_units_to_accrue = attributes[:'type_of_units_to_accrue']
116
+ end
99
117
  end
100
118
 
101
119
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -136,7 +154,9 @@ module XeroRuby::PayrollNz
136
154
  is_paid_leave == o.is_paid_leave &&
137
155
  show_on_payslip == o.show_on_payslip &&
138
156
  updated_date_utc == o.updated_date_utc &&
139
- is_active == o.is_active
157
+ is_active == o.is_active &&
158
+ type_of_units == o.type_of_units &&
159
+ type_of_units_to_accrue == o.type_of_units_to_accrue
140
160
  end
141
161
 
142
162
  # @see the `==` method
@@ -148,7 +168,7 @@ module XeroRuby::PayrollNz
148
168
  # Calculates hash code according to all attributes.
149
169
  # @return [Integer] Hash code
150
170
  def hash
151
- [leave_type_id, name, is_paid_leave, show_on_payslip, updated_date_utc, is_active].hash
171
+ [leave_type_id, name, is_paid_leave, show_on_payslip, updated_date_utc, is_active, type_of_units, type_of_units_to_accrue].hash
152
172
  end
153
173
 
154
174
  # Builds the object from hash
@@ -51,6 +51,11 @@ module XeroRuby::PayrollNz
51
51
  SALARY ||= "Salary".freeze
52
52
  HOURLY ||= "Hourly".freeze
53
53
 
54
+ # The type of the Working Pattern of the corresponding salary and wages
55
+ attr_accessor :work_pattern_type
56
+ DAYS_AND_HOURS ||= "DaysAndHours".freeze
57
+ REGULAR_WEEK ||= "RegularWeek".freeze
58
+
54
59
  class EnumAttributeValidator
55
60
  attr_reader :datatype
56
61
  attr_reader :allowable_values
@@ -85,7 +90,8 @@ module XeroRuby::PayrollNz
85
90
  :'effective_from' => :'effectiveFrom',
86
91
  :'annual_salary' => :'annualSalary',
87
92
  :'status' => :'status',
88
- :'payment_type' => :'paymentType'
93
+ :'payment_type' => :'paymentType',
94
+ :'work_pattern_type' => :'workPatternType'
89
95
  }
90
96
  end
91
97
 
@@ -101,7 +107,8 @@ module XeroRuby::PayrollNz
101
107
  :'effective_from' => :'Date',
102
108
  :'annual_salary' => :'BigDecimal',
103
109
  :'status' => :'String',
104
- :'payment_type' => :'String'
110
+ :'payment_type' => :'String',
111
+ :'work_pattern_type' => :'String'
105
112
  }
106
113
  end
107
114
 
@@ -159,6 +166,10 @@ module XeroRuby::PayrollNz
159
166
  if attributes.key?(:'payment_type')
160
167
  self.payment_type = attributes[:'payment_type']
161
168
  end
169
+
170
+ if attributes.key?(:'work_pattern_type')
171
+ self.work_pattern_type = attributes[:'work_pattern_type']
172
+ end
162
173
  end
163
174
 
164
175
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -210,6 +221,8 @@ module XeroRuby::PayrollNz
210
221
  return false if @payment_type.nil?
211
222
  payment_type_validator = EnumAttributeValidator.new('String', ["Salary", "Hourly"])
212
223
  return false unless payment_type_validator.valid?(@payment_type)
224
+ work_pattern_type_validator = EnumAttributeValidator.new('String', ["DaysAndHours", "RegularWeek"])
225
+ return false unless work_pattern_type_validator.valid?(@work_pattern_type)
213
226
  true
214
227
  end
215
228
 
@@ -233,6 +246,16 @@ module XeroRuby::PayrollNz
233
246
  @payment_type = payment_type
234
247
  end
235
248
 
249
+ # Custom attribute writer method checking allowed values (enum).
250
+ # @param [Object] work_pattern_type Object to be assigned
251
+ def work_pattern_type=(work_pattern_type)
252
+ validator = EnumAttributeValidator.new('String', ["DaysAndHours", "RegularWeek"])
253
+ unless validator.valid?(work_pattern_type)
254
+ fail ArgumentError, "invalid value for \"work_pattern_type\", must be one of #{validator.allowable_values}."
255
+ end
256
+ @work_pattern_type = work_pattern_type
257
+ end
258
+
236
259
  # Checks equality by comparing each attribute.
237
260
  # @param [Object] Object to be compared
238
261
  def ==(o)
@@ -247,7 +270,8 @@ module XeroRuby::PayrollNz
247
270
  effective_from == o.effective_from &&
248
271
  annual_salary == o.annual_salary &&
249
272
  status == o.status &&
250
- payment_type == o.payment_type
273
+ payment_type == o.payment_type &&
274
+ work_pattern_type == o.work_pattern_type
251
275
  end
252
276
 
253
277
  # @see the `==` method
@@ -259,7 +283,7 @@ module XeroRuby::PayrollNz
259
283
  # Calculates hash code according to all attributes.
260
284
  # @return [Integer] Hash code
261
285
  def hash
262
- [salary_and_wages_id, earnings_rate_id, number_of_units_per_week, rate_per_unit, number_of_units_per_day, days_per_week, effective_from, annual_salary, status, payment_type].hash
286
+ [salary_and_wages_id, earnings_rate_id, number_of_units_per_week, rate_per_unit, number_of_units_per_day, days_per_week, effective_from, annual_salary, status, payment_type, work_pattern_type].hash
263
287
  end
264
288
 
265
289
  # Builds the object from hash