vpndetection 1.5.0 → 3.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/README.md +2 -2
- data/lib/vpndetection/api/{database_api.rb → database_wire_api.rb} +41 -51
- data/lib/vpndetection/api/lookup_wire_api.rb +142 -0
- data/lib/vpndetection/api_client.rb +2 -2
- data/lib/vpndetection/api_error.rb +2 -2
- data/lib/vpndetection/api_model_base.rb +2 -2
- data/lib/vpndetection/client.rb +1 -1
- data/lib/vpndetection/configuration.rb +2 -2
- data/lib/vpndetection/{database.rb → database_api.rb} +5 -5
- data/lib/vpndetection/models/class_detail.rb +2 -2
- data/lib/vpndetection/models/{licensed_dataset.rb → database.rb} +20 -26
- data/lib/vpndetection/models/{dataset_checksums_response.rb → database_checksums_response.rb} +6 -6
- data/lib/vpndetection/models/database_format.rb +40 -0
- data/lib/vpndetection/models/{dataset_format_size.rb → database_format_size.rb} +11 -13
- data/lib/vpndetection/models/{dataset_list.rb → database_list.rb} +22 -22
- data/lib/vpndetection/models/{dataset_metadata.rb → database_metadata.rb} +6 -6
- data/lib/vpndetection/models/{dataset_metadata_column.rb → database_metadata_column.rb} +5 -5
- data/lib/vpndetection/models/{licensed_version.rb → database_version.rb} +9 -31
- data/lib/vpndetection/models/{dataset_checksums.rb → db_checksums.rb} +74 -5
- data/lib/vpndetection/models/download.rb +2 -2
- data/lib/vpndetection/models/download_list.rb +2 -2
- data/lib/vpndetection/models/error_envelope.rb +2 -2
- data/lib/vpndetection/models/license_type.rb +41 -0
- data/lib/vpndetection/models/lookup_error.rb +2 -2
- data/lib/vpndetection/models/lookup_response.rb +2 -2
- data/lib/vpndetection/models/proxy_detail.rb +2 -2
- data/lib/vpndetection/models/standing.rb +41 -0
- data/lib/vpndetection/models/vpn_detail.rb +3 -3
- data/lib/vpndetection/transport.rb +1 -1
- data/lib/vpndetection/version.rb +1 -1
- data/lib/vpndetection.rb +1 -1
- metadata +15 -12
- data/lib/vpndetection/api/lookup_api.rb +0 -85
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d80c8ce32eeb125e13622a5edae6ea738396941432e2d1d666872b5d1f1caff5
|
|
4
|
+
data.tar.gz: b895a219283c89c84690405ad7bd7719175d7e4303885e05de9325a1f273c785
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 579cb6d0adcd24b1e83b8bcca8d9aefcde2c5f2ff99a0534cf447a397a133942bdeab4c41245cc541c9e46e6c193601e850a02a70c1e0e29ba79d6dcd0d77f82
|
|
7
|
+
data.tar.gz: efb8371a1b228608ebc835bf15fd7942004b9aabca5668c6cc0d471e26ddcce5367e9daa2e376bb57934ed67e509aad521754981481c94d65c335ef42a673807
|
data/README.md
CHANGED
|
@@ -134,7 +134,7 @@ Note that `:rate_limited` and `:quota_exceeded` both arrive as HTTP 429 and are
|
|
|
134
134
|
|
|
135
135
|
### Database downloads
|
|
136
136
|
|
|
137
|
-
If your key carries the `db.download` scope, the licensed
|
|
137
|
+
If your key carries the `db.download` scope, the licensed databases are available through `client.database`. A license covers a database FAMILY and a download names one of its versions, so the id comes from `versions`:
|
|
138
138
|
|
|
139
139
|
```ruby
|
|
140
140
|
family = client.database.list.first
|
|
@@ -145,7 +145,7 @@ url = client.database.download_url(id, 'mmdb')
|
|
|
145
145
|
bytes = client.database.download_bytes('cdn_ip_v1', 'csvgz')
|
|
146
146
|
```
|
|
147
147
|
|
|
148
|
-
`download` streams straight to disk, so nothing bigger than a chunk is ever held in memory whatever the
|
|
148
|
+
`download` streams straight to disk, so nothing bigger than a chunk is ever held in memory whatever the database weighs, and it writes through a neighboring `.part` file so a transfer that dies half way leaves no truncated copy behind. `download_url` hands back the time-limited link and follows nothing, for when you want to run the transfer yourself. `download_bytes` holds the whole file in memory, and the catalog runs from `cdn_ip_v1` at 10 KB to `resproxy_ip_90d_v1` at 1.79 GB, so reach for `download` for anything you have not measured.
|
|
149
149
|
|
|
150
150
|
### Absent is not false
|
|
151
151
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -13,7 +13,7 @@ Generator version: 7.25.0
|
|
|
13
13
|
require 'cgi'
|
|
14
14
|
|
|
15
15
|
module VPNDetection
|
|
16
|
-
class
|
|
16
|
+
class DatabaseWireApi
|
|
17
17
|
attr_accessor :api_client
|
|
18
18
|
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
|
@@ -22,9 +22,9 @@ module VPNDetection
|
|
|
22
22
|
# Checksums
|
|
23
23
|
# Checksums for one published file, so a download can be verified after it lands.
|
|
24
24
|
# @param id [String]
|
|
25
|
-
# @param format [
|
|
25
|
+
# @param format [DatabaseFormat]
|
|
26
26
|
# @param [Hash] opts the optional parameters
|
|
27
|
-
# @return [
|
|
27
|
+
# @return [DatabaseChecksumsResponse]
|
|
28
28
|
def database_checksum(id, format, opts = {})
|
|
29
29
|
data, _status_code, _headers = database_checksum_with_http_info(id, format, opts)
|
|
30
30
|
data
|
|
@@ -33,25 +33,20 @@ module VPNDetection
|
|
|
33
33
|
# Checksums
|
|
34
34
|
# Checksums for one published file, so a download can be verified after it lands.
|
|
35
35
|
# @param id [String]
|
|
36
|
-
# @param format [
|
|
36
|
+
# @param format [DatabaseFormat]
|
|
37
37
|
# @param [Hash] opts the optional parameters
|
|
38
|
-
# @return [Array<(
|
|
38
|
+
# @return [Array<(DatabaseChecksumsResponse, Integer, Hash)>] DatabaseChecksumsResponse data, response status code and response headers
|
|
39
39
|
def database_checksum_with_http_info(id, format, opts = {})
|
|
40
40
|
if @api_client.config.debugging
|
|
41
|
-
@api_client.config.logger.debug 'Calling API:
|
|
41
|
+
@api_client.config.logger.debug 'Calling API: DatabaseWireApi.database_checksum ...'
|
|
42
42
|
end
|
|
43
43
|
# verify the required parameter 'id' is set
|
|
44
44
|
if @api_client.config.client_side_validation && id.nil?
|
|
45
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling
|
|
45
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DatabaseWireApi.database_checksum"
|
|
46
46
|
end
|
|
47
47
|
# verify the required parameter 'format' is set
|
|
48
48
|
if @api_client.config.client_side_validation && format.nil?
|
|
49
|
-
fail ArgumentError, "Missing the required parameter 'format' when calling
|
|
50
|
-
end
|
|
51
|
-
# verify enum value
|
|
52
|
-
allowable_values = ["csvgz", "mmdb"]
|
|
53
|
-
if @api_client.config.client_side_validation && !allowable_values.include?(format)
|
|
54
|
-
fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
|
|
49
|
+
fail ArgumentError, "Missing the required parameter 'format' when calling DatabaseWireApi.database_checksum"
|
|
55
50
|
end
|
|
56
51
|
# resource path
|
|
57
52
|
local_var_path = '/api/v1/database/checksum'
|
|
@@ -73,13 +68,13 @@ module VPNDetection
|
|
|
73
68
|
post_body = opts[:debug_body]
|
|
74
69
|
|
|
75
70
|
# return_type
|
|
76
|
-
return_type = opts[:debug_return_type] || '
|
|
71
|
+
return_type = opts[:debug_return_type] || 'DatabaseChecksumsResponse'
|
|
77
72
|
|
|
78
73
|
# auth_names
|
|
79
74
|
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
80
75
|
|
|
81
76
|
new_options = opts.merge(
|
|
82
|
-
:operation => :"
|
|
77
|
+
:operation => :"DatabaseWireApi.database_checksum",
|
|
83
78
|
:header_params => header_params,
|
|
84
79
|
:query_params => query_params,
|
|
85
80
|
:form_params => form_params,
|
|
@@ -90,33 +85,33 @@ module VPNDetection
|
|
|
90
85
|
|
|
91
86
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
92
87
|
if @api_client.config.debugging
|
|
93
|
-
@api_client.config.logger.debug "API called:
|
|
88
|
+
@api_client.config.logger.debug "API called: DatabaseWireApi#database_checksum\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
94
89
|
end
|
|
95
90
|
return data, status_code, headers
|
|
96
91
|
end
|
|
97
92
|
|
|
98
93
|
# Metadata
|
|
99
|
-
# Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything. No `format` parameter - one document describes every format the
|
|
94
|
+
# Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything. No `format` parameter - one document describes every format the database is built in.
|
|
100
95
|
# @param id [String]
|
|
101
96
|
# @param [Hash] opts the optional parameters
|
|
102
|
-
# @return [
|
|
97
|
+
# @return [DatabaseMetadata]
|
|
103
98
|
def database_metadata(id, opts = {})
|
|
104
99
|
data, _status_code, _headers = database_metadata_with_http_info(id, opts)
|
|
105
100
|
data
|
|
106
101
|
end
|
|
107
102
|
|
|
108
103
|
# Metadata
|
|
109
|
-
# Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything. No `format` parameter - one document describes every format the
|
|
104
|
+
# Poll this to decide whether today's build is worth fetching: it carries `updated` and `entries` without downloading anything. No `format` parameter - one document describes every format the database is built in.
|
|
110
105
|
# @param id [String]
|
|
111
106
|
# @param [Hash] opts the optional parameters
|
|
112
|
-
# @return [Array<(
|
|
107
|
+
# @return [Array<(DatabaseMetadata, Integer, Hash)>] DatabaseMetadata data, response status code and response headers
|
|
113
108
|
def database_metadata_with_http_info(id, opts = {})
|
|
114
109
|
if @api_client.config.debugging
|
|
115
|
-
@api_client.config.logger.debug 'Calling API:
|
|
110
|
+
@api_client.config.logger.debug 'Calling API: DatabaseWireApi.database_metadata ...'
|
|
116
111
|
end
|
|
117
112
|
# verify the required parameter 'id' is set
|
|
118
113
|
if @api_client.config.client_side_validation && id.nil?
|
|
119
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling
|
|
114
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DatabaseWireApi.database_metadata"
|
|
120
115
|
end
|
|
121
116
|
# resource path
|
|
122
117
|
local_var_path = '/api/v1/database/metadata'
|
|
@@ -137,13 +132,13 @@ module VPNDetection
|
|
|
137
132
|
post_body = opts[:debug_body]
|
|
138
133
|
|
|
139
134
|
# return_type
|
|
140
|
-
return_type = opts[:debug_return_type] || '
|
|
135
|
+
return_type = opts[:debug_return_type] || 'DatabaseMetadata'
|
|
141
136
|
|
|
142
137
|
# auth_names
|
|
143
138
|
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
144
139
|
|
|
145
140
|
new_options = opts.merge(
|
|
146
|
-
:operation => :"
|
|
141
|
+
:operation => :"DatabaseWireApi.database_metadata",
|
|
147
142
|
:header_params => header_params,
|
|
148
143
|
:query_params => query_params,
|
|
149
144
|
:form_params => form_params,
|
|
@@ -154,7 +149,7 @@ module VPNDetection
|
|
|
154
149
|
|
|
155
150
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
156
151
|
if @api_client.config.debugging
|
|
157
|
-
@api_client.config.logger.debug "API called:
|
|
152
|
+
@api_client.config.logger.debug "API called: DatabaseWireApi#database_metadata\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
158
153
|
end
|
|
159
154
|
return data, status_code, headers
|
|
160
155
|
end
|
|
@@ -162,7 +157,7 @@ module VPNDetection
|
|
|
162
157
|
# Download
|
|
163
158
|
# Answers `302` with a time-limited URL pointing straight at object storage. Follow the redirect; the link authorizes the START of a transfer, so one already running is not interrupted when it lapses.
|
|
164
159
|
# @param id [String] Dataset id, e.g. vpn_ip_extended_v1
|
|
165
|
-
# @param format [
|
|
160
|
+
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogues are keyed by provider id rather than by IP range, so no MMDB exists for them.
|
|
166
161
|
# @param [Hash] opts the optional parameters
|
|
167
162
|
# @return [nil]
|
|
168
163
|
def download_database(id, format, opts = {})
|
|
@@ -173,25 +168,20 @@ module VPNDetection
|
|
|
173
168
|
# Download
|
|
174
169
|
# Answers `302` with a time-limited URL pointing straight at object storage. Follow the redirect; the link authorizes the START of a transfer, so one already running is not interrupted when it lapses.
|
|
175
170
|
# @param id [String] Dataset id, e.g. vpn_ip_extended_v1
|
|
176
|
-
# @param format [
|
|
171
|
+
# @param format [DatabaseFormat] Not every database is built in every format. The `_provider` catalogues are keyed by provider id rather than by IP range, so no MMDB exists for them.
|
|
177
172
|
# @param [Hash] opts the optional parameters
|
|
178
173
|
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
|
179
174
|
def download_database_with_http_info(id, format, opts = {})
|
|
180
175
|
if @api_client.config.debugging
|
|
181
|
-
@api_client.config.logger.debug 'Calling API:
|
|
176
|
+
@api_client.config.logger.debug 'Calling API: DatabaseWireApi.download_database ...'
|
|
182
177
|
end
|
|
183
178
|
# verify the required parameter 'id' is set
|
|
184
179
|
if @api_client.config.client_side_validation && id.nil?
|
|
185
|
-
fail ArgumentError, "Missing the required parameter 'id' when calling
|
|
180
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DatabaseWireApi.download_database"
|
|
186
181
|
end
|
|
187
182
|
# verify the required parameter 'format' is set
|
|
188
183
|
if @api_client.config.client_side_validation && format.nil?
|
|
189
|
-
fail ArgumentError, "Missing the required parameter 'format' when calling
|
|
190
|
-
end
|
|
191
|
-
# verify enum value
|
|
192
|
-
allowable_values = ["csvgz", "mmdb"]
|
|
193
|
-
if @api_client.config.client_side_validation && !allowable_values.include?(format)
|
|
194
|
-
fail ArgumentError, "invalid value for \"format\", must be one of #{allowable_values}"
|
|
184
|
+
fail ArgumentError, "Missing the required parameter 'format' when calling DatabaseWireApi.download_database"
|
|
195
185
|
end
|
|
196
186
|
# resource path
|
|
197
187
|
local_var_path = '/api/v1/database/download'
|
|
@@ -219,7 +209,7 @@ module VPNDetection
|
|
|
219
209
|
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
220
210
|
|
|
221
211
|
new_options = opts.merge(
|
|
222
|
-
:operation => :"
|
|
212
|
+
:operation => :"DatabaseWireApi.download_database",
|
|
223
213
|
:header_params => header_params,
|
|
224
214
|
:query_params => query_params,
|
|
225
215
|
:form_params => form_params,
|
|
@@ -230,27 +220,27 @@ module VPNDetection
|
|
|
230
220
|
|
|
231
221
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
232
222
|
if @api_client.config.debugging
|
|
233
|
-
@api_client.config.logger.debug "API called:
|
|
223
|
+
@api_client.config.logger.debug "API called: DatabaseWireApi#download_database\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
234
224
|
end
|
|
235
225
|
return data, status_code, headers
|
|
236
226
|
end
|
|
237
227
|
|
|
238
228
|
# List
|
|
239
|
-
# Every
|
|
229
|
+
# Every database this organization holds a licence for, with the term and the license_type right beside each one.
|
|
240
230
|
# @param [Hash] opts the optional parameters
|
|
241
|
-
# @return [
|
|
231
|
+
# @return [DatabaseList]
|
|
242
232
|
def list_databases(opts = {})
|
|
243
233
|
data, _status_code, _headers = list_databases_with_http_info(opts)
|
|
244
234
|
data
|
|
245
235
|
end
|
|
246
236
|
|
|
247
237
|
# List
|
|
248
|
-
# Every
|
|
238
|
+
# Every database this organization holds a licence for, with the term and the license_type right beside each one.
|
|
249
239
|
# @param [Hash] opts the optional parameters
|
|
250
|
-
# @return [Array<(
|
|
240
|
+
# @return [Array<(DatabaseList, Integer, Hash)>] DatabaseList data, response status code and response headers
|
|
251
241
|
def list_databases_with_http_info(opts = {})
|
|
252
242
|
if @api_client.config.debugging
|
|
253
|
-
@api_client.config.logger.debug 'Calling API:
|
|
243
|
+
@api_client.config.logger.debug 'Calling API: DatabaseWireApi.list_databases ...'
|
|
254
244
|
end
|
|
255
245
|
# resource path
|
|
256
246
|
local_var_path = '/api/v1/database/list'
|
|
@@ -270,13 +260,13 @@ module VPNDetection
|
|
|
270
260
|
post_body = opts[:debug_body]
|
|
271
261
|
|
|
272
262
|
# return_type
|
|
273
|
-
return_type = opts[:debug_return_type] || '
|
|
263
|
+
return_type = opts[:debug_return_type] || 'DatabaseList'
|
|
274
264
|
|
|
275
265
|
# auth_names
|
|
276
266
|
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
277
267
|
|
|
278
268
|
new_options = opts.merge(
|
|
279
|
-
:operation => :"
|
|
269
|
+
:operation => :"DatabaseWireApi.list_databases",
|
|
280
270
|
:header_params => header_params,
|
|
281
271
|
:query_params => query_params,
|
|
282
272
|
:form_params => form_params,
|
|
@@ -287,7 +277,7 @@ module VPNDetection
|
|
|
287
277
|
|
|
288
278
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
289
279
|
if @api_client.config.debugging
|
|
290
|
-
@api_client.config.logger.debug "API called:
|
|
280
|
+
@api_client.config.logger.debug "API called: DatabaseWireApi#list_databases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
291
281
|
end
|
|
292
282
|
return data, status_code, headers
|
|
293
283
|
end
|
|
@@ -309,10 +299,10 @@ module VPNDetection
|
|
|
309
299
|
# @return [Array<(DownloadList, Integer, Hash)>] DownloadList data, response status code and response headers
|
|
310
300
|
def list_downloads_with_http_info(opts = {})
|
|
311
301
|
if @api_client.config.debugging
|
|
312
|
-
@api_client.config.logger.debug 'Calling API:
|
|
302
|
+
@api_client.config.logger.debug 'Calling API: DatabaseWireApi.list_downloads ...'
|
|
313
303
|
end
|
|
314
304
|
if @api_client.config.client_side_validation && !opts[:'limit'].nil? && opts[:'limit'] > 200
|
|
315
|
-
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling
|
|
305
|
+
fail ArgumentError, 'invalid value for "opts[:"limit"]" when calling DatabaseWireApi.list_downloads, must be smaller than or equal to 200.'
|
|
316
306
|
end
|
|
317
307
|
|
|
318
308
|
# resource path
|
|
@@ -340,7 +330,7 @@ module VPNDetection
|
|
|
340
330
|
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
341
331
|
|
|
342
332
|
new_options = opts.merge(
|
|
343
|
-
:operation => :"
|
|
333
|
+
:operation => :"DatabaseWireApi.list_downloads",
|
|
344
334
|
:header_params => header_params,
|
|
345
335
|
:query_params => query_params,
|
|
346
336
|
:form_params => form_params,
|
|
@@ -351,7 +341,7 @@ module VPNDetection
|
|
|
351
341
|
|
|
352
342
|
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
353
343
|
if @api_client.config.debugging
|
|
354
|
-
@api_client.config.logger.debug "API called:
|
|
344
|
+
@api_client.config.logger.debug "API called: DatabaseWireApi#list_downloads\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
355
345
|
end
|
|
356
346
|
return data, status_code, headers
|
|
357
347
|
end
|
|
@@ -0,0 +1,142 @@
|
|
|
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 LookupWireApi
|
|
17
|
+
attr_accessor :api_client
|
|
18
|
+
|
|
19
|
+
def initialize(api_client = ApiClient.default)
|
|
20
|
+
@api_client = api_client
|
|
21
|
+
end
|
|
22
|
+
# Lookup
|
|
23
|
+
# Answers what is known about a single IPv4 or IPv6 address. Which fields come back is decided by the plan behind the presented key; with no key the answer is `ip` and `is_vpn`.
|
|
24
|
+
# @param ip [String] The IPv4 or IPv6 address to classify.
|
|
25
|
+
# @param [Hash] opts the optional parameters
|
|
26
|
+
# @return [LookupResponse]
|
|
27
|
+
def lookup_ip(ip, opts = {})
|
|
28
|
+
data, _status_code, _headers = lookup_ip_with_http_info(ip, opts)
|
|
29
|
+
data
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Lookup
|
|
33
|
+
# Answers what is known about a single IPv4 or IPv6 address. Which fields come back is decided by the plan behind the presented key; with no key the answer is `ip` and `is_vpn`.
|
|
34
|
+
# @param ip [String] The IPv4 or IPv6 address to classify.
|
|
35
|
+
# @param [Hash] opts the optional parameters
|
|
36
|
+
# @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers
|
|
37
|
+
def lookup_ip_with_http_info(ip, opts = {})
|
|
38
|
+
if @api_client.config.debugging
|
|
39
|
+
@api_client.config.logger.debug 'Calling API: LookupWireApi.lookup_ip ...'
|
|
40
|
+
end
|
|
41
|
+
# verify the required parameter 'ip' is set
|
|
42
|
+
if @api_client.config.client_side_validation && ip.nil?
|
|
43
|
+
fail ArgumentError, "Missing the required parameter 'ip' when calling LookupWireApi.lookup_ip"
|
|
44
|
+
end
|
|
45
|
+
# resource path
|
|
46
|
+
local_var_path = '/{ip}'.sub('{ip}', CGI.escape(ip.to_s))
|
|
47
|
+
|
|
48
|
+
# query parameters
|
|
49
|
+
query_params = opts[:query_params] || {}
|
|
50
|
+
|
|
51
|
+
# header parameters
|
|
52
|
+
header_params = opts[:header_params] || {}
|
|
53
|
+
# HTTP header 'Accept' (if needed)
|
|
54
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
55
|
+
|
|
56
|
+
# form parameters
|
|
57
|
+
form_params = opts[:form_params] || {}
|
|
58
|
+
|
|
59
|
+
# http body (model)
|
|
60
|
+
post_body = opts[:debug_body]
|
|
61
|
+
|
|
62
|
+
# return_type
|
|
63
|
+
return_type = opts[:debug_return_type] || 'LookupResponse'
|
|
64
|
+
|
|
65
|
+
# auth_names
|
|
66
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
67
|
+
|
|
68
|
+
new_options = opts.merge(
|
|
69
|
+
:operation => :"LookupWireApi.lookup_ip",
|
|
70
|
+
:header_params => header_params,
|
|
71
|
+
:query_params => query_params,
|
|
72
|
+
:form_params => form_params,
|
|
73
|
+
:body => post_body,
|
|
74
|
+
:auth_names => auth_names,
|
|
75
|
+
:return_type => return_type
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
79
|
+
if @api_client.config.debugging
|
|
80
|
+
@api_client.config.logger.debug "API called: LookupWireApi#lookup_ip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
+
end
|
|
82
|
+
return data, status_code, headers
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
# Lookup your own address
|
|
86
|
+
# Answers what is known about the address this request came from, which is the same answer `GET /{ip}` gives for that address: the plan behind the presented key decides which fields come back, and the request counts against the same allowance. The address is the one our edge observed, so a request through a proxy or a VPN reports the exit it left through rather than the machine that made it. That is usually the point of asking.
|
|
87
|
+
# @param [Hash] opts the optional parameters
|
|
88
|
+
# @return [LookupResponse]
|
|
89
|
+
def lookup_my_ip(opts = {})
|
|
90
|
+
data, _status_code, _headers = lookup_my_ip_with_http_info(opts)
|
|
91
|
+
data
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
# Lookup your own address
|
|
95
|
+
# Answers what is known about the address this request came from, which is the same answer `GET /{ip}` gives for that address: the plan behind the presented key decides which fields come back, and the request counts against the same allowance. The address is the one our edge observed, so a request through a proxy or a VPN reports the exit it left through rather than the machine that made it. That is usually the point of asking.
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers
|
|
98
|
+
def lookup_my_ip_with_http_info(opts = {})
|
|
99
|
+
if @api_client.config.debugging
|
|
100
|
+
@api_client.config.logger.debug 'Calling API: LookupWireApi.lookup_my_ip ...'
|
|
101
|
+
end
|
|
102
|
+
# resource path
|
|
103
|
+
local_var_path = '/myip'
|
|
104
|
+
|
|
105
|
+
# query parameters
|
|
106
|
+
query_params = opts[:query_params] || {}
|
|
107
|
+
|
|
108
|
+
# header parameters
|
|
109
|
+
header_params = opts[:header_params] || {}
|
|
110
|
+
# HTTP header 'Accept' (if needed)
|
|
111
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
|
112
|
+
|
|
113
|
+
# form parameters
|
|
114
|
+
form_params = opts[:form_params] || {}
|
|
115
|
+
|
|
116
|
+
# http body (model)
|
|
117
|
+
post_body = opts[:debug_body]
|
|
118
|
+
|
|
119
|
+
# return_type
|
|
120
|
+
return_type = opts[:debug_return_type] || 'LookupResponse'
|
|
121
|
+
|
|
122
|
+
# auth_names
|
|
123
|
+
auth_names = opts[:debug_auth_names] || ['apiKeyQuery', 'bearerAuth', 'apiKeyHeader']
|
|
124
|
+
|
|
125
|
+
new_options = opts.merge(
|
|
126
|
+
:operation => :"LookupWireApi.lookup_my_ip",
|
|
127
|
+
:header_params => header_params,
|
|
128
|
+
:query_params => query_params,
|
|
129
|
+
:form_params => form_params,
|
|
130
|
+
:body => post_body,
|
|
131
|
+
:auth_names => auth_names,
|
|
132
|
+
:return_type => return_type
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
136
|
+
if @api_client.config.debugging
|
|
137
|
+
@api_client.config.logger.debug "API called: LookupWireApi#lookup_my_ip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
138
|
+
end
|
|
139
|
+
return data, status_code, headers
|
|
140
|
+
end
|
|
141
|
+
end
|
|
142
|
+
end
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
data/lib/vpndetection/client.rb
CHANGED
|
@@ -36,7 +36,7 @@ module VPNDetection
|
|
|
36
36
|
@cache = cache ? Cache.new(max_size: cache_max_size, ttl: cache_ttl) : nil
|
|
37
37
|
@concurrency = concurrency
|
|
38
38
|
@retries = retries
|
|
39
|
-
@database =
|
|
39
|
+
@database = DatabaseApi.new(@transport, retries: retries)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
# Whether an address is private, loopback, link-local, documentation,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
module VPNDetection
|
|
4
|
-
# The licensed
|
|
4
|
+
# The licensed database downloads, reached as `client.database`.
|
|
5
5
|
#
|
|
6
6
|
# Access is granted by contract rather than self-serve, so every method here
|
|
7
7
|
# needs a key carrying the `db.download` scope.
|
|
8
|
-
class
|
|
8
|
+
class DatabaseApi
|
|
9
9
|
def initialize(transport, retries:)
|
|
10
10
|
@transport = transport
|
|
11
|
-
@api =
|
|
11
|
+
@api = DatabaseWireApi.new(transport)
|
|
12
12
|
@retries = retries
|
|
13
13
|
end
|
|
14
14
|
|
|
15
|
-
# The
|
|
15
|
+
# The database FAMILIES your organization is licensed to download.
|
|
16
16
|
#
|
|
17
17
|
# A license is held against the family, while a download names one version,
|
|
18
18
|
# so the ids {#download}, {#download_bytes}, {#download_url} and {#checksums}
|
|
19
19
|
# take come from each family's `versions`, not from the family itself.
|
|
20
20
|
def list
|
|
21
|
-
call { @api.list_databases.
|
|
21
|
+
call { @api.list_databases.databases }
|
|
22
22
|
end
|
|
23
23
|
|
|
24
24
|
# What is inside one dataset: schema, samples, row count and sizes.
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#VPNDetection API
|
|
3
3
|
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.09.
|
|
6
|
+
The version of the OpenAPI document: 2026.09.13
|
|
7
7
|
Contact: support@vpndetection.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|