forestvpn_cloud_api 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +139 -0
  4. data/Rakefile +10 -0
  5. data/docs/Action.md +32 -0
  6. data/docs/Activity.md +36 -0
  7. data/docs/Address.md +28 -0
  8. data/docs/Billing.md +24 -0
  9. data/docs/Country.md +26 -0
  10. data/docs/CreateBillingRequest.md +22 -0
  11. data/docs/CreateOrUpdateDataUsageLimitRequest.md +20 -0
  12. data/docs/CreateOrUpdatePaymentProfileRequest.md +34 -0
  13. data/docs/CreateOrUpdateProfileRequest.md +22 -0
  14. data/docs/DataUsageLimit.md +24 -0
  15. data/docs/Error.md +20 -0
  16. data/docs/GeoApi.md +77 -0
  17. data/docs/LimitsApi.md +447 -0
  18. data/docs/Location.md +28 -0
  19. data/docs/PaymentMethod.md +24 -0
  20. data/docs/PaymentProfile.md +32 -0
  21. data/docs/Profile.md +26 -0
  22. data/docs/ProfileStats.md +26 -0
  23. data/docs/ProfilesApi.md +996 -0
  24. data/docs/Project.md +22 -0
  25. data/docs/ResourceRef.md +20 -0
  26. data/docs/User.md +32 -0
  27. data/forestvpn_cloud_api.gemspec +39 -0
  28. data/git_push.sh +57 -0
  29. data/lib/forestvpn_cloud_api/api/geo_api.rb +77 -0
  30. data/lib/forestvpn_cloud_api/api/limits_api.rb +405 -0
  31. data/lib/forestvpn_cloud_api/api/profiles_api.rb +915 -0
  32. data/lib/forestvpn_cloud_api/api_client.rb +426 -0
  33. data/lib/forestvpn_cloud_api/api_error.rb +57 -0
  34. data/lib/forestvpn_cloud_api/configuration.rb +335 -0
  35. data/lib/forestvpn_cloud_api/models/action.rb +348 -0
  36. data/lib/forestvpn_cloud_api/models/activity.rb +360 -0
  37. data/lib/forestvpn_cloud_api/models/address.rb +269 -0
  38. data/lib/forestvpn_cloud_api/models/billing.rb +266 -0
  39. data/lib/forestvpn_cloud_api/models/country.rb +282 -0
  40. data/lib/forestvpn_cloud_api/models/create_billing_request.rb +252 -0
  41. data/lib/forestvpn_cloud_api/models/create_or_update_data_usage_limit_request.rb +230 -0
  42. data/lib/forestvpn_cloud_api/models/create_or_update_payment_profile_request.rb +328 -0
  43. data/lib/forestvpn_cloud_api/models/create_or_update_profile_request.rb +275 -0
  44. data/lib/forestvpn_cloud_api/models/data_usage_limit.rb +302 -0
  45. data/lib/forestvpn_cloud_api/models/error.rb +238 -0
  46. data/lib/forestvpn_cloud_api/models/location.rb +296 -0
  47. data/lib/forestvpn_cloud_api/models/payment_method.rb +261 -0
  48. data/lib/forestvpn_cloud_api/models/payment_profile.rb +313 -0
  49. data/lib/forestvpn_cloud_api/models/profile.rb +320 -0
  50. data/lib/forestvpn_cloud_api/models/profile_stats.rb +280 -0
  51. data/lib/forestvpn_cloud_api/models/project.rb +254 -0
  52. data/lib/forestvpn_cloud_api/models/resource_ref.rb +238 -0
  53. data/lib/forestvpn_cloud_api/models/user.rb +307 -0
  54. data/lib/forestvpn_cloud_api/version.rb +15 -0
  55. data/lib/forestvpn_cloud_api.rb +61 -0
  56. data/spec/api/geo_api_spec.rb +45 -0
  57. data/spec/api/limits_api_spec.rb +102 -0
  58. data/spec/api/profiles_api_spec.rb +195 -0
  59. data/spec/api_client_spec.rb +188 -0
  60. data/spec/configuration_spec.rb +42 -0
  61. data/spec/models/action_spec.rb +80 -0
  62. data/spec/models/activity_spec.rb +92 -0
  63. data/spec/models/address_spec.rb +64 -0
  64. data/spec/models/billing_spec.rb +52 -0
  65. data/spec/models/country_spec.rb +58 -0
  66. data/spec/models/create_billing_request_spec.rb +46 -0
  67. data/spec/models/create_or_update_data_usage_limit_request_spec.rb +40 -0
  68. data/spec/models/create_or_update_payment_profile_request_spec.rb +82 -0
  69. data/spec/models/create_or_update_profile_request_spec.rb +50 -0
  70. data/spec/models/data_usage_limit_spec.rb +56 -0
  71. data/spec/models/error_spec.rb +40 -0
  72. data/spec/models/location_spec.rb +64 -0
  73. data/spec/models/payment_method_spec.rb +52 -0
  74. data/spec/models/payment_profile_spec.rb +76 -0
  75. data/spec/models/profile_spec.rb +62 -0
  76. data/spec/models/profile_stats_spec.rb +58 -0
  77. data/spec/models/project_spec.rb +46 -0
  78. data/spec/models/resource_ref_spec.rb +40 -0
  79. data/spec/models/user_spec.rb +76 -0
  80. data/spec/spec_helper.rb +111 -0
  81. metadata +203 -0
