xero-ruby 3.11.0 → 3.16.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/lib/xero-ruby/api/accounting_api.rb +84 -9
  4. data/lib/xero-ruby/api/app_store_api.rb +238 -0
  5. data/lib/xero-ruby/api/project_api.rb +7 -7
  6. data/lib/xero-ruby/api_client.rb +7 -1
  7. data/lib/xero-ruby/models/accounting/account.rb +1 -1
  8. data/lib/xero-ruby/models/accounting/batch_payment.rb +2 -2
  9. data/lib/xero-ruby/models/accounting/journal_line.rb +1 -1
  10. data/lib/xero-ruby/models/accounting/line_item.rb +2 -2
  11. data/lib/xero-ruby/models/accounting/organisation.rb +3 -2
  12. data/lib/xero-ruby/models/accounting/payment.rb +11 -1
  13. data/lib/xero-ruby/models/accounting/tax_rate.rb +12 -2
  14. data/lib/xero-ruby/models/accounting/tax_type.rb +15 -0
  15. data/lib/xero-ruby/models/accounting/time_zone.rb +123 -91
  16. data/lib/xero-ruby/models/app_store/create_usage_record.rb +243 -0
  17. data/lib/xero-ruby/models/app_store/update_usage_record.rb +228 -0
  18. data/lib/xero-ruby/models/app_store/usage_record.rb +332 -0
  19. data/lib/xero-ruby/models/app_store/usage_records_list.rb +230 -0
  20. data/lib/xero-ruby/models/payroll_au/country_of_residence.rb +285 -0
  21. data/lib/xero-ruby/models/payroll_au/employee.rb +42 -2
  22. data/lib/xero-ruby/models/payroll_au/employment_basis.rb +1 -0
  23. data/lib/xero-ruby/models/payroll_au/employment_type.rb +36 -0
  24. data/lib/xero-ruby/models/payroll_au/income_type.rb +39 -0
  25. data/lib/xero-ruby/models/payroll_au/leave_category_code.rb +46 -0
  26. data/lib/xero-ruby/models/payroll_au/leave_type.rb +24 -4
  27. data/lib/xero-ruby/models/payroll_au/senior_marital_status.rb +37 -0
  28. data/lib/xero-ruby/models/payroll_au/settings.rb +14 -4
  29. data/lib/xero-ruby/models/payroll_au/tax_declaration.rb +41 -1
  30. data/lib/xero-ruby/models/payroll_au/tax_scale_type.rb +40 -0
  31. data/lib/xero-ruby/models/payroll_au/work_condition.rb +37 -0
  32. data/lib/xero-ruby/version.rb +2 -2
  33. data/lib/xero-ruby/where.rb +2 -0
  34. data/lib/xero-ruby.rb +11 -0
  35. metadata +13 -2
