xero-ruby 3.2.0 → 3.5.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/README.md +71 -2
- 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 +30 -4
- data/lib/xero-ruby/configuration.rb +4 -0
- data/lib/xero-ruby/models/accounting/bank_transfer.rb +35 -1
- data/lib/xero-ruby/models/accounting/budget_balance.rb +2 -2
- data/lib/xero-ruby/models/accounting/contact.rb +86 -1
- data/lib/xero-ruby/models/accounting/payment.rb +11 -1
- data/lib/xero-ruby/models/accounting/time_zone.rb +1 -0
- data/lib/xero-ruby/models/app_store/plan.rb +310 -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 +324 -0
- data/lib/xero-ruby/models/app_store/subscription_item.rb +292 -0
- 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/earnings_type.rb +2 -0
- data/lib/xero-ruby/models/payroll_au/employee.rb +30 -1
- data/lib/xero-ruby/models/payroll_au/manual_tax_type.rb +1 -0
- data/lib/xero-ruby/models/payroll_au/payroll_calendar.rb +11 -1
- data/lib/xero-ruby/models/payroll_uk/earnings_rate.rb +4 -4
- data/lib/xero-ruby/version.rb +6 -6
- data/lib/xero-ruby.rb +51 -0
- data/spec/api_client_spec.rb +5 -2
- 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 +142 -3
|
@@ -34,6 +34,9 @@ module XeroRuby::PayrollAu
|
|
|
34
34
|
# Last modified timestamp
|
|
35
35
|
attr_accessor :updated_date_utc
|
|
36
36
|
|
|
37
|
+
# Reference Date (YYYY-MM-DD)
|
|
38
|
+
attr_accessor :reference_date
|
|
39
|
+
|
|
37
40
|
# Displays array of validation error messages from the API
|
|
38
41
|
attr_accessor :validation_errors
|
|
39
42
|
|
|
@@ -46,6 +49,7 @@ module XeroRuby::PayrollAu
|
|
|
46
49
|
:'payment_date' => :'PaymentDate',
|
|
47
50
|
:'payroll_calendar_id' => :'PayrollCalendarID',
|
|
48
51
|
:'updated_date_utc' => :'UpdatedDateUTC',
|
|
52
|
+
:'reference_date' => :'ReferenceDate',
|
|
49
53
|
:'validation_errors' => :'ValidationErrors'
|
|
50
54
|
}
|
|
51
55
|
end
|
|
@@ -59,6 +63,7 @@ module XeroRuby::PayrollAu
|
|
|
59
63
|
:'payment_date' => :'Date',
|
|
60
64
|
:'payroll_calendar_id' => :'String',
|
|
61
65
|
:'updated_date_utc' => :'DateTime',
|
|
66
|
+
:'reference_date' => :'Date',
|
|
62
67
|
:'validation_errors' => :'Array<ValidationError>'
|
|
63
68
|
}
|
|
64
69
|
end
|
|
@@ -102,6 +107,10 @@ module XeroRuby::PayrollAu
|
|
|
102
107
|
self.updated_date_utc = attributes[:'updated_date_utc']
|
|
103
108
|
end
|
|
104
109
|
|
|
110
|
+
if attributes.key?(:'reference_date')
|
|
111
|
+
self.reference_date = attributes[:'reference_date']
|
|
112
|
+
end
|
|
113
|
+
|
|
105
114
|
if attributes.key?(:'validation_errors')
|
|
106
115
|
if (value = attributes[:'validation_errors']).is_a?(Array)
|
|
107
116
|
self.validation_errors = value
|
|
@@ -133,6 +142,7 @@ module XeroRuby::PayrollAu
|
|
|
133
142
|
payment_date == o.payment_date &&
|
|
134
143
|
payroll_calendar_id == o.payroll_calendar_id &&
|
|
135
144
|
updated_date_utc == o.updated_date_utc &&
|
|
145
|
+
reference_date == o.reference_date &&
|
|
136
146
|
validation_errors == o.validation_errors
|
|
137
147
|
end
|
|
138
148
|
|
|
@@ -145,7 +155,7 @@ module XeroRuby::PayrollAu
|
|
|
145
155
|
# Calculates hash code according to all attributes.
|
|
146
156
|
# @return [Integer] Hash code
|
|
147
157
|
def hash
|
|
148
|
-
[name, calendar_type, start_date, payment_date, payroll_calendar_id, updated_date_utc, validation_errors].hash
|
|
158
|
+
[name, calendar_type, start_date, payment_date, payroll_calendar_id, updated_date_utc, reference_date, validation_errors].hash
|
|
149
159
|
end
|
|
150
160
|
|
|
151
161
|
# Builds the object from hash
|
|
@@ -44,8 +44,8 @@ module XeroRuby::PayrollUk
|
|
|
44
44
|
STATUTORY_SHARED_PARENTAL_PAY_NON_PENSIONABLE = "StatutorySharedParentalPayNonPensionable".freeze
|
|
45
45
|
STATUTORY_SICK_PAY = "StatutorySickPay".freeze
|
|
46
46
|
STATUTORY_SICK_PAY_NON_PENSIONABLE = "StatutorySickPayNonPensionable".freeze
|
|
47
|
-
|
|
48
|
-
|
|
47
|
+
TIPS_NON_DIRECT = "TipsNonDirect".freeze
|
|
48
|
+
TIPS_DIRECT = "TipsDirect".freeze
|
|
49
49
|
TERMINATION_PAY = "TerminationPay".freeze
|
|
50
50
|
|
|
51
51
|
# Indicates the type of the earning rate
|
|
@@ -214,7 +214,7 @@ module XeroRuby::PayrollUk
|
|
|
214
214
|
def valid?
|
|
215
215
|
return false if @name.nil?
|
|
216
216
|
return false if @earnings_type.nil?
|
|
217
|
-
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "
|
|
217
|
+
earnings_type_validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay"])
|
|
218
218
|
return false unless earnings_type_validator.valid?(@earnings_type)
|
|
219
219
|
return false if @rate_type.nil?
|
|
220
220
|
rate_type_validator = EnumAttributeValidator.new('String', ["RatePerUnit", "MultipleOfOrdinaryEarningsRate", "FixedAmount"])
|
|
@@ -227,7 +227,7 @@ module XeroRuby::PayrollUk
|
|
|
227
227
|
# Custom attribute writer method checking allowed values (enum).
|
|
228
228
|
# @param [Object] earnings_type Object to be assigned
|
|
229
229
|
def earnings_type=(earnings_type)
|
|
230
|
-
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "
|
|
230
|
+
validator = EnumAttributeValidator.new('String', ["Allowance", "Backpay", "Bonus", "Commission", "LumpSum", "OtherEarnings", "OvertimeEarnings", "RegularEarnings", "StatutoryAdoptionPay", "StatutoryAdoptionPayNonPensionable", "StatutoryBereavementPay", "StatutoryMaternityPay", "StatutoryMaternityPayNonPensionable", "StatutoryPaternityPay", "StatutoryPaternityPayNonPensionable", "StatutoryParentalBereavementPayNonPensionable", "StatutorySharedParentalPay", "StatutorySharedParentalPayNonPensionable", "StatutorySickPay", "StatutorySickPayNonPensionable", "TipsNonDirect", "TipsDirect", "TerminationPay"])
|
|
231
231
|
unless validator.valid?(earnings_type)
|
|
232
232
|
fail ArgumentError, "invalid value for \"earnings_type\", must be one of #{validator.allowable_values}."
|
|
233
233
|
end
|
data/lib/xero-ruby/version.rb
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
|
|
4
4
|
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
5
|
|
|
6
|
-
Contact: api@xero.com
|
|
7
|
-
Generated by: https://openapi-generator.tech
|
|
8
|
-
OpenAPI Generator version: 4.3.1
|
|
6
|
+
# Contact: api@xero.com
|
|
7
|
+
# Generated by: https://openapi-generator.tech
|
|
8
|
+
# OpenAPI Generator version: 4.3.1
|
|
9
9
|
|
|
10
|
-
The version of the XeroOpenAPI document: 2.
|
|
10
|
+
# The version of the XeroOpenAPI document: 2.17.2
|
|
11
11
|
=end
|
|
12
12
|
|
|
13
13
|
module XeroRuby
|
|
14
|
-
VERSION = '3.
|
|
15
|
-
end
|
|
14
|
+
VERSION = '3.5.0'
|
|
15
|
+
end
|
data/lib/xero-ruby.rb
CHANGED
|
@@ -18,6 +18,55 @@ require 'xero-ruby/version'
|
|
|
18
18
|
require 'xero-ruby/configuration'
|
|
19
19
|
|
|
20
20
|
# Models
|
|
21
|
+
require 'xero-ruby/models/finance/account_usage'
|
|
22
|
+
require 'xero-ruby/models/finance/account_usage_response'
|
|
23
|
+
require 'xero-ruby/models/finance/balance_sheet_account_detail'
|
|
24
|
+
require 'xero-ruby/models/finance/balance_sheet_account_group'
|
|
25
|
+
require 'xero-ruby/models/finance/balance_sheet_account_type'
|
|
26
|
+
require 'xero-ruby/models/finance/balance_sheet_response'
|
|
27
|
+
require 'xero-ruby/models/finance/bank_statement_response'
|
|
28
|
+
require 'xero-ruby/models/finance/cash_account_response'
|
|
29
|
+
require 'xero-ruby/models/finance/cash_balance'
|
|
30
|
+
require 'xero-ruby/models/finance/cash_validation_response'
|
|
31
|
+
require 'xero-ruby/models/finance/cashflow_account'
|
|
32
|
+
require 'xero-ruby/models/finance/cashflow_activity'
|
|
33
|
+
require 'xero-ruby/models/finance/cashflow_response'
|
|
34
|
+
require 'xero-ruby/models/finance/cashflow_type'
|
|
35
|
+
require 'xero-ruby/models/finance/contact_detail'
|
|
36
|
+
require 'xero-ruby/models/finance/contact_total_detail'
|
|
37
|
+
require 'xero-ruby/models/finance/contact_total_other'
|
|
38
|
+
require 'xero-ruby/models/finance/current_statement_response'
|
|
39
|
+
require 'xero-ruby/models/finance/data_source_response'
|
|
40
|
+
require 'xero-ruby/models/finance/history_record_response'
|
|
41
|
+
require 'xero-ruby/models/finance/income_by_contact_response'
|
|
42
|
+
require 'xero-ruby/models/finance/lock_history_model'
|
|
43
|
+
require 'xero-ruby/models/finance/lock_history_response'
|
|
44
|
+
require 'xero-ruby/models/finance/manual_journal_total'
|
|
45
|
+
require 'xero-ruby/models/finance/pnl_account'
|
|
46
|
+
require 'xero-ruby/models/finance/pnl_account_class'
|
|
47
|
+
require 'xero-ruby/models/finance/pnl_account_type'
|
|
48
|
+
require 'xero-ruby/models/finance/practice_response'
|
|
49
|
+
require 'xero-ruby/models/finance/problem'
|
|
50
|
+
require 'xero-ruby/models/finance/problem_type'
|
|
51
|
+
require 'xero-ruby/models/finance/profit_and_loss_response'
|
|
52
|
+
require 'xero-ruby/models/finance/report_history_model'
|
|
53
|
+
require 'xero-ruby/models/finance/report_history_response'
|
|
54
|
+
require 'xero-ruby/models/finance/statement_balance_response'
|
|
55
|
+
require 'xero-ruby/models/finance/statement_lines_response'
|
|
56
|
+
require 'xero-ruby/models/finance/total_detail'
|
|
57
|
+
require 'xero-ruby/models/finance/total_other'
|
|
58
|
+
require 'xero-ruby/models/finance/trial_balance_account'
|
|
59
|
+
require 'xero-ruby/models/finance/trial_balance_entry'
|
|
60
|
+
require 'xero-ruby/models/finance/trial_balance_movement'
|
|
61
|
+
require 'xero-ruby/models/finance/trial_balance_response'
|
|
62
|
+
require 'xero-ruby/models/finance/user_activities_response'
|
|
63
|
+
require 'xero-ruby/models/finance/user_response'
|
|
64
|
+
require 'xero-ruby/models/app_store/plan'
|
|
65
|
+
require 'xero-ruby/models/app_store/price'
|
|
66
|
+
require 'xero-ruby/models/app_store/problem_details'
|
|
67
|
+
require 'xero-ruby/models/app_store/product'
|
|
68
|
+
require 'xero-ruby/models/app_store/subscription'
|
|
69
|
+
require 'xero-ruby/models/app_store/subscription_item'
|
|
21
70
|
require 'xero-ruby/models/payroll_uk/account'
|
|
22
71
|
require 'xero-ruby/models/payroll_uk/accounts'
|
|
23
72
|
require 'xero-ruby/models/payroll_uk/address'
|
|
@@ -456,6 +505,8 @@ require 'xero-ruby/models/accounting/users'
|
|
|
456
505
|
require 'xero-ruby/models/accounting/validation_error'
|
|
457
506
|
|
|
458
507
|
# APIs
|
|
508
|
+
require 'xero-ruby/api/finance_api'
|
|
509
|
+
require 'xero-ruby/api/app_store_api'
|
|
459
510
|
require 'xero-ruby/api/payroll_uk_api'
|
|
460
511
|
require 'xero-ruby/api/payroll_nz_api'
|
|
461
512
|
require 'xero-ruby/api/payroll_au_api'
|
data/spec/api_client_spec.rb
CHANGED
|
@@ -47,7 +47,7 @@ describe XeroRuby::ApiClient do
|
|
|
47
47
|
state: 'i-am-customer-state'
|
|
48
48
|
}
|
|
49
49
|
api_client = XeroRuby::ApiClient.new(credentials: creds)
|
|
50
|
-
expect(api_client.authorization_url).to eq('https://login.xero.com/identity/connect/authorize?response_type=code&client_id=abc&redirect_uri=https
|
|
50
|
+
expect(api_client.authorization_url).to eq('https://login.xero.com/identity/connect/authorize?response_type=code&client_id=abc&redirect_uri=https%3A%2F%2Fmydomain.com%2Fcallback&scope=openid+profile+email+accounting.transactions+accounting.settings&state=i-am-customer-state')
|
|
51
51
|
end
|
|
52
52
|
|
|
53
53
|
it "Does not append state if it is not provided" do
|
|
@@ -58,7 +58,7 @@ describe XeroRuby::ApiClient do
|
|
|
58
58
|
scopes: 'openid profile email accounting.transactions accounting.settings'
|
|
59
59
|
}
|
|
60
60
|
api_client = XeroRuby::ApiClient.new(credentials: creds)
|
|
61
|
-
expect(api_client.authorization_url).to eq('https://login.xero.com/identity/connect/authorize?response_type=code&client_id=abc&redirect_uri=https
|
|
61
|
+
expect(api_client.authorization_url).to eq('https://login.xero.com/identity/connect/authorize?response_type=code&client_id=abc&redirect_uri=https%3A%2F%2Fmydomain.com%2Fcallback&scope=openid+profile+email+accounting.transactions+accounting.settings')
|
|
62
62
|
end
|
|
63
63
|
|
|
64
64
|
it "Validates state on callback matches @config.state" do
|
|
@@ -174,6 +174,9 @@ describe XeroRuby::ApiClient do
|
|
|
174
174
|
|
|
175
175
|
api_client.payroll_uk_api
|
|
176
176
|
expect(api_client.config.base_url).to eq('https://api.xero.com/payroll.xro/2.0/')
|
|
177
|
+
|
|
178
|
+
api_client.finance_api
|
|
179
|
+
expect(api_client.config.base_url).to eq('https://api.xero.com/finance.xro/1.0/')
|
|
177
180
|
|
|
178
181
|
api_client.connections
|
|
179
182
|
expect(api_client.config.base_url).to eq('https://api.xero.com')
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
|
|
15
|
+
# Unit tests for XeroRuby::AppStoreApi
|
|
16
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
17
|
+
# Please update as you see appropriate
|
|
18
|
+
describe 'AppStoreApi' do
|
|
19
|
+
before do
|
|
20
|
+
# run before each test
|
|
21
|
+
@api_instance = XeroRuby::AppStoreApi.new
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
after do
|
|
25
|
+
# run after each test
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
describe 'test an instance of AppStoreApi' do
|
|
29
|
+
it 'should create an instance of AppStoreApi' do
|
|
30
|
+
expect(@api_instance).to be_instance_of(XeroRuby::AppStoreApi)
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
# unit tests for get_subscription
|
|
35
|
+
# Retrieves a subscription for a given subscriptionId
|
|
36
|
+
# @param subscription_id Unique identifier for Subscription object
|
|
37
|
+
# @param [Hash] opts the optional parameters
|
|
38
|
+
# @return [Subscription]
|
|
39
|
+
describe 'get_subscription test' do
|
|
40
|
+
it 'should work' do
|
|
41
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
end
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::Plan
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'Plan' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::Plan.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of Plan' do
|
|
30
|
+
it 'should create an instance of Plan' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::Plan)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "id"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "name"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "status"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ACTIVE", "PENDING_ACTIVATION"])
|
|
50
|
+
# validator.allowable_values.each do |value|
|
|
51
|
+
# expect { @instance.status = value }.not_to raise_error
|
|
52
|
+
# end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
describe 'test attribute "subscription_items"' do
|
|
57
|
+
it 'should work' do
|
|
58
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
end
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::Price
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'Price' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::Price.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of Price' do
|
|
30
|
+
it 'should create an instance of Price' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::Price)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "amount"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "currency"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "id"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::ProblemDetails
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'ProblemDetails' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::ProblemDetails.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of ProblemDetails' do
|
|
30
|
+
it 'should create an instance of ProblemDetails' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::ProblemDetails)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "detail"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "extensions"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "instance"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "status"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "title"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "type"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::Product
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'Product' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::Product.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of Product' do
|
|
30
|
+
it 'should create an instance of Product' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::Product)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "id"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "name"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "type"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
# validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["FIXED", "PER_SEAT"])
|
|
50
|
+
# validator.allowable_values.each do |value|
|
|
51
|
+
# expect { @instance.type = value }.not_to raise_error
|
|
52
|
+
# end
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
end
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::SubscriptionItem
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'SubscriptionItem' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::SubscriptionItem.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of SubscriptionItem' do
|
|
30
|
+
it 'should create an instance of SubscriptionItem' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::SubscriptionItem)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "end_date"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "id"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "price"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "product"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "start_date"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "test_mode"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#Xero AppStore API
|
|
3
|
+
|
|
4
|
+
#These endpoints are for Xero Partners to interact with the App Store Billing platform
|
|
5
|
+
|
|
6
|
+
Contact: api@xero.com
|
|
7
|
+
Generated by: https://openapi-generator.tech
|
|
8
|
+
OpenAPI Generator version: 4.3.1
|
|
9
|
+
|
|
10
|
+
=end
|
|
11
|
+
|
|
12
|
+
require 'spec_helper'
|
|
13
|
+
require 'json'
|
|
14
|
+
require 'date'
|
|
15
|
+
|
|
16
|
+
# Unit tests for XeroRuby::AppStore::Subscription
|
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
|
18
|
+
# Please update as you see appropriate
|
|
19
|
+
describe 'Subscription' do
|
|
20
|
+
before do
|
|
21
|
+
# run before each test
|
|
22
|
+
@instance = XeroRuby::AppStore::Subscription.new
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
after do
|
|
26
|
+
# run after each test
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
describe 'test an instance of Subscription' do
|
|
30
|
+
it 'should create an instance of Subscription' do
|
|
31
|
+
expect(@instance).to be_instance_of(XeroRuby::AppStore::Subscription)
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
describe 'test attribute "current_period_end"' do
|
|
35
|
+
it 'should work' do
|
|
36
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
describe 'test attribute "end_date"' do
|
|
41
|
+
it 'should work' do
|
|
42
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
describe 'test attribute "id"' do
|
|
47
|
+
it 'should work' do
|
|
48
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
describe 'test attribute "organisation_id"' do
|
|
53
|
+
it 'should work' do
|
|
54
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
describe 'test attribute "plans"' do
|
|
59
|
+
it 'should work' do
|
|
60
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
describe 'test attribute "start_date"' do
|
|
65
|
+
it 'should work' do
|
|
66
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
describe 'test attribute "status"' do
|
|
71
|
+
it 'should work' do
|
|
72
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
73
|
+
end
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
describe 'test attribute "test_mode"' do
|
|
77
|
+
it 'should work' do
|
|
78
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
end
|
data/spec/configuration_spec.rb
CHANGED
|
@@ -14,6 +14,7 @@ describe XeroRuby::Configuration do
|
|
|
14
14
|
expect(config.payroll_au_url).to eq('https://api.xero.com/payroll.xro/1.0/')
|
|
15
15
|
expect(config.payroll_nz_url).to eq('https://api.xero.com/payroll.xro/2.0/')
|
|
16
16
|
expect(config.payroll_uk_url).to eq('https://api.xero.com/payroll.xro/2.0/')
|
|
17
|
+
expect(config.finance_url).to eq('https://api.xero.com/finance.xro/1.0/')
|
|
17
18
|
end
|
|
18
19
|
end
|
|
19
20
|
|