@@ -0,0 +1,266 @@
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 Billing
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :country
23
+
24
+ attr_accessor :payment_profile
25
+
26
+ # Attribute mapping from ruby-style variable name to JSON key.
27
+ def self.attribute_map
28
+ {
29
+ :'id' => :'id',
30
+ :'name' => :'name',
31
+ :'country' => :'country',
32
+ :'payment_profile' => :'payment_profile'
33
+ }
34
+ end
35
+
36
+ # Returns all the JSON keys this model knows about
37
+ def self.acceptable_attributes
38
+ attribute_map.values
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.openapi_types
43
+ {
44
+ :'id' => :'String',
45
+ :'name' => :'String',
46
+ :'country' => :'Country',
47
+ :'payment_profile' => :'PaymentProfile'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ForestVPNCloudAPI::Billing` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ForestVPNCloudAPI::Billing`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'id')
73
+ self.id = attributes[:'id']
74
+ end
75
+
76
+ if attributes.key?(:'name')
77
+ self.name = attributes[:'name']
78
+ end
79
+
80
+ if attributes.key?(:'country')
81
+ self.country = attributes[:'country']
82
+ end
83
+
84
+ if attributes.key?(:'payment_profile')
85
+ self.payment_profile = attributes[:'payment_profile']
86
+ end
87
+ end
88
+
89
+ # Show invalid properties with the reasons. Usually used together with valid?
90
+ # @return Array for valid properties with the reasons
91
+ def list_invalid_properties
92
+ invalid_properties = Array.new
93
+ if @id.nil?
94
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
95
+ end
96
+
97
+ if @name.nil?
98
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
99
+ end
100
+
101
+ if @country.nil?
102
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
103
+ end
104
+
105
+ if @payment_profile.nil?
106
+ invalid_properties.push('invalid value for "payment_profile", payment_profile cannot be nil.')
107
+ end
108
+
109
+ invalid_properties
110
+ end
111
+
112
+ # Check to see if the all the properties in the model are valid
113
+ # @return true if the model is valid
114
+ def valid?
115
+ return false if @id.nil?
116
+ return false if @name.nil?
117
+ return false if @country.nil?
118
+ return false if @payment_profile.nil?
119
+ true
120
+ end
121
+
122
+ # Checks equality by comparing each attribute.
123
+ # @param [Object] Object to be compared
124
+ def ==(o)
125
+ return true if self.equal?(o)
126
+ self.class == o.class &&
127
+ id == o.id &&
128
+ name == o.name &&
129
+ country == o.country &&
130
+ payment_profile == o.payment_profile
131
+ end
132
+
133
+ # @see the `==` method
134
+ # @param [Object] Object to be compared
135
+ def eql?(o)
136
+ self == o
137
+ end
138
+
139
+ # Calculates hash code according to all attributes.
140
+ # @return [Integer] Hash code
141
+ def hash
142
+ [id, name, country, payment_profile].hash
143
+ end
144
+
145
+ # Builds the object from hash
146
+ # @param [Hash] attributes Model attributes in the form of hash
147
+ # @return [Object] Returns the model itself
148
+ def self.build_from_hash(attributes)
149
+ new.build_from_hash(attributes)
150
+ end
151
+
152
+ # Builds the object from hash
153
+ # @param [Hash] attributes Model attributes in the form of hash
154
+ # @return [Object] Returns the model itself
155
+ def build_from_hash(attributes)
156
+ return nil unless attributes.is_a?(Hash)
157
+ attributes = attributes.transform_keys(&:to_sym)
158
+ self.class.openapi_types.each_pair do |key, type|
159
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
160
+ self.send("#{key}=", nil)
161
+ elsif type =~ /\AArray<(.*)>/i
162
+ # check to ensure the input is an array given that the attribute
163
+ # is documented as an array but the input is not
164
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
165
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
166
+ end
167
+ elsif !attributes[self.class.attribute_map[key]].nil?
168
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
169
+ end
170
+ end
171
+
172
+ self
173
+ end
174
+
175
+ # Deserializes the data based on type
176
+ # @param string type Data type
177
+ # @param string value Value to be deserialized
178
+ # @return [Object] Deserialized data
179
+ def _deserialize(type, value)
180
+ case type.to_sym
181
+ when :Time
182
+ Time.parse(value)
183
+ when :Date
184
+ Date.parse(value)
185
+ when :String
186
+ value.to_s
187
+ when :Integer
188
+ value.to_i
189
+ when :Float
190
+ value.to_f
191
+ when :Boolean
192
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
193
+ true
194
+ else
195
+ false
196
+ end
197
+ when :Object
198
+ # generic object (usually a Hash), return directly
199
+ value
200
+ when /\AArray<(?<inner_type>.+)>\z/
201
+ inner_type = Regexp.last_match[:inner_type]
202
+ value.map { |v| _deserialize(inner_type, v) }
203
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
204
+ k_type = Regexp.last_match[:k_type]
205
+ v_type = Regexp.last_match[:v_type]
206
+ {}.tap do |hash|
207
+ value.each do |k, v|
208
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
209
+ end
210
+ end
211
+ else # model
212
+ # models (e.g. Pet) or oneOf
213
+ klass = ForestVPNCloudAPI.const_get(type)
214
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
215
+ end
216
+ end
217
+
218
+ # Returns the string representation of the object
219
+ # @return [String] String presentation of the object
220
+ def to_s
221
+ to_hash.to_s
222
+ end
223
+
224
+ # to_body is an alias to to_hash (backward compatibility)
225
+ # @return [Hash] Returns the object in the form of hash
226
+ def to_body
227
+ to_hash
228
+ end
229
+
230
+ # Returns the object in the form of hash
231
+ # @return [Hash] Returns the object in the form of hash
232
+ def to_hash
233
+ hash = {}
234
+ self.class.attribute_map.each_pair do |attr, param|
235
+ value = self.send(attr)
236
+ if value.nil?
237
+ is_nullable = self.class.openapi_nullable.include?(attr)
238
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
239
+ end
240
+
241
+ hash[param] = _to_hash(value)
242
+ end
243
+ hash
244
+ end
245
+
246
+ # Outputs non-array value in the form of hash
247
+ # For object, use to_hash. Otherwise, just return the value
248
+ # @param [Object] value Any valid value
249
+ # @return [Hash] Returns the value in the form of hash
250
+ def _to_hash(value)
251
+ if value.is_a?(Array)
252
+ value.compact.map { |v| _to_hash(v) }
253
+ elsif value.is_a?(Hash)
254
+ {}.tap do |hash|
255
+ value.each { |k, v| hash[k] = _to_hash(v) }
256
+ end
257
+ elsif value.respond_to? :to_hash
258
+ value.to_hash
259
+ else
260
+ value
261
+ end
262
+ end
263
+
264
+ end
265
+
266
+ end
@@ -0,0 +1,282 @@
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 Country
18
+ attr_accessor :id
19
+
20
+ attr_accessor :name
21
+
22
+ attr_accessor :emoji
23
+
24
+ attr_accessor :currency
25
+
26
+ attr_accessor :alternative_names
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'id' => :'id',
32
+ :'name' => :'name',
33
+ :'emoji' => :'emoji',
34
+ :'currency' => :'currency',
35
+ :'alternative_names' => :'alternative_names'
36
+ }
37
+ end
38
+
39
+ # Returns all the JSON keys this model knows about
40
+ def self.acceptable_attributes
41
+ attribute_map.values
42
+ end
43
+
44
+ # Attribute type mapping.
45
+ def self.openapi_types
46
+ {
47
+ :'id' => :'String',
48
+ :'name' => :'String',
49
+ :'emoji' => :'String',
50
+ :'currency' => :'String',
51
+ :'alternative_names' => :'Array<String>'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `ForestVPNCloudAPI::Country` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ attributes = attributes.each_with_object({}) { |(k, v), h|
70
+ if (!self.class.attribute_map.key?(k.to_sym))
71
+ fail ArgumentError, "`#{k}` is not a valid attribute in `ForestVPNCloudAPI::Country`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
72
+ end
73
+ h[k.to_sym] = v
74
+ }
75
+
76
+ if attributes.key?(:'id')
77
+ self.id = attributes[:'id']
78
+ end
79
+
80
+ if attributes.key?(:'name')
81
+ self.name = attributes[:'name']
82
+ end
83
+
84
+ if attributes.key?(:'emoji')
85
+ self.emoji = attributes[:'emoji']
86
+ end
87
+
88
+ if attributes.key?(:'currency')
89
+ self.currency = attributes[:'currency']
90
+ end
91
+
92
+ if attributes.key?(:'alternative_names')
93
+ if (value = attributes[:'alternative_names']).is_a?(Array)
94
+ self.alternative_names = value
95
+ end
96
+ end
97
+ end
98
+
99
+ # Show invalid properties with the reasons. Usually used together with valid?
100
+ # @return Array for valid properties with the reasons
101
+ def list_invalid_properties
102
+ invalid_properties = Array.new
103
+ if @id.nil?
104
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
105
+ end
106
+
107
+ if @name.nil?
108
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
109
+ end
110
+
111
+ if @emoji.nil?
112
+ invalid_properties.push('invalid value for "emoji", emoji cannot be nil.')
113
+ end
114
+
115
+ if @currency.nil?
116
+ invalid_properties.push('invalid value for "currency", currency cannot be nil.')
117
+ end
118
+
119
+ if @alternative_names.nil?
120
+ invalid_properties.push('invalid value for "alternative_names", alternative_names cannot be nil.')
121
+ end
122
+
123
+ invalid_properties
124
+ end
125
+
126
+ # Check to see if the all the properties in the model are valid
127
+ # @return true if the model is valid
128
+ def valid?
129
+ return false if @id.nil?
130
+ return false if @name.nil?
131
+ return false if @emoji.nil?
132
+ return false if @currency.nil?
133
+ return false if @alternative_names.nil?
134
+ true
135
+ end
136
+
137
+ # Checks equality by comparing each attribute.
138
+ # @param [Object] Object to be compared
139
+ def ==(o)
140
+ return true if self.equal?(o)
141
+ self.class == o.class &&
142
+ id == o.id &&
143
+ name == o.name &&
144
+ emoji == o.emoji &&
145
+ currency == o.currency &&
146
+ alternative_names == o.alternative_names
147
+ end
148
+
149
+ # @see the `==` method
150
+ # @param [Object] Object to be compared
151
+ def eql?(o)
152
+ self == o
153
+ end
154
+
155
+ # Calculates hash code according to all attributes.
156
+ # @return [Integer] Hash code
157
+ def hash
158
+ [id, name, emoji, currency, alternative_names].hash
159
+ end
160
+
161
+ # Builds the object from hash
162
+ # @param [Hash] attributes Model attributes in the form of hash
163
+ # @return [Object] Returns the model itself
164
+ def self.build_from_hash(attributes)
165
+ new.build_from_hash(attributes)
166
+ end
167
+
168
+ # Builds the object from hash
169
+ # @param [Hash] attributes Model attributes in the form of hash
170
+ # @return [Object] Returns the model itself
171
+ def build_from_hash(attributes)
172
+ return nil unless attributes.is_a?(Hash)
173
+ attributes = attributes.transform_keys(&:to_sym)
174
+ self.class.openapi_types.each_pair do |key, type|
175
+ if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
176
+ self.send("#{key}=", nil)
177
+ elsif type =~ /\AArray<(.*)>/i
178
+ # check to ensure the input is an array given that the attribute
179
+ # is documented as an array but the input is not
180
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
181
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
182
+ end
183
+ elsif !attributes[self.class.attribute_map[key]].nil?
184
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
185
+ end
186
+ end
187
+
188
+ self
189
+ end
190
+
191
+ # Deserializes the data based on type
192
+ # @param string type Data type
193
+ # @param string value Value to be deserialized
194
+ # @return [Object] Deserialized data
195
+ def _deserialize(type, value)
196
+ case type.to_sym
197
+ when :Time
198
+ Time.parse(value)
199
+ when :Date
200
+ Date.parse(value)
201
+ when :String
202
+ value.to_s
203
+ when :Integer
204
+ value.to_i
205
+ when :Float
206
+ value.to_f
207
+ when :Boolean
208
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
209
+ true
210
+ else
211
+ false
212
+ end
213
+ when :Object
214
+ # generic object (usually a Hash), return directly
215
+ value
216
+ when /\AArray<(?<inner_type>.+)>\z/
217
+ inner_type = Regexp.last_match[:inner_type]
218
+ value.map { |v| _deserialize(inner_type, v) }
219
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
220
+ k_type = Regexp.last_match[:k_type]
221
+ v_type = Regexp.last_match[:v_type]
222
+ {}.tap do |hash|
223
+ value.each do |k, v|
224
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
225
+ end
226
+ end
227
+ else # model
228
+ # models (e.g. Pet) or oneOf
229
+ klass = ForestVPNCloudAPI.const_get(type)
230
+ klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
231
+ end
232
+ end
233
+
234
+ # Returns the string representation of the object
235
+ # @return [String] String presentation of the object
236
+ def to_s
237
+ to_hash.to_s
238
+ end
239
+
240
+ # to_body is an alias to to_hash (backward compatibility)
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_body
243
+ to_hash
244
+ end
245
+
246
+ # Returns the object in the form of hash
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_hash
249
+ hash = {}
250
+ self.class.attribute_map.each_pair do |attr, param|
251
+ value = self.send(attr)
252
+ if value.nil?
253
+ is_nullable = self.class.openapi_nullable.include?(attr)
254
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
255
+ end
256
+
257
+ hash[param] = _to_hash(value)
258
+ end
259
+ hash
260
+ end
261
+
262
+ # Outputs non-array value in the form of hash
263
+ # For object, use to_hash. Otherwise, just return the value
264
+ # @param [Object] value Any valid value
265
+ # @return [Hash] Returns the value in the form of hash
266
+ def _to_hash(value)
267
+ if value.is_a?(Array)
268
+ value.compact.map { |v| _to_hash(v) }
269
+ elsif value.is_a?(Hash)
270
+ {}.tap do |hash|
271
+ value.each { |k, v| hash[k] = _to_hash(v) }
272
+ end
273
+ elsif value.respond_to? :to_hash
274
+ value.to_hash
275
+ else
276
+ value
277
+ end
278
+ end
279
+
280
+ end
281
+
282
+ end