vpndetection 3.2.1 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vpndetection/api/account_wire_api.rb +79 -0
- data/lib/vpndetection/api/database_wire_api.rb +2 -2
- data/lib/vpndetection/configuration.rb +0 -4
- data/lib/vpndetection/models/account_apikey.rb +207 -0
- data/lib/vpndetection/models/account_error.rb +164 -0
- data/lib/vpndetection/models/account_me.rb +243 -0
- data/lib/vpndetection/models/account_plan.rb +216 -0
- data/lib/vpndetection/models/account_usage.rb +259 -0
- data/lib/vpndetection/models/database.rb +10 -11
- data/lib/vpndetection/version.rb +1 -1
- metadata +7 -2
- data/lib/vpndetection/models/license_type.rb +0 -41
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a5e55f291802dac250f1170cbc48751d463f5fb2a0c182a69301fe1627c245a5
|
|
4
|
+
data.tar.gz: c8dc05902e2c94bc9a843897717684883bdc9429e36682c9c20b5486862da66a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0186489fad83fb671a47344cf3a5c63dbfaa05cab0b905c8dbeaa4c70c7305f36c3062828f747532b92be13f185659aa4fb282f6a4245557fc1b0328d757d42c'
|
|
7
|
+
data.tar.gz: e2cec75355df5c8d328939857e6249c22980bf8e4d90210297aa4b78ceb3e4c7491a53f37dfa41657b982c046a900ee379ff99cc8f10cf1ad8a68f07b31fd7e5
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'cgi'
|
|
14
|
+
|
|
15
|
+
module VPNDetection
|
|
16
|
+
class AccountWireApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Your key, plan and usage
|
|
23
|
+
# Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
|
|
24
|
+
# @param [Hash] opts the optional parameters
|
|
25
|
+
# @return [AccountMe]
|
|
26
|
+
def account_me(opts = {})
|
|
27
|
+
data, _status_code, _headers = account_me_with_http_info(opts)
|
|
28
|
+
data
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
# Your key, plan and usage
|
|
32
|
+
# Answers what the presented key is, what plan is behind it, and what has been spent against that plan's allowance in the current window.
|
|
33
|
+
# @param [Hash] opts the optional parameters
|
|
34
|
+
# @return [Array<(AccountMe, Integer, Hash)>] AccountMe data, response status code and response headers
|
|
35
|
+
def account_me_with_http_info(opts = {})
|
|
36
|
+
if @api_client.config.debugging
|
|
37
|
+
@api_client.config.logger.debug 'Calling API: AccountWireApi.account_me ...'
|
|
38
|
+
end
|
|
39
|
+
# resource path
|
|
40
|
+
local_var_path = '/api/v1/account/me'
|
|
41
|
+
|
|
42
|
+
# query parameters
|
|
43
|
+
query_params = opts[:query_params] || {}
|
|
44
|
+
|
|
45
|
+
# header parameters
|
|
46
|
+
header_params = opts[:header_params] || {}
|
|
47
|
+
# HTTP header 'Accept' (if needed)
|
|
48
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
49
|
+
|
|
50
|
+
# form parameters
|
|
51
|
+
form_params = opts[:form_params] || {}
|
|
52
|
+
|
|
53
|
+
# http body (model)
|
|
54
|
+
post_body = opts[:debug_body]
|
|
55
|
+
|
|
56
|
+
# return_type
|
|
57
|
+
return_type = opts[:debug_return_type] || 'AccountMe'
|
|
58
|
+
|
|
59
|
+
# auth_names
|
|
60
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
61
|
+
|
|
62
|
+
new_options = opts.merge(
|
|
63
|
+
:operation => :"AccountWireApi.account_me",
|
|
64
|
+
:header_params => header_params,
|
|
65
|
+
:query_params => query_params,
|
|
66
|
+
:form_params => form_params,
|
|
67
|
+
:body => post_body,
|
|
68
|
+
:auth_names => auth_names,
|
|
69
|
+
:return_type => return_type
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
73
|
+
if @api_client.config.debugging
|
|
74
|
+
@api_client.config.logger.debug "API called: AccountWireApi#account_me\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
75
|
+
end
|
|
76
|
+
return data, status_code, headers
|
|
77
|
+
end
|
|
78
|
+
end
|
|
79
|
+
end
|
|
@@ -226,7 +226,7 @@ module VPNDetection
|
|
|
226
226
|
end
|
|
227
227
|
|
|
228
228
|
# List
|
|
229
|
-
# Every database this organization
|
|
229
|
+
# Every database this organization may SEE, with where its licence stands. Not just the ones you hold: a customer with one grant should be able to tell what else is published without asking. `standing` is the difference - `licensed`, `expired`, or `unlicensed` for one never bought.
|
|
230
230
|
# @param [Hash] opts the optional parameters
|
|
231
231
|
# @return [DatabaseList]
|
|
232
232
|
def list_databases(opts = {})
|
|
@@ -235,7 +235,7 @@ module VPNDetection
|
|
|
235
235
|
end
|
|
236
236
|
|
|
237
237
|
# List
|
|
238
|
-
# Every database this organization
|
|
238
|
+
# Every database this organization may SEE, with where its licence stands. Not just the ones you hold: a customer with one grant should be able to tell what else is published without asking. `standing` is the difference - `licensed`, `expired`, or `unlicensed` for one never bought.
|
|
239
239
|
# @param [Hash] opts the optional parameters
|
|
240
240
|
# @return [Array<(DatabaseList, Integer, Hash)>] DatabaseList data, response status code and response headers
|
|
241
241
|
def list_databases_with_http_info(opts = {})
|
|
@@ -177,10 +177,6 @@ module VPNDetection
|
|
|
177
177
|
@ignore_operation_servers = false
|
|
178
178
|
@inject_format = false
|
|
179
179
|
@force_ending_format = false
|
|
180
|
-
# `::Rails`, not `Rails`: this file is inside `module VPNDetection`, so a
|
|
181
|
-
# bare constant resolves to `VPNDetection::Rails` first if one exists -
|
|
182
|
-
# and one does, as soon as the vpndetection-rails gem is loaded. The
|
|
183
|
-
# intent has always been the top-level Rails.
|
|
184
180
|
@logger = defined?(::Rails) ? ::Rails.logger : Logger.new(STDOUT)
|
|
185
181
|
|
|
186
182
|
yield(self) if block_given?
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module VPNDetection
|
|
17
|
+
# The credential itself. The key is never echoed - only its id, which is what the console shows and what you can act on.
|
|
18
|
+
class AccountApikey < ApiModelBase
|
|
19
|
+
attr_accessor :id
|
|
20
|
+
|
|
21
|
+
# Null for a key with no end date, which is the normal case.
|
|
22
|
+
attr_accessor :expires
|
|
23
|
+
|
|
24
|
+
# The source addresses this key may be used from. EMPTY means unrestricted, never \"deny all\".
|
|
25
|
+
attr_accessor :allowed_cidrs
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'id' => :'id',
|
|
31
|
+
:'expires' => :'expires',
|
|
32
|
+
:'allowed_cidrs' => :'allowed_cidrs'
|
|
33
|
+
}
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
# Returns attribute mapping this model knows about
|
|
37
|
+
def self.acceptable_attribute_map
|
|
38
|
+
attribute_map
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# Returns all the JSON keys this model knows about
|
|
42
|
+
def self.acceptable_attributes
|
|
43
|
+
acceptable_attribute_map.values
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute type mapping.
|
|
47
|
+
def self.openapi_types
|
|
48
|
+
{
|
|
49
|
+
:'id' => :'String',
|
|
50
|
+
:'expires' => :'Time',
|
|
51
|
+
:'allowed_cidrs' => :'Array<String>'
|
|
52
|
+
}
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
# List of attributes with nullable: true
|
|
56
|
+
def self.openapi_nullable
|
|
57
|
+
Set.new([
|
|
58
|
+
:'expires',
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountApikey` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountApikey`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'id')
|
|
79
|
+
self.id = attributes[:'id']
|
|
80
|
+
else
|
|
81
|
+
self.id = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'expires')
|
|
85
|
+
self.expires = attributes[:'expires']
|
|
86
|
+
else
|
|
87
|
+
self.expires = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'allowed_cidrs')
|
|
91
|
+
if (value = attributes[:'allowed_cidrs']).is_a?(Array)
|
|
92
|
+
self.allowed_cidrs = value
|
|
93
|
+
end
|
|
94
|
+
else
|
|
95
|
+
self.allowed_cidrs = nil
|
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
if @id.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "id", id cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @allowed_cidrs.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "allowed_cidrs", allowed_cidrs cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
invalid_properties
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
# Check to see if the all the properties in the model are valid
|
|
116
|
+
# @return true if the model is valid
|
|
117
|
+
def valid?
|
|
118
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
119
|
+
return false if @id.nil?
|
|
120
|
+
return false if @allowed_cidrs.nil?
|
|
121
|
+
true
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
# Custom attribute writer method with validation
|
|
125
|
+
# @param [Object] id Value to be assigned
|
|
126
|
+
def id=(id)
|
|
127
|
+
if id.nil?
|
|
128
|
+
fail ArgumentError, 'id cannot be nil'
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
@id = id
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] allowed_cidrs Value to be assigned
|
|
136
|
+
def allowed_cidrs=(allowed_cidrs)
|
|
137
|
+
if allowed_cidrs.nil?
|
|
138
|
+
fail ArgumentError, 'allowed_cidrs cannot be nil'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
@allowed_cidrs = allowed_cidrs
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Checks equality by comparing each attribute.
|
|
145
|
+
# @param [Object] Object to be compared
|
|
146
|
+
def ==(o)
|
|
147
|
+
return true if self.equal?(o)
|
|
148
|
+
self.class == o.class &&
|
|
149
|
+
id == o.id &&
|
|
150
|
+
expires == o.expires &&
|
|
151
|
+
allowed_cidrs == o.allowed_cidrs
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# @see the `==` method
|
|
155
|
+
# @param [Object] Object to be compared
|
|
156
|
+
def eql?(o)
|
|
157
|
+
self == o
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
# Calculates hash code according to all attributes.
|
|
161
|
+
# @return [Integer] Hash code
|
|
162
|
+
def hash
|
|
163
|
+
[id, expires, allowed_cidrs].hash
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
# Builds the object from hash
|
|
167
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
168
|
+
# @return [Object] Returns the model itself
|
|
169
|
+
def self.build_from_hash(attributes)
|
|
170
|
+
return nil unless attributes.is_a?(Hash)
|
|
171
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
172
|
+
transformed_hash = {}
|
|
173
|
+
openapi_types.each_pair do |key, type|
|
|
174
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
175
|
+
transformed_hash["#{key}"] = nil
|
|
176
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
177
|
+
# check to ensure the input is an array given that the attribute
|
|
178
|
+
# is documented as an array but the input is not
|
|
179
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
180
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
181
|
+
end
|
|
182
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
183
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
new(transformed_hash)
|
|
187
|
+
end
|
|
188
|
+
|
|
189
|
+
# Returns the object in the form of hash
|
|
190
|
+
# @return [Hash] Returns the object in the form of hash
|
|
191
|
+
def to_hash
|
|
192
|
+
hash = {}
|
|
193
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
194
|
+
value = self.send(attr)
|
|
195
|
+
if value.nil?
|
|
196
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
197
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
hash[param] = _to_hash(value)
|
|
201
|
+
end
|
|
202
|
+
hash
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
end
|
|
206
|
+
|
|
207
|
+
end
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module VPNDetection
|
|
17
|
+
class AccountError < ApiModelBase
|
|
18
|
+
attr_accessor :error
|
|
19
|
+
|
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
21
|
+
def self.attribute_map
|
|
22
|
+
{
|
|
23
|
+
:'error' => :'error'
|
|
24
|
+
}
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
# Returns attribute mapping this model knows about
|
|
28
|
+
def self.acceptable_attribute_map
|
|
29
|
+
attribute_map
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Returns all the JSON keys this model knows about
|
|
33
|
+
def self.acceptable_attributes
|
|
34
|
+
acceptable_attribute_map.values
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Attribute type mapping.
|
|
38
|
+
def self.openapi_types
|
|
39
|
+
{
|
|
40
|
+
:'error' => :'String'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# List of attributes with nullable: true
|
|
45
|
+
def self.openapi_nullable
|
|
46
|
+
Set.new([
|
|
47
|
+
])
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
# Initializes the object
|
|
51
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
52
|
+
def initialize(attributes = {})
|
|
53
|
+
if (!attributes.is_a?(Hash))
|
|
54
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountError` initialize method"
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
58
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
59
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
60
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
61
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
62
|
+
end
|
|
63
|
+
h[k.to_sym] = v
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if attributes.key?(:'error')
|
|
67
|
+
self.error = attributes[:'error']
|
|
68
|
+
else
|
|
69
|
+
self.error = nil
|
|
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
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
77
|
+
invalid_properties = Array.new
|
|
78
|
+
if @error.nil?
|
|
79
|
+
invalid_properties.push('invalid value for "error", error cannot be nil.')
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
invalid_properties
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Check to see if the all the properties in the model are valid
|
|
86
|
+
# @return true if the model is valid
|
|
87
|
+
def valid?
|
|
88
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
89
|
+
return false if @error.nil?
|
|
90
|
+
true
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
# Custom attribute writer method with validation
|
|
94
|
+
# @param [Object] error Value to be assigned
|
|
95
|
+
def error=(error)
|
|
96
|
+
if error.nil?
|
|
97
|
+
fail ArgumentError, 'error cannot be nil'
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
@error = error
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
# Checks equality by comparing each attribute.
|
|
104
|
+
# @param [Object] Object to be compared
|
|
105
|
+
def ==(o)
|
|
106
|
+
return true if self.equal?(o)
|
|
107
|
+
self.class == o.class &&
|
|
108
|
+
error == o.error
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# @see the `==` method
|
|
112
|
+
# @param [Object] Object to be compared
|
|
113
|
+
def eql?(o)
|
|
114
|
+
self == o
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Calculates hash code according to all attributes.
|
|
118
|
+
# @return [Integer] Hash code
|
|
119
|
+
def hash
|
|
120
|
+
[error].hash
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Builds the object from hash
|
|
124
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
125
|
+
# @return [Object] Returns the model itself
|
|
126
|
+
def self.build_from_hash(attributes)
|
|
127
|
+
return nil unless attributes.is_a?(Hash)
|
|
128
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
129
|
+
transformed_hash = {}
|
|
130
|
+
openapi_types.each_pair do |key, type|
|
|
131
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
132
|
+
transformed_hash["#{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[attribute_map[key]].is_a?(Array)
|
|
137
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
138
|
+
end
|
|
139
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
140
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
141
|
+
end
|
|
142
|
+
end
|
|
143
|
+
new(transformed_hash)
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Returns the object in the form of hash
|
|
147
|
+
# @return [Hash] Returns the object in the form of hash
|
|
148
|
+
def to_hash
|
|
149
|
+
hash = {}
|
|
150
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
151
|
+
value = self.send(attr)
|
|
152
|
+
if value.nil?
|
|
153
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
154
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
hash[param] = _to_hash(value)
|
|
158
|
+
end
|
|
159
|
+
hash
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
end
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module VPNDetection
|
|
17
|
+
class AccountMe < ApiModelBase
|
|
18
|
+
# The organization the key belongs to.
|
|
19
|
+
attr_accessor :org_id
|
|
20
|
+
|
|
21
|
+
attr_accessor :apikey
|
|
22
|
+
|
|
23
|
+
attr_accessor :plan
|
|
24
|
+
|
|
25
|
+
attr_accessor :usage
|
|
26
|
+
|
|
27
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
28
|
+
def self.attribute_map
|
|
29
|
+
{
|
|
30
|
+
:'org_id' => :'org_id',
|
|
31
|
+
:'apikey' => :'apikey',
|
|
32
|
+
:'plan' => :'plan',
|
|
33
|
+
:'usage' => :'usage'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'org_id' => :'String',
|
|
51
|
+
:'apikey' => :'AccountApikey',
|
|
52
|
+
:'plan' => :'AccountPlan',
|
|
53
|
+
:'usage' => :'AccountUsage'
|
|
54
|
+
}
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# List of attributes with nullable: true
|
|
58
|
+
def self.openapi_nullable
|
|
59
|
+
Set.new([
|
|
60
|
+
])
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
# Initializes the object
|
|
64
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
65
|
+
def initialize(attributes = {})
|
|
66
|
+
if (!attributes.is_a?(Hash))
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountMe` initialize method"
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
71
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
72
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
73
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountMe`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
75
|
+
end
|
|
76
|
+
h[k.to_sym] = v
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'org_id')
|
|
80
|
+
self.org_id = attributes[:'org_id']
|
|
81
|
+
else
|
|
82
|
+
self.org_id = nil
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
if attributes.key?(:'apikey')
|
|
86
|
+
self.apikey = attributes[:'apikey']
|
|
87
|
+
else
|
|
88
|
+
self.apikey = nil
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
if attributes.key?(:'plan')
|
|
92
|
+
self.plan = attributes[:'plan']
|
|
93
|
+
else
|
|
94
|
+
self.plan = nil
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'usage')
|
|
98
|
+
self.usage = attributes[:'usage']
|
|
99
|
+
else
|
|
100
|
+
self.usage = nil
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
105
|
+
# @return Array for valid properties with the reasons
|
|
106
|
+
def list_invalid_properties
|
|
107
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
108
|
+
invalid_properties = Array.new
|
|
109
|
+
if @org_id.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "org_id", org_id cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if @apikey.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "apikey", apikey cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @plan.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "plan", plan cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @usage.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "usage", usage cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
invalid_properties
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
# Check to see if the all the properties in the model are valid
|
|
129
|
+
# @return true if the model is valid
|
|
130
|
+
def valid?
|
|
131
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
return false if @org_id.nil?
|
|
133
|
+
return false if @apikey.nil?
|
|
134
|
+
return false if @plan.nil?
|
|
135
|
+
return false if @usage.nil?
|
|
136
|
+
true
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] org_id Value to be assigned
|
|
141
|
+
def org_id=(org_id)
|
|
142
|
+
if org_id.nil?
|
|
143
|
+
fail ArgumentError, 'org_id cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@org_id = org_id
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] apikey Value to be assigned
|
|
151
|
+
def apikey=(apikey)
|
|
152
|
+
if apikey.nil?
|
|
153
|
+
fail ArgumentError, 'apikey cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@apikey = apikey
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] plan Value to be assigned
|
|
161
|
+
def plan=(plan)
|
|
162
|
+
if plan.nil?
|
|
163
|
+
fail ArgumentError, 'plan cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@plan = plan
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] usage Value to be assigned
|
|
171
|
+
def usage=(usage)
|
|
172
|
+
if usage.nil?
|
|
173
|
+
fail ArgumentError, 'usage cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@usage = usage
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
# Checks equality by comparing each attribute.
|
|
180
|
+
# @param [Object] Object to be compared
|
|
181
|
+
def ==(o)
|
|
182
|
+
return true if self.equal?(o)
|
|
183
|
+
self.class == o.class &&
|
|
184
|
+
org_id == o.org_id &&
|
|
185
|
+
apikey == o.apikey &&
|
|
186
|
+
plan == o.plan &&
|
|
187
|
+
usage == o.usage
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# @see the `==` method
|
|
191
|
+
# @param [Object] Object to be compared
|
|
192
|
+
def eql?(o)
|
|
193
|
+
self == o
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
# Calculates hash code according to all attributes.
|
|
197
|
+
# @return [Integer] Hash code
|
|
198
|
+
def hash
|
|
199
|
+
[org_id, apikey, plan, usage].hash
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
# Builds the object from hash
|
|
203
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
204
|
+
# @return [Object] Returns the model itself
|
|
205
|
+
def self.build_from_hash(attributes)
|
|
206
|
+
return nil unless attributes.is_a?(Hash)
|
|
207
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
208
|
+
transformed_hash = {}
|
|
209
|
+
openapi_types.each_pair do |key, type|
|
|
210
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
211
|
+
transformed_hash["#{key}"] = nil
|
|
212
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
213
|
+
# check to ensure the input is an array given that the attribute
|
|
214
|
+
# is documented as an array but the input is not
|
|
215
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
216
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
217
|
+
end
|
|
218
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
219
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
220
|
+
end
|
|
221
|
+
end
|
|
222
|
+
new(transformed_hash)
|
|
223
|
+
end
|
|
224
|
+
|
|
225
|
+
# Returns the object in the form of hash
|
|
226
|
+
# @return [Hash] Returns the object in the form of hash
|
|
227
|
+
def to_hash
|
|
228
|
+
hash = {}
|
|
229
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
230
|
+
value = self.send(attr)
|
|
231
|
+
if value.nil?
|
|
232
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
233
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
234
|
+
end
|
|
235
|
+
|
|
236
|
+
hash[param] = _to_hash(value)
|
|
237
|
+
end
|
|
238
|
+
hash
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
end
|
|
242
|
+
|
|
243
|
+
end
|
|
@@ -0,0 +1,216 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module VPNDetection
|
|
17
|
+
class AccountPlan < ApiModelBase
|
|
18
|
+
# The plan the organization is on.
|
|
19
|
+
attr_accessor :key
|
|
20
|
+
|
|
21
|
+
# The field tier, which decides how much of a lookup answer comes back. What each tier includes is documented on the lookup endpoint rather than repeated here, so there is one place it can be wrong.
|
|
22
|
+
attr_accessor :tier
|
|
23
|
+
|
|
24
|
+
class EnumAttributeValidator
|
|
25
|
+
attr_reader :datatype
|
|
26
|
+
attr_reader :allowable_values
|
|
27
|
+
|
|
28
|
+
def initialize(datatype, allowable_values)
|
|
29
|
+
@allowable_values = allowable_values.map do |value|
|
|
30
|
+
case datatype.to_s
|
|
31
|
+
when /Integer/i
|
|
32
|
+
value.to_i
|
|
33
|
+
when /Float/i
|
|
34
|
+
value.to_f
|
|
35
|
+
else
|
|
36
|
+
value
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
def valid?(value)
|
|
42
|
+
!value || allowable_values.include?(value)
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
47
|
+
def self.attribute_map
|
|
48
|
+
{
|
|
49
|
+
:'key' => :'key',
|
|
50
|
+
:'tier' => :'tier'
|
|
51
|
+
}
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Returns attribute mapping this model knows about
|
|
55
|
+
def self.acceptable_attribute_map
|
|
56
|
+
attribute_map
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
# Returns all the JSON keys this model knows about
|
|
60
|
+
def self.acceptable_attributes
|
|
61
|
+
acceptable_attribute_map.values
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# Attribute type mapping.
|
|
65
|
+
def self.openapi_types
|
|
66
|
+
{
|
|
67
|
+
:'key' => :'String',
|
|
68
|
+
:'tier' => :'String'
|
|
69
|
+
}
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# List of attributes with nullable: true
|
|
73
|
+
def self.openapi_nullable
|
|
74
|
+
Set.new([
|
|
75
|
+
])
|
|
76
|
+
end
|
|
77
|
+
|
|
78
|
+
# Initializes the object
|
|
79
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
80
|
+
def initialize(attributes = {})
|
|
81
|
+
if (!attributes.is_a?(Hash))
|
|
82
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountPlan` initialize method"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
86
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
87
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
88
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
89
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountPlan`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
90
|
+
end
|
|
91
|
+
h[k.to_sym] = v
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'key')
|
|
95
|
+
self.key = attributes[:'key']
|
|
96
|
+
else
|
|
97
|
+
self.key = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'tier')
|
|
101
|
+
self.tier = attributes[:'tier']
|
|
102
|
+
else
|
|
103
|
+
self.tier = nil
|
|
104
|
+
end
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
108
|
+
# @return Array for valid properties with the reasons
|
|
109
|
+
def list_invalid_properties
|
|
110
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
111
|
+
invalid_properties = Array.new
|
|
112
|
+
if @key.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "key", key cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
if @tier.nil?
|
|
117
|
+
invalid_properties.push('invalid value for "tier", tier cannot be nil.')
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
invalid_properties
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Check to see if the all the properties in the model are valid
|
|
124
|
+
# @return true if the model is valid
|
|
125
|
+
def valid?
|
|
126
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
127
|
+
return false if @key.nil?
|
|
128
|
+
return false if @tier.nil?
|
|
129
|
+
tier_validator = EnumAttributeValidator.new('String', ["free", "starter", "scale", "max"])
|
|
130
|
+
return false unless tier_validator.valid?(@tier)
|
|
131
|
+
true
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# Custom attribute writer method with validation
|
|
135
|
+
# @param [Object] key Value to be assigned
|
|
136
|
+
def key=(key)
|
|
137
|
+
if key.nil?
|
|
138
|
+
fail ArgumentError, 'key cannot be nil'
|
|
139
|
+
end
|
|
140
|
+
|
|
141
|
+
@key = key
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
145
|
+
# @param [Object] tier Object to be assigned
|
|
146
|
+
def tier=(tier)
|
|
147
|
+
validator = EnumAttributeValidator.new('String', ["free", "starter", "scale", "max"])
|
|
148
|
+
unless validator.valid?(tier)
|
|
149
|
+
fail ArgumentError, "invalid value for \"tier\", must be one of #{validator.allowable_values}."
|
|
150
|
+
end
|
|
151
|
+
@tier = tier
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Checks equality by comparing each attribute.
|
|
155
|
+
# @param [Object] Object to be compared
|
|
156
|
+
def ==(o)
|
|
157
|
+
return true if self.equal?(o)
|
|
158
|
+
self.class == o.class &&
|
|
159
|
+
key == o.key &&
|
|
160
|
+
tier == o.tier
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
# @see the `==` method
|
|
164
|
+
# @param [Object] Object to be compared
|
|
165
|
+
def eql?(o)
|
|
166
|
+
self == o
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Calculates hash code according to all attributes.
|
|
170
|
+
# @return [Integer] Hash code
|
|
171
|
+
def hash
|
|
172
|
+
[key, tier].hash
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Builds the object from hash
|
|
176
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
177
|
+
# @return [Object] Returns the model itself
|
|
178
|
+
def self.build_from_hash(attributes)
|
|
179
|
+
return nil unless attributes.is_a?(Hash)
|
|
180
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
181
|
+
transformed_hash = {}
|
|
182
|
+
openapi_types.each_pair do |key, type|
|
|
183
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
184
|
+
transformed_hash["#{key}"] = nil
|
|
185
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
186
|
+
# check to ensure the input is an array given that the attribute
|
|
187
|
+
# is documented as an array but the input is not
|
|
188
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
189
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
190
|
+
end
|
|
191
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
192
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
193
|
+
end
|
|
194
|
+
end
|
|
195
|
+
new(transformed_hash)
|
|
196
|
+
end
|
|
197
|
+
|
|
198
|
+
# Returns the object in the form of hash
|
|
199
|
+
# @return [Hash] Returns the object in the form of hash
|
|
200
|
+
def to_hash
|
|
201
|
+
hash = {}
|
|
202
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
203
|
+
value = self.send(attr)
|
|
204
|
+
if value.nil?
|
|
205
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
206
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
207
|
+
end
|
|
208
|
+
|
|
209
|
+
hash[param] = _to_hash(value)
|
|
210
|
+
end
|
|
211
|
+
hash
|
|
212
|
+
end
|
|
213
|
+
|
|
214
|
+
end
|
|
215
|
+
|
|
216
|
+
end
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
=begin
|
|
2
|
+
#VPNDetection API
|
|
3
|
+
|
|
4
|
+
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
+
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
|
+
Contact: support@vpndetection.io
|
|
8
|
+
Generated by: https://openapi-generator.tech
|
|
9
|
+
Generator version: 7.25.0
|
|
10
|
+
|
|
11
|
+
=end
|
|
12
|
+
|
|
13
|
+
require 'date'
|
|
14
|
+
require 'time'
|
|
15
|
+
|
|
16
|
+
module VPNDetection
|
|
17
|
+
class AccountUsage < ApiModelBase
|
|
18
|
+
# Requests counted in the current window. The same number the lookup API gates on, and it can lag by a few seconds.
|
|
19
|
+
attr_accessor :requests
|
|
20
|
+
|
|
21
|
+
# What the plan includes. Zero on a plan that includes none.
|
|
22
|
+
attr_accessor :quota
|
|
23
|
+
|
|
24
|
+
# Where we stop serving. NULL means never, which is the normal state of an uncapped paid plan and is not the same as zero. Above the quota and below this, requests are served and billed as overage.
|
|
25
|
+
attr_accessor :hard_limit
|
|
26
|
+
|
|
27
|
+
# When the current allowance period began.
|
|
28
|
+
attr_accessor :window_start
|
|
29
|
+
|
|
30
|
+
# When the allowance next resets.
|
|
31
|
+
attr_accessor :window_end
|
|
32
|
+
|
|
33
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
34
|
+
def self.attribute_map
|
|
35
|
+
{
|
|
36
|
+
:'requests' => :'requests',
|
|
37
|
+
:'quota' => :'quota',
|
|
38
|
+
:'hard_limit' => :'hard_limit',
|
|
39
|
+
:'window_start' => :'window_start',
|
|
40
|
+
:'window_end' => :'window_end'
|
|
41
|
+
}
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
# Returns attribute mapping this model knows about
|
|
45
|
+
def self.acceptable_attribute_map
|
|
46
|
+
attribute_map
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
# Returns all the JSON keys this model knows about
|
|
50
|
+
def self.acceptable_attributes
|
|
51
|
+
acceptable_attribute_map.values
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
# Attribute type mapping.
|
|
55
|
+
def self.openapi_types
|
|
56
|
+
{
|
|
57
|
+
:'requests' => :'Integer',
|
|
58
|
+
:'quota' => :'Integer',
|
|
59
|
+
:'hard_limit' => :'Integer',
|
|
60
|
+
:'window_start' => :'Time',
|
|
61
|
+
:'window_end' => :'Time'
|
|
62
|
+
}
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# List of attributes with nullable: true
|
|
66
|
+
def self.openapi_nullable
|
|
67
|
+
Set.new([
|
|
68
|
+
:'hard_limit',
|
|
69
|
+
])
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
# Initializes the object
|
|
73
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
74
|
+
def initialize(attributes = {})
|
|
75
|
+
if (!attributes.is_a?(Hash))
|
|
76
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::AccountUsage` initialize method"
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
80
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
81
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
82
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
83
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::AccountUsage`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
84
|
+
end
|
|
85
|
+
h[k.to_sym] = v
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
if attributes.key?(:'requests')
|
|
89
|
+
self.requests = attributes[:'requests']
|
|
90
|
+
else
|
|
91
|
+
self.requests = nil
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
if attributes.key?(:'quota')
|
|
95
|
+
self.quota = attributes[:'quota']
|
|
96
|
+
else
|
|
97
|
+
self.quota = nil
|
|
98
|
+
end
|
|
99
|
+
|
|
100
|
+
if attributes.key?(:'hard_limit')
|
|
101
|
+
self.hard_limit = attributes[:'hard_limit']
|
|
102
|
+
else
|
|
103
|
+
self.hard_limit = nil
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
if attributes.key?(:'window_start')
|
|
107
|
+
self.window_start = attributes[:'window_start']
|
|
108
|
+
else
|
|
109
|
+
self.window_start = nil
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if attributes.key?(:'window_end')
|
|
113
|
+
self.window_end = attributes[:'window_end']
|
|
114
|
+
else
|
|
115
|
+
self.window_end = nil
|
|
116
|
+
end
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
120
|
+
# @return Array for valid properties with the reasons
|
|
121
|
+
def list_invalid_properties
|
|
122
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
123
|
+
invalid_properties = Array.new
|
|
124
|
+
if @requests.nil?
|
|
125
|
+
invalid_properties.push('invalid value for "requests", requests cannot be nil.')
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
if @quota.nil?
|
|
129
|
+
invalid_properties.push('invalid value for "quota", quota cannot be nil.')
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
if @window_start.nil?
|
|
133
|
+
invalid_properties.push('invalid value for "window_start", window_start cannot be nil.')
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
if @window_end.nil?
|
|
137
|
+
invalid_properties.push('invalid value for "window_end", window_end cannot be nil.')
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
invalid_properties
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Check to see if the all the properties in the model are valid
|
|
144
|
+
# @return true if the model is valid
|
|
145
|
+
def valid?
|
|
146
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
147
|
+
return false if @requests.nil?
|
|
148
|
+
return false if @quota.nil?
|
|
149
|
+
return false if @window_start.nil?
|
|
150
|
+
return false if @window_end.nil?
|
|
151
|
+
true
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Custom attribute writer method with validation
|
|
155
|
+
# @param [Object] requests Value to be assigned
|
|
156
|
+
def requests=(requests)
|
|
157
|
+
if requests.nil?
|
|
158
|
+
fail ArgumentError, 'requests cannot be nil'
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
@requests = requests
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
# Custom attribute writer method with validation
|
|
165
|
+
# @param [Object] quota Value to be assigned
|
|
166
|
+
def quota=(quota)
|
|
167
|
+
if quota.nil?
|
|
168
|
+
fail ArgumentError, 'quota cannot be nil'
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
@quota = quota
|
|
172
|
+
end
|
|
173
|
+
|
|
174
|
+
# Custom attribute writer method with validation
|
|
175
|
+
# @param [Object] window_start Value to be assigned
|
|
176
|
+
def window_start=(window_start)
|
|
177
|
+
if window_start.nil?
|
|
178
|
+
fail ArgumentError, 'window_start cannot be nil'
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
@window_start = window_start
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
# Custom attribute writer method with validation
|
|
185
|
+
# @param [Object] window_end Value to be assigned
|
|
186
|
+
def window_end=(window_end)
|
|
187
|
+
if window_end.nil?
|
|
188
|
+
fail ArgumentError, 'window_end cannot be nil'
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
@window_end = window_end
|
|
192
|
+
end
|
|
193
|
+
|
|
194
|
+
# Checks equality by comparing each attribute.
|
|
195
|
+
# @param [Object] Object to be compared
|
|
196
|
+
def ==(o)
|
|
197
|
+
return true if self.equal?(o)
|
|
198
|
+
self.class == o.class &&
|
|
199
|
+
requests == o.requests &&
|
|
200
|
+
quota == o.quota &&
|
|
201
|
+
hard_limit == o.hard_limit &&
|
|
202
|
+
window_start == o.window_start &&
|
|
203
|
+
window_end == o.window_end
|
|
204
|
+
end
|
|
205
|
+
|
|
206
|
+
# @see the `==` method
|
|
207
|
+
# @param [Object] Object to be compared
|
|
208
|
+
def eql?(o)
|
|
209
|
+
self == o
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
# Calculates hash code according to all attributes.
|
|
213
|
+
# @return [Integer] Hash code
|
|
214
|
+
def hash
|
|
215
|
+
[requests, quota, hard_limit, window_start, window_end].hash
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
# Builds the object from hash
|
|
219
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
220
|
+
# @return [Object] Returns the model itself
|
|
221
|
+
def self.build_from_hash(attributes)
|
|
222
|
+
return nil unless attributes.is_a?(Hash)
|
|
223
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
224
|
+
transformed_hash = {}
|
|
225
|
+
openapi_types.each_pair do |key, type|
|
|
226
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
227
|
+
transformed_hash["#{key}"] = nil
|
|
228
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
229
|
+
# check to ensure the input is an array given that the attribute
|
|
230
|
+
# is documented as an array but the input is not
|
|
231
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
232
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
233
|
+
end
|
|
234
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
235
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
new(transformed_hash)
|
|
239
|
+
end
|
|
240
|
+
|
|
241
|
+
# Returns the object in the form of hash
|
|
242
|
+
# @return [Hash] Returns the object in the form of hash
|
|
243
|
+
def to_hash
|
|
244
|
+
hash = {}
|
|
245
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
246
|
+
value = self.send(attr)
|
|
247
|
+
if value.nil?
|
|
248
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
249
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
250
|
+
end
|
|
251
|
+
|
|
252
|
+
hash[param] = _to_hash(value)
|
|
253
|
+
end
|
|
254
|
+
hash
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
end
|
|
@@ -23,6 +23,7 @@ module VPNDetection
|
|
|
23
23
|
|
|
24
24
|
attr_accessor :summary
|
|
25
25
|
|
|
26
|
+
# What a license permits you to do with the data. Null for a family you hold no license for, which is every one with standing `unlicensed`.
|
|
26
27
|
attr_accessor :license_type
|
|
27
28
|
|
|
28
29
|
attr_accessor :starts
|
|
@@ -99,7 +100,7 @@ module VPNDetection
|
|
|
99
100
|
:'base' => :'String',
|
|
100
101
|
:'name' => :'String',
|
|
101
102
|
:'summary' => :'String',
|
|
102
|
-
:'license_type' => :'
|
|
103
|
+
:'license_type' => :'String',
|
|
103
104
|
:'starts' => :'Time',
|
|
104
105
|
:'expires' => :'Time',
|
|
105
106
|
:'renews_at' => :'Time',
|
|
@@ -113,6 +114,7 @@ module VPNDetection
|
|
|
113
114
|
# List of attributes with nullable: true
|
|
114
115
|
def self.openapi_nullable
|
|
115
116
|
Set.new([
|
|
117
|
+
:'license_type',
|
|
116
118
|
:'starts',
|
|
117
119
|
:'expires',
|
|
118
120
|
:'renews_at',
|
|
@@ -222,10 +224,6 @@ module VPNDetection
|
|
|
222
224
|
invalid_properties.push('invalid value for "summary", summary cannot be nil.')
|
|
223
225
|
end
|
|
224
226
|
|
|
225
|
-
if @license_type.nil?
|
|
226
|
-
invalid_properties.push('invalid value for "license_type", license_type cannot be nil.')
|
|
227
|
-
end
|
|
228
|
-
|
|
229
227
|
if @in_term.nil?
|
|
230
228
|
invalid_properties.push('invalid value for "in_term", in_term cannot be nil.')
|
|
231
229
|
end
|
|
@@ -248,7 +246,8 @@ module VPNDetection
|
|
|
248
246
|
return false if @base.nil?
|
|
249
247
|
return false if @name.nil?
|
|
250
248
|
return false if @summary.nil?
|
|
251
|
-
|
|
249
|
+
license_type_validator = EnumAttributeValidator.new('String', ["evaluation", "standard", "redistribute"])
|
|
250
|
+
return false unless license_type_validator.valid?(@license_type)
|
|
252
251
|
return false if @in_term.nil?
|
|
253
252
|
return false if @standing.nil?
|
|
254
253
|
return false if @versions.nil?
|
|
@@ -285,13 +284,13 @@ module VPNDetection
|
|
|
285
284
|
@summary = summary
|
|
286
285
|
end
|
|
287
286
|
|
|
288
|
-
# Custom attribute writer method
|
|
289
|
-
# @param [Object] license_type
|
|
287
|
+
# Custom attribute writer method checking allowed values (enum).
|
|
288
|
+
# @param [Object] license_type Object to be assigned
|
|
290
289
|
def license_type=(license_type)
|
|
291
|
-
|
|
292
|
-
|
|
290
|
+
validator = EnumAttributeValidator.new('String', ["evaluation", "standard", "redistribute"])
|
|
291
|
+
unless validator.valid?(license_type)
|
|
292
|
+
fail ArgumentError, "invalid value for \"license_type\", must be one of #{validator.allowable_values}."
|
|
293
293
|
end
|
|
294
|
-
|
|
295
294
|
@license_type = license_type
|
|
296
295
|
end
|
|
297
296
|
|
data/lib/vpndetection/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: vpndetection
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mslm Dev
|
|
@@ -48,6 +48,7 @@ files:
|
|
|
48
48
|
- LICENSE
|
|
49
49
|
- README.md
|
|
50
50
|
- lib/vpndetection.rb
|
|
51
|
+
- lib/vpndetection/api/account_wire_api.rb
|
|
51
52
|
- lib/vpndetection/api/database_wire_api.rb
|
|
52
53
|
- lib/vpndetection/api/lookup_wire_api.rb
|
|
53
54
|
- lib/vpndetection/api_client.rb
|
|
@@ -63,6 +64,11 @@ files:
|
|
|
63
64
|
- lib/vpndetection/middleware.rb
|
|
64
65
|
- lib/vpndetection/middleware/condition.rb
|
|
65
66
|
- lib/vpndetection/middleware/core.rb
|
|
67
|
+
- lib/vpndetection/models/account_apikey.rb
|
|
68
|
+
- lib/vpndetection/models/account_error.rb
|
|
69
|
+
- lib/vpndetection/models/account_me.rb
|
|
70
|
+
- lib/vpndetection/models/account_plan.rb
|
|
71
|
+
- lib/vpndetection/models/account_usage.rb
|
|
66
72
|
- lib/vpndetection/models/class_detail.rb
|
|
67
73
|
- lib/vpndetection/models/database.rb
|
|
68
74
|
- lib/vpndetection/models/database_checksums_response.rb
|
|
@@ -76,7 +82,6 @@ files:
|
|
|
76
82
|
- lib/vpndetection/models/download.rb
|
|
77
83
|
- lib/vpndetection/models/download_list.rb
|
|
78
84
|
- lib/vpndetection/models/error_envelope.rb
|
|
79
|
-
- lib/vpndetection/models/license_type.rb
|
|
80
85
|
- lib/vpndetection/models/lookup_error.rb
|
|
81
86
|
- lib/vpndetection/models/lookup_response.rb
|
|
82
87
|
- lib/vpndetection/models/proxy_detail.rb
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#VPNDetection API
|
|
3
|
-
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
|
|
5
|
-
|
|
6
|
-
The version of the OpenAPI document: 2026.09.13
|
|
7
|
-
Contact: support@vpndetection.io
|
|
8
|
-
Generated by: https://openapi-generator.tech
|
|
9
|
-
Generator version: 7.25.0
|
|
10
|
-
|
|
11
|
-
=end
|
|
12
|
-
|
|
13
|
-
require 'date'
|
|
14
|
-
require 'time'
|
|
15
|
-
|
|
16
|
-
module VPNDetection
|
|
17
|
-
class LicenseType
|
|
18
|
-
EVALUATION = "evaluation".freeze
|
|
19
|
-
STANDARD = "standard".freeze
|
|
20
|
-
REDISTRIBUTE = "redistribute".freeze
|
|
21
|
-
|
|
22
|
-
def self.all_vars
|
|
23
|
-
@all_vars ||= [EVALUATION, STANDARD, REDISTRIBUTE].freeze
|
|
24
|
-
end
|
|
25
|
-
|
|
26
|
-
# Builds the enum from string
|
|
27
|
-
# @param [String] The enum value in the form of the string
|
|
28
|
-
# @return [String] The enum value
|
|
29
|
-
def self.build_from_hash(value)
|
|
30
|
-
new.build_from_hash(value)
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
# Builds the enum from string
|
|
34
|
-
# @param [String] The enum value in the form of the string
|
|
35
|
-
# @return [String] The enum value
|
|
36
|
-
def build_from_hash(value)
|
|
37
|
-
return value if LicenseType.all_vars.include?(value)
|
|
38
|
-
raise "Invalid ENUM value #{value} for class #LicenseType"
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
end
|