xero-ruby 3.2.1 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +70 -1
- data/lib/xero-ruby/api/accounting_api.rb +11 -2
- data/lib/xero-ruby/api/app_store_api.rb +87 -0
- data/lib/xero-ruby/api/finance_api.rb +866 -0
- data/lib/xero-ruby/api/payroll_au_api.rb +14 -14
- data/lib/xero-ruby/api/payroll_nz_api.rb +18 -12
- data/lib/xero-ruby/api/payroll_uk_api.rb +14 -2
- data/lib/xero-ruby/api_client.rb +21 -3
- data/lib/xero-ruby/configuration.rb +4 -0
- 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/bank_transfer.rb +35 -1
- 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/budget_balance.rb +2 -2
- data/lib/xero-ruby/models/accounting/contact.rb +89 -4
- 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/linked_transaction.rb +8 -8
- data/lib/xero-ruby/models/accounting/manual_journal.rb +5 -5
- data/lib/xero-ruby/models/accounting/organisation.rb +70 -70
- data/lib/xero-ruby/models/accounting/overpayment.rb +6 -6
- data/lib/xero-ruby/models/accounting/payment.rb +21 -11
- 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 -108
- 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 +311 -0
- data/lib/xero-ruby/models/app_store/price.rb +257 -0
- data/lib/xero-ruby/models/app_store/problem_details.rb +272 -0
- data/lib/xero-ruby/models/app_store/product.rb +288 -0
- data/lib/xero-ruby/models/app_store/subscription.rb +361 -0
- data/lib/xero-ruby/models/app_store/subscription_item.rb +344 -0
- 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/account_usage.rb +342 -0
- data/lib/xero-ruby/models/finance/account_usage_response.rb +254 -0
- data/lib/xero-ruby/models/finance/balance_sheet_account_detail.rb +262 -0
- data/lib/xero-ruby/models/finance/balance_sheet_account_group.rb +234 -0
- data/lib/xero-ruby/models/finance/balance_sheet_account_type.rb +244 -0
- data/lib/xero-ruby/models/finance/balance_sheet_response.rb +252 -0
- data/lib/xero-ruby/models/finance/bank_statement_response.rb +232 -0
- data/lib/xero-ruby/models/finance/cash_account_response.rb +262 -0
- data/lib/xero-ruby/models/finance/cash_balance.rb +242 -0
- data/lib/xero-ruby/models/finance/cash_validation_response.rb +262 -0
- data/lib/xero-ruby/models/finance/cashflow_account.rb +282 -0
- data/lib/xero-ruby/models/finance/cashflow_activity.rb +244 -0
- data/lib/xero-ruby/models/finance/cashflow_response.rb +254 -0
- data/lib/xero-ruby/models/finance/cashflow_type.rb +244 -0
- data/lib/xero-ruby/models/finance/contact_detail.rb +274 -0
- data/lib/xero-ruby/models/finance/contact_total_detail.rb +242 -0
- data/lib/xero-ruby/models/finance/contact_total_other.rb +252 -0
- data/lib/xero-ruby/models/finance/current_statement_response.rb +272 -0
- data/lib/xero-ruby/models/finance/data_source_response.rb +362 -0
- data/lib/xero-ruby/models/finance/history_record_response.rb +262 -0
- data/lib/xero-ruby/models/finance/income_by_contact_response.rb +284 -0
- data/lib/xero-ruby/models/finance/lock_history_model.rb +242 -0
- data/lib/xero-ruby/models/finance/lock_history_response.rb +244 -0
- data/lib/xero-ruby/models/finance/manual_journal_total.rb +222 -0
- data/lib/xero-ruby/models/finance/pnl_account.rb +272 -0
- data/lib/xero-ruby/models/finance/pnl_account_class.rb +234 -0
- data/lib/xero-ruby/models/finance/pnl_account_type.rb +244 -0
- data/lib/xero-ruby/models/finance/practice_response.rb +262 -0
- data/lib/xero-ruby/models/finance/problem.rb +252 -0
- data/lib/xero-ruby/models/finance/problem_type.rb +39 -0
- data/lib/xero-ruby/models/finance/profit_and_loss_response.rb +262 -0
- data/lib/xero-ruby/models/finance/report_history_model.rb +242 -0
- data/lib/xero-ruby/models/finance/report_history_response.rb +244 -0
- data/lib/xero-ruby/models/finance/statement_balance_response.rb +232 -0
- data/lib/xero-ruby/models/finance/statement_lines_response.rb +382 -0
- data/lib/xero-ruby/models/finance/total_detail.rb +242 -0
- data/lib/xero-ruby/models/finance/total_other.rb +242 -0
- data/lib/xero-ruby/models/finance/trial_balance_account.rb +312 -0
- data/lib/xero-ruby/models/finance/trial_balance_entry.rb +232 -0
- data/lib/xero-ruby/models/finance/trial_balance_movement.rb +252 -0
- data/lib/xero-ruby/models/finance/trial_balance_response.rb +244 -0
- data/lib/xero-ruby/models/finance/user_activities_response.rb +244 -0
- data/lib/xero-ruby/models/finance/user_response.rb +336 -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 -10
- data/lib/xero-ruby/models/payroll_au/employee.rb +34 -5
- 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 -5
- 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/payroll_calendar.rb +11 -1
- 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 +28 -28
- data/lib/xero-ruby/models/payroll_uk/employee.rb +2 -2
- 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 +2 -2
- data/lib/xero-ruby.rb +52 -0
- data/spec/api_client_spec.rb +3 -0
- data/spec/app_store/api/app_store_api_spec.rb +45 -0
- data/spec/app_store/models/plan_spec.rb +62 -0
- data/spec/app_store/models/price_spec.rb +52 -0
- data/spec/app_store/models/problem_details_spec.rb +70 -0
- data/spec/app_store/models/product_spec.rb +56 -0
- data/spec/app_store/models/subscription_item_spec.rb +70 -0
- data/spec/app_store/models/subscription_spec.rb +82 -0
- data/spec/configuration_spec.rb +1 -0
- data/spec/finance/api/finance_api_spec.rb +156 -0
- data/spec/finance/models/account_usage_response_spec.rb +58 -0
- data/spec/finance/models/account_usage_spec.rb +112 -0
- data/spec/finance/models/balance_sheet_account_detail_spec.rb +64 -0
- data/spec/finance/models/balance_sheet_account_group_spec.rb +46 -0
- data/spec/finance/models/balance_sheet_account_type_spec.rb +52 -0
- data/spec/finance/models/balance_sheet_response_spec.rb +58 -0
- data/spec/finance/models/bank_statement_response_spec.rb +46 -0
- data/spec/finance/models/cash_account_response_spec.rb +64 -0
- data/spec/finance/models/cash_balance_spec.rb +52 -0
- data/spec/finance/models/cash_validation_response_spec.rb +64 -0
- data/spec/finance/models/cashflow_account_spec.rb +76 -0
- data/spec/finance/models/cashflow_activity_spec.rb +52 -0
- data/spec/finance/models/cashflow_response_spec.rb +58 -0
- data/spec/finance/models/cashflow_type_spec.rb +52 -0
- data/spec/finance/models/current_statement_response_spec.rb +70 -0
- data/spec/finance/models/data_source_response_spec.rb +124 -0
- data/spec/finance/models/history_record_response_spec.rb +64 -0
- data/spec/finance/models/lock_history_model_spec.rb +52 -0
- data/spec/finance/models/lock_history_response_spec.rb +52 -0
- data/spec/finance/models/pnl_account_class_spec.rb +46 -0
- data/spec/finance/models/pnl_account_spec.rb +70 -0
- data/spec/finance/models/pnl_account_type_spec.rb +52 -0
- data/spec/finance/models/practice_response_spec.rb +64 -0
- data/spec/finance/models/problem_spec.rb +58 -0
- data/spec/finance/models/problem_type_spec.rb +34 -0
- data/spec/finance/models/profit_and_loss_response_spec.rb +64 -0
- data/spec/finance/models/report_history_model_spec.rb +52 -0
- data/spec/finance/models/report_history_response_spec.rb +52 -0
- data/spec/finance/models/statement_balance_response_spec.rb +46 -0
- data/spec/finance/models/statement_lines_response_spec.rb +136 -0
- data/spec/finance/models/trial_balance_account_spec.rb +94 -0
- data/spec/finance/models/trial_balance_entry_spec.rb +46 -0
- data/spec/finance/models/trial_balance_movement_spec.rb +58 -0
- data/spec/finance/models/trial_balance_response_spec.rb +52 -0
- data/spec/finance/models/user_activities_response_spec.rb +52 -0
- data/spec/finance/models/user_response_spec.rb +106 -0
- metadata +143 -3
@@ -0,0 +1,244 @@
|
|
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 UserActivitiesResponse
|
19
|
+
# The requested Organisation to which the data pertains
|
20
|
+
attr_accessor :organisation_id
|
21
|
+
|
22
|
+
# The month of the report
|
23
|
+
attr_accessor :data_month
|
24
|
+
|
25
|
+
|
26
|
+
attr_accessor :users
|
27
|
+
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
29
|
+
def self.attribute_map
|
30
|
+
{
|
31
|
+
:'organisation_id' => :'organisationId',
|
32
|
+
:'data_month' => :'dataMonth',
|
33
|
+
:'users' => :'users'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Attribute type mapping.
|
38
|
+
def self.openapi_types
|
39
|
+
{
|
40
|
+
:'organisation_id' => :'String',
|
41
|
+
:'data_month' => :'String',
|
42
|
+
:'users' => :'Array<UserResponse>'
|
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::Finance::UserActivitiesResponse` 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::Finance::UserActivitiesResponse`. 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?(:'organisation_id')
|
62
|
+
self.organisation_id = attributes[:'organisation_id']
|
63
|
+
end
|
64
|
+
|
65
|
+
if attributes.key?(:'data_month')
|
66
|
+
self.data_month = attributes[:'data_month']
|
67
|
+
end
|
68
|
+
|
69
|
+
if attributes.key?(:'users')
|
70
|
+
if (value = attributes[:'users']).is_a?(Array)
|
71
|
+
self.users = 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
|
+
organisation_id == o.organisation_id &&
|
95
|
+
data_month == o.data_month &&
|
96
|
+
users == o.users
|
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
|
+
[organisation_id, data_month, users].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::Finance.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
|
@@ -0,0 +1,336 @@
|
|
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 UserResponse
|
19
|
+
# The Xero identifier for the user
|
20
|
+
attr_accessor :user_id
|
21
|
+
|
22
|
+
# Timestamp of user creation.
|
23
|
+
attr_accessor :user_created_date_utc
|
24
|
+
|
25
|
+
# Timestamp of user last login
|
26
|
+
attr_accessor :last_login_date_utc
|
27
|
+
|
28
|
+
# User is external partner.
|
29
|
+
attr_accessor :is_external_partner
|
30
|
+
|
31
|
+
# User has Accountant role.
|
32
|
+
attr_accessor :has_accountant_role
|
33
|
+
|
34
|
+
# Month period in format yyyy-MM.
|
35
|
+
attr_accessor :month_period
|
36
|
+
|
37
|
+
# Number of times the user has logged in.
|
38
|
+
attr_accessor :number_of_logins
|
39
|
+
|
40
|
+
# Number of documents created.
|
41
|
+
attr_accessor :number_of_documents_created
|
42
|
+
|
43
|
+
# Net value of documents created.
|
44
|
+
attr_accessor :net_value_documents_created
|
45
|
+
|
46
|
+
# Absolute value of documents created.
|
47
|
+
attr_accessor :absolute_value_documents_created
|
48
|
+
|
49
|
+
|
50
|
+
attr_accessor :attached_practices
|
51
|
+
|
52
|
+
|
53
|
+
attr_accessor :history_records
|
54
|
+
|
55
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
56
|
+
def self.attribute_map
|
57
|
+
{
|
58
|
+
:'user_id' => :'userId',
|
59
|
+
:'user_created_date_utc' => :'userCreatedDateUtc',
|
60
|
+
:'last_login_date_utc' => :'lastLoginDateUtc',
|
61
|
+
:'is_external_partner' => :'isExternalPartner',
|
62
|
+
:'has_accountant_role' => :'hasAccountantRole',
|
63
|
+
:'month_period' => :'monthPeriod',
|
64
|
+
:'number_of_logins' => :'numberOfLogins',
|
65
|
+
:'number_of_documents_created' => :'numberOfDocumentsCreated',
|
66
|
+
:'net_value_documents_created' => :'netValueDocumentsCreated',
|
67
|
+
:'absolute_value_documents_created' => :'absoluteValueDocumentsCreated',
|
68
|
+
:'attached_practices' => :'attachedPractices',
|
69
|
+
:'history_records' => :'historyRecords'
|
70
|
+
}
|
71
|
+
end
|
72
|
+
|
73
|
+
# Attribute type mapping.
|
74
|
+
def self.openapi_types
|
75
|
+
{
|
76
|
+
:'user_id' => :'String',
|
77
|
+
:'user_created_date_utc' => :'DateTime',
|
78
|
+
:'last_login_date_utc' => :'DateTime',
|
79
|
+
:'is_external_partner' => :'Boolean',
|
80
|
+
:'has_accountant_role' => :'Boolean',
|
81
|
+
:'month_period' => :'String',
|
82
|
+
:'number_of_logins' => :'Integer',
|
83
|
+
:'number_of_documents_created' => :'Integer',
|
84
|
+
:'net_value_documents_created' => :'BigDecimal',
|
85
|
+
:'absolute_value_documents_created' => :'BigDecimal',
|
86
|
+
:'attached_practices' => :'Array<PracticeResponse>',
|
87
|
+
:'history_records' => :'Array<HistoryRecordResponse>'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initializes the object
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
def initialize(attributes = {})
|
94
|
+
if (!attributes.is_a?(Hash))
|
95
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `XeroRuby::Finance::UserResponse` initialize method"
|
96
|
+
end
|
97
|
+
|
98
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
99
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
100
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
101
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `XeroRuby::Finance::UserResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
102
|
+
end
|
103
|
+
h[k.to_sym] = v
|
104
|
+
}
|
105
|
+
|
106
|
+
if attributes.key?(:'user_id')
|
107
|
+
self.user_id = attributes[:'user_id']
|
108
|
+
end
|
109
|
+
|
110
|
+
if attributes.key?(:'user_created_date_utc')
|
111
|
+
self.user_created_date_utc = attributes[:'user_created_date_utc']
|
112
|
+
end
|
113
|
+
|
114
|
+
if attributes.key?(:'last_login_date_utc')
|
115
|
+
self.last_login_date_utc = attributes[:'last_login_date_utc']
|
116
|
+
end
|
117
|
+
|
118
|
+
if attributes.key?(:'is_external_partner')
|
119
|
+
self.is_external_partner = attributes[:'is_external_partner']
|
120
|
+
end
|
121
|
+
|
122
|
+
if attributes.key?(:'has_accountant_role')
|
123
|
+
self.has_accountant_role = attributes[:'has_accountant_role']
|
124
|
+
end
|
125
|
+
|
126
|
+
if attributes.key?(:'month_period')
|
127
|
+
self.month_period = attributes[:'month_period']
|
128
|
+
end
|
129
|
+
|
130
|
+
if attributes.key?(:'number_of_logins')
|
131
|
+
self.number_of_logins = attributes[:'number_of_logins']
|
132
|
+
end
|
133
|
+
|
134
|
+
if attributes.key?(:'number_of_documents_created')
|
135
|
+
self.number_of_documents_created = attributes[:'number_of_documents_created']
|
136
|
+
end
|
137
|
+
|
138
|
+
if attributes.key?(:'net_value_documents_created')
|
139
|
+
self.net_value_documents_created = attributes[:'net_value_documents_created']
|
140
|
+
end
|
141
|
+
|
142
|
+
if attributes.key?(:'absolute_value_documents_created')
|
143
|
+
self.absolute_value_documents_created = attributes[:'absolute_value_documents_created']
|
144
|
+
end
|
145
|
+
|
146
|
+
if attributes.key?(:'attached_practices')
|
147
|
+
if (value = attributes[:'attached_practices']).is_a?(Array)
|
148
|
+
self.attached_practices = value
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
if attributes.key?(:'history_records')
|
153
|
+
if (value = attributes[:'history_records']).is_a?(Array)
|
154
|
+
self.history_records = value
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
160
|
+
# @return Array for valid properties with the reasons
|
161
|
+
def list_invalid_properties
|
162
|
+
invalid_properties = Array.new
|
163
|
+
invalid_properties
|
164
|
+
end
|
165
|
+
|
166
|
+
# Check to see if the all the properties in the model are valid
|
167
|
+
# @return true if the model is valid
|
168
|
+
def valid?
|
169
|
+
true
|
170
|
+
end
|
171
|
+
|
172
|
+
# Checks equality by comparing each attribute.
|
173
|
+
# @param [Object] Object to be compared
|
174
|
+
def ==(o)
|
175
|
+
return true if self.equal?(o)
|
176
|
+
self.class == o.class &&
|
177
|
+
user_id == o.user_id &&
|
178
|
+
user_created_date_utc == o.user_created_date_utc &&
|
179
|
+
last_login_date_utc == o.last_login_date_utc &&
|
180
|
+
is_external_partner == o.is_external_partner &&
|
181
|
+
has_accountant_role == o.has_accountant_role &&
|
182
|
+
month_period == o.month_period &&
|
183
|
+
number_of_logins == o.number_of_logins &&
|
184
|
+
number_of_documents_created == o.number_of_documents_created &&
|
185
|
+
net_value_documents_created == o.net_value_documents_created &&
|
186
|
+
absolute_value_documents_created == o.absolute_value_documents_created &&
|
187
|
+
attached_practices == o.attached_practices &&
|
188
|
+
history_records == o.history_records
|
189
|
+
end
|
190
|
+
|
191
|
+
# @see the `==` method
|
192
|
+
# @param [Object] Object to be compared
|
193
|
+
def eql?(o)
|
194
|
+
self == o
|
195
|
+
end
|
196
|
+
|
197
|
+
# Calculates hash code according to all attributes.
|
198
|
+
# @return [Integer] Hash code
|
199
|
+
def hash
|
200
|
+
[user_id, user_created_date_utc, last_login_date_utc, is_external_partner, has_accountant_role, month_period, number_of_logins, number_of_documents_created, net_value_documents_created, absolute_value_documents_created, attached_practices, history_records].hash
|
201
|
+
end
|
202
|
+
|
203
|
+
# Builds the object from hash
|
204
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
205
|
+
# @return [Object] Returns the model itself
|
206
|
+
def self.build_from_hash(attributes)
|
207
|
+
new.build_from_hash(attributes)
|
208
|
+
end
|
209
|
+
|
210
|
+
# Builds the object from hash
|
211
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
212
|
+
# @return [Object] Returns the model itself
|
213
|
+
def build_from_hash(attributes)
|
214
|
+
return nil unless attributes.is_a?(Hash)
|
215
|
+
self.class.openapi_types.each_pair do |key, type|
|
216
|
+
if type =~ /\AArray<(.*)>/i
|
217
|
+
# check to ensure the input is an array given that the attribute
|
218
|
+
# is documented as an array but the input is not
|
219
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
220
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
221
|
+
end
|
222
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
223
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
224
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
225
|
+
end
|
226
|
+
|
227
|
+
self
|
228
|
+
end
|
229
|
+
|
230
|
+
# Deserializes the data based on type
|
231
|
+
# @param string type Data type
|
232
|
+
# @param string value Value to be deserialized
|
233
|
+
# @return [Object] Deserialized data
|
234
|
+
def _deserialize(type, value)
|
235
|
+
case type.to_sym
|
236
|
+
when :DateTime
|
237
|
+
DateTime.parse(parse_date(value))
|
238
|
+
when :Date
|
239
|
+
Date.parse(parse_date(value))
|
240
|
+
when :String
|
241
|
+
value.to_s
|
242
|
+
when :Integer
|
243
|
+
value.to_i
|
244
|
+
when :Float
|
245
|
+
value.to_f
|
246
|
+
when :BigDecimal
|
247
|
+
BigDecimal(value.to_s)
|
248
|
+
when :Boolean
|
249
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
250
|
+
true
|
251
|
+
else
|
252
|
+
false
|
253
|
+
end
|
254
|
+
when :Object
|
255
|
+
# generic object (usually a Hash), return directly
|
256
|
+
value
|
257
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
258
|
+
inner_type = Regexp.last_match[:inner_type]
|
259
|
+
value.map { |v| _deserialize(inner_type, v) }
|
260
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
261
|
+
k_type = Regexp.last_match[:k_type]
|
262
|
+
v_type = Regexp.last_match[:v_type]
|
263
|
+
{}.tap do |hash|
|
264
|
+
value.each do |k, v|
|
265
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
266
|
+
end
|
267
|
+
end
|
268
|
+
else # model
|
269
|
+
XeroRuby::Finance.const_get(type).build_from_hash(value)
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
# Returns the string representation of the object
|
274
|
+
# @return [String] String presentation of the object
|
275
|
+
def to_s
|
276
|
+
to_hash.to_s
|
277
|
+
end
|
278
|
+
|
279
|
+
# to_body is an alias to to_hash (backward compatibility)
|
280
|
+
# @return [Hash] Returns the object in the form of hash
|
281
|
+
def to_body
|
282
|
+
to_hash
|
283
|
+
end
|
284
|
+
|
285
|
+
# Returns the object in the form of hash
|
286
|
+
# @return [Hash] Returns the object in the form of hash
|
287
|
+
def to_hash(downcase: false)
|
288
|
+
hash = {}
|
289
|
+
self.class.attribute_map.each_pair do |attr, param|
|
290
|
+
value = self.send(attr)
|
291
|
+
next if value.nil?
|
292
|
+
key = downcase ? attr : param
|
293
|
+
hash[key] = _to_hash(value, downcase: downcase)
|
294
|
+
end
|
295
|
+
hash
|
296
|
+
end
|
297
|
+
|
298
|
+
# Returns the object in the form of hash with snake_case
|
299
|
+
def to_attributes
|
300
|
+
to_hash(downcase: true)
|
301
|
+
end
|
302
|
+
|
303
|
+
# Outputs non-array value in the form of hash
|
304
|
+
# For object, use to_hash. Otherwise, just return the value
|
305
|
+
# @param [Object] value Any valid value
|
306
|
+
# @return [Hash] Returns the value in the form of hash
|
307
|
+
def _to_hash(value, downcase: false)
|
308
|
+
if value.is_a?(Array)
|
309
|
+
value.map do |v|
|
310
|
+
v.to_hash(downcase: downcase)
|
311
|
+
end
|
312
|
+
elsif value.is_a?(Hash)
|
313
|
+
{}.tap do |hash|
|
314
|
+
value.map { |k, v| hash[k] = _to_hash(v, downcase: downcase) }
|
315
|
+
end
|
316
|
+
elsif value.respond_to? :to_hash
|
317
|
+
value.to_hash(downcase: downcase)
|
318
|
+
else
|
319
|
+
value
|
320
|
+
end
|
321
|
+
end
|
322
|
+
|
323
|
+
def parse_date(datestring)
|
324
|
+
if datestring.include?('Date')
|
325
|
+
date_pattern = /\/Date\((-?\d+)(\+\d+)?\)\//
|
326
|
+
original, date, timezone = *date_pattern.match(datestring)
|
327
|
+
date = (date.to_i / 1000)
|
328
|
+
Time.at(date).utc.strftime('%Y-%m-%dT%H:%M:%S%z').to_s
|
329
|
+
elsif /(\d\d\d\d)-(\d\d)/.match(datestring) # handles dates w/out Days: YYYY-MM*-DD
|
330
|
+
Time.parse(datestring + '-01').strftime('%Y-%m-%dT%H:%M:%S').to_s
|
331
|
+
else # handle date 'types' for small subset of payroll API's
|
332
|
+
Time.parse(datestring).strftime('%Y-%m-%dT%H:%M:%S').to_s
|
333
|
+
end
|
334
|
+
end
|
335
|
+
end
|
336
|
+
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
|