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,238 @@
|
|
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 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module ForestVPNCloudAPI
|
17
|
+
class ResourceRef
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :type
|
21
|
+
|
22
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
23
|
+
def self.attribute_map
|
24
|
+
{
|
25
|
+
:'id' => :'id',
|
26
|
+
:'type' => :'type'
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
# Returns all the JSON keys this model knows about
|
31
|
+
def self.acceptable_attributes
|
32
|
+
attribute_map.values
|
33
|
+
end
|
34
|
+
|
35
|
+
# Attribute type mapping.
|
36
|
+
def self.openapi_types
|
37
|
+
{
|
38
|
+
:'id' => :'String',
|
39
|
+
:'type' => :'String'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# List of attributes with nullable: true
|
44
|
+
def self.openapi_nullable
|
45
|
+
Set.new([
|
46
|
+
])
|
47
|
+
end
|
48
|
+
|
49
|
+
# Initializes the object
|
50
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
51
|
+
def initialize(attributes = {})
|
52
|
+
if (!attributes.is_a?(Hash))
|
53
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ForestVPNCloudAPI::ResourceRef` initialize method"
|
54
|
+
end
|
55
|
+
|
56
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
58
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
59
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ForestVPNCloudAPI::ResourceRef`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
60
|
+
end
|
61
|
+
h[k.to_sym] = v
|
62
|
+
}
|
63
|
+
|
64
|
+
if attributes.key?(:'id')
|
65
|
+
self.id = attributes[:'id']
|
66
|
+
end
|
67
|
+
|
68
|
+
if attributes.key?(:'type')
|
69
|
+
self.type = attributes[:'type']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
74
|
+
# @return Array for valid properties with the reasons
|
75
|
+
def list_invalid_properties
|
76
|
+
invalid_properties = Array.new
|
77
|
+
if @id.nil?
|
78
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
79
|
+
end
|
80
|
+
|
81
|
+
if @type.nil?
|
82
|
+
invalid_properties.push('invalid value for "type", type cannot be nil.')
|
83
|
+
end
|
84
|
+
|
85
|
+
invalid_properties
|
86
|
+
end
|
87
|
+
|
88
|
+
# Check to see if the all the properties in the model are valid
|
89
|
+
# @return true if the model is valid
|
90
|
+
def valid?
|
91
|
+
return false if @id.nil?
|
92
|
+
return false if @type.nil?
|
93
|
+
true
|
94
|
+
end
|
95
|
+
|
96
|
+
# Checks equality by comparing each attribute.
|
97
|
+
# @param [Object] Object to be compared
|
98
|
+
def ==(o)
|
99
|
+
return true if self.equal?(o)
|
100
|
+
self.class == o.class &&
|
101
|
+
id == o.id &&
|
102
|
+
type == o.type
|
103
|
+
end
|
104
|
+
|
105
|
+
# @see the `==` method
|
106
|
+
# @param [Object] Object to be compared
|
107
|
+
def eql?(o)
|
108
|
+
self == o
|
109
|
+
end
|
110
|
+
|
111
|
+
# Calculates hash code according to all attributes.
|
112
|
+
# @return [Integer] Hash code
|
113
|
+
def hash
|
114
|
+
[id, type].hash
|
115
|
+
end
|
116
|
+
|
117
|
+
# Builds the object from hash
|
118
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
119
|
+
# @return [Object] Returns the model itself
|
120
|
+
def self.build_from_hash(attributes)
|
121
|
+
new.build_from_hash(attributes)
|
122
|
+
end
|
123
|
+
|
124
|
+
# Builds the object from hash
|
125
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
126
|
+
# @return [Object] Returns the model itself
|
127
|
+
def build_from_hash(attributes)
|
128
|
+
return nil unless attributes.is_a?(Hash)
|
129
|
+
attributes = attributes.transform_keys(&:to_sym)
|
130
|
+
self.class.openapi_types.each_pair do |key, type|
|
131
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
132
|
+
self.send("#{key}=", nil)
|
133
|
+
elsif type =~ /\AArray<(.*)>/i
|
134
|
+
# check to ensure the input is an array given that the attribute
|
135
|
+
# is documented as an array but the input is not
|
136
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
137
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
138
|
+
end
|
139
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
140
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
self
|
145
|
+
end
|
146
|
+
|
147
|
+
# Deserializes the data based on type
|
148
|
+
# @param string type Data type
|
149
|
+
# @param string value Value to be deserialized
|
150
|
+
# @return [Object] Deserialized data
|
151
|
+
def _deserialize(type, value)
|
152
|
+
case type.to_sym
|
153
|
+
when :Time
|
154
|
+
Time.parse(value)
|
155
|
+
when :Date
|
156
|
+
Date.parse(value)
|
157
|
+
when :String
|
158
|
+
value.to_s
|
159
|
+
when :Integer
|
160
|
+
value.to_i
|
161
|
+
when :Float
|
162
|
+
value.to_f
|
163
|
+
when :Boolean
|
164
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
165
|
+
true
|
166
|
+
else
|
167
|
+
false
|
168
|
+
end
|
169
|
+
when :Object
|
170
|
+
# generic object (usually a Hash), return directly
|
171
|
+
value
|
172
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
173
|
+
inner_type = Regexp.last_match[:inner_type]
|
174
|
+
value.map { |v| _deserialize(inner_type, v) }
|
175
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
176
|
+
k_type = Regexp.last_match[:k_type]
|
177
|
+
v_type = Regexp.last_match[:v_type]
|
178
|
+
{}.tap do |hash|
|
179
|
+
value.each do |k, v|
|
180
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
181
|
+
end
|
182
|
+
end
|
183
|
+
else # model
|
184
|
+
# models (e.g. Pet) or oneOf
|
185
|
+
klass = ForestVPNCloudAPI.const_get(type)
|
186
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
187
|
+
end
|
188
|
+
end
|
189
|
+
|
190
|
+
# Returns the string representation of the object
|
191
|
+
# @return [String] String presentation of the object
|
192
|
+
def to_s
|
193
|
+
to_hash.to_s
|
194
|
+
end
|
195
|
+
|
196
|
+
# to_body is an alias to to_hash (backward compatibility)
|
197
|
+
# @return [Hash] Returns the object in the form of hash
|
198
|
+
def to_body
|
199
|
+
to_hash
|
200
|
+
end
|
201
|
+
|
202
|
+
# Returns the object in the form of hash
|
203
|
+
# @return [Hash] Returns the object in the form of hash
|
204
|
+
def to_hash
|
205
|
+
hash = {}
|
206
|
+
self.class.attribute_map.each_pair do |attr, param|
|
207
|
+
value = self.send(attr)
|
208
|
+
if value.nil?
|
209
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
210
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
211
|
+
end
|
212
|
+
|
213
|
+
hash[param] = _to_hash(value)
|
214
|
+
end
|
215
|
+
hash
|
216
|
+
end
|
217
|
+
|
218
|
+
# Outputs non-array value in the form of hash
|
219
|
+
# For object, use to_hash. Otherwise, just return the value
|
220
|
+
# @param [Object] value Any valid value
|
221
|
+
# @return [Hash] Returns the value in the form of hash
|
222
|
+
def _to_hash(value)
|
223
|
+
if value.is_a?(Array)
|
224
|
+
value.compact.map { |v| _to_hash(v) }
|
225
|
+
elsif value.is_a?(Hash)
|
226
|
+
{}.tap do |hash|
|
227
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
228
|
+
end
|
229
|
+
elsif value.respond_to? :to_hash
|
230
|
+
value.to_hash
|
231
|
+
else
|
232
|
+
value
|
233
|
+
end
|
234
|
+
end
|
235
|
+
|
236
|
+
end
|
237
|
+
|
238
|
+
end
|
@@ -0,0 +1,307 @@
|
|
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 'date'
|
14
|
+
require 'time'
|
15
|
+
|
16
|
+
module ForestVPNCloudAPI
|
17
|
+
class User
|
18
|
+
attr_accessor :id
|
19
|
+
|
20
|
+
attr_accessor :username
|
21
|
+
|
22
|
+
attr_accessor :first_name
|
23
|
+
|
24
|
+
attr_accessor :last_name
|
25
|
+
|
26
|
+
attr_accessor :email
|
27
|
+
|
28
|
+
attr_accessor :email_verified
|
29
|
+
|
30
|
+
attr_accessor :photo_url
|
31
|
+
|
32
|
+
attr_accessor :date_joined
|
33
|
+
|
34
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
35
|
+
def self.attribute_map
|
36
|
+
{
|
37
|
+
:'id' => :'id',
|
38
|
+
:'username' => :'username',
|
39
|
+
:'first_name' => :'first_name',
|
40
|
+
:'last_name' => :'last_name',
|
41
|
+
:'email' => :'email',
|
42
|
+
:'email_verified' => :'email_verified',
|
43
|
+
:'photo_url' => :'photo_url',
|
44
|
+
:'date_joined' => :'date_joined'
|
45
|
+
}
|
46
|
+
end
|
47
|
+
|
48
|
+
# Returns all the JSON keys this model knows about
|
49
|
+
def self.acceptable_attributes
|
50
|
+
attribute_map.values
|
51
|
+
end
|
52
|
+
|
53
|
+
# Attribute type mapping.
|
54
|
+
def self.openapi_types
|
55
|
+
{
|
56
|
+
:'id' => :'String',
|
57
|
+
:'username' => :'String',
|
58
|
+
:'first_name' => :'String',
|
59
|
+
:'last_name' => :'String',
|
60
|
+
:'email' => :'String',
|
61
|
+
:'email_verified' => :'Boolean',
|
62
|
+
:'photo_url' => :'String',
|
63
|
+
:'date_joined' => :'Time'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
# List of attributes with nullable: true
|
68
|
+
def self.openapi_nullable
|
69
|
+
Set.new([
|
70
|
+
])
|
71
|
+
end
|
72
|
+
|
73
|
+
# Initializes the object
|
74
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
75
|
+
def initialize(attributes = {})
|
76
|
+
if (!attributes.is_a?(Hash))
|
77
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `ForestVPNCloudAPI::User` initialize method"
|
78
|
+
end
|
79
|
+
|
80
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
82
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `ForestVPNCloudAPI::User`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
84
|
+
end
|
85
|
+
h[k.to_sym] = v
|
86
|
+
}
|
87
|
+
|
88
|
+
if attributes.key?(:'id')
|
89
|
+
self.id = attributes[:'id']
|
90
|
+
end
|
91
|
+
|
92
|
+
if attributes.key?(:'username')
|
93
|
+
self.username = attributes[:'username']
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'first_name')
|
97
|
+
self.first_name = attributes[:'first_name']
|
98
|
+
end
|
99
|
+
|
100
|
+
if attributes.key?(:'last_name')
|
101
|
+
self.last_name = attributes[:'last_name']
|
102
|
+
end
|
103
|
+
|
104
|
+
if attributes.key?(:'email')
|
105
|
+
self.email = attributes[:'email']
|
106
|
+
end
|
107
|
+
|
108
|
+
if attributes.key?(:'email_verified')
|
109
|
+
self.email_verified = attributes[:'email_verified']
|
110
|
+
end
|
111
|
+
|
112
|
+
if attributes.key?(:'photo_url')
|
113
|
+
self.photo_url = attributes[:'photo_url']
|
114
|
+
end
|
115
|
+
|
116
|
+
if attributes.key?(:'date_joined')
|
117
|
+
self.date_joined = attributes[:'date_joined']
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
122
|
+
# @return Array for valid properties with the reasons
|
123
|
+
def list_invalid_properties
|
124
|
+
invalid_properties = Array.new
|
125
|
+
if @id.nil?
|
126
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
127
|
+
end
|
128
|
+
|
129
|
+
if @username.nil?
|
130
|
+
invalid_properties.push('invalid value for "username", username cannot be nil.')
|
131
|
+
end
|
132
|
+
|
133
|
+
if @email.nil?
|
134
|
+
invalid_properties.push('invalid value for "email", email cannot be nil.')
|
135
|
+
end
|
136
|
+
|
137
|
+
if @email_verified.nil?
|
138
|
+
invalid_properties.push('invalid value for "email_verified", email_verified cannot be nil.')
|
139
|
+
end
|
140
|
+
|
141
|
+
if @date_joined.nil?
|
142
|
+
invalid_properties.push('invalid value for "date_joined", date_joined cannot be nil.')
|
143
|
+
end
|
144
|
+
|
145
|
+
invalid_properties
|
146
|
+
end
|
147
|
+
|
148
|
+
# Check to see if the all the properties in the model are valid
|
149
|
+
# @return true if the model is valid
|
150
|
+
def valid?
|
151
|
+
return false if @id.nil?
|
152
|
+
return false if @username.nil?
|
153
|
+
return false if @email.nil?
|
154
|
+
return false if @email_verified.nil?
|
155
|
+
return false if @date_joined.nil?
|
156
|
+
true
|
157
|
+
end
|
158
|
+
|
159
|
+
# Checks equality by comparing each attribute.
|
160
|
+
# @param [Object] Object to be compared
|
161
|
+
def ==(o)
|
162
|
+
return true if self.equal?(o)
|
163
|
+
self.class == o.class &&
|
164
|
+
id == o.id &&
|
165
|
+
username == o.username &&
|
166
|
+
first_name == o.first_name &&
|
167
|
+
last_name == o.last_name &&
|
168
|
+
email == o.email &&
|
169
|
+
email_verified == o.email_verified &&
|
170
|
+
photo_url == o.photo_url &&
|
171
|
+
date_joined == o.date_joined
|
172
|
+
end
|
173
|
+
|
174
|
+
# @see the `==` method
|
175
|
+
# @param [Object] Object to be compared
|
176
|
+
def eql?(o)
|
177
|
+
self == o
|
178
|
+
end
|
179
|
+
|
180
|
+
# Calculates hash code according to all attributes.
|
181
|
+
# @return [Integer] Hash code
|
182
|
+
def hash
|
183
|
+
[id, username, first_name, last_name, email, email_verified, photo_url, date_joined].hash
|
184
|
+
end
|
185
|
+
|
186
|
+
# Builds the object from hash
|
187
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
188
|
+
# @return [Object] Returns the model itself
|
189
|
+
def self.build_from_hash(attributes)
|
190
|
+
new.build_from_hash(attributes)
|
191
|
+
end
|
192
|
+
|
193
|
+
# Builds the object from hash
|
194
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
195
|
+
# @return [Object] Returns the model itself
|
196
|
+
def build_from_hash(attributes)
|
197
|
+
return nil unless attributes.is_a?(Hash)
|
198
|
+
attributes = attributes.transform_keys(&:to_sym)
|
199
|
+
self.class.openapi_types.each_pair do |key, type|
|
200
|
+
if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
201
|
+
self.send("#{key}=", nil)
|
202
|
+
elsif type =~ /\AArray<(.*)>/i
|
203
|
+
# check to ensure the input is an array given that the attribute
|
204
|
+
# is documented as an array but the input is not
|
205
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
206
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
207
|
+
end
|
208
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
209
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
210
|
+
end
|
211
|
+
end
|
212
|
+
|
213
|
+
self
|
214
|
+
end
|
215
|
+
|
216
|
+
# Deserializes the data based on type
|
217
|
+
# @param string type Data type
|
218
|
+
# @param string value Value to be deserialized
|
219
|
+
# @return [Object] Deserialized data
|
220
|
+
def _deserialize(type, value)
|
221
|
+
case type.to_sym
|
222
|
+
when :Time
|
223
|
+
Time.parse(value)
|
224
|
+
when :Date
|
225
|
+
Date.parse(value)
|
226
|
+
when :String
|
227
|
+
value.to_s
|
228
|
+
when :Integer
|
229
|
+
value.to_i
|
230
|
+
when :Float
|
231
|
+
value.to_f
|
232
|
+
when :Boolean
|
233
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
234
|
+
true
|
235
|
+
else
|
236
|
+
false
|
237
|
+
end
|
238
|
+
when :Object
|
239
|
+
# generic object (usually a Hash), return directly
|
240
|
+
value
|
241
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
242
|
+
inner_type = Regexp.last_match[:inner_type]
|
243
|
+
value.map { |v| _deserialize(inner_type, v) }
|
244
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
245
|
+
k_type = Regexp.last_match[:k_type]
|
246
|
+
v_type = Regexp.last_match[:v_type]
|
247
|
+
{}.tap do |hash|
|
248
|
+
value.each do |k, v|
|
249
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
250
|
+
end
|
251
|
+
end
|
252
|
+
else # model
|
253
|
+
# models (e.g. Pet) or oneOf
|
254
|
+
klass = ForestVPNCloudAPI.const_get(type)
|
255
|
+
klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
256
|
+
end
|
257
|
+
end
|
258
|
+
|
259
|
+
# Returns the string representation of the object
|
260
|
+
# @return [String] String presentation of the object
|
261
|
+
def to_s
|
262
|
+
to_hash.to_s
|
263
|
+
end
|
264
|
+
|
265
|
+
# to_body is an alias to to_hash (backward compatibility)
|
266
|
+
# @return [Hash] Returns the object in the form of hash
|
267
|
+
def to_body
|
268
|
+
to_hash
|
269
|
+
end
|
270
|
+
|
271
|
+
# Returns the object in the form of hash
|
272
|
+
# @return [Hash] Returns the object in the form of hash
|
273
|
+
def to_hash
|
274
|
+
hash = {}
|
275
|
+
self.class.attribute_map.each_pair do |attr, param|
|
276
|
+
value = self.send(attr)
|
277
|
+
if value.nil?
|
278
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
279
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
280
|
+
end
|
281
|
+
|
282
|
+
hash[param] = _to_hash(value)
|
283
|
+
end
|
284
|
+
hash
|
285
|
+
end
|
286
|
+
|
287
|
+
# Outputs non-array value in the form of hash
|
288
|
+
# For object, use to_hash. Otherwise, just return the value
|
289
|
+
# @param [Object] value Any valid value
|
290
|
+
# @return [Hash] Returns the value in the form of hash
|
291
|
+
def _to_hash(value)
|
292
|
+
if value.is_a?(Array)
|
293
|
+
value.compact.map { |v| _to_hash(v) }
|
294
|
+
elsif value.is_a?(Hash)
|
295
|
+
{}.tap do |hash|
|
296
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
297
|
+
end
|
298
|
+
elsif value.respond_to? :to_hash
|
299
|
+
value.to_hash
|
300
|
+
else
|
301
|
+
value
|
302
|
+
end
|
303
|
+
end
|
304
|
+
|
305
|
+
end
|
306
|
+
|
307
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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
|
+
module ForestVPNCloudAPI
|
14
|
+
VERSION = '0.1.0'
|
15
|
+
end
|
@@ -0,0 +1,61 @@
|
|
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
|
+
# Common files
|
14
|
+
require 'forestvpn_cloud_api/api_client'
|
15
|
+
require 'forestvpn_cloud_api/api_error'
|
16
|
+
require 'forestvpn_cloud_api/version'
|
17
|
+
require 'forestvpn_cloud_api/configuration'
|
18
|
+
|
19
|
+
# Models
|
20
|
+
require 'forestvpn_cloud_api/models/action'
|
21
|
+
require 'forestvpn_cloud_api/models/activity'
|
22
|
+
require 'forestvpn_cloud_api/models/address'
|
23
|
+
require 'forestvpn_cloud_api/models/billing'
|
24
|
+
require 'forestvpn_cloud_api/models/country'
|
25
|
+
require 'forestvpn_cloud_api/models/create_billing_request'
|
26
|
+
require 'forestvpn_cloud_api/models/create_or_update_data_usage_limit_request'
|
27
|
+
require 'forestvpn_cloud_api/models/create_or_update_payment_profile_request'
|
28
|
+
require 'forestvpn_cloud_api/models/create_or_update_profile_request'
|
29
|
+
require 'forestvpn_cloud_api/models/data_usage_limit'
|
30
|
+
require 'forestvpn_cloud_api/models/error'
|
31
|
+
require 'forestvpn_cloud_api/models/location'
|
32
|
+
require 'forestvpn_cloud_api/models/payment_method'
|
33
|
+
require 'forestvpn_cloud_api/models/payment_profile'
|
34
|
+
require 'forestvpn_cloud_api/models/profile'
|
35
|
+
require 'forestvpn_cloud_api/models/profile_stats'
|
36
|
+
require 'forestvpn_cloud_api/models/project'
|
37
|
+
require 'forestvpn_cloud_api/models/resource_ref'
|
38
|
+
require 'forestvpn_cloud_api/models/user'
|
39
|
+
|
40
|
+
# APIs
|
41
|
+
require 'forestvpn_cloud_api/api/geo_api'
|
42
|
+
require 'forestvpn_cloud_api/api/limits_api'
|
43
|
+
require 'forestvpn_cloud_api/api/profiles_api'
|
44
|
+
|
45
|
+
module ForestVPNCloudAPI
|
46
|
+
class << self
|
47
|
+
# Customize default settings for the SDK using block.
|
48
|
+
# ForestVPNCloudAPI.configure do |config|
|
49
|
+
# config.username = "xxx"
|
50
|
+
# config.password = "xxx"
|
51
|
+
# end
|
52
|
+
# If no block given, return the default Configuration object.
|
53
|
+
def configure
|
54
|
+
if block_given?
|
55
|
+
yield(Configuration.default)
|
56
|
+
else
|
57
|
+
Configuration.default
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,45 @@
|
|
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::GeoApi
|
17
|
+
# Automatically generated by openapi-generator (https://openapi-generator.tech)
|
18
|
+
# Please update as you see appropriate
|
19
|
+
describe 'GeoApi' do
|
20
|
+
before do
|
21
|
+
# run before each test
|
22
|
+
@api_instance = ForestVPNCloudAPI::GeoApi.new
|
23
|
+
end
|
24
|
+
|
25
|
+
after do
|
26
|
+
# run after each test
|
27
|
+
end
|
28
|
+
|
29
|
+
describe 'test an instance of GeoApi' do
|
30
|
+
it 'should create an instance of GeoApi' do
|
31
|
+
expect(@api_instance).to be_instance_of(ForestVPNCloudAPI::GeoApi)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
# unit tests for list_locations
|
36
|
+
# Location list
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<Location>]
|
39
|
+
describe 'list_locations 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
|