@@ -0,0 +1,230 @@
1
+ =begin
2
+ #Xero AppStore API
3
+
4
+ #These endpoints are for Xero Partners to interact with the App Store Billing platform
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::AppStore
16
+ # Response to get usage record
17
+ require 'bigdecimal'
18
+
19
+ class UsageRecordsList
20
+ # A collection of usage records
21
+ attr_accessor :usage_records
22
+
23
+ # Attribute mapping from ruby-style variable name to JSON key.
24
+ def self.attribute_map
25
+ {
26
+ :'usage_records' => :'usageRecords'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.openapi_types
32
+ {
33
+ :'usage_records' => :'Array<UsageRecord>'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ if (!attributes.is_a?(Hash))
41
+ fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::AppStore::UsageRecordsList` initialize method"
42
+ end
43
+
44
+ # check to see if the attribute exists and convert string to symbol for hash key
45
+ attributes = attributes.each_with_object({}) { |(k, v), h|
46
+ if (!self.class.attribute_map.key?(k.to_sym))
47
+ fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::AppStore::UsageRecordsList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
48
+ end
49
+ h[k.to_sym] = v
50
+ }
51
+
52
+ if attributes.key?(:'usage_records')
53
+ if (value = attributes[:'usage_records']).is_a?(Array)
54
+ self.usage_records = value
55
+ end
56
+ end
57
+ end
58
+
59
+ # Show invalid properties with the reasons. Usually used together with valid?
60
+ # @return Array for valid properties with the reasons
61
+ def list_invalid_properties
62
+ invalid_properties = Array.new
63
+ if @usage_records.nil?
64
+ invalid_properties.push('invalid value for "usage_records", usage_records cannot be nil.')
65
+ end
66
+
67
+ invalid_properties
68
+ end
69
+
70
+ # Check to see if the all the properties in the model are valid
71
+ # @return true if the model is valid
72
+ def valid?
73
+ return false if @usage_records.nil?
74
+ true
75
+ end
76
+
77
+ # Checks equality by comparing each attribute.
78
+ # @param [Object] Object to be compared
79
+ def ==(o)
80
+ return true if self.equal?(o)
81
+ self.class == o.class &&
82
+ usage_records == o.usage_records
83
+ end
84
+
85
+ # @see the `==` method
86
+ # @param [Object] Object to be compared
87
+ def eql?(o)
88
+ self == o
89
+ end
90
+
91
+ # Calculates hash code according to all attributes.
92
+ # @return [Integer] Hash code
93
+ def hash
94
+ [usage_records].hash
95
+ end
96
+
97
+ # Builds the object from hash
98
+ # @param [Hash] attributes Model attributes in the form of hash
99
+ # @return [Object] Returns the model itself
100
+ def self.build_from_hash(attributes)
101
+ new.build_from_hash(attributes)
102
+ end
103
+
104
+ # Builds the object from hash
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ # @return [Object] Returns the model itself
107
+ def build_from_hash(attributes)
108
+ return nil unless attributes.is_a?(Hash)
109
+ self.class.openapi_types.each_pair do |key, type|
110
+ if type =~ /\AArray<(.*)>/i
111
+ # check to ensure the input is an array given that the attribute
112
+ # is documented as an array but the input is not
113
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
114
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
115
+ end
116
+ elsif !attributes[self.class.attribute_map[key]].nil?
117
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
118
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
119
+ end
120
+
121
+ self
122
+ end
123
+
124
+ # Deserializes the data based on type
125
+ # @param string type Data type
126
+ # @param string value Value to be deserialized
127
+ # @return [Object] Deserialized data
128
+ def _deserialize(type, value)
129
+ case type.to_sym
130
+ when :DateTime
131
+ DateTime.parse(parse_date(value))
132
+ when :Date
133
+ Date.parse(parse_date(value))
134
+ when :String
135
+ value.to_s
136
+ when :Integer
137
+ value.to_i
138
+ when :Float
139
+ value.to_f
140
+ when :BigDecimal
141
+ BigDecimal(value.to_s)
142
+ when :Boolean
143
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
144
+ true
145
+ else
146
+ false
147
+ end
148
+ when :Object
149
+ # generic object (usually a Hash), return directly
150
+ value
151
+ when /\AArray<(?<inner_type>.+)>\z/
152
+ inner_type = Regexp.last_match[:inner_type]
153
+ value.map { |v| _deserialize(inner_type, v) }
154
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
155
+ k_type = Regexp.last_match[:k_type]
156
+ v_type = Regexp.last_match[:v_type]
157
+ {}.tap do |hash|
158
+ value.each do |k, v|
159
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
160
+ end
161
+ end
162
+ else # model
163
+ XeroRuby::AppStore.const_get(type).build_from_hash(value)
164
+ end
165
+ end
166
+
167
+ # Returns the string representation of the object
168
+ # @return [String] String presentation of the object
169
+ def to_s
170
+ to_hash.to_s
171
+ end
172
+
173
+ # to_body is an alias to to_hash (backward compatibility)
174
+ # @return [Hash] Returns the object in the form of hash
175
+ def to_body
176
+ to_hash
177
+ end
178
+
179
+ # Returns the object in the form of hash
180
+ # @return [Hash] Returns the object in the form of hash
181
+ def to_hash(downcase: false)
182
+ hash = {}
183
+ self.class.attribute_map.each_pair do |attr, param|
184
+ value = self.send(attr)
185
+ next if value.nil?
186
+ key = downcase ? attr : param
187
+ hash[key] = _to_hash(value, downcase: downcase)
188
+ end
189
+ hash
190
+ end
191
+
192
+ # Returns the object in the form of hash with snake_case
193
+ def to_attributes
194
+ to_hash(downcase: true)
195
+ end
196
+
197
+ # Outputs non-array value in the form of hash
198
+ # For object, use to_hash. Otherwise, just return the value
199
+ # @param [Object] value Any valid value
200
+ # @return [Hash] Returns the value in the form of hash
201
+ def _to_hash(value, downcase: false)
202
+ if value.is_a?(Array)
203
+ value.map do |v|
204
+ v.to_hash(downcase: downcase)
205
+ end
206
+ elsif value.is_a?(Hash)
207
+ {}.tap do |hash|
208
+ value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
209
+ end
210
+ elsif value.respond_to? :to_hash
211
+ value.to_hash(downcase: downcase)
212
+ else
213
+ value
214
+ end
215
+ end
216
+
217
+ def parse_date(datestring)
218
+ if datestring.include?('Date')
219
+ date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
220
+ original, date, timezone = *date_pattern.match(datestring)
221
+ date = (date.to_i / 1000)
222
+ Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
223
+ elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
224
+ Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
225
+ else # handle date 'types' for small subset of payroll API's
226
+ Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
227
+ end
228
+ end
229
+ end
230
+ end
@@ -0,0 +1,285 @@
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 CountryOfResidence
17
+ AF ||= "AF".freeze
18
+ AX ||= "AX".freeze
19
+ AL ||= "AL".freeze
20
+ DZ ||= "DZ".freeze
21
+ AS ||= "AS".freeze
22
+ AD ||= "AD".freeze
23
+ AO ||= "AO".freeze
24
+ AI ||= "AI".freeze
25
+ AQ ||= "AQ".freeze
26
+ AG ||= "AG".freeze
27
+ AR ||= "AR".freeze
28
+ AM ||= "AM".freeze
29
+ AW ||= "AW".freeze
30
+ AU ||= "AU".freeze
31
+ AT ||= "AT".freeze
32
+ AZ ||= "AZ".freeze
33
+ BS ||= "BS".freeze
34
+ BH ||= "BH".freeze
35
+ BD ||= "BD".freeze
36
+ BB ||= "BB".freeze
37
+ BY ||= "BY".freeze
38
+ BE ||= "BE".freeze
39
+ BZ ||= "BZ".freeze
40
+ BJ ||= "BJ".freeze
41
+ BM ||= "BM".freeze
42
+ BT ||= "BT".freeze
43
+ BO ||= "BO".freeze
44
+ BA ||= "BA".freeze
45
+ BW ||= "BW".freeze
46
+ BV ||= "BV".freeze
47
+ BR ||= "BR".freeze
48
+ IO ||= "IO".freeze
49
+ BN ||= "BN".freeze
50
+ BG ||= "BG".freeze
51
+ BF ||= "BF".freeze
52
+ BI ||= "BI".freeze
53
+ KH ||= "KH".freeze
54
+ CM ||= "CM".freeze
55
+ CA ||= "CA".freeze
56
+ CV ||= "CV".freeze
57
+ KY ||= "KY".freeze
58
+ CF ||= "CF".freeze
59
+ TD ||= "TD".freeze
60
+ CL ||= "CL".freeze
61
+ CN ||= "CN".freeze
62
+ CX ||= "CX".freeze
63
+ CC ||= "CC".freeze
64
+ CO ||= "CO".freeze
65
+ KM ||= "KM".freeze
66
+ CG ||= "CG".freeze
67
+ CD ||= "CD".freeze
68
+ CK ||= "CK".freeze
69
+ CR ||= "CR".freeze
70
+ CI ||= "CI".freeze
71
+ HR ||= "HR".freeze
72
+ CU ||= "CU".freeze
73
+ CY ||= "CY".freeze
74
+ CZ ||= "CZ".freeze
75
+ DK ||= "DK".freeze
76
+ DJ ||= "DJ".freeze
77
+ DM ||= "DM".freeze
78
+ DO ||= "DO".freeze
79
+ EC ||= "EC".freeze
80
+ EG ||= "EG".freeze
81
+ SV ||= "SV".freeze
82
+ GQ ||= "GQ".freeze
83
+ ER ||= "ER".freeze
84
+ EE ||= "EE".freeze
85
+ ET ||= "ET".freeze
86
+ FK ||= "FK".freeze
87
+ FO ||= "FO".freeze
88
+ FJ ||= "FJ".freeze
89
+ FI ||= "FI".freeze
90
+ FR ||= "FR".freeze
91
+ GF ||= "GF".freeze
92
+ PF ||= "PF".freeze
93
+ TF ||= "TF".freeze
94
+ GA ||= "GA".freeze
95
+ GM ||= "GM".freeze
96
+ GE ||= "GE".freeze
97
+ DE ||= "DE".freeze
98
+ GH ||= "GH".freeze
99
+ GI ||= "GI".freeze
100
+ GR ||= "GR".freeze
101
+ GL ||= "GL".freeze
102
+ GD ||= "GD".freeze
103
+ GP ||= "GP".freeze
104
+ GU ||= "GU".freeze
105
+ GT ||= "GT".freeze
106
+ GG ||= "GG".freeze
107
+ GN ||= "GN".freeze
108
+ GW ||= "GW".freeze
109
+ GY ||= "GY".freeze
110
+ HT ||= "HT".freeze
111
+ HM ||= "HM".freeze
112
+ VA ||= "VA".freeze
113
+ HN ||= "HN".freeze
114
+ HK ||= "HK".freeze
115
+ HU ||= "HU".freeze
116
+ IS ||= "IS".freeze
117
+ IN ||= "IN".freeze
118
+ ID ||= "ID".freeze
119
+ IR ||= "IR".freeze
120
+ IQ ||= "IQ".freeze
121
+ IE ||= "IE".freeze
122
+ IM ||= "IM".freeze
123
+ IL ||= "IL".freeze
124
+ IT ||= "IT".freeze
125
+ JM ||= "JM".freeze
126
+ JP ||= "JP".freeze
127
+ JE ||= "JE".freeze
128
+ JO ||= "JO".freeze
129
+ KZ ||= "KZ".freeze
130
+ KE ||= "KE".freeze
131
+ KI ||= "KI".freeze
132
+ KP ||= "KP".freeze
133
+ KR ||= "KR".freeze
134
+ KW ||= "KW".freeze
135
+ KG ||= "KG".freeze
136
+ LA ||= "LA".freeze
137
+ LV ||= "LV".freeze
138
+ LB ||= "LB".freeze
139
+ LS ||= "LS".freeze
140
+ LR ||= "LR".freeze
141
+ LY ||= "LY".freeze
142
+ LI ||= "LI".freeze
143
+ LT ||= "LT".freeze
144
+ LU ||= "LU".freeze
145
+ MO ||= "MO".freeze
146
+ MK ||= "MK".freeze
147
+ MG ||= "MG".freeze
148
+ MW ||= "MW".freeze
149
+ MY ||= "MY".freeze
150
+ MV ||= "MV".freeze
151
+ ML ||= "ML".freeze
152
+ MT ||= "MT".freeze
153
+ MH ||= "MH".freeze
154
+ MQ ||= "MQ".freeze
155
+ MR ||= "MR".freeze
156
+ MU ||= "MU".freeze
157
+ YT ||= "YT".freeze
158
+ MX ||= "MX".freeze
159
+ FM ||= "FM".freeze
160
+ MD ||= "MD".freeze
161
+ MC ||= "MC".freeze
162
+ MN ||= "MN".freeze
163
+ ME ||= "ME".freeze
164
+ MS ||= "MS".freeze
165
+ MA ||= "MA".freeze
166
+ MZ ||= "MZ".freeze
167
+ MM ||= "MM".freeze
168
+ NA ||= "NA".freeze
169
+ NR ||= "NR".freeze
170
+ NP ||= "NP".freeze
171
+ NL ||= "NL".freeze
172
+ AN ||= "AN".freeze
173
+ NC ||= "NC".freeze
174
+ NZ ||= "NZ".freeze
175
+ NI ||= "NI".freeze
176
+ NE ||= "NE".freeze
177
+ NG ||= "NG".freeze
178
+ NU ||= "NU".freeze
179
+ NF ||= "NF".freeze
180
+ MP ||= "MP".freeze
181
+ NO ||= "NO".freeze
182
+ OM ||= "OM".freeze
183
+ PK ||= "PK".freeze
184
+ PW ||= "PW".freeze
185
+ PS ||= "PS".freeze
186
+ PA ||= "PA".freeze
187
+ PG ||= "PG".freeze
188
+ PY ||= "PY".freeze
189
+ PE ||= "PE".freeze
190
+ PH ||= "PH".freeze
191
+ PN ||= "PN".freeze
192
+ PL ||= "PL".freeze
193
+ PT ||= "PT".freeze
194
+ PR ||= "PR".freeze
195
+ QA ||= "QA".freeze
196
+ RE ||= "RE".freeze
197
+ RO ||= "RO".freeze
198
+ RU ||= "RU".freeze
199
+ RW ||= "RW".freeze
200
+ BL ||= "BL".freeze
201
+ SH ||= "SH".freeze
202
+ KN ||= "KN".freeze
203
+ LC ||= "LC".freeze
204
+ MF ||= "MF".freeze
205
+ PM ||= "PM".freeze
206
+ VC ||= "VC".freeze
207
+ WS ||= "WS".freeze
208
+ SM ||= "SM".freeze
209
+ ST ||= "ST".freeze
210
+ SA ||= "SA".freeze
211
+ SN ||= "SN".freeze
212
+ RS ||= "RS".freeze
213
+ SC ||= "SC".freeze
214
+ SL ||= "SL".freeze
215
+ SG ||= "SG".freeze
216
+ SK ||= "SK".freeze
217
+ SI ||= "SI".freeze
218
+ SB ||= "SB".freeze
219
+ SO ||= "SO".freeze
220
+ ZA ||= "ZA".freeze
221
+ GS ||= "GS".freeze
222
+ ES ||= "ES".freeze
223
+ LK ||= "LK".freeze
224
+ SD ||= "SD".freeze
225
+ SR ||= "SR".freeze
226
+ SJ ||= "SJ".freeze
227
+ SZ ||= "SZ".freeze
228
+ SE ||= "SE".freeze
229
+ CH ||= "CH".freeze
230
+ SY ||= "SY".freeze
231
+ TW ||= "TW".freeze
232
+ TJ ||= "TJ".freeze
233
+ TZ ||= "TZ".freeze
234
+ TH ||= "TH".freeze
235
+ TL ||= "TL".freeze
236
+ TG ||= "TG".freeze
237
+ TK ||= "TK".freeze
238
+ TO ||= "TO".freeze
239
+ TT ||= "TT".freeze
240
+ TN ||= "TN".freeze
241
+ TR ||= "TR".freeze
242
+ TM ||= "TM".freeze
243
+ TC ||= "TC".freeze
244
+ TV ||= "TV".freeze
245
+ UG ||= "UG".freeze
246
+ UA ||= "UA".freeze
247
+ AE ||= "AE".freeze
248
+ GB ||= "GB".freeze
249
+ US ||= "US".freeze
250
+ UM ||= "UM".freeze
251
+ UY ||= "UY".freeze
252
+ UZ ||= "UZ".freeze
253
+ VU ||= "VU".freeze
254
+ VE ||= "VE".freeze
255
+ VN ||= "VN".freeze
256
+ VG ||= "VG".freeze
257
+ VI ||= "VI".freeze
258
+ WF ||= "WF".freeze
259
+ EH ||= "EH".freeze
260
+ YE ||= "YE".freeze
261
+ ZM ||= "ZM".freeze
262
+ ZW ||= "ZW".freeze
263
+ BQ ||= "BQ".freeze
264
+ CW ||= "CW".freeze
265
+ SX ||= "SX".freeze
266
+ SS ||= "SS".freeze
267
+ EMPTY ||= "".freeze
268
+
269
+ # Builds the enum from string
270
+ # @param [String] The enum value in the form of the string
271
+ # @return [String] The enum value
272
+ def self.build_from_hash(value)
273
+ new.build_from_hash(value)
274
+ end
275
+
276
+ # Builds the enum from string
277
+ # @param [String] The enum value in the form of the string
278
+ # @return [String] The enum value
279
+ def build_from_hash(value)
280
+ constantValues = CountryOfResidence.constants.select { |c| CountryOfResidence::const_get(c) == value }
281
+ raise "Invalid ENUM value #{value} for class #CountryOfResidence" if constantValues.empty?
282
+ value
283
+ end
284
+ end
285
+ end
@@ -40,7 +40,7 @@ module XeroRuby::PayrollAu
40
40
  # The email address for the employee
41
41
  attr_accessor :email
42
42
 
43
- # The employee’s gender. See Employee Gender
43
+ # The employee’s gender. See Employee Gender
44
44
  attr_accessor :gender
45
45
  N ||= "N".freeze
46
46
  M ||= "M".freeze
@@ -106,6 +106,18 @@ module XeroRuby::PayrollAu
106
106
  attr_accessor :tax_declaration
107
107
 
108
108
 
109
+ attr_accessor :income_type
110
+
111
+
112
+ attr_accessor :employment_type
113
+
114
+
115
+ attr_accessor :country_of_residence
116
+
117
+ # Indicates if the employee has been updated for STP Phase 2 compliance. Doesn't indicate that the employee is payable.
118
+ attr_accessor :is_stp2_qualified
119
+
120
+
109
121
  attr_accessor :leave_balances
110
122
 
111
123
 
@@ -174,6 +186,10 @@ module XeroRuby::PayrollAu
174
186
  :'pay_template' => :'PayTemplate',
175
187
  :'opening_balances' => :'OpeningBalances',
176
188
  :'tax_declaration' => :'TaxDeclaration',
189
+ :'income_type' => :'IncomeType',
190
+ :'employment_type' => :'EmploymentType',
191
+ :'country_of_residence' => :'CountryOfResidence',
192
+ :'is_stp2_qualified' => :'IsSTP2Qualified',
177
193
  :'leave_balances' => :'LeaveBalances',
178
194
  :'leave_lines' => :'LeaveLines',
179
195
  :'super_memberships' => :'SuperMemberships',
@@ -212,6 +228,10 @@ module XeroRuby::PayrollAu
212
228
  :'pay_template' => :'PayTemplate',
213
229
  :'opening_balances' => :'OpeningBalances',
214
230
  :'tax_declaration' => :'TaxDeclaration',
231
+ :'income_type' => :'IncomeType',
232
+ :'employment_type' => :'EmploymentType',
233
+ :'country_of_residence' => :'CountryOfResidence',
234
+ :'is_stp2_qualified' => :'Boolean',
215
235
  :'leave_balances' => :'Array<LeaveBalance>',
216
236
  :'leave_lines' => :'Array<LeaveLine>',
217
237
  :'super_memberships' => :'Array<SuperMembership>',
@@ -342,6 +362,22 @@ module XeroRuby::PayrollAu
342
362
  self.tax_declaration = attributes[:'tax_declaration']
343
363
  end
344
364
 
365
+ if attributes.key?(:'income_type')
366
+ self.income_type = attributes[:'income_type']
367
+ end
368
+
369
+ if attributes.key?(:'employment_type')
370
+ self.employment_type = attributes[:'employment_type']
371
+ end
372
+
373
+ if attributes.key?(:'country_of_residence')
374
+ self.country_of_residence = attributes[:'country_of_residence']
375
+ end
376
+
377
+ if attributes.key?(:'is_stp2_qualified')
378
+ self.is_stp2_qualified = attributes[:'is_stp2_qualified']
379
+ end
380
+
345
381
  if attributes.key?(:'leave_balances')
346
382
  if (value = attributes[:'leave_balances']).is_a?(Array)
347
383
  self.leave_balances = value
@@ -458,6 +494,10 @@ module XeroRuby::PayrollAu
458
494
  pay_template == o.pay_template &&
459
495
  opening_balances == o.opening_balances &&
460
496
  tax_declaration == o.tax_declaration &&
497
+ income_type == o.income_type &&
498
+ employment_type == o.employment_type &&
499
+ country_of_residence == o.country_of_residence &&
500
+ is_stp2_qualified == o.is_stp2_qualified &&
461
501
  leave_balances == o.leave_balances &&
462
502
  leave_lines == o.leave_lines &&
463
503
  super_memberships == o.super_memberships &&
@@ -475,7 +515,7 @@ module XeroRuby::PayrollAu
475
515
  # Calculates hash code according to all attributes.
476
516
  # @return [Integer] Hash code
477
517
  def hash
478
- [first_name, last_name, date_of_birth, home_address, start_date, title, middle_names, email, gender, phone, mobile, twitter_user_name, is_authorised_to_approve_leave, is_authorised_to_approve_timesheets, job_title, classification, ordinary_earnings_rate_id, payroll_calendar_id, employee_group_name, employee_id, termination_date, termination_reason, bank_accounts, pay_template, opening_balances, tax_declaration, leave_balances, leave_lines, super_memberships, status, updated_date_utc, validation_errors].hash
518
+ [first_name, last_name, date_of_birth, home_address, start_date, title, middle_names, email, gender, phone, mobile, twitter_user_name, is_authorised_to_approve_leave, is_authorised_to_approve_timesheets, job_title, classification, ordinary_earnings_rate_id, payroll_calendar_id, employee_group_name, employee_id, termination_date, termination_reason, bank_accounts, pay_template, opening_balances, tax_declaration, income_type, employment_type, country_of_residence, is_stp2_qualified, leave_balances, leave_lines, super_memberships, status, updated_date_utc, validation_errors].hash
479
519
  end
480
520
 
481
521
  # Builds the object from hash
@@ -19,6 +19,7 @@ module XeroRuby::PayrollAu
19
19
  CASUAL ||= "CASUAL".freeze
20
20
  LABOURHIRE ||= "LABOURHIRE".freeze
21
21
  SUPERINCOMESTREAM ||= "SUPERINCOMESTREAM".freeze
22
+ NONEMPLOYEE ||= "NONEMPLOYEE".freeze
22
23
 
23
24
  # Builds the enum from string
24
25
  # @param [String] The enum value in the form of the string
@@ -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 EmploymentType
17
+ EMPLOYEE ||= "EMPLOYEE".freeze
18
+ CONTRACTOR ||= "CONTRACTOR".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 = EmploymentType.constants.select { |c| EmploymentType::const_get(c) == value }
32
+ raise "Invalid ENUM value #{value} for class #EmploymentType" if constantValues.empty?
33
+ value
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,39 @@
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 IncomeType
17
+ SALARYANDWAGES ||= "SALARYANDWAGES".freeze
18
+ WORKINGHOLIDAYMAKER ||= "WORKINGHOLIDAYMAKER".freeze
19
+ NONEMPLOYEE ||= "NONEMPLOYEE".freeze
20
+ CLOSELYHELDPAYEES ||= "CLOSELYHELDPAYEES".freeze
21
+ LABOURHIRE ||= "LABOURHIRE".freeze
22
+
23
+ # Builds the enum from string
24
+ # @param [String] The enum value in the form of the string
25
+ # @return [String] The enum value
26
+ def self.build_from_hash(value)
27
+ new.build_from_hash(value)
28
+ end
29
+
30
+ # Builds the enum from string
31
+ # @param [String] The enum value in the form of the string
32
+ # @return [String] The enum value
33
+ def build_from_hash(value)
34
+ constantValues = IncomeType.constants.select { |c| IncomeType::const_get(c) == value }
35
+ raise "Invalid ENUM value #{value} for class #IncomeType" if constantValues.empty?
36
+ value
37
+ end
38
+ end
39
+ end