xero-ruby 8.0.0 → 9.1.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 +36 -27
- data/lib/xero-ruby/api/payroll_nz_api.rb +330 -7
- data/lib/xero-ruby/models/accounting/bank_transactions.rb +23 -1
- data/lib/xero-ruby/models/accounting/contacts.rb +23 -1
- data/lib/xero-ruby/models/accounting/credit_notes.rb +23 -1
- data/lib/xero-ruby/models/accounting/invoices.rb +23 -1
- data/lib/xero-ruby/models/accounting/journals.rb +13 -1
- data/lib/xero-ruby/models/accounting/manual_journals.rb +23 -1
- data/lib/xero-ruby/models/accounting/organisation.rb +6 -2
- data/lib/xero-ruby/models/accounting/overpayments.rb +23 -1
- data/lib/xero-ruby/models/accounting/{page_info.rb → pagination.rb} +18 -19
- data/lib/xero-ruby/models/accounting/payments.rb +23 -1
- data/lib/xero-ruby/models/accounting/prepayments.rb +23 -1
- data/lib/xero-ruby/models/accounting/purchase_orders.rb +23 -1
- data/lib/xero-ruby/models/payroll_nz/employee.rb +24 -4
- data/lib/xero-ruby/models/payroll_nz/employee_leave_setup.rb +24 -4
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +14 -4
- data/lib/xero-ruby/models/payroll_nz/employee_working_pattern.rb +242 -0
- data/lib/xero-ruby/models/{accounting/get_payments_response.rb → payroll_nz/employee_working_pattern_with_working_weeks.rb} +39 -59
- data/lib/xero-ruby/models/payroll_nz/employee_working_pattern_with_working_weeks_object.rb +242 -0
- data/lib/xero-ruby/models/{accounting/get_invoices_response.rb → payroll_nz/employee_working_pattern_with_working_weeks_request.rb} +32 -62
- data/lib/xero-ruby/models/{accounting/get_contacts_response.rb → payroll_nz/employee_working_patterns_object.rb} +27 -57
- data/lib/xero-ruby/models/payroll_nz/employment.rb +24 -4
- data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +28 -4
- data/lib/xero-ruby/models/{accounting/get_manual_journals_response.rb → payroll_nz/working_week.rb} +95 -52
- data/lib/xero-ruby/version.rb +2 -2
- data/lib/xero-ruby.rb +7 -10
- metadata +9 -12
- data/lib/xero-ruby/models/accounting/get_bank_transactions_response.rb +0 -274
- data/lib/xero-ruby/models/accounting/get_credit_notes_response.rb +0 -274
- data/lib/xero-ruby/models/accounting/get_overpayments_response.rb +0 -274
- data/lib/xero-ruby/models/accounting/get_prepayments_response.rb +0 -274
- data/lib/xero-ruby/models/accounting/get_purchase_orders_response.rb +0 -274
@@ -0,0 +1,242 @@
|
|
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 EmployeeWorkingPatternWithWorkingWeeksObject
|
19
|
+
|
20
|
+
attr_accessor :pagination
|
21
|
+
|
22
|
+
|
23
|
+
attr_accessor :problem
|
24
|
+
|
25
|
+
|
26
|
+
attr_accessor :payee_working_pattern
|
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_pattern' => :'payeeWorkingPattern'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'pagination' => :'Pagination',
|
41
|
+
:'problem' => :'Problem',
|
42
|
+
:'payee_working_pattern' => :'EmployeeWorkingPatternWithWorkingWeeks'
|
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::EmployeeWorkingPatternWithWorkingWeeksObject` 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::EmployeeWorkingPatternWithWorkingWeeksObject`. 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_pattern')
|
70
|
+
self.payee_working_pattern = attributes[:'payee_working_pattern']
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
75
|
+
# @return Array for valid properties with the reasons
|
76
|
+
def list_invalid_properties
|
77
|
+
invalid_properties = Array.new
|
78
|
+
invalid_properties
|
79
|
+
end
|
80
|
+
|
81
|
+
# Check to see if the all the properties in the model are valid
|
82
|
+
# @return true if the model is valid
|
83
|
+
def valid?
|
84
|
+
true
|
85
|
+
end
|
86
|
+
|
87
|
+
# Checks equality by comparing each attribute.
|
88
|
+
# @param [Object] Object to be compared
|
89
|
+
def ==(o)
|
90
|
+
return true if self.equal?(o)
|
91
|
+
self.class == o.class &&
|
92
|
+
pagination == o.pagination &&
|
93
|
+
problem == o.problem &&
|
94
|
+
payee_working_pattern == o.payee_working_pattern
|
95
|
+
end
|
96
|
+
|
97
|
+
# @see the `==` method
|
98
|
+
# @param [Object] Object to be compared
|
99
|
+
def eql?(o)
|
100
|
+
self == o
|
101
|
+
end
|
102
|
+
|
103
|
+
# Calculates hash code according to all attributes.
|
104
|
+
# @return [Integer] Hash code
|
105
|
+
def hash
|
106
|
+
[pagination, problem, payee_working_pattern].hash
|
107
|
+
end
|
108
|
+
|
109
|
+
# Builds the object from hash
|
110
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
111
|
+
# @return [Object] Returns the model itself
|
112
|
+
def self.build_from_hash(attributes)
|
113
|
+
new.build_from_hash(attributes)
|
114
|
+
end
|
115
|
+
|
116
|
+
# Builds the object from hash
|
117
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
118
|
+
# @return [Object] Returns the model itself
|
119
|
+
def build_from_hash(attributes)
|
120
|
+
return nil unless attributes.is_a?(Hash)
|
121
|
+
self.class.openapi_types.each_pair do |key, type|
|
122
|
+
if type =~ /\AArray<(.*)>/i
|
123
|
+
# check to ensure the input is an array given that the attribute
|
124
|
+
# is documented as an array but the input is not
|
125
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
126
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
127
|
+
end
|
128
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
129
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
130
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
131
|
+
end
|
132
|
+
|
133
|
+
self
|
134
|
+
end
|
135
|
+
|
136
|
+
# Deserializes the data based on type
|
137
|
+
# @param string type Data type
|
138
|
+
# @param string value Value to be deserialized
|
139
|
+
# @return [Object] Deserialized data
|
140
|
+
def _deserialize(type, value)
|
141
|
+
case type.to_sym
|
142
|
+
when :DateTime
|
143
|
+
DateTime.parse(parse_date(value))
|
144
|
+
when :Date
|
145
|
+
Date.parse(parse_date(value))
|
146
|
+
when :String
|
147
|
+
value.to_s
|
148
|
+
when :Integer
|
149
|
+
value.to_i
|
150
|
+
when :Float
|
151
|
+
value.to_f
|
152
|
+
when :BigDecimal
|
153
|
+
BigDecimal(value.to_s)
|
154
|
+
when :Boolean
|
155
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
156
|
+
true
|
157
|
+
else
|
158
|
+
false
|
159
|
+
end
|
160
|
+
when :Object
|
161
|
+
# generic object (usually a Hash), return directly
|
162
|
+
value
|
163
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
164
|
+
inner_type = Regexp.last_match[:inner_type]
|
165
|
+
value.map { |v| _deserialize(inner_type, v) }
|
166
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
167
|
+
k_type = Regexp.last_match[:k_type]
|
168
|
+
v_type = Regexp.last_match[:v_type]
|
169
|
+
{}.tap do |hash|
|
170
|
+
value.each do |k, v|
|
171
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
172
|
+
end
|
173
|
+
end
|
174
|
+
else # model
|
175
|
+
XeroRuby::PayrollNz.const_get(type).build_from_hash(value)
|
176
|
+
end
|
177
|
+
end
|
178
|
+
|
179
|
+
# Returns the string representation of the object
|
180
|
+
# @return [String] String presentation of the object
|
181
|
+
def to_s
|
182
|
+
to_hash.to_s
|
183
|
+
end
|
184
|
+
|
185
|
+
# to_body is an alias to to_hash (backward compatibility)
|
186
|
+
# @return [Hash] Returns the object in the form of hash
|
187
|
+
def to_body
|
188
|
+
to_hash
|
189
|
+
end
|
190
|
+
|
191
|
+
# Returns the object in the form of hash
|
192
|
+
# @return [Hash] Returns the object in the form of hash
|
193
|
+
def to_hash(downcase: false)
|
194
|
+
hash = {}
|
195
|
+
self.class.attribute_map.each_pair do |attr, param|
|
196
|
+
value = self.send(attr)
|
197
|
+
next if value.nil?
|
198
|
+
key = downcase ? attr : param
|
199
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
200
|
+
end
|
201
|
+
hash
|
202
|
+
end
|
203
|
+
|
204
|
+
# Returns the object in the form of hash with snake_case
|
205
|
+
def to_attributes
|
206
|
+
to_hash(downcase: true)
|
207
|
+
end
|
208
|
+
|
209
|
+
# Outputs non-array value in the form of hash
|
210
|
+
# For object, use to_hash. Otherwise, just return the value
|
211
|
+
# @param [Object] value Any valid value
|
212
|
+
# @return [Hash] Returns the value in the form of hash
|
213
|
+
def _to_hash(value, downcase: false)
|
214
|
+
if value.is_a?(Array)
|
215
|
+
value.map do |v|
|
216
|
+
v.to_hash(downcase: downcase)
|
217
|
+
end
|
218
|
+
elsif value.is_a?(Hash)
|
219
|
+
{}.tap do |hash|
|
220
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
221
|
+
end
|
222
|
+
elsif value.respond_to? :to_hash
|
223
|
+
value.to_hash(downcase: downcase)
|
224
|
+
else
|
225
|
+
value
|
226
|
+
end
|
227
|
+
end
|
228
|
+
|
229
|
+
def parse_date(datestring)
|
230
|
+
if datestring.include?('Date')
|
231
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
232
|
+
original, date, timezone = *date_pattern.match(datestring)
|
233
|
+
date = (date.to_i / 1000)
|
234
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
235
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
236
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
237
|
+
else # handle date 'types' for small subset of payroll API's
|
238
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Xero
|
2
|
+
#Xero Payroll NZ
|
3
3
|
|
4
|
-
#
|
4
|
+
#This is the Xero Payroll API for orgs in the NZ region.
|
5
5
|
|
6
6
|
Contact: api@xero.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
@@ -12,49 +12,29 @@ OpenAPI Generator version: 4.3.1
|
|
12
12
|
require 'time'
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module XeroRuby::
|
15
|
+
module XeroRuby::PayrollNz
|
16
16
|
require 'bigdecimal'
|
17
17
|
|
18
|
-
class
|
19
|
-
|
20
|
-
attr_accessor :
|
21
|
-
|
22
|
-
|
23
|
-
attr_accessor :status
|
18
|
+
class EmployeeWorkingPatternWithWorkingWeeksRequest
|
19
|
+
# The effective date of the corresponding salary and wages
|
20
|
+
attr_accessor :effective_from
|
24
21
|
|
25
22
|
|
26
|
-
attr_accessor :
|
27
|
-
|
28
|
-
|
29
|
-
attr_accessor :date_time_utc
|
30
|
-
|
31
|
-
|
32
|
-
attr_accessor :page_info
|
33
|
-
|
34
|
-
|
35
|
-
attr_accessor :invoices
|
23
|
+
attr_accessor :working_weeks
|
36
24
|
|
37
25
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
26
|
def self.attribute_map
|
39
27
|
{
|
40
|
-
:'
|
41
|
-
:'
|
42
|
-
:'provider_name' => :'ProviderName',
|
43
|
-
:'date_time_utc' => :'DateTimeUTC',
|
44
|
-
:'page_info' => :'PageInfo',
|
45
|
-
:'invoices' => :'Invoices'
|
28
|
+
:'effective_from' => :'effectiveFrom',
|
29
|
+
:'working_weeks' => :'workingWeeks'
|
46
30
|
}
|
47
31
|
end
|
48
32
|
|
49
33
|
# Attribute type mapping.
|
50
34
|
def self.openapi_types
|
51
35
|
{
|
52
|
-
:'
|
53
|
-
:'
|
54
|
-
:'provider_name' => :'String',
|
55
|
-
:'date_time_utc' => :'String',
|
56
|
-
:'page_info' => :'PageInfo',
|
57
|
-
:'invoices' => :'Array<Invoice>'
|
36
|
+
:'effective_from' => :'Date',
|
37
|
+
:'working_weeks' => :'Array<WorkingWeek>'
|
58
38
|
}
|
59
39
|
end
|
60
40
|
|
@@ -62,40 +42,24 @@ module XeroRuby::Accounting
|
|
62
42
|
# @param [Hash] attributes Model attributes in the form of hash
|
63
43
|
def initialize(attributes = {})
|
64
44
|
if (!attributes.is_a?(Hash))
|
65
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::
|
45
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksRequest` initialize method"
|
66
46
|
end
|
67
47
|
|
68
48
|
# check to see if the attribute exists and convert string to symbol for hash key
|
69
49
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
50
|
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::
|
51
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::PayrollNz::EmployeeWorkingPatternWithWorkingWeeksRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
52
|
end
|
73
53
|
h[k.to_sym] = v
|
74
54
|
}
|
75
55
|
|
76
|
-
if attributes.key?(:'
|
77
|
-
self.
|
78
|
-
end
|
79
|
-
|
80
|
-
if attributes.key?(:'status')
|
81
|
-
self.status = attributes[:'status']
|
56
|
+
if attributes.key?(:'effective_from')
|
57
|
+
self.effective_from = attributes[:'effective_from']
|
82
58
|
end
|
83
59
|
|
84
|
-
if attributes.key?(:'
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
if attributes.key?(:'date_time_utc')
|
89
|
-
self.date_time_utc = attributes[:'date_time_utc']
|
90
|
-
end
|
91
|
-
|
92
|
-
if attributes.key?(:'page_info')
|
93
|
-
self.page_info = attributes[:'page_info']
|
94
|
-
end
|
95
|
-
|
96
|
-
if attributes.key?(:'invoices')
|
97
|
-
if (value = attributes[:'invoices']).is_a?(Array)
|
98
|
-
self.invoices = value
|
60
|
+
if attributes.key?(:'working_weeks')
|
61
|
+
if (value = attributes[:'working_weeks']).is_a?(Array)
|
62
|
+
self.working_weeks = value
|
99
63
|
end
|
100
64
|
end
|
101
65
|
end
|
@@ -104,12 +68,22 @@ module XeroRuby::Accounting
|
|
104
68
|
# @return Array for valid properties with the reasons
|
105
69
|
def list_invalid_properties
|
106
70
|
invalid_properties = Array.new
|
71
|
+
if @effective_from.nil?
|
72
|
+
invalid_properties.push('invalid value for "effective_from", effective_from cannot be nil.')
|
73
|
+
end
|
74
|
+
|
75
|
+
if @working_weeks.nil?
|
76
|
+
invalid_properties.push('invalid value for "working_weeks", working_weeks cannot be nil.')
|
77
|
+
end
|
78
|
+
|
107
79
|
invalid_properties
|
108
80
|
end
|
109
81
|
|
110
82
|
# Check to see if the all the properties in the model are valid
|
111
83
|
# @return true if the model is valid
|
112
84
|
def valid?
|
85
|
+
return false if @effective_from.nil?
|
86
|
+
return false if @working_weeks.nil?
|
113
87
|
true
|
114
88
|
end
|
115
89
|
|
@@ -118,12 +92,8 @@ module XeroRuby::Accounting
|
|
118
92
|
def ==(o)
|
119
93
|
return true if self.equal?(o)
|
120
94
|
self.class == o.class &&
|
121
|
-
|
122
|
-
|
123
|
-
provider_name == o.provider_name &&
|
124
|
-
date_time_utc == o.date_time_utc &&
|
125
|
-
page_info == o.page_info &&
|
126
|
-
invoices == o.invoices
|
95
|
+
effective_from == o.effective_from &&
|
96
|
+
working_weeks == o.working_weeks
|
127
97
|
end
|
128
98
|
|
129
99
|
# @see the `==` method
|
@@ -135,7 +105,7 @@ module XeroRuby::Accounting
|
|
135
105
|
# Calculates hash code according to all attributes.
|
136
106
|
# @return [Integer] Hash code
|
137
107
|
def hash
|
138
|
-
[
|
108
|
+
[effective_from, working_weeks].hash
|
139
109
|
end
|
140
110
|
|
141
111
|
# Builds the object from hash
|
@@ -204,7 +174,7 @@ module XeroRuby::Accounting
|
|
204
174
|
end
|
205
175
|
end
|
206
176
|
else # model
|
207
|
-
XeroRuby::
|
177
|
+
XeroRuby::PayrollNz.const_get(type).build_from_hash(value)
|
208
178
|
end
|
209
179
|
end
|
210
180
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
|
-
#Xero
|
2
|
+
#Xero Payroll NZ
|
3
3
|
|
4
|
-
#
|
4
|
+
#This is the Xero Payroll API for orgs in the NZ region.
|
5
5
|
|
6
6
|
Contact: api@xero.com
|
7
7
|
Generated by: https://openapi-generator.tech
|
@@ -12,49 +12,34 @@ OpenAPI Generator version: 4.3.1
|
|
12
12
|
require 'time'
|
13
13
|
require 'date'
|
14
14
|
|
15
|
-
module XeroRuby::
|
15
|
+
module XeroRuby::PayrollNz
|
16
16
|
require 'bigdecimal'
|
17
17
|
|
18
|
-
class
|
18
|
+
class EmployeeWorkingPatternsObject
|
19
19
|
|
20
|
-
attr_accessor :
|
20
|
+
attr_accessor :pagination
|
21
21
|
|
22
22
|
|
23
|
-
attr_accessor :
|
23
|
+
attr_accessor :problem
|
24
24
|
|
25
25
|
|
26
|
-
attr_accessor :
|
27
|
-
|
28
|
-
|
29
|
-
attr_accessor :date_time_utc
|
30
|
-
|
31
|
-
|
32
|
-
attr_accessor :page_info
|
33
|
-
|
34
|
-
|
35
|
-
attr_accessor :contacts
|
26
|
+
attr_accessor :payee_working_patterns
|
36
27
|
|
37
28
|
# Attribute mapping from ruby-style variable name to JSON key.
|
38
29
|
def self.attribute_map
|
39
30
|
{
|
40
|
-
:'
|
41
|
-
:'
|
42
|
-
:'
|
43
|
-
:'date_time_utc' => :'DateTimeUTC',
|
44
|
-
:'page_info' => :'PageInfo',
|
45
|
-
:'contacts' => :'Contacts'
|
31
|
+
:'pagination' => :'pagination',
|
32
|
+
:'problem' => :'problem',
|
33
|
+
:'payee_working_patterns' => :'payeeWorkingPatterns'
|
46
34
|
}
|
47
35
|
end
|
48
36
|
|
49
37
|
# Attribute type mapping.
|
50
38
|
def self.openapi_types
|
51
39
|
{
|
52
|
-
:'
|
53
|
-
:'
|
54
|
-
:'
|
55
|
-
:'date_time_utc' => :'String',
|
56
|
-
:'page_info' => :'PageInfo',
|
57
|
-
:'contacts' => :'Array<Contact>'
|
40
|
+
:'pagination' => :'Pagination',
|
41
|
+
:'problem' => :'Problem',
|
42
|
+
:'payee_working_patterns' => :'Array<EmployeeWorkingPattern>'
|
58
43
|
}
|
59
44
|
end
|
60
45
|
|
@@ -62,40 +47,28 @@ module XeroRuby::Accounting
|
|
62
47
|
# @param [Hash] attributes Model attributes in the form of hash
|
63
48
|
def initialize(attributes = {})
|
64
49
|
if (!attributes.is_a?(Hash))
|
65
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::
|
50
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::PayrollNz::EmployeeWorkingPatternsObject` initialize method"
|
66
51
|
end
|
67
52
|
|
68
53
|
# check to see if the attribute exists and convert string to symbol for hash key
|
69
54
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
55
|
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::
|
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
|
72
57
|
end
|
73
58
|
h[k.to_sym] = v
|
74
59
|
}
|
75
60
|
|
76
|
-
if attributes.key?(:'
|
77
|
-
self.
|
78
|
-
end
|
79
|
-
|
80
|
-
if attributes.key?(:'status')
|
81
|
-
self.status = attributes[:'status']
|
82
|
-
end
|
83
|
-
|
84
|
-
if attributes.key?(:'provider_name')
|
85
|
-
self.provider_name = attributes[:'provider_name']
|
86
|
-
end
|
87
|
-
|
88
|
-
if attributes.key?(:'date_time_utc')
|
89
|
-
self.date_time_utc = attributes[:'date_time_utc']
|
61
|
+
if attributes.key?(:'pagination')
|
62
|
+
self.pagination = attributes[:'pagination']
|
90
63
|
end
|
91
64
|
|
92
|
-
if attributes.key?(:'
|
93
|
-
self.
|
65
|
+
if attributes.key?(:'problem')
|
66
|
+
self.problem = attributes[:'problem']
|
94
67
|
end
|
95
68
|
|
96
|
-
if attributes.key?(:'
|
97
|
-
if (value = attributes[:'
|
98
|
-
self.
|
69
|
+
if attributes.key?(:'payee_working_patterns')
|
70
|
+
if (value = attributes[:'payee_working_patterns']).is_a?(Array)
|
71
|
+
self.payee_working_patterns = value
|
99
72
|
end
|
100
73
|
end
|
101
74
|
end
|
@@ -118,12 +91,9 @@ module XeroRuby::Accounting
|
|
118
91
|
def ==(o)
|
119
92
|
return true if self.equal?(o)
|
120
93
|
self.class == o.class &&
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
date_time_utc == o.date_time_utc &&
|
125
|
-
page_info == o.page_info &&
|
126
|
-
contacts == o.contacts
|
94
|
+
pagination == o.pagination &&
|
95
|
+
problem == o.problem &&
|
96
|
+
payee_working_patterns == o.payee_working_patterns
|
127
97
|
end
|
128
98
|
|
129
99
|
# @see the `==` method
|
@@ -135,7 +105,7 @@ module XeroRuby::Accounting
|
|
135
105
|
# Calculates hash code according to all attributes.
|
136
106
|
# @return [Integer] Hash code
|
137
107
|
def hash
|
138
|
-
[
|
108
|
+
[pagination, problem, payee_working_patterns].hash
|
139
109
|
end
|
140
110
|
|
141
111
|
# Builds the object from hash
|
@@ -204,7 +174,7 @@ module XeroRuby::Accounting
|
|
204
174
|
end
|
205
175
|
end
|
206
176
|
else # model
|
207
|
-
XeroRuby::
|
177
|
+
XeroRuby::PayrollNz.const_get(type).build_from_hash(value)
|
208
178
|
end
|
209
179
|
end
|
210
180
|
|
@@ -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
|