forestvpn_cloud_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/Gemfile +9 -0
- data/README.md +139 -0
- data/Rakefile +10 -0
- data/docs/Action.md +32 -0
- data/docs/Activity.md +36 -0
- data/docs/Address.md +28 -0
- data/docs/Billing.md +24 -0
- data/docs/Country.md +26 -0
- data/docs/CreateBillingRequest.md +22 -0
- data/docs/CreateOrUpdateDataUsageLimitRequest.md +20 -0
- data/docs/CreateOrUpdatePaymentProfileRequest.md +34 -0
- data/docs/CreateOrUpdateProfileRequest.md +22 -0
- data/docs/DataUsageLimit.md +24 -0
- data/docs/Error.md +20 -0
- data/docs/GeoApi.md +77 -0
- data/docs/LimitsApi.md +447 -0
- data/docs/Location.md +28 -0
- data/docs/PaymentMethod.md +24 -0
- data/docs/PaymentProfile.md +32 -0
- data/docs/Profile.md +26 -0
- data/docs/ProfileStats.md +26 -0
- data/docs/ProfilesApi.md +996 -0
- data/docs/Project.md +22 -0
- data/docs/ResourceRef.md +20 -0
- data/docs/User.md +32 -0
- data/forestvpn_cloud_api.gemspec +39 -0
- data/git_push.sh +57 -0
- data/lib/forestvpn_cloud_api/api/geo_api.rb +77 -0
- data/lib/forestvpn_cloud_api/api/limits_api.rb +405 -0
- data/lib/forestvpn_cloud_api/api/profiles_api.rb +915 -0
- data/lib/forestvpn_cloud_api/api_client.rb +426 -0
- data/lib/forestvpn_cloud_api/api_error.rb +57 -0
- data/lib/forestvpn_cloud_api/configuration.rb +335 -0
- data/lib/forestvpn_cloud_api/models/action.rb +348 -0
- data/lib/forestvpn_cloud_api/models/activity.rb +360 -0
- data/lib/forestvpn_cloud_api/models/address.rb +269 -0
- data/lib/forestvpn_cloud_api/models/billing.rb +266 -0
- data/lib/forestvpn_cloud_api/models/country.rb +282 -0
- data/lib/forestvpn_cloud_api/models/create_billing_request.rb +252 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_data_usage_limit_request.rb +230 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_payment_profile_request.rb +328 -0
- data/lib/forestvpn_cloud_api/models/create_or_update_profile_request.rb +275 -0
- data/lib/forestvpn_cloud_api/models/data_usage_limit.rb +302 -0
- data/lib/forestvpn_cloud_api/models/error.rb +238 -0
- data/lib/forestvpn_cloud_api/models/location.rb +296 -0
- data/lib/forestvpn_cloud_api/models/payment_method.rb +261 -0
- data/lib/forestvpn_cloud_api/models/payment_profile.rb +313 -0
- data/lib/forestvpn_cloud_api/models/profile.rb +320 -0
- data/lib/forestvpn_cloud_api/models/profile_stats.rb +280 -0
- data/lib/forestvpn_cloud_api/models/project.rb +254 -0
- data/lib/forestvpn_cloud_api/models/resource_ref.rb +238 -0
- data/lib/forestvpn_cloud_api/models/user.rb +307 -0
- data/lib/forestvpn_cloud_api/version.rb +15 -0
- data/lib/forestvpn_cloud_api.rb +61 -0
- data/spec/api/geo_api_spec.rb +45 -0
- data/spec/api/limits_api_spec.rb +102 -0
- data/spec/api/profiles_api_spec.rb +195 -0
- data/spec/api_client_spec.rb +188 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/action_spec.rb +80 -0
- data/spec/models/activity_spec.rb +92 -0
- data/spec/models/address_spec.rb +64 -0
- data/spec/models/billing_spec.rb +52 -0
- data/spec/models/country_spec.rb +58 -0
- data/spec/models/create_billing_request_spec.rb +46 -0
- data/spec/models/create_or_update_data_usage_limit_request_spec.rb +40 -0
- data/spec/models/create_or_update_payment_profile_request_spec.rb +82 -0
- data/spec/models/create_or_update_profile_request_spec.rb +50 -0
- data/spec/models/data_usage_limit_spec.rb +56 -0
- data/spec/models/error_spec.rb +40 -0
- data/spec/models/location_spec.rb +64 -0
- data/spec/models/payment_method_spec.rb +52 -0
- data/spec/models/payment_profile_spec.rb +76 -0
- data/spec/models/profile_spec.rb +62 -0
- data/spec/models/profile_stats_spec.rb +58 -0
- data/spec/models/project_spec.rb +46 -0
- data/spec/models/resource_ref_spec.rb +40 -0
- data/spec/models/user_spec.rb +76 -0
- data/spec/spec_helper.rb +111 -0
- metadata +203 -0
@@ -0,0 +1,102 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for ForestVPNCloudAPI::LimitsApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'LimitsApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = ForestVPNCloudAPI::LimitsApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of LimitsApi' do
|
30
|
+
it 'should create an instance of LimitsApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(ForestVPNCloudAPI::LimitsApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for create_data_usage_limit
|
36
|
+
# Create data usage limit
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [CreateOrUpdateDataUsageLimitRequest] :create_or_update_data_usage_limit_request
|
39
|
+
# @return [DataUsageLimit]
|
40
|
+
describe 'create_data_usage_limit test' 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
|
+
# unit tests for delete_data_usage_limit
|
47
|
+
# Delete data usage limit
|
48
|
+
# @param limit_id
|
49
|
+
# @param [Hash] opts the optional parameters
|
50
|
+
# @return [nil]
|
51
|
+
describe 'delete_data_usage_limit test' do
|
52
|
+
it 'should work' do
|
53
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# unit tests for get_data_usage_limit
|
58
|
+
# Data usage limit details
|
59
|
+
# @param limit_id
|
60
|
+
# @param [Hash] opts the optional parameters
|
61
|
+
# @return [DataUsageLimit]
|
62
|
+
describe 'get_data_usage_limit test' 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
|
+
# unit tests for lis_data_usage_limits
|
69
|
+
# Data usage limit list
|
70
|
+
# @param [Hash] opts the optional parameters
|
71
|
+
# @return [Array<DataUsageLimit>]
|
72
|
+
describe 'lis_data_usage_limits test' do
|
73
|
+
it 'should work' do
|
74
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
# unit tests for partial_update_data_usage_limit
|
79
|
+
# Partial update profile details
|
80
|
+
# @param limit_id
|
81
|
+
# @param create_or_update_data_usage_limit_request
|
82
|
+
# @param [Hash] opts the optional parameters
|
83
|
+
# @return [DataUsageLimit]
|
84
|
+
describe 'partial_update_data_usage_limit test' do
|
85
|
+
it 'should work' do
|
86
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
# unit tests for update_data_usage_limit
|
91
|
+
# Update data usage limit
|
92
|
+
# @param limit_id
|
93
|
+
# @param create_or_update_data_usage_limit_request
|
94
|
+
# @param [Hash] opts the optional parameters
|
95
|
+
# @return [DataUsageLimit]
|
96
|
+
describe 'update_data_usage_limit test' do
|
97
|
+
it 'should work' do
|
98
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
|
16
|
+
# Unit tests for ForestVPNCloudAPI::ProfilesApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'ProfilesApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = ForestVPNCloudAPI::ProfilesApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of ProfilesApi' do
|
30
|
+
it 'should create an instance of ProfilesApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(ForestVPNCloudAPI::ProfilesApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for create_profile
|
36
|
+
# Create profile
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @option opts [CreateOrUpdateProfileRequest] :create_or_update_profile_request
|
39
|
+
# @return [Profile]
|
40
|
+
describe 'create_profile test' 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
|
+
# unit tests for create_profile_data_usage_limit
|
47
|
+
# Create profile data usage limit
|
48
|
+
# @param profile_id
|
49
|
+
# @param [Hash] opts the optional parameters
|
50
|
+
# @option opts [CreateOrUpdateDataUsageLimitRequest] :create_or_update_data_usage_limit_request
|
51
|
+
# @return [DataUsageLimit]
|
52
|
+
describe 'create_profile_data_usage_limit test' 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
|
+
# unit tests for delete_profile
|
59
|
+
# Delete profile
|
60
|
+
# Deletes profile and all associated resources
|
61
|
+
# @param profile_id
|
62
|
+
# @param [Hash] opts the optional parameters
|
63
|
+
# @return [nil]
|
64
|
+
describe 'delete_profile test' 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
|
+
# unit tests for delete_profile_data_usage_limit
|
71
|
+
# Delete profile data usage limit
|
72
|
+
# @param profile_id
|
73
|
+
# @param limit_id
|
74
|
+
# @param [Hash] opts the optional parameters
|
75
|
+
# @return [nil]
|
76
|
+
describe 'delete_profile_data_usage_limit test' 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
|
+
# unit tests for get_profile
|
83
|
+
# Profile details
|
84
|
+
# @param profile_id
|
85
|
+
# @param [Hash] opts the optional parameters
|
86
|
+
# @return [Profile]
|
87
|
+
describe 'get_profile test' do
|
88
|
+
it 'should work' do
|
89
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
90
|
+
end
|
91
|
+
end
|
92
|
+
|
93
|
+
# unit tests for get_profile_data_usage_limit
|
94
|
+
# Profile data usage limit details
|
95
|
+
# @param profile_id
|
96
|
+
# @param limit_id
|
97
|
+
# @param [Hash] opts the optional parameters
|
98
|
+
# @return [DataUsageLimit]
|
99
|
+
describe 'get_profile_data_usage_limit test' do
|
100
|
+
it 'should work' do
|
101
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
# unit tests for list_profile_data_usage_limits
|
106
|
+
# Profile data usage limits list
|
107
|
+
# @param profile_id
|
108
|
+
# @param [Hash] opts the optional parameters
|
109
|
+
# @return [Array<DataUsageLimit>]
|
110
|
+
describe 'list_profile_data_usage_limits test' 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
|
+
# unit tests for list_profile_stats
|
117
|
+
# Profile stats list
|
118
|
+
# @param profile_id
|
119
|
+
# @param [Hash] opts the optional parameters
|
120
|
+
# @option opts [String] :aggregate_by
|
121
|
+
# @option opts [Date] :date_after
|
122
|
+
# @option opts [Date] :date_before
|
123
|
+
# @option opts [Float] :per_page
|
124
|
+
# @option opts [Float] :page
|
125
|
+
# @return [Array<ProfileStats>]
|
126
|
+
describe 'list_profile_stats test' do
|
127
|
+
it 'should work' do
|
128
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
129
|
+
end
|
130
|
+
end
|
131
|
+
|
132
|
+
# unit tests for list_profiles
|
133
|
+
# Profile list
|
134
|
+
# @param [Hash] opts the optional parameters
|
135
|
+
# @option opts [String] :external_key
|
136
|
+
# @option opts [Float] :per_page
|
137
|
+
# @option opts [Float] :page
|
138
|
+
# @return [Array<Profile>]
|
139
|
+
describe 'list_profiles test' do
|
140
|
+
it 'should work' do
|
141
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
# unit tests for partial_update_profile
|
146
|
+
# Partial update profile details
|
147
|
+
# @param profile_id
|
148
|
+
# @param create_or_update_profile_request
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @return [Profile]
|
151
|
+
describe 'partial_update_profile test' do
|
152
|
+
it 'should work' do
|
153
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# unit tests for partial_update_profile_data_usage_limit
|
158
|
+
# Partial update profile data usage limit
|
159
|
+
# @param profile_id
|
160
|
+
# @param limit_id
|
161
|
+
# @param create_or_update_data_usage_limit_request
|
162
|
+
# @param [Hash] opts the optional parameters
|
163
|
+
# @return [DataUsageLimit]
|
164
|
+
describe 'partial_update_profile_data_usage_limit test' do
|
165
|
+
it 'should work' do
|
166
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
# unit tests for update_profile
|
171
|
+
# Update profile details
|
172
|
+
# @param profile_id
|
173
|
+
# @param create_or_update_profile_request
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @return [Profile]
|
176
|
+
describe 'update_profile test' do
|
177
|
+
it 'should work' do
|
178
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
179
|
+
end
|
180
|
+
end
|
181
|
+
|
182
|
+
# unit tests for update_profile_data_usage_limit
|
183
|
+
# Update profile data usage limit
|
184
|
+
# @param profile_id
|
185
|
+
# @param limit_id
|
186
|
+
# @param create_or_update_data_usage_limit_request
|
187
|
+
# @param [Hash] opts the optional parameters
|
188
|
+
# @return [DataUsageLimit]
|
189
|
+
describe 'update_profile_data_usage_limit test' do
|
190
|
+
it 'should work' do
|
191
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
end
|
@@ -0,0 +1,188 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe ForestVPNCloudAPI::ApiClient do
|
16
|
+
context 'initialization' do
|
17
|
+
context 'URL stuff' do
|
18
|
+
context 'host' do
|
19
|
+
it 'removes http from host' do
|
20
|
+
ForestVPNCloudAPI.configure { |c| c.host = 'http://example.com' }
|
21
|
+
expect(ForestVPNCloudAPI::Configuration.default.host).to eq('example.com')
|
22
|
+
end
|
23
|
+
|
24
|
+
it 'removes https from host' do
|
25
|
+
ForestVPNCloudAPI.configure { |c| c.host = 'https://wookiee.com' }
|
26
|
+
expect(ForestVPNCloudAPI::ApiClient.default.config.host).to eq('wookiee.com')
|
27
|
+
end
|
28
|
+
|
29
|
+
it 'removes trailing path from host' do
|
30
|
+
ForestVPNCloudAPI.configure { |c| c.host = 'hobo.com/v4' }
|
31
|
+
expect(ForestVPNCloudAPI::Configuration.default.host).to eq('hobo.com')
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
context 'base_path' do
|
36
|
+
it "prepends a slash to base_path" do
|
37
|
+
ForestVPNCloudAPI.configure { |c| c.base_path = 'v4/dog' }
|
38
|
+
expect(ForestVPNCloudAPI::Configuration.default.base_path).to eq('/v4/dog')
|
39
|
+
end
|
40
|
+
|
41
|
+
it "doesn't prepend a slash if one is already there" do
|
42
|
+
ForestVPNCloudAPI.configure { |c| c.base_path = '/v4/dog' }
|
43
|
+
expect(ForestVPNCloudAPI::Configuration.default.base_path).to eq('/v4/dog')
|
44
|
+
end
|
45
|
+
|
46
|
+
it "ends up as a blank string if nil" do
|
47
|
+
ForestVPNCloudAPI.configure { |c| c.base_path = nil }
|
48
|
+
expect(ForestVPNCloudAPI::Configuration.default.base_path).to eq('')
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
describe '#deserialize' do
|
55
|
+
it "handles Array<Integer>" do
|
56
|
+
api_client = ForestVPNCloudAPI::ApiClient.new
|
57
|
+
headers = { 'Content-Type' => 'application/json' }
|
58
|
+
response = double('response', headers: headers, body: '[12, 34]')
|
59
|
+
data = api_client.deserialize(response, 'Array<Integer>')
|
60
|
+
expect(data).to be_instance_of(Array)
|
61
|
+
expect(data).to eq([12, 34])
|
62
|
+
end
|
63
|
+
|
64
|
+
it 'handles Array<Array<Integer>>' do
|
65
|
+
api_client = ForestVPNCloudAPI::ApiClient.new
|
66
|
+
headers = { 'Content-Type' => 'application/json' }
|
67
|
+
response = double('response', headers: headers, body: '[[12, 34], [56]]')
|
68
|
+
data = api_client.deserialize(response, 'Array<Array<Integer>>')
|
69
|
+
expect(data).to be_instance_of(Array)
|
70
|
+
expect(data).to eq([[12, 34], [56]])
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'handles Hash<String, String>' do
|
74
|
+
api_client = ForestVPNCloudAPI::ApiClient.new
|
75
|
+
headers = { 'Content-Type' => 'application/json' }
|
76
|
+
response = double('response', headers: headers, body: '{"message": "Hello"}')
|
77
|
+
data = api_client.deserialize(response, 'Hash<String, String>')
|
78
|
+
expect(data).to be_instance_of(Hash)
|
79
|
+
expect(data).to eq(:message => 'Hello')
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
describe "#object_to_hash" do
|
84
|
+
it 'ignores nils and includes empty arrays' do
|
85
|
+
# uncomment below to test object_to_hash for model
|
86
|
+
# api_client = ForestVPNCloudAPI::ApiClient.new
|
87
|
+
# _model = ForestVPNCloudAPI::ModelName.new
|
88
|
+
# update the model attribute below
|
89
|
+
# _model.id = 1
|
90
|
+
# update the expected value (hash) below
|
91
|
+
# expected = {id: 1, name: '', tags: []}
|
92
|
+
# expect(api_client.object_to_hash(_model)).to eq(expected)
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
describe '#build_collection_param' do
|
97
|
+
let(:param) { ['aa', 'bb', 'cc'] }
|
98
|
+
let(:api_client) { ForestVPNCloudAPI::ApiClient.new }
|
99
|
+
|
100
|
+
it 'works for csv' do
|
101
|
+
expect(api_client.build_collection_param(param, :csv)).to eq('aa,bb,cc')
|
102
|
+
end
|
103
|
+
|
104
|
+
it 'works for ssv' do
|
105
|
+
expect(api_client.build_collection_param(param, :ssv)).to eq('aa bb cc')
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'works for tsv' do
|
109
|
+
expect(api_client.build_collection_param(param, :tsv)).to eq("aa\tbb\tcc")
|
110
|
+
end
|
111
|
+
|
112
|
+
it 'works for pipes' do
|
113
|
+
expect(api_client.build_collection_param(param, :pipes)).to eq('aa|bb|cc')
|
114
|
+
end
|
115
|
+
|
116
|
+
it 'works for multi' do
|
117
|
+
expect(api_client.build_collection_param(param, :multi)).to eq(['aa', 'bb', 'cc'])
|
118
|
+
end
|
119
|
+
|
120
|
+
it 'fails for invalid collection format' do
|
121
|
+
expect { api_client.build_collection_param(param, :INVALID) }.to raise_error(RuntimeError, 'unknown collection format: :INVALID')
|
122
|
+
end
|
123
|
+
end
|
124
|
+
|
125
|
+
describe '#json_mime?' do
|
126
|
+
let(:api_client) { ForestVPNCloudAPI::ApiClient.new }
|
127
|
+
|
128
|
+
it 'works' do
|
129
|
+
expect(api_client.json_mime?(nil)).to eq false
|
130
|
+
expect(api_client.json_mime?('')).to eq false
|
131
|
+
|
132
|
+
expect(api_client.json_mime?('application/json')).to eq true
|
133
|
+
expect(api_client.json_mime?('application/json; charset=UTF8')).to eq true
|
134
|
+
expect(api_client.json_mime?('APPLICATION/JSON')).to eq true
|
135
|
+
|
136
|
+
expect(api_client.json_mime?('application/xml')).to eq false
|
137
|
+
expect(api_client.json_mime?('text/plain')).to eq false
|
138
|
+
expect(api_client.json_mime?('application/jsonp')).to eq false
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
describe '#select_header_accept' do
|
143
|
+
let(:api_client) { ForestVPNCloudAPI::ApiClient.new }
|
144
|
+
|
145
|
+
it 'works' do
|
146
|
+
expect(api_client.select_header_accept(nil)).to be_nil
|
147
|
+
expect(api_client.select_header_accept([])).to be_nil
|
148
|
+
|
149
|
+
expect(api_client.select_header_accept(['application/json'])).to eq('application/json')
|
150
|
+
expect(api_client.select_header_accept(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
151
|
+
expect(api_client.select_header_accept(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
152
|
+
|
153
|
+
expect(api_client.select_header_accept(['application/xml'])).to eq('application/xml')
|
154
|
+
expect(api_client.select_header_accept(['text/html', 'application/xml'])).to eq('text/html,application/xml')
|
155
|
+
end
|
156
|
+
end
|
157
|
+
|
158
|
+
describe '#select_header_content_type' do
|
159
|
+
let(:api_client) { ForestVPNCloudAPI::ApiClient.new }
|
160
|
+
|
161
|
+
it 'works' do
|
162
|
+
expect(api_client.select_header_content_type(nil)).to be_nil
|
163
|
+
expect(api_client.select_header_content_type([])).to be_nil
|
164
|
+
|
165
|
+
expect(api_client.select_header_content_type(['application/json'])).to eq('application/json')
|
166
|
+
expect(api_client.select_header_content_type(['application/xml', 'application/json; charset=UTF8'])).to eq('application/json; charset=UTF8')
|
167
|
+
expect(api_client.select_header_content_type(['APPLICATION/JSON', 'text/html'])).to eq('APPLICATION/JSON')
|
168
|
+
expect(api_client.select_header_content_type(['application/xml'])).to eq('application/xml')
|
169
|
+
expect(api_client.select_header_content_type(['text/plain', 'application/xml'])).to eq('text/plain')
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
describe '#sanitize_filename' do
|
174
|
+
let(:api_client) { ForestVPNCloudAPI::ApiClient.new }
|
175
|
+
|
176
|
+
it 'works' do
|
177
|
+
expect(api_client.sanitize_filename('sun')).to eq('sun')
|
178
|
+
expect(api_client.sanitize_filename('sun.gif')).to eq('sun.gif')
|
179
|
+
expect(api_client.sanitize_filename('../sun.gif')).to eq('sun.gif')
|
180
|
+
expect(api_client.sanitize_filename('/var/tmp/sun.gif')).to eq('sun.gif')
|
181
|
+
expect(api_client.sanitize_filename('./sun.gif')).to eq('sun.gif')
|
182
|
+
expect(api_client.sanitize_filename('..\sun.gif')).to eq('sun.gif')
|
183
|
+
expect(api_client.sanitize_filename('\var\tmp\sun.gif')).to eq('sun.gif')
|
184
|
+
expect(api_client.sanitize_filename('c:\var\tmp\sun.gif')).to eq('sun.gif')
|
185
|
+
expect(api_client.sanitize_filename('.\sun.gif')).to eq('sun.gif')
|
186
|
+
end
|
187
|
+
end
|
188
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
|
15
|
+
describe ForestVPNCloudAPI::Configuration do
|
16
|
+
let(:config) { ForestVPNCloudAPI::Configuration.default }
|
17
|
+
|
18
|
+
before(:each) do
|
19
|
+
# uncomment below to setup host and base_path
|
20
|
+
# require 'URI'
|
21
|
+
# uri = URI.parse("https://api.forestvpn.com/cloud/v1")
|
22
|
+
# ForestVPNCloudAPI.configure do |c|
|
23
|
+
# c.host = uri.host
|
24
|
+
# c.base_path = uri.path
|
25
|
+
# end
|
26
|
+
end
|
27
|
+
|
28
|
+
describe '#base_url' do
|
29
|
+
it 'should have the default value' do
|
30
|
+
# uncomment below to test default value of the base path
|
31
|
+
# expect(config.base_url).to eq("https://api.forestvpn.com/cloud/v1")
|
32
|
+
end
|
33
|
+
|
34
|
+
it 'should remove trailing slashes' do
|
35
|
+
[nil, '', '/', '//'].each do |base_path|
|
36
|
+
config.base_path = base_path
|
37
|
+
# uncomment below to test trailing slashes
|
38
|
+
# expect(config.base_url).to eq("https://api.forestvpn.com/cloud/v1")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
=begin
|
2
|
+
#ForestVPN Cloud API
|
3
|
+
|
4
|
+
#ForestVPN Cloud - it's a Google Cloud but for VPN apps. Ready to use VPN Cloud Platform minimizes efforts to build fast, secure, and modern VPN apps.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 2.0
|
7
|
+
Contact: support@forestvpn.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 6.0.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'spec_helper'
|
14
|
+
require 'json'
|
15
|
+
require 'date'
|
16
|
+
|
17
|
+
# Unit tests for ForestVPNCloudAPI::Action
|
18
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
19
|
+
# Please update as you see appropriate
|
20
|
+
describe ForestVPNCloudAPI::Action do
|
21
|
+
let(:instance) { ForestVPNCloudAPI::Action.new }
|
22
|
+
|
23
|
+
describe 'test an instance of Action' do
|
24
|
+
it 'should create an instance of Action' do
|
25
|
+
expect(instance).to be_instance_of(ForestVPNCloudAPI::Action)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
describe 'test attribute "id"' do
|
29
|
+
it 'should work' do
|
30
|
+
# assertion here. ref: https://www.relishapp.com/rspec/rspec-expectations/docs/built-in-matchers
|
31
|
+
end
|
32
|
+
end
|
33
|
+
|
34
|
+
describe 'test attribute "command"' 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 "error"' 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', ["running", "failed", "success"])
|
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 "progress"' 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 "resources"' 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 "created_at"' 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 "finished_at"' 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
|
+
end
|