qwil_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +91 -0
- data/docs/AccountSerializer.md +18 -0
- data/docs/AccountsApi.md +243 -0
- data/docs/ApitokenauthApi.md +57 -0
- data/docs/CashoutCalculationSerializer.md +10 -0
- data/docs/CashoutSerializer.md +20 -0
- data/docs/CashoutSliceSerializer.md +11 -0
- data/docs/CashoutsApi.md +56 -0
- data/docs/CompanyInformationSerializer.md +18 -0
- data/docs/ContactInfoSerializer.md +10 -0
- data/docs/ContactInformationSerializer.md +16 -0
- data/docs/ContractorSerializer.md +20 -0
- data/docs/IncomeApi.md +98 -0
- data/docs/IncomeNestedSerializer.md +18 -0
- data/docs/IncomeSerializer.md +18 -0
- data/docs/IncomeSerializerFixedSource.md +18 -0
- data/docs/InvoiceSerializer.md +17 -0
- data/docs/InvoiceSerializerFixedSourceCreate.md +17 -0
- data/docs/InvoicesApi.md +98 -0
- data/docs/JSONWebTokenSerializer.md +7 -0
- data/docs/ManagerPlatformSerializer.md +22 -0
- data/docs/ManagerSerializer.md +10 -0
- data/docs/ManagersApi.md +172 -0
- data/docs/MembershipSerializer.md +9 -0
- data/docs/MembershipsApi.md +56 -0
- data/docs/PersonalInformationSerializer.md +16 -0
- data/docs/PlaidPublicTokenSerializer.md +8 -0
- data/docs/PlatformIncomeRequestSerializer.md +15 -0
- data/docs/PlatformMembershipRequestSerializer.md +11 -0
- data/docs/PlatformSerializer.md +30 -0
- data/docs/PlatformSummarySerializer.md +10 -0
- data/docs/PlatformsApi.md +1369 -0
- data/docs/RebateSerializer.md +15 -0
- data/docs/RebatesApi.md +98 -0
- data/docs/ReceivablesSerializer.md +9 -0
- data/docs/TaxSavingsSerializer.md +10 -0
- data/docs/UserAccountSerializer.md +17 -0
- data/docs/UserCashoutSerializer.md +20 -0
- data/docs/UserIncomeRequestSerializer.md +15 -0
- data/docs/UserPlatformMembershipRequestSerializer.md +13 -0
- data/docs/UserSerializer.md +40 -0
- data/docs/UsersApi.md +2173 -0
- data/docs/WriteAccountSerializer.md +16 -0
- data/docs/WriteCashoutCalculationSerializer.md +8 -0
- data/docs/WriteCashoutSerializer.md +16 -0
- data/docs/WriteCashoutSliceSerializer.md +11 -0
- data/docs/WriteCompanyInformationSerializer.md +17 -0
- data/docs/WriteContactInfoSerializer.md +10 -0
- data/docs/WriteContactInformationSerializer.md +15 -0
- data/docs/WriteContractorSerializer.md +14 -0
- data/docs/WriteIncomeNestedSerializer.md +12 -0
- data/docs/WriteIncomeSerializer.md +13 -0
- data/docs/WriteIncomeSerializerFixedSource.md +12 -0
- data/docs/WriteInvoiceSerializer.md +13 -0
- data/docs/WriteInvoiceSerializerFixedSourceCreate.md +9 -0
- data/docs/WriteJSONWebTokenSerializer.md +7 -0
- data/docs/WriteManagerPlatformSerializer.md +15 -0
- data/docs/WriteManagerSerializer.md +8 -0
- data/docs/WriteMembershipSerializer.md +8 -0
- data/docs/WritePersonalInformationSerializer.md +16 -0
- data/docs/WritePlaidPublicTokenSerializer.md +8 -0
- data/docs/WritePlatformIncomeRequestSerializer.md +10 -0
- data/docs/WritePlatformMembershipRequestSerializer.md +7 -0
- data/docs/WritePlatformSerializer.md +19 -0
- data/docs/WritePlatformSummarySerializer.md +8 -0
- data/docs/WriteRebateSerializer.md +9 -0
- data/docs/WriteReceivablesSerializer.md +8 -0
- data/docs/WriteTaxSavingsSerializer.md +8 -0
- data/docs/WriteUserAccountSerializer.md +14 -0
- data/docs/WriteUserCashoutSerializer.md +15 -0
- data/docs/WriteUserIncomeRequestSerializer.md +10 -0
- data/docs/WriteUserPlatformMembershipRequestSerializer.md +9 -0
- data/docs/WriteUserSerializer.md +21 -0
- data/generate-client.sh +6 -0
- data/lib/qwil_api/api/accounts_api.rb +320 -0
- data/lib/qwil_api/api/apitokenauth_api.rb +87 -0
- data/lib/qwil_api/api/cashouts_api.rb +89 -0
- data/lib/qwil_api/api/income_api.rb +142 -0
- data/lib/qwil_api/api/invoices_api.rb +142 -0
- data/lib/qwil_api/api/managers_api.rb +237 -0
- data/lib/qwil_api/api/memberships_api.rb +89 -0
- data/lib/qwil_api/api/platforms_api.rb +1674 -0
- data/lib/qwil_api/api/rebates_api.rb +142 -0
- data/lib/qwil_api/api/users_api.rb +2672 -0
- data/lib/qwil_api/api_client.rb +376 -0
- data/lib/qwil_api/api_error.rb +45 -0
- data/lib/qwil_api/configuration.rb +205 -0
- data/lib/qwil_api/models/account_serializer.rb +370 -0
- data/lib/qwil_api/models/cashout_calculation_serializer.rb +221 -0
- data/lib/qwil_api/models/cashout_serializer.rb +379 -0
- data/lib/qwil_api/models/cashout_slice_serializer.rb +232 -0
- data/lib/qwil_api/models/company_information_serializer.rb +299 -0
- data/lib/qwil_api/models/contact_info_serializer.rb +218 -0
- data/lib/qwil_api/models/contact_information_serializer.rb +280 -0
- data/lib/qwil_api/models/contractor_serializer.rb +361 -0
- data/lib/qwil_api/models/income_nested_serializer.rb +302 -0
- data/lib/qwil_api/models/income_serializer.rb +302 -0
- data/lib/qwil_api/models/income_serializer_fixed_source.rb +302 -0
- data/lib/qwil_api/models/invoice_serializer.rb +299 -0
- data/lib/qwil_api/models/invoice_serializer_fixed_source_create.rb +299 -0
- data/lib/qwil_api/models/json_web_token_serializer.rb +188 -0
- data/lib/qwil_api/models/manager_platform_serializer.rb +391 -0
- data/lib/qwil_api/models/manager_serializer.rb +218 -0
- data/lib/qwil_api/models/membership_serializer.rb +208 -0
- data/lib/qwil_api/models/personal_information_serializer.rb +279 -0
- data/lib/qwil_api/models/plaid_public_token_serializer.rb +199 -0
- data/lib/qwil_api/models/platform_income_request_serializer.rb +307 -0
- data/lib/qwil_api/models/platform_membership_request_serializer.rb +262 -0
- data/lib/qwil_api/models/platform_serializer.rb +480 -0
- data/lib/qwil_api/models/platform_summary_serializer.rb +218 -0
- data/lib/qwil_api/models/rebate_serializer.rb +276 -0
- data/lib/qwil_api/models/receivables_serializer.rb +208 -0
- data/lib/qwil_api/models/tax_savings_serializer.rb +219 -0
- data/lib/qwil_api/models/user_account_serializer.rb +359 -0
- data/lib/qwil_api/models/user_cashout_serializer.rb +379 -0
- data/lib/qwil_api/models/user_income_request_serializer.rb +307 -0
- data/lib/qwil_api/models/user_platform_membership_request_serializer.rb +283 -0
- data/lib/qwil_api/models/user_serializer.rb +592 -0
- data/lib/qwil_api/models/write_account_serializer.rb +331 -0
- data/lib/qwil_api/models/write_cashout_calculation_serializer.rb +198 -0
- data/lib/qwil_api/models/write_cashout_serializer.rb +316 -0
- data/lib/qwil_api/models/write_cashout_slice_serializer.rb +232 -0
- data/lib/qwil_api/models/write_company_information_serializer.rb +280 -0
- data/lib/qwil_api/models/write_contact_info_serializer.rb +218 -0
- data/lib/qwil_api/models/write_contact_information_serializer.rb +262 -0
- data/lib/qwil_api/models/write_contractor_serializer.rb +289 -0
- data/lib/qwil_api/models/write_income_nested_serializer.rb +236 -0
- data/lib/qwil_api/models/write_income_serializer.rb +247 -0
- data/lib/qwil_api/models/write_income_serializer_fixed_source.rb +236 -0
- data/lib/qwil_api/models/write_invoice_serializer.rb +252 -0
- data/lib/qwil_api/models/write_invoice_serializer_fixed_source_create.rb +210 -0
- data/lib/qwil_api/models/write_json_web_token_serializer.rb +188 -0
- data/lib/qwil_api/models/write_manager_platform_serializer.rb +314 -0
- data/lib/qwil_api/models/write_manager_serializer.rb +198 -0
- data/lib/qwil_api/models/write_membership_serializer.rb +198 -0
- data/lib/qwil_api/models/write_personal_information_serializer.rb +270 -0
- data/lib/qwil_api/models/write_plaid_public_token_serializer.rb +199 -0
- data/lib/qwil_api/models/write_platform_income_request_serializer.rb +220 -0
- data/lib/qwil_api/models/write_platform_membership_request_serializer.rb +188 -0
- data/lib/qwil_api/models/write_platform_serializer.rb +309 -0
- data/lib/qwil_api/models/write_platform_summary_serializer.rb +198 -0
- data/lib/qwil_api/models/write_rebate_serializer.rb +209 -0
- data/lib/qwil_api/models/write_receivables_serializer.rb +198 -0
- data/lib/qwil_api/models/write_tax_savings_serializer.rb +198 -0
- data/lib/qwil_api/models/write_user_account_serializer.rb +312 -0
- data/lib/qwil_api/models/write_user_cashout_serializer.rb +307 -0
- data/lib/qwil_api/models/write_user_income_request_serializer.rb +220 -0
- data/lib/qwil_api/models/write_user_platform_membership_request_serializer.rb +208 -0
- data/lib/qwil_api/models/write_user_serializer.rb +358 -0
- data/lib/qwil_api/version.rb +24 -0
- data/lib/qwil_api.rb +51 -0
- data/qwil_api.gemspec +53 -0
- data/spec/api/accounts_api_spec.rb +110 -0
- data/spec/api/apitokenauth_api_spec.rb +56 -0
- data/spec/api/cashouts_api_spec.rb +56 -0
- data/spec/api/income_api_spec.rb +67 -0
- data/spec/api/invoices_api_spec.rb +67 -0
- data/spec/api/managers_api_spec.rb +88 -0
- data/spec/api/memberships_api_spec.rb +56 -0
- data/spec/api/platforms_api_spec.rb +398 -0
- data/spec/api/rebates_api_spec.rb +67 -0
- data/spec/api/users_api_spec.rb +625 -0
- data/spec/api_client_spec.rb +235 -0
- data/spec/configuration_spec.rb +51 -0
- data/spec/models/account_serializer_spec.rb +111 -0
- data/spec/models/cashout_calculation_serializer_spec.rb +63 -0
- data/spec/models/cashout_serializer_spec.rb +135 -0
- data/spec/models/cashout_slice_serializer_spec.rb +69 -0
- data/spec/models/company_information_serializer_spec.rb +111 -0
- data/spec/models/contact_info_serializer_spec.rb +63 -0
- data/spec/models/contact_information_serializer_spec.rb +99 -0
- data/spec/models/contractor_serializer_spec.rb +127 -0
- data/spec/models/income_nested_serializer_spec.rb +111 -0
- data/spec/models/income_serializer_fixed_source_spec.rb +111 -0
- data/spec/models/income_serializer_spec.rb +111 -0
- data/spec/models/invoice_serializer_fixed_source_create_spec.rb +105 -0
- data/spec/models/invoice_serializer_spec.rb +105 -0
- data/spec/models/json_web_token_serializer_spec.rb +45 -0
- data/spec/models/manager_platform_serializer_spec.rb +143 -0
- data/spec/models/manager_serializer_spec.rb +63 -0
- data/spec/models/membership_serializer_spec.rb +57 -0
- data/spec/models/personal_information_serializer_spec.rb +99 -0
- data/spec/models/plaid_public_token_serializer_spec.rb +51 -0
- data/spec/models/platform_income_request_serializer_spec.rb +97 -0
- data/spec/models/platform_membership_request_serializer_spec.rb +73 -0
- data/spec/models/platform_serializer_spec.rb +191 -0
- data/spec/models/platform_summary_serializer_spec.rb +63 -0
- data/spec/models/rebate_serializer_spec.rb +93 -0
- data/spec/models/receivables_serializer_spec.rb +57 -0
- data/spec/models/tax_savings_serializer_spec.rb +63 -0
- data/spec/models/user_account_serializer_spec.rb +105 -0
- data/spec/models/user_cashout_serializer_spec.rb +135 -0
- data/spec/models/user_income_request_serializer_spec.rb +97 -0
- data/spec/models/user_platform_membership_request_serializer_spec.rb +85 -0
- data/spec/models/user_serializer_spec.rb +251 -0
- data/spec/models/write_account_serializer_spec.rb +99 -0
- data/spec/models/write_cashout_calculation_serializer_spec.rb +51 -0
- data/spec/models/write_cashout_serializer_spec.rb +107 -0
- data/spec/models/write_cashout_slice_serializer_spec.rb +69 -0
- data/spec/models/write_company_information_serializer_spec.rb +105 -0
- data/spec/models/write_contact_info_serializer_spec.rb +63 -0
- data/spec/models/write_contact_information_serializer_spec.rb +93 -0
- data/spec/models/write_contractor_serializer_spec.rb +91 -0
- data/spec/models/write_income_nested_serializer_spec.rb +75 -0
- data/spec/models/write_income_serializer_fixed_source_spec.rb +75 -0
- data/spec/models/write_income_serializer_spec.rb +81 -0
- data/spec/models/write_invoice_serializer_fixed_source_create_spec.rb +57 -0
- data/spec/models/write_invoice_serializer_spec.rb +81 -0
- data/spec/models/write_json_web_token_serializer_spec.rb +45 -0
- data/spec/models/write_manager_platform_serializer_spec.rb +101 -0
- data/spec/models/write_manager_serializer_spec.rb +51 -0
- data/spec/models/write_membership_serializer_spec.rb +51 -0
- data/spec/models/write_personal_information_serializer_spec.rb +99 -0
- data/spec/models/write_plaid_public_token_serializer_spec.rb +51 -0
- data/spec/models/write_platform_income_request_serializer_spec.rb +63 -0
- data/spec/models/write_platform_membership_request_serializer_spec.rb +45 -0
- data/spec/models/write_platform_serializer_spec.rb +117 -0
- data/spec/models/write_platform_summary_serializer_spec.rb +51 -0
- data/spec/models/write_rebate_serializer_spec.rb +57 -0
- data/spec/models/write_receivables_serializer_spec.rb +51 -0
- data/spec/models/write_tax_savings_serializer_spec.rb +51 -0
- data/spec/models/write_user_account_serializer_spec.rb +87 -0
- data/spec/models/write_user_cashout_serializer_spec.rb +101 -0
- data/spec/models/write_user_income_request_serializer_spec.rb +63 -0
- data/spec/models/write_user_platform_membership_request_serializer_spec.rb +57 -0
- data/spec/models/write_user_serializer_spec.rb +133 -0
- data/spec/spec_helper.rb +120 -0
- data/swagger-codegen-config.json +9 -0
- metadata +527 -0
@@ -0,0 +1,235 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
|
24
|
+
describe QwilAPI::ApiClient do
|
25
|
+
context 'initialization' do
|
26
|
+
context 'URL stuff' do
|
27
|
+
context 'host' do
|
28
|
+
it 'removes http from host' do
|
29
|
+
QwilAPI.configure { |c| c.host = 'http://example.com' }
|
30
|
+
expect(QwilAPI::Configuration.default.host).to eq('example.com')
|
31
|
+
end
|
32
|
+
|
33
|
+
it 'removes https from host' do
|
34
|
+
QwilAPI.configure { |c| c.host = 'https://wookiee.com' }
|
35
|
+
expect(QwilAPI::ApiClient.default.config.host).to eq('wookiee.com')
|
36
|
+
end
|
37
|
+
|
38
|
+
it 'removes trailing path from host' do
|
39
|
+
QwilAPI.configure { |c| c.host = 'hobo.com/v4' }
|
40
|
+
expect(QwilAPI::Configuration.default.host).to eq('hobo.com')
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
context 'base_path' do
|
45
|
+
it "prepends a slash to base_path" do
|
46
|
+
QwilAPI.configure { |c| c.base_path = 'v4/dog' }
|
47
|
+
expect(QwilAPI::Configuration.default.base_path).to eq('/v4/dog')
|
48
|
+
end
|
49
|
+
|
50
|
+
it "doesn't prepend a slash if one is already there" do
|
51
|
+
QwilAPI.configure { |c| c.base_path = '/v4/dog' }
|
52
|
+
expect(QwilAPI::Configuration.default.base_path).to eq('/v4/dog')
|
53
|
+
end
|
54
|
+
|
55
|
+
it "ends up as a blank string if nil" do
|
56
|
+
QwilAPI.configure { |c| c.base_path = nil }
|
57
|
+
expect(QwilAPI::Configuration.default.base_path).to eq('')
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
describe "params_encoding in #build_request" do
|
64
|
+
let(:config) { QwilAPI::Configuration.new }
|
65
|
+
let(:api_client) { QwilAPI::ApiClient.new(config) }
|
66
|
+
|
67
|
+
it "defaults to nil" do
|
68
|
+
expect(QwilAPI::Configuration.default.params_encoding).to eq(nil)
|
69
|
+
expect(config.params_encoding).to eq(nil)
|
70
|
+
|
71
|
+
request = api_client.build_request(:get, '/test')
|
72
|
+
expect(request.options[:params_encoding]).to eq(nil)
|
73
|
+
end
|
74
|
+
|
75
|
+
it "can be customized" do
|
76
|
+
config.params_encoding = :multi
|
77
|
+
request = api_client.build_request(:get, '/test')
|
78
|
+
expect(request.options[:params_encoding]).to eq(:multi)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
82
|
+
describe "timeout in #build_request" do
|
83
|
+
let(:config) { QwilAPI::Configuration.new }
|
84
|
+
let(:api_client) { QwilAPI::ApiClient.new(config) }
|
85
|
+
|
86
|
+
it "defaults to 0" do
|
87
|
+
expect(QwilAPI::Configuration.default.timeout).to eq(0)
|
88
|
+
expect(config.timeout).to eq(0)
|
89
|
+
|
90
|
+
request = api_client.build_request(:get, '/test')
|
91
|
+
expect(request.options[:timeout]).to eq(0)
|
92
|
+
end
|
93
|
+
|
94
|
+
it "can be customized" do
|
95
|
+
config.timeout = 100
|
96
|
+
request = api_client.build_request(:get, '/test')
|
97
|
+
expect(request.options[:timeout]).to eq(100)
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
describe "#deserialize" do
|
102
|
+
it "handles Array<Integer>" do
|
103
|
+
api_client = QwilAPI::ApiClient.new
|
104
|
+
headers = {'Content-Type' => 'application/json'}
|
105
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
106
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
107
|
+
expect(data).to be_instance_of(Array)
|
108
|
+
expect(data).to eq([12, 34])
|
109
|
+
end
|
110
|
+
|
111
|
+
it "handles Array<Array<Integer>>" do
|
112
|
+
api_client = QwilAPI::ApiClient.new
|
113
|
+
headers = {'Content-Type' => 'application/json'}
|
114
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
115
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
116
|
+
expect(data).to be_instance_of(Array)
|
117
|
+
expect(data).to eq([[12, 34], [56]])
|
118
|
+
end
|
119
|
+
|
120
|
+
it "handles Hash<String, String>" do
|
121
|
+
api_client = QwilAPI::ApiClient.new
|
122
|
+
headers = {'Content-Type' => 'application/json'}
|
123
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
124
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
125
|
+
expect(data).to be_instance_of(Hash)
|
126
|
+
expect(data).to eq({:message => 'Hello'})
|
127
|
+
end
|
128
|
+
end
|
129
|
+
|
130
|
+
describe "#object_to_hash" do
|
131
|
+
it "ignores nils and includes empty arrays" do
|
132
|
+
# uncomment below to test object_to_hash for model
|
133
|
+
#api_client = QwilAPI::ApiClient.new
|
134
|
+
#_model = QwilAPI::ModelName.new
|
135
|
+
# update the model attribute below
|
136
|
+
#_model.id = 1
|
137
|
+
# update the expected value (hash) below
|
138
|
+
#expected = {id: 1, name: '', tags: []}
|
139
|
+
#expect(api_client.object_to_hash(_model)).to eq(expected)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
describe "#build_collection_param" do
|
144
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
145
|
+
let(:api_client) { QwilAPI::ApiClient.new }
|
146
|
+
|
147
|
+
it "works for csv" do
|
148
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
149
|
+
end
|
150
|
+
|
151
|
+
it "works for ssv" do
|
152
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
153
|
+
end
|
154
|
+
|
155
|
+
it "works for tsv" do
|
156
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
157
|
+
end
|
158
|
+
|
159
|
+
it "works for pipes" do
|
160
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
161
|
+
end
|
162
|
+
|
163
|
+
it "works for multi" do
|
164
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
165
|
+
end
|
166
|
+
|
167
|
+
it "fails for invalid collection format" do
|
168
|
+
expect(proc { api_client.build_collection_param(param, :INVALID) }).to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
describe "#json_mime?" do
|
173
|
+
let(:api_client) { QwilAPI::ApiClient.new }
|
174
|
+
|
175
|
+
it "works" do
|
176
|
+
expect(api_client.json_mime?(nil)).to eq false
|
177
|
+
expect(api_client.json_mime?('')).to eq false
|
178
|
+
|
179
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
180
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
181
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
182
|
+
|
183
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
184
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
185
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
describe "#select_header_accept" do
|
190
|
+
let(:api_client) { QwilAPI::ApiClient.new }
|
191
|
+
|
192
|
+
it "works" do
|
193
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
194
|
+
expect(api_client.select_header_accept([])).to be_nil
|
195
|
+
|
196
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
197
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
198
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
199
|
+
|
200
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
201
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
describe "#select_header_content_type" do
|
206
|
+
let(:api_client) { QwilAPI::ApiClient.new }
|
207
|
+
|
208
|
+
it "works" do
|
209
|
+
expect(api_client.select_header_content_type(nil)).to eq('application/json')
|
210
|
+
expect(api_client.select_header_content_type([])).to eq('application/json')
|
211
|
+
|
212
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
213
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
214
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
215
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
216
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
217
|
+
end
|
218
|
+
end
|
219
|
+
|
220
|
+
describe "#sanitize_filename" do
|
221
|
+
let(:api_client) { QwilAPI::ApiClient.new }
|
222
|
+
|
223
|
+
it "works" do
|
224
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
225
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
226
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
227
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
228
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
229
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
230
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
231
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
232
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
233
|
+
end
|
234
|
+
end
|
235
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
|
24
|
+
describe QwilAPI::Configuration do
|
25
|
+
let(:config) { QwilAPI::Configuration.default }
|
26
|
+
|
27
|
+
before(:each) do
|
28
|
+
# uncomment below to setup host and base_path
|
29
|
+
#require 'URI'
|
30
|
+
#uri = URI.parse("http://localhost:8000/")
|
31
|
+
#QwilAPI.configure do |c|
|
32
|
+
# c.host = uri.host
|
33
|
+
# c.base_path = uri.path
|
34
|
+
#end
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#base_url' do
|
38
|
+
it 'should have the default value' do
|
39
|
+
# uncomment below to test default value of the base path
|
40
|
+
#expect(config.base_url).to eq("http://localhost:8000/")
|
41
|
+
end
|
42
|
+
|
43
|
+
it 'should remove trailing slashes' do
|
44
|
+
[nil, '', '/', '//'].each do |base_path|
|
45
|
+
config.base_path = base_path
|
46
|
+
# uncomment below to test trailing slashes
|
47
|
+
#expect(config.base_url).to eq("http://localhost:8000/")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
@@ -0,0 +1,111 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
require 'json'
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
# Unit tests for QwilAPI::AccountSerializer
|
27
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
28
|
+
# Please update as you see appropriate
|
29
|
+
describe 'AccountSerializer' do
|
30
|
+
before do
|
31
|
+
# run before each test
|
32
|
+
@instance = QwilAPI::AccountSerializer.new
|
33
|
+
end
|
34
|
+
|
35
|
+
after do
|
36
|
+
# run after each test
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of AccountSerializer' do
|
40
|
+
it 'should create an instact of AccountSerializer' do
|
41
|
+
expect(@instance).to be_instance_of(QwilAPI::AccountSerializer)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe 'test attribute "url"' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'test attribute "account_number"' do
|
51
|
+
it 'should work' do
|
52
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'test attribute "name"' 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
|
+
describe 'test attribute "routing_number"' do
|
63
|
+
it 'should work' do
|
64
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe 'test attribute "is_tax_savings"' do
|
69
|
+
it 'should work' do
|
70
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe 'test attribute "is_paypal"' do
|
75
|
+
it 'should work' do
|
76
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
describe 'test attribute "is_mychoice"' do
|
81
|
+
it 'should work' do
|
82
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
describe 'test attribute "mychoice_user_id"' do
|
87
|
+
it 'should work' do
|
88
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
describe 'test attribute "mychoice_card_id"' do
|
93
|
+
it 'should work' do
|
94
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
95
|
+
end
|
96
|
+
end
|
97
|
+
|
98
|
+
describe 'test attribute "deleted"' do
|
99
|
+
it 'should work' do
|
100
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe 'test attribute "user"' do
|
105
|
+
it 'should work' do
|
106
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
end
|
111
|
+
|
@@ -0,0 +1,63 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
require 'json'
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
# Unit tests for QwilAPI::CashoutCalculationSerializer
|
27
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
28
|
+
# Please update as you see appropriate
|
29
|
+
describe 'CashoutCalculationSerializer' do
|
30
|
+
before do
|
31
|
+
# run before each test
|
32
|
+
@instance = QwilAPI::CashoutCalculationSerializer.new
|
33
|
+
end
|
34
|
+
|
35
|
+
after do
|
36
|
+
# run after each test
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of CashoutCalculationSerializer' do
|
40
|
+
it 'should create an instact of CashoutCalculationSerializer' do
|
41
|
+
expect(@instance).to be_instance_of(QwilAPI::CashoutCalculationSerializer)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe 'test attribute "amount"' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'test attribute "fee"' do
|
51
|
+
it 'should work' do
|
52
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'test attribute "maximum_available"' 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
|
63
|
+
|
@@ -0,0 +1,135 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
require 'json'
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
# Unit tests for QwilAPI::CashoutSerializer
|
27
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
28
|
+
# Please update as you see appropriate
|
29
|
+
describe 'CashoutSerializer' do
|
30
|
+
before do
|
31
|
+
# run before each test
|
32
|
+
@instance = QwilAPI::CashoutSerializer.new
|
33
|
+
end
|
34
|
+
|
35
|
+
after do
|
36
|
+
# run after each test
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of CashoutSerializer' do
|
40
|
+
it 'should create an instact of CashoutSerializer' do
|
41
|
+
expect(@instance).to be_instance_of(QwilAPI::CashoutSerializer)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe 'test attribute "url"' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'test attribute "amount"' do
|
51
|
+
it 'should work' do
|
52
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'test attribute "fee"' 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
|
+
describe 'test attribute "cashout_time"' do
|
63
|
+
it 'should work' do
|
64
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe 'test attribute "notes"' do
|
69
|
+
it 'should work' do
|
70
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
71
|
+
end
|
72
|
+
end
|
73
|
+
|
74
|
+
describe 'test attribute "type"' do
|
75
|
+
it 'should work' do
|
76
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
77
|
+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["CASHOUT", "DEBIT", "REBATE"])
|
78
|
+
#validator.allowable_values.each do |value|
|
79
|
+
# expect { @instance.type = value }.not_to raise_error
|
80
|
+
#end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe 'test attribute "method"' do
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["ACH", "CHECK", "WIRE", "PAYPAL"])
|
88
|
+
#validator.allowable_values.each do |value|
|
89
|
+
# expect { @instance.method = value }.not_to raise_error
|
90
|
+
#end
|
91
|
+
end
|
92
|
+
end
|
93
|
+
|
94
|
+
describe 'test attribute "status"' do
|
95
|
+
it 'should work' do
|
96
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
97
|
+
#validator = Petstore::EnumTest::EnumAttributeValidator.new('String', ["REQUESTED", "PENDING", "COMPLETED", "REJECTED"])
|
98
|
+
#validator.allowable_values.each do |value|
|
99
|
+
# expect { @instance.status = value }.not_to raise_error
|
100
|
+
#end
|
101
|
+
end
|
102
|
+
end
|
103
|
+
|
104
|
+
describe 'test attribute "transmit_time"' do
|
105
|
+
it 'should work' do
|
106
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
describe 'test attribute "user"' do
|
111
|
+
it 'should work' do
|
112
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
113
|
+
end
|
114
|
+
end
|
115
|
+
|
116
|
+
describe 'test attribute "rebate"' do
|
117
|
+
it 'should work' do
|
118
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
119
|
+
end
|
120
|
+
end
|
121
|
+
|
122
|
+
describe 'test attribute "account"' do
|
123
|
+
it 'should work' do
|
124
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
describe 'test attribute "incomes"' do
|
129
|
+
it 'should work' do
|
130
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
131
|
+
end
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
|
@@ -0,0 +1,69 @@
|
|
1
|
+
=begin
|
2
|
+
#No descripton provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
|
3
|
+
|
4
|
+
OpenAPI spec version:
|
5
|
+
|
6
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
7
|
+
|
8
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
9
|
+
you may not use this file except in compliance with the License.
|
10
|
+
You may obtain a copy of the License at
|
11
|
+
|
12
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
13
|
+
|
14
|
+
Unless required by applicable law or agreed to in writing, software
|
15
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
16
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
17
|
+
See the License for the specific language governing permissions and
|
18
|
+
limitations under the License.
|
19
|
+
|
20
|
+
=end
|
21
|
+
|
22
|
+
require 'spec_helper'
|
23
|
+
require 'json'
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
# Unit tests for QwilAPI::CashoutSliceSerializer
|
27
|
+
# Automatically generated by swagger-codegen (github.com/swagger-api/swagger-codegen)
|
28
|
+
# Please update as you see appropriate
|
29
|
+
describe 'CashoutSliceSerializer' do
|
30
|
+
before do
|
31
|
+
# run before each test
|
32
|
+
@instance = QwilAPI::CashoutSliceSerializer.new
|
33
|
+
end
|
34
|
+
|
35
|
+
after do
|
36
|
+
# run after each test
|
37
|
+
end
|
38
|
+
|
39
|
+
describe 'test an instance of CashoutSliceSerializer' do
|
40
|
+
it 'should create an instact of CashoutSliceSerializer' do
|
41
|
+
expect(@instance).to be_instance_of(QwilAPI::CashoutSliceSerializer)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
describe 'test attribute "amount"' do
|
45
|
+
it 'should work' do
|
46
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
describe 'test attribute "fee"' do
|
51
|
+
it 'should work' do
|
52
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
describe 'test attribute "cashout"' 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
|
+
describe 'test attribute "income"' do
|
63
|
+
it 'should work' do
|
64
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
end
|
69
|
+
|