xero-ruby 3.5.0 → 3.7.1
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/finance_api.rb +95 -0
- data/lib/xero-ruby/api/payroll_uk_api.rb +2 -2
- data/lib/xero-ruby/api_client.rb +1 -1
- data/lib/xero-ruby/models/accounting/account.rb +34 -34
- data/lib/xero-ruby/models/accounting/account_type.rb +22 -22
- data/lib/xero-ruby/models/accounting/action.rb +2 -2
- data/lib/xero-ruby/models/accounting/address.rb +2 -2
- data/lib/xero-ruby/models/accounting/address_for_organisation.rb +3 -3
- data/lib/xero-ruby/models/accounting/bank_transaction.rb +11 -11
- data/lib/xero-ruby/models/accounting/batch_payment.rb +4 -4
- data/lib/xero-ruby/models/accounting/branding_theme.rb +1 -1
- data/lib/xero-ruby/models/accounting/budget.rb +2 -2
- data/lib/xero-ruby/models/accounting/contact.rb +9 -9
- data/lib/xero-ruby/models/accounting/contact_group.rb +2 -2
- data/lib/xero-ruby/models/accounting/country_code.rb +240 -240
- data/lib/xero-ruby/models/accounting/credit_note.rb +8 -8
- data/lib/xero-ruby/models/accounting/currency_code.rb +166 -166
- data/lib/xero-ruby/models/accounting/employee.rb +4 -4
- data/lib/xero-ruby/models/accounting/expense_claim.rb +5 -5
- data/lib/xero-ruby/models/accounting/external_link.rb +5 -5
- data/lib/xero-ruby/models/accounting/invoice.rb +14 -14
- data/lib/xero-ruby/models/accounting/journal.rb +25 -25
- data/lib/xero-ruby/models/accounting/line_amount_types.rb +3 -3
- data/lib/xero-ruby/models/accounting/line_item.rb +11 -1
- data/lib/xero-ruby/models/accounting/line_item_item.rb +272 -0
- data/lib/xero-ruby/models/accounting/linked_transaction.rb +8 -8
- data/lib/xero-ruby/models/accounting/manual_journal.rb +5 -5
- data/lib/xero-ruby/models/accounting/organisation.rb +76 -74
- data/lib/xero-ruby/models/accounting/overpayment.rb +6 -6
- data/lib/xero-ruby/models/accounting/payment.rb +10 -10
- data/lib/xero-ruby/models/accounting/payment_term_type.rb +4 -4
- data/lib/xero-ruby/models/accounting/phone.rb +5 -5
- data/lib/xero-ruby/models/accounting/prepayment.rb +7 -7
- data/lib/xero-ruby/models/accounting/purchase_order.rb +5 -5
- data/lib/xero-ruby/models/accounting/quote_line_amount_types.rb +3 -3
- data/lib/xero-ruby/models/accounting/quote_status_codes.rb +6 -6
- data/lib/xero-ruby/models/accounting/receipt.rb +5 -5
- data/lib/xero-ruby/models/accounting/repeating_invoice.rb +5 -5
- data/lib/xero-ruby/models/accounting/report.rb +1 -1
- data/lib/xero-ruby/models/accounting/row_type.rb +4 -4
- data/lib/xero-ruby/models/accounting/schedule.rb +8 -8
- data/lib/xero-ruby/models/accounting/tax_rate.rb +78 -78
- data/lib/xero-ruby/models/accounting/tax_type.rb +59 -59
- data/lib/xero-ruby/models/accounting/time_zone.rb +109 -109
- data/lib/xero-ruby/models/accounting/tracking_category.rb +3 -3
- data/lib/xero-ruby/models/accounting/tracking_option.rb +3 -3
- data/lib/xero-ruby/models/accounting/user.rb +7 -7
- data/lib/xero-ruby/models/app_store/plan.rb +6 -5
- data/lib/xero-ruby/models/app_store/product.rb +2 -2
- data/lib/xero-ruby/models/app_store/subscription.rb +37 -0
- data/lib/xero-ruby/models/app_store/subscription_item.rb +53 -1
- data/lib/xero-ruby/models/assets/asset_status.rb +3 -3
- data/lib/xero-ruby/models/assets/asset_status_query_param.rb +3 -3
- data/lib/xero-ruby/models/assets/book_depreciation_setting.rb +11 -11
- data/lib/xero-ruby/models/files/object_group.rb +12 -11
- data/lib/xero-ruby/models/files/object_type.rb +56 -55
- data/lib/xero-ruby/models/finance/bank_statement_accounting_response.rb +254 -0
- data/lib/xero-ruby/models/finance/bank_transaction_response.rb +274 -0
- data/lib/xero-ruby/models/finance/contact_response.rb +232 -0
- data/lib/xero-ruby/models/finance/credit_note_response.rb +254 -0
- data/lib/xero-ruby/models/finance/invoice_response.rb +254 -0
- data/lib/xero-ruby/models/finance/line_item_response.rb +252 -0
- data/lib/xero-ruby/models/finance/overpayment_response.rb +254 -0
- data/lib/xero-ruby/models/finance/payment_response.rb +312 -0
- data/lib/xero-ruby/models/finance/prepayment_response.rb +254 -0
- data/lib/xero-ruby/models/finance/problem_type.rb +10 -5
- data/lib/xero-ruby/models/finance/statement_line_response.rb +346 -0
- data/lib/xero-ruby/models/finance/statement_response.rb +274 -0
- data/lib/xero-ruby/models/payroll_au/account_type.rb +23 -23
- data/lib/xero-ruby/models/payroll_au/allowance_category.rb +41 -0
- data/lib/xero-ruby/models/payroll_au/allowance_type.rb +10 -7
- data/lib/xero-ruby/models/payroll_au/calendar_type.rb +6 -6
- data/lib/xero-ruby/models/payroll_au/deduction_type.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/deduction_type_calculation_type.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/earnings_rate.rb +14 -4
- data/lib/xero-ruby/models/payroll_au/earnings_rate_calculation_type.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/earnings_type.rb +12 -12
- data/lib/xero-ruby/models/payroll_au/employee.rb +11 -11
- data/lib/xero-ruby/models/payroll_au/employee_status.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/employment_basis.rb +5 -5
- data/lib/xero-ruby/models/payroll_au/employment_termination_payment_type.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/entitlement_final_pay_payout_type.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/leave_line_calculation_type.rb +5 -5
- data/lib/xero-ruby/models/payroll_au/leave_period_status.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/leave_type_contribution_type.rb +4 -4
- data/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +6 -6
- data/lib/xero-ruby/models/payroll_au/pay_run_status.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/payment_frequency_type.rb +7 -7
- data/lib/xero-ruby/models/payroll_au/rate_type.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/residency_status.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/state.rb +8 -8
- data/lib/xero-ruby/models/payroll_au/super_fund_type.rb +2 -2
- data/lib/xero-ruby/models/payroll_au/superannuation_calculation_type.rb +3 -3
- data/lib/xero-ruby/models/payroll_au/superannuation_contribution_type.rb +4 -4
- data/lib/xero-ruby/models/payroll_au/tfn_exemption_type.rb +4 -4
- data/lib/xero-ruby/models/payroll_au/timesheet_status.rb +5 -5
- data/lib/xero-ruby/models/payroll_nz/account.rb +4 -4
- data/lib/xero-ruby/models/payroll_nz/bank_account.rb +2 -2
- data/lib/xero-ruby/models/payroll_nz/benefit.rb +5 -5
- data/lib/xero-ruby/models/payroll_nz/calendar_type.rb +7 -7
- data/lib/xero-ruby/models/payroll_nz/deduction.rb +4 -4
- data/lib/xero-ruby/models/payroll_nz/earnings_rate.rb +18 -18
- data/lib/xero-ruby/models/payroll_nz/employee.rb +2 -2
- data/lib/xero-ruby/models/payroll_nz/employee_leave_type.rb +4 -4
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_balance.rb +6 -6
- data/lib/xero-ruby/models/payroll_nz/employee_statutory_leave_summary.rb +8 -8
- data/lib/xero-ruby/models/payroll_nz/employee_tax.rb +5 -5
- data/lib/xero-ruby/models/payroll_nz/leave_period.rb +2 -2
- data/lib/xero-ruby/models/payroll_nz/pay_run.rb +5 -5
- data/lib/xero-ruby/models/payroll_nz/pay_slip.rb +3 -3
- data/lib/xero-ruby/models/payroll_nz/payment_method.rb +3 -3
- data/lib/xero-ruby/models/payroll_nz/reimbursement.rb +8 -8
- data/lib/xero-ruby/models/payroll_nz/salary_and_wage.rb +5 -5
- data/lib/xero-ruby/models/payroll_nz/statutory_deduction_category.rb +11 -11
- data/lib/xero-ruby/models/payroll_nz/tax_code.rb +19 -19
- data/lib/xero-ruby/models/payroll_nz/tax_settings.rb +2 -2
- data/lib/xero-ruby/models/payroll_nz/timesheet.rb +4 -4
- data/lib/xero-ruby/models/payroll_uk/account.rb +7 -7
- data/lib/xero-ruby/models/payroll_uk/benefit.rb +4 -4
- data/lib/xero-ruby/models/payroll_uk/deduction.rb +12 -12
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +26 -26
- data/lib/xero-ruby/models/payroll_uk/employee.rb +16 -6
- data/lib/xero-ruby/models/payroll_uk/employee_leave_type.rb +4 -4
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_balance.rb +6 -6
- data/lib/xero-ruby/models/payroll_uk/employee_statutory_leave_summary.rb +8 -8
- data/lib/xero-ruby/models/payroll_uk/employment.rb +8 -8
- data/lib/xero-ruby/models/payroll_uk/leave_period.rb +2 -2
- data/lib/xero-ruby/models/payroll_uk/pay_run.rb +11 -11
- data/lib/xero-ruby/models/payroll_uk/pay_run_calendar.rb +6 -6
- data/lib/xero-ruby/models/payroll_uk/payment_method.rb +3 -3
- data/lib/xero-ruby/models/payroll_uk/payslip.rb +3 -3
- data/lib/xero-ruby/models/payroll_uk/salary_and_wage.rb +5 -5
- data/lib/xero-ruby/models/payroll_uk/statutory_deduction_category.rb +14 -14
- data/lib/xero-ruby/models/payroll_uk/timesheet.rb +3 -3
- data/lib/xero-ruby/models/projects/charge_type.rb +3 -3
- data/lib/xero-ruby/models/projects/currency_code.rb +164 -164
- data/lib/xero-ruby/models/projects/project_status.rb +2 -2
- data/lib/xero-ruby/models/projects/task.rb +3 -3
- data/lib/xero-ruby/models/projects/time_entry.rb +3 -3
- data/lib/xero-ruby/version.rb +6 -6
- data/lib/xero-ruby.rb +13 -0
- metadata +15 -2
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero Finance API
|
|
3
|
+
|
|
4
|
+
#The Finance API is a collection of endpoints which customers can use in the course of a loan application, which may assist lenders to gain the confidence they need to provide capital.
|
|
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::Finance
|
|
16
|
+
require 'bigdecimal'
|
|
17
|
+
|
|
18
|
+
class StatementResponse
|
|
19
|
+
# Xero Identifier of statement
|
|
20
|
+
attr_accessor :statement_id
|
|
21
|
+
|
|
22
|
+
# Start date of statement
|
|
23
|
+
attr_accessor :start_date
|
|
24
|
+
|
|
25
|
+
# End date of statement
|
|
26
|
+
attr_accessor :end_date
|
|
27
|
+
|
|
28
|
+
# Utc date time of when the statement was imported in Xero
|
|
29
|
+
attr_accessor :imported_date_time_utc
|
|
30
|
+
|
|
31
|
+
# Import source of statement (STMTIMPORTSRC/MANUAL, STMTIMPORTSRC/CSV, STMTIMPORTSRC/QIF, STMTIMPORTSRC/OFX, XeroApi)
|
|
32
|
+
attr_accessor :import_source
|
|
33
|
+
|
|
34
|
+
# List of statement lines
|
|
35
|
+
attr_accessor :statement_lines
|
|
36
|
+
|
|
37
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
38
|
+
def self.attribute_map
|
|
39
|
+
{
|
|
40
|
+
:'statement_id' => :'statementId',
|
|
41
|
+
:'start_date' => :'startDate',
|
|
42
|
+
:'end_date' => :'endDate',
|
|
43
|
+
:'imported_date_time_utc' => :'importedDateTimeUtc',
|
|
44
|
+
:'import_source' => :'importSource',
|
|
45
|
+
:'statement_lines' => :'statementLines'
|
|
46
|
+
}
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Attribute type mapping.
|
|
50
|
+
def self.openapi_types
|
|
51
|
+
{
|
|
52
|
+
:'statement_id' => :'String',
|
|
53
|
+
:'start_date' => :'Date',
|
|
54
|
+
:'end_date' => :'Date',
|
|
55
|
+
:'imported_date_time_utc' => :'DateTime',
|
|
56
|
+
:'import_source' => :'String',
|
|
57
|
+
:'statement_lines' => :'Array<StatementLineResponse>'
|
|
58
|
+
}
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
# Initializes the object
|
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
63
|
+
def initialize(attributes = {})
|
|
64
|
+
if (!attributes.is_a?(Hash))
|
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Finance::StatementResponse` initialize method"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Finance::StatementResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
72
|
+
end
|
|
73
|
+
h[k.to_sym] = v
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
if attributes.key?(:'statement_id')
|
|
77
|
+
self.statement_id = attributes[:'statement_id']
|
|
78
|
+
end
|
|
79
|
+
|
|
80
|
+
if attributes.key?(:'start_date')
|
|
81
|
+
self.start_date = attributes[:'start_date']
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'end_date')
|
|
85
|
+
self.end_date = attributes[:'end_date']
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'imported_date_time_utc')
|
|
89
|
+
self.imported_date_time_utc = attributes[:'imported_date_time_utc']
|
|
90
|
+
end
|
|
91
|
+
|
|
92
|
+
if attributes.key?(:'import_source')
|
|
93
|
+
self.import_source = attributes[:'import_source']
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
if attributes.key?(:'statement_lines')
|
|
97
|
+
if (value = attributes[:'statement_lines']).is_a?(Array)
|
|
98
|
+
self.statement_lines = value
|
|
99
|
+
end
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
104
|
+
# @return Array for valid properties with the reasons
|
|
105
|
+
def list_invalid_properties
|
|
106
|
+
invalid_properties = Array.new
|
|
107
|
+
invalid_properties
|
|
108
|
+
end
|
|
109
|
+
|
|
110
|
+
# Check to see if the all the properties in the model are valid
|
|
111
|
+
# @return true if the model is valid
|
|
112
|
+
def valid?
|
|
113
|
+
true
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
# Checks equality by comparing each attribute.
|
|
117
|
+
# @param [Object] Object to be compared
|
|
118
|
+
def ==(o)
|
|
119
|
+
return true if self.equal?(o)
|
|
120
|
+
self.class == o.class &&
|
|
121
|
+
statement_id == o.statement_id &&
|
|
122
|
+
start_date == o.start_date &&
|
|
123
|
+
end_date == o.end_date &&
|
|
124
|
+
imported_date_time_utc == o.imported_date_time_utc &&
|
|
125
|
+
import_source == o.import_source &&
|
|
126
|
+
statement_lines == o.statement_lines
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# @see the `==` method
|
|
130
|
+
# @param [Object] Object to be compared
|
|
131
|
+
def eql?(o)
|
|
132
|
+
self == o
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
# Calculates hash code according to all attributes.
|
|
136
|
+
# @return [Integer] Hash code
|
|
137
|
+
def hash
|
|
138
|
+
[statement_id, start_date, end_date, imported_date_time_utc, import_source, statement_lines].hash
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
# Builds the object from hash
|
|
142
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
143
|
+
# @return [Object] Returns the model itself
|
|
144
|
+
def self.build_from_hash(attributes)
|
|
145
|
+
new.build_from_hash(attributes)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Builds the object from hash
|
|
149
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
150
|
+
# @return [Object] Returns the model itself
|
|
151
|
+
def build_from_hash(attributes)
|
|
152
|
+
return nil unless attributes.is_a?(Hash)
|
|
153
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
154
|
+
if type =~ /\AArray<(.*)>/i
|
|
155
|
+
# check to ensure the input is an array given that the attribute
|
|
156
|
+
# is documented as an array but the input is not
|
|
157
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
|
158
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
|
159
|
+
end
|
|
160
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
161
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
162
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
self
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
# Deserializes the data based on type
|
|
169
|
+
# @param string type Data type
|
|
170
|
+
# @param string value Value to be deserialized
|
|
171
|
+
# @return [Object] Deserialized data
|
|
172
|
+
def _deserialize(type, value)
|
|
173
|
+
case type.to_sym
|
|
174
|
+
when :DateTime
|
|
175
|
+
DateTime.parse(parse_date(value))
|
|
176
|
+
when :Date
|
|
177
|
+
Date.parse(parse_date(value))
|
|
178
|
+
when :String
|
|
179
|
+
value.to_s
|
|
180
|
+
when :Integer
|
|
181
|
+
value.to_i
|
|
182
|
+
when :Float
|
|
183
|
+
value.to_f
|
|
184
|
+
when :BigDecimal
|
|
185
|
+
BigDecimal(value.to_s)
|
|
186
|
+
when :Boolean
|
|
187
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
188
|
+
true
|
|
189
|
+
else
|
|
190
|
+
false
|
|
191
|
+
end
|
|
192
|
+
when :Object
|
|
193
|
+
# generic object (usually a Hash), return directly
|
|
194
|
+
value
|
|
195
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
|
196
|
+
inner_type = Regexp.last_match[:inner_type]
|
|
197
|
+
value.map { |v| _deserialize(inner_type, v) }
|
|
198
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
|
199
|
+
k_type = Regexp.last_match[:k_type]
|
|
200
|
+
v_type = Regexp.last_match[:v_type]
|
|
201
|
+
{}.tap do |hash|
|
|
202
|
+
value.each do |k, v|
|
|
203
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
else # model
|
|
207
|
+
XeroRuby::Finance.const_get(type).build_from_hash(value)
|
|
208
|
+
end
|
|
209
|
+
end
|
|
210
|
+
|
|
211
|
+
# Returns the string representation of the object
|
|
212
|
+
# @return [String] String presentation of the object
|
|
213
|
+
def to_s
|
|
214
|
+
to_hash.to_s
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
# to_body is an alias to to_hash (backward compatibility)
|
|
218
|
+
# @return [Hash] Returns the object in the form of hash
|
|
219
|
+
def to_body
|
|
220
|
+
to_hash
|
|
221
|
+
end
|
|
222
|
+
|
|
223
|
+
# Returns the object in the form of hash
|
|
224
|
+
# @return [Hash] Returns the object in the form of hash
|
|
225
|
+
def to_hash(downcase: false)
|
|
226
|
+
hash = {}
|
|
227
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
228
|
+
value = self.send(attr)
|
|
229
|
+
next if value.nil?
|
|
230
|
+
key = downcase ? attr : param
|
|
231
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
|
232
|
+
end
|
|
233
|
+
hash
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
# Returns the object in the form of hash with snake_case
|
|
237
|
+
def to_attributes
|
|
238
|
+
to_hash(downcase: true)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Outputs non-array value in the form of hash
|
|
242
|
+
# For object, use to_hash. Otherwise, just return the value
|
|
243
|
+
# @param [Object] value Any valid value
|
|
244
|
+
# @return [Hash] Returns the value in the form of hash
|
|
245
|
+
def _to_hash(value, downcase: false)
|
|
246
|
+
if value.is_a?(Array)
|
|
247
|
+
value.map do |v|
|
|
248
|
+
v.to_hash(downcase: downcase)
|
|
249
|
+
end
|
|
250
|
+
elsif value.is_a?(Hash)
|
|
251
|
+
{}.tap do |hash|
|
|
252
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
|
253
|
+
end
|
|
254
|
+
elsif value.respond_to? :to_hash
|
|
255
|
+
value.to_hash(downcase: downcase)
|
|
256
|
+
else
|
|
257
|
+
value
|
|
258
|
+
end
|
|
259
|
+
end
|
|
260
|
+
|
|
261
|
+
def parse_date(datestring)
|
|
262
|
+
if datestring.include?('Date')
|
|
263
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
|
264
|
+
original, date, timezone = *date_pattern.match(datestring)
|
|
265
|
+
date = (date.to_i / 1000)
|
|
266
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
|
267
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
|
268
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
269
|
+
else # handle date 'types' for small subset of payroll API's
|
|
270
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
|
271
|
+
end
|
|
272
|
+
end
|
|
273
|
+
end
|
|
274
|
+
end
|
|
@@ -14,29 +14,29 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class AccountType
|
|
17
|
-
BANK
|
|
18
|
-
CURRENT
|
|
19
|
-
CURRLIAB
|
|
20
|
-
DEPRECIATN
|
|
21
|
-
DIRECTCOSTS
|
|
22
|
-
EQUITY
|
|
23
|
-
EXPENSE
|
|
24
|
-
FIXED
|
|
25
|
-
INVENTORY
|
|
26
|
-
LIABILITY
|
|
27
|
-
NONCURRENT
|
|
28
|
-
OTHERINCOME
|
|
29
|
-
OVERHEADS
|
|
30
|
-
PREPAYMENT
|
|
31
|
-
REVENUE
|
|
32
|
-
SALES
|
|
33
|
-
TERMLIAB
|
|
34
|
-
PAYGLIABILITY
|
|
35
|
-
PAYG
|
|
36
|
-
SUPERANNUATIONEXPENSE
|
|
37
|
-
SUPERANNUATIONLIABILITY
|
|
38
|
-
WAGESEXPENSE
|
|
39
|
-
WAGESPAYABLELIABILITY
|
|
17
|
+
BANK ||= "BANK".freeze
|
|
18
|
+
CURRENT ||= "CURRENT".freeze
|
|
19
|
+
CURRLIAB ||= "CURRLIAB".freeze
|
|
20
|
+
DEPRECIATN ||= "DEPRECIATN".freeze
|
|
21
|
+
DIRECTCOSTS ||= "DIRECTCOSTS".freeze
|
|
22
|
+
EQUITY ||= "EQUITY".freeze
|
|
23
|
+
EXPENSE ||= "EXPENSE".freeze
|
|
24
|
+
FIXED ||= "FIXED".freeze
|
|
25
|
+
INVENTORY ||= "INVENTORY".freeze
|
|
26
|
+
LIABILITY ||= "LIABILITY".freeze
|
|
27
|
+
NONCURRENT ||= "NONCURRENT".freeze
|
|
28
|
+
OTHERINCOME ||= "OTHERINCOME".freeze
|
|
29
|
+
OVERHEADS ||= "OVERHEADS".freeze
|
|
30
|
+
PREPAYMENT ||= "PREPAYMENT".freeze
|
|
31
|
+
REVENUE ||= "REVENUE".freeze
|
|
32
|
+
SALES ||= "SALES".freeze
|
|
33
|
+
TERMLIAB ||= "TERMLIAB".freeze
|
|
34
|
+
PAYGLIABILITY ||= "PAYGLIABILITY".freeze
|
|
35
|
+
PAYG ||= "PAYG".freeze
|
|
36
|
+
SUPERANNUATIONEXPENSE ||= "SUPERANNUATIONEXPENSE".freeze
|
|
37
|
+
SUPERANNUATIONLIABILITY ||= "SUPERANNUATIONLIABILITY".freeze
|
|
38
|
+
WAGESEXPENSE ||= "WAGESEXPENSE".freeze
|
|
39
|
+
WAGESPAYABLELIABILITY ||= "WAGESPAYABLELIABILITY".freeze
|
|
40
40
|
|
|
41
41
|
# Builds the enum from string
|
|
42
42
|
# @param [String] The enum value in the form of the string
|
|
@@ -0,0 +1,41 @@
|
|
|
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 AllowanceCategory
|
|
17
|
+
NONDEDUCTIBLE ||= "NONDEDUCTIBLE".freeze
|
|
18
|
+
UNIFORM ||= "UNIFORM".freeze
|
|
19
|
+
PRIVATEVEHICLE ||= "PRIVATEVEHICLE".freeze
|
|
20
|
+
HOMEOFFICE ||= "HOMEOFFICE".freeze
|
|
21
|
+
TRANSPORT ||= "TRANSPORT".freeze
|
|
22
|
+
GENERAL ||= "GENERAL".freeze
|
|
23
|
+
OTHER ||= "OTHER".freeze
|
|
24
|
+
|
|
25
|
+
# Builds the enum from string
|
|
26
|
+
# @param [String] The enum value in the form of the string
|
|
27
|
+
# @return [String] The enum value
|
|
28
|
+
def self.build_from_hash(value)
|
|
29
|
+
new.build_from_hash(value)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Builds the enum from string
|
|
33
|
+
# @param [String] The enum value in the form of the string
|
|
34
|
+
# @return [String] The enum value
|
|
35
|
+
def build_from_hash(value)
|
|
36
|
+
constantValues = AllowanceCategory.constants.select { |c| AllowanceCategory::const_get(c) == value }
|
|
37
|
+
raise "Invalid ENUM value #{value} for class #AllowanceCategory" if constantValues.empty?
|
|
38
|
+
value
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
end
|
|
@@ -14,13 +14,16 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class AllowanceType
|
|
17
|
-
CAR
|
|
18
|
-
TRANSPORT
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
CAR ||= "CAR".freeze
|
|
18
|
+
TRANSPORT ||= "TRANSPORT".freeze
|
|
19
|
+
LAUNDRY ||= "LAUNDRY".freeze
|
|
20
|
+
MEALS ||= "MEALS".freeze
|
|
21
|
+
TRAVEL ||= "TRAVEL".freeze
|
|
22
|
+
OTHER ||= "OTHER".freeze
|
|
23
|
+
JOBKEEPER ||= "JOBKEEPER".freeze
|
|
24
|
+
TOOLS ||= "TOOLS".freeze
|
|
25
|
+
TASKS ||= "TASKS".freeze
|
|
26
|
+
QUALIFICATIONS ||= "QUALIFICATIONS".freeze
|
|
24
27
|
|
|
25
28
|
# Builds the enum from string
|
|
26
29
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,12 +14,12 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class CalendarType
|
|
17
|
-
WEEKLY
|
|
18
|
-
FORTNIGHTLY
|
|
19
|
-
FOURWEEKLY
|
|
20
|
-
MONTHLY
|
|
21
|
-
TWICEMONTHLY
|
|
22
|
-
QUARTERLY
|
|
17
|
+
WEEKLY ||= "WEEKLY".freeze
|
|
18
|
+
FORTNIGHTLY ||= "FORTNIGHTLY".freeze
|
|
19
|
+
FOURWEEKLY ||= "FOURWEEKLY".freeze
|
|
20
|
+
MONTHLY ||= "MONTHLY".freeze
|
|
21
|
+
TWICEMONTHLY ||= "TWICEMONTHLY".freeze
|
|
22
|
+
QUARTERLY ||= "QUARTERLY".freeze
|
|
23
23
|
|
|
24
24
|
# Builds the enum from string
|
|
25
25
|
# @param [String] The enum value in the form of the string
|
|
@@ -39,9 +39,9 @@ module XeroRuby::PayrollAu
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
attr_accessor :deduction_category
|
|
42
|
-
NONE
|
|
43
|
-
UNIONFEES
|
|
44
|
-
WORKPLACEGIVING
|
|
42
|
+
NONE ||= "NONE".freeze
|
|
43
|
+
UNIONFEES ||= "UNIONFEES".freeze
|
|
44
|
+
WORKPLACEGIVING ||= "WORKPLACEGIVING".freeze
|
|
45
45
|
|
|
46
46
|
# Is the current record
|
|
47
47
|
attr_accessor :current_record
|
|
@@ -14,9 +14,9 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class DeductionTypeCalculationType
|
|
17
|
-
FIXEDAMOUNT
|
|
18
|
-
PRETAX
|
|
19
|
-
POSTTAX
|
|
17
|
+
FIXEDAMOUNT ||= "FIXEDAMOUNT".freeze
|
|
18
|
+
PRETAX ||= "PRETAX".freeze
|
|
19
|
+
POSTTAX ||= "POSTTAX".freeze
|
|
20
20
|
|
|
21
21
|
# Builds the enum from string
|
|
22
22
|
# @param [String] The enum value in the form of the string
|
|
@@ -67,6 +67,9 @@ module XeroRuby::PayrollAu
|
|
|
67
67
|
|
|
68
68
|
attr_accessor :allowance_type
|
|
69
69
|
|
|
70
|
+
|
|
71
|
+
attr_accessor :allowance_category
|
|
72
|
+
|
|
70
73
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
71
74
|
def self.attribute_map
|
|
72
75
|
{
|
|
@@ -86,7 +89,8 @@ module XeroRuby::PayrollAu
|
|
|
86
89
|
:'employment_termination_payment_type' => :'EmploymentTerminationPaymentType',
|
|
87
90
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
88
91
|
:'current_record' => :'CurrentRecord',
|
|
89
|
-
:'allowance_type' => :'AllowanceType'
|
|
92
|
+
:'allowance_type' => :'AllowanceType',
|
|
93
|
+
:'allowance_category' => :'AllowanceCategory'
|
|
90
94
|
}
|
|
91
95
|
end
|
|
92
96
|
|
|
@@ -109,7 +113,8 @@ module XeroRuby::PayrollAu
|
|
|
109
113
|
:'employment_termination_payment_type' => :'EmploymentTerminationPaymentType',
|
|
110
114
|
:'updated_date_utc' => :'DateTime',
|
|
111
115
|
:'current_record' => :'Boolean',
|
|
112
|
-
:'allowance_type' => :'AllowanceType'
|
|
116
|
+
:'allowance_type' => :'AllowanceType',
|
|
117
|
+
:'allowance_category' => :'AllowanceCategory'
|
|
113
118
|
}
|
|
114
119
|
end
|
|
115
120
|
|
|
@@ -195,6 +200,10 @@ module XeroRuby::PayrollAu
|
|
|
195
200
|
if attributes.key?(:'allowance_type')
|
|
196
201
|
self.allowance_type = attributes[:'allowance_type']
|
|
197
202
|
end
|
|
203
|
+
|
|
204
|
+
if attributes.key?(:'allowance_category')
|
|
205
|
+
self.allowance_category = attributes[:'allowance_category']
|
|
206
|
+
end
|
|
198
207
|
end
|
|
199
208
|
|
|
200
209
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -261,7 +270,8 @@ module XeroRuby::PayrollAu
|
|
|
261
270
|
employment_termination_payment_type == o.employment_termination_payment_type &&
|
|
262
271
|
updated_date_utc == o.updated_date_utc &&
|
|
263
272
|
current_record == o.current_record &&
|
|
264
|
-
allowance_type == o.allowance_type
|
|
273
|
+
allowance_type == o.allowance_type &&
|
|
274
|
+
allowance_category == o.allowance_category
|
|
265
275
|
end
|
|
266
276
|
|
|
267
277
|
# @see the `==` method
|
|
@@ -273,7 +283,7 @@ module XeroRuby::PayrollAu
|
|
|
273
283
|
# Calculates hash code according to all attributes.
|
|
274
284
|
# @return [Integer] Hash code
|
|
275
285
|
def hash
|
|
276
|
-
[name, account_code, type_of_units, is_exempt_from_tax, is_exempt_from_super, is_reportable_as_w1, earnings_type, earnings_rate_id, rate_type, rate_per_unit, multiplier, accrue_leave, amount, employment_termination_payment_type, updated_date_utc, current_record, allowance_type].hash
|
|
286
|
+
[name, account_code, type_of_units, is_exempt_from_tax, is_exempt_from_super, is_reportable_as_w1, earnings_type, earnings_rate_id, rate_type, rate_per_unit, multiplier, accrue_leave, amount, employment_termination_payment_type, updated_date_utc, current_record, allowance_type, allowance_category].hash
|
|
277
287
|
end
|
|
278
288
|
|
|
279
289
|
# Builds the object from hash
|
|
@@ -14,9 +14,9 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EarningsRateCalculationType
|
|
17
|
-
USEEARNINGSRATE
|
|
18
|
-
ENTEREARNINGSRATE
|
|
19
|
-
ANNUALSALARY
|
|
17
|
+
USEEARNINGSRATE ||= "USEEARNINGSRATE".freeze
|
|
18
|
+
ENTEREARNINGSRATE ||= "ENTEREARNINGSRATE".freeze
|
|
19
|
+
ANNUALSALARY ||= "ANNUALSALARY".freeze
|
|
20
20
|
|
|
21
21
|
# Builds the enum from string
|
|
22
22
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,18 +14,18 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EarningsType
|
|
17
|
-
FIXED
|
|
18
|
-
ORDINARYTIMEEARNINGS
|
|
19
|
-
OVERTIMEEARNINGS
|
|
20
|
-
ALLOWANCE
|
|
21
|
-
LUMPSUMD
|
|
22
|
-
EMPLOYMENTTERMINATIONPAYMENT
|
|
23
|
-
LUMPSUMA
|
|
24
|
-
LUMPSUMB
|
|
25
|
-
BONUSESANDCOMMISSIONS
|
|
26
|
-
LUMPSUME
|
|
27
|
-
LUMPSUMW
|
|
28
|
-
DIRECTORSFEES
|
|
17
|
+
FIXED ||= "FIXED".freeze
|
|
18
|
+
ORDINARYTIMEEARNINGS ||= "ORDINARYTIMEEARNINGS".freeze
|
|
19
|
+
OVERTIMEEARNINGS ||= "OVERTIMEEARNINGS".freeze
|
|
20
|
+
ALLOWANCE ||= "ALLOWANCE".freeze
|
|
21
|
+
LUMPSUMD ||= "LUMPSUMD".freeze
|
|
22
|
+
EMPLOYMENTTERMINATIONPAYMENT ||= "EMPLOYMENTTERMINATIONPAYMENT".freeze
|
|
23
|
+
LUMPSUMA ||= "LUMPSUMA".freeze
|
|
24
|
+
LUMPSUMB ||= "LUMPSUMB".freeze
|
|
25
|
+
BONUSESANDCOMMISSIONS ||= "BONUSESANDCOMMISSIONS".freeze
|
|
26
|
+
LUMPSUME ||= "LUMPSUME".freeze
|
|
27
|
+
LUMPSUMW ||= "LUMPSUMW".freeze
|
|
28
|
+
DIRECTORSFEES ||= "DIRECTORSFEES".freeze
|
|
29
29
|
|
|
30
30
|
# Builds the enum from string
|
|
31
31
|
# @param [String] The enum value in the form of the string
|
|
@@ -42,10 +42,10 @@ module XeroRuby::PayrollAu
|
|
|
42
42
|
|
|
43
43
|
# The employee’s gender. See Employee Gender
|
|
44
44
|
attr_accessor :gender
|
|
45
|
-
N
|
|
46
|
-
M
|
|
47
|
-
F
|
|
48
|
-
I
|
|
45
|
+
N ||= "N".freeze
|
|
46
|
+
M ||= "M".freeze
|
|
47
|
+
F ||= "F".freeze
|
|
48
|
+
I ||= "I".freeze
|
|
49
49
|
|
|
50
50
|
# Employee phone number
|
|
51
51
|
attr_accessor :phone
|
|
@@ -85,13 +85,13 @@ module XeroRuby::PayrollAu
|
|
|
85
85
|
|
|
86
86
|
# * `V` Voluntary cessation - An employee resignation, retirement, domestic or pressing necessity or abandonment of employment * `I` Ill health - An employee resignation due to medical condition that prevents the continuation of employment, such as for illness, ill-health, medical unfitness or total permanent disability * `D` Deceased - The death of an employee * `R` Redundancy - An employer-initiated termination of employment due to a genuine redundancy or approved early retirement scheme * `F` Dismissal - An employer-initiated termination of employment due to dismissal, inability to perform the required work, misconduct or inefficiency * `C` Contract cessation - The natural conclusion of a limited employment relationship due to contract/engagement duration or task completion, seasonal work completion, or to cease casuals that are no longer required * `T` Transfer - The administrative arrangements performed to transfer employees across payroll systems, move them temporarily to another employer (machinery of government for public servants), transfer of business, move them to outsourcing arrangements or other such technical activities.
|
|
87
87
|
attr_accessor :termination_reason
|
|
88
|
-
V
|
|
89
|
-
|
|
90
|
-
D
|
|
91
|
-
R
|
|
92
|
-
|
|
93
|
-
C
|
|
94
|
-
T
|
|
88
|
+
V ||= "V".freeze
|
|
89
|
+
I ||= "I".freeze
|
|
90
|
+
D ||= "D".freeze
|
|
91
|
+
R ||= "R".freeze
|
|
92
|
+
F ||= "F".freeze
|
|
93
|
+
C ||= "C".freeze
|
|
94
|
+
T ||= "T".freeze
|
|
95
95
|
|
|
96
96
|
|
|
97
97
|
attr_accessor :bank_accounts
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EmployeeStatus
|
|
17
|
-
ACTIVE
|
|
18
|
-
TERMINATED
|
|
17
|
+
ACTIVE ||= "ACTIVE".freeze
|
|
18
|
+
TERMINATED ||= "TERMINATED".freeze
|
|
19
19
|
|
|
20
20
|
# Builds the enum from string
|
|
21
21
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,11 +14,11 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EmploymentBasis
|
|
17
|
-
FULLTIME
|
|
18
|
-
PARTTIME
|
|
19
|
-
CASUAL
|
|
20
|
-
LABOURHIRE
|
|
21
|
-
SUPERINCOMESTREAM
|
|
17
|
+
FULLTIME ||= "FULLTIME".freeze
|
|
18
|
+
PARTTIME ||= "PARTTIME".freeze
|
|
19
|
+
CASUAL ||= "CASUAL".freeze
|
|
20
|
+
LABOURHIRE ||= "LABOURHIRE".freeze
|
|
21
|
+
SUPERINCOMESTREAM ||= "SUPERINCOMESTREAM".freeze
|
|
22
22
|
|
|
23
23
|
# Builds the enum from string
|
|
24
24
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EmploymentTerminationPaymentType
|
|
17
|
-
O
|
|
18
|
-
R
|
|
17
|
+
O ||= "O".freeze
|
|
18
|
+
R ||= "R".freeze
|
|
19
19
|
|
|
20
20
|
# Builds the enum from string
|
|
21
21
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class EntitlementFinalPayPayoutType
|
|
17
|
-
NOTPAIDOUT
|
|
18
|
-
PAIDOUT
|
|
17
|
+
NOTPAIDOUT ||= "NOTPAIDOUT".freeze
|
|
18
|
+
PAIDOUT ||= "PAIDOUT".freeze
|
|
19
19
|
|
|
20
20
|
# Builds the enum from string
|
|
21
21
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,11 +14,11 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class LeaveLineCalculationType
|
|
17
|
-
NOCALCULATIONREQUIRED
|
|
18
|
-
FIXEDAMOUNTEACHPERIOD
|
|
19
|
-
ENTERRATEINPAYTEMPLATE
|
|
20
|
-
BASEDONORDINARYEARNINGS
|
|
21
|
-
EMPTY
|
|
17
|
+
NOCALCULATIONREQUIRED ||= "NOCALCULATIONREQUIRED".freeze
|
|
18
|
+
FIXEDAMOUNTEACHPERIOD ||= "FIXEDAMOUNTEACHPERIOD".freeze
|
|
19
|
+
ENTERRATEINPAYTEMPLATE ||= "ENTERRATEINPAYTEMPLATE".freeze
|
|
20
|
+
BASEDONORDINARYEARNINGS ||= "BASEDONORDINARYEARNINGS".freeze
|
|
21
|
+
EMPTY ||= "".freeze
|
|
22
22
|
|
|
23
23
|
# Builds the enum from string
|
|
24
24
|
# @param [String] The enum value in the form of the string
|
|
@@ -14,8 +14,8 @@ require 'date'
|
|
|
14
14
|
|
|
15
15
|
module XeroRuby::PayrollAu
|
|
16
16
|
class LeavePeriodStatus
|
|
17
|
-
SCHEDULED
|
|
18
|
-
PROCESSED
|
|
17
|
+
SCHEDULED ||= "SCHEDULED".freeze
|
|
18
|
+
PROCESSED ||= "PROCESSED".freeze
|
|
19
19
|
|
|
20
20
|
# Builds the enum from string
|
|
21
21
|
# @param [String] The enum value in the form of the string
|