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
|
@@ -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
|
|
@@ -14,7 +14,8 @@ require 'date'
|
|
|
14
14
|
require 'time'
|
|
15
15
|
|
|
16
16
|
module VPNDetection
|
|
17
|
-
|
|
17
|
+
# The published digests for one database file.
|
|
18
|
+
class DbChecksums < ApiModelBase
|
|
18
19
|
attr_accessor :md5
|
|
19
20
|
|
|
20
21
|
attr_accessor :sha1
|
|
@@ -63,32 +64,40 @@ module VPNDetection
|
|
|
63
64
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
65
|
def initialize(attributes = {})
|
|
65
66
|
if (!attributes.is_a?(Hash))
|
|
66
|
-
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::
|
|
67
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::DbChecksums` initialize method"
|
|
67
68
|
end
|
|
68
69
|
|
|
69
70
|
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
71
|
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
72
|
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
73
|
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
-
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::
|
|
74
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::DbChecksums`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
75
|
end
|
|
75
76
|
h[k.to_sym] = v
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
if attributes.key?(:'md5')
|
|
79
80
|
self.md5 = attributes[:'md5']
|
|
81
|
+
else
|
|
82
|
+
self.md5 = nil
|
|
80
83
|
end
|
|
81
84
|
|
|
82
85
|
if attributes.key?(:'sha1')
|
|
83
86
|
self.sha1 = attributes[:'sha1']
|
|
87
|
+
else
|
|
88
|
+
self.sha1 = nil
|
|
84
89
|
end
|
|
85
90
|
|
|
86
91
|
if attributes.key?(:'sha256')
|
|
87
92
|
self.sha256 = attributes[:'sha256']
|
|
93
|
+
else
|
|
94
|
+
self.sha256 = nil
|
|
88
95
|
end
|
|
89
96
|
|
|
90
97
|
if attributes.key?(:'sha512')
|
|
91
98
|
self.sha512 = attributes[:'sha512']
|
|
99
|
+
else
|
|
100
|
+
self.sha512 = nil
|
|
92
101
|
end
|
|
93
102
|
end
|
|
94
103
|
|
|
@@ -97,6 +106,22 @@ module VPNDetection
|
|
|
97
106
|
def list_invalid_properties
|
|
98
107
|
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
99
108
|
invalid_properties = Array.new
|
|
109
|
+
if @md5.nil?
|
|
110
|
+
invalid_properties.push('invalid value for "md5", md5 cannot be nil.')
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
if @sha1.nil?
|
|
114
|
+
invalid_properties.push('invalid value for "sha1", sha1 cannot be nil.')
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if @sha256.nil?
|
|
118
|
+
invalid_properties.push('invalid value for "sha256", sha256 cannot be nil.')
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if @sha512.nil?
|
|
122
|
+
invalid_properties.push('invalid value for "sha512", sha512 cannot be nil.')
|
|
123
|
+
end
|
|
124
|
+
|
|
100
125
|
invalid_properties
|
|
101
126
|
end
|
|
102
127
|
|
|
@@ -104,9 +129,53 @@ module VPNDetection
|
|
|
104
129
|
# @return true if the model is valid
|
|
105
130
|
def valid?
|
|
106
131
|
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
132
|
+
return false if @md5.nil?
|
|
133
|
+
return false if @sha1.nil?
|
|
134
|
+
return false if @sha256.nil?
|
|
135
|
+
return false if @sha512.nil?
|
|
107
136
|
true
|
|
108
137
|
end
|
|
109
138
|
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] md5 Value to be assigned
|
|
141
|
+
def md5=(md5)
|
|
142
|
+
if md5.nil?
|
|
143
|
+
fail ArgumentError, 'md5 cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@md5 = md5
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] sha1 Value to be assigned
|
|
151
|
+
def sha1=(sha1)
|
|
152
|
+
if sha1.nil?
|
|
153
|
+
fail ArgumentError, 'sha1 cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@sha1 = sha1
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Custom attribute writer method with validation
|
|
160
|
+
# @param [Object] sha256 Value to be assigned
|
|
161
|
+
def sha256=(sha256)
|
|
162
|
+
if sha256.nil?
|
|
163
|
+
fail ArgumentError, 'sha256 cannot be nil'
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
@sha256 = sha256
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# Custom attribute writer method with validation
|
|
170
|
+
# @param [Object] sha512 Value to be assigned
|
|
171
|
+
def sha512=(sha512)
|
|
172
|
+
if sha512.nil?
|
|
173
|
+
fail ArgumentError, 'sha512 cannot be nil'
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
@sha512 = sha512
|
|
177
|
+
end
|
|
178
|
+
|
|
110
179
|
# Checks equality by comparing each attribute.
|
|
111
180
|
# @param [Object] Object to be compared
|
|
112
181
|
def ==(o)
|
|
@@ -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
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
|
@@ -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
|
|
@@ -0,0 +1,41 @@
|
|
|
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 Standing
|
|
18
|
+
EXPIRED = "expired".freeze
|
|
19
|
+
LICENSED = "licensed".freeze
|
|
20
|
+
UNLICENSED = "unlicensed".freeze
|
|
21
|
+
|
|
22
|
+
def self.all_vars
|
|
23
|
+
@all_vars ||= [EXPIRED, LICENSED, UNLICENSED].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 Standing.all_vars.include?(value)
|
|
38
|
+
raise "Invalid ENUM value #{value} for class #Standing"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
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
|
|
@@ -25,7 +25,7 @@ module VPNDetection
|
|
|
25
25
|
# How strongly the attribution is supported. Max only.
|
|
26
26
|
attr_accessor :confidence
|
|
27
27
|
|
|
28
|
-
#
|
|
28
|
+
# The class of evidence the attribution rests on, one of four values. Max only. `scan` - we spoke the VPN protocol to the address ourselves and got a valid server response. `scrape` - the operator published the address through its own API, client or configuration. `registry` - public registration or naming records attribute it to the operator. `infer` - the address was extrapolated from confirmed neighbours in the same block.
|
|
29
29
|
attr_accessor :method
|
|
30
30
|
|
|
31
31
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
@@ -8,7 +8,7 @@ module VPNDetection
|
|
|
8
8
|
# The generated wire client, with the three things it gets wrong for this API
|
|
9
9
|
# corrected in one place.
|
|
10
10
|
class Transport < ApiClient
|
|
11
|
-
# The same path template the generated
|
|
11
|
+
# The same path template the generated LookupWireApi holds. Both are asserted
|
|
12
12
|
# against each other in the test suite, because the batch builds its own
|
|
13
13
|
# requests to queue them on a hydra and cannot go through the generated
|
|
14
14
|
# method, which runs each request as it builds it.
|
data/lib/vpndetection/version.rb
CHANGED
data/lib/vpndetection.rb
CHANGED
|
@@ -19,7 +19,7 @@ require 'vpndetection/bogon'
|
|
|
19
19
|
require 'vpndetection/cache'
|
|
20
20
|
require 'vpndetection/retries'
|
|
21
21
|
require 'vpndetection/transport'
|
|
22
|
-
require 'vpndetection/
|
|
22
|
+
require 'vpndetection/database_api'
|
|
23
23
|
require 'vpndetection/client'
|
|
24
24
|
|
|
25
25
|
# The official Ruby client library for the VPNDetection API.
|
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: 3.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Mslm Dev
|
|
@@ -48,8 +48,8 @@ files:
|
|
|
48
48
|
- LICENSE
|
|
49
49
|
- README.md
|
|
50
50
|
- lib/vpndetection.rb
|
|
51
|
-
- lib/vpndetection/api/
|
|
52
|
-
- lib/vpndetection/api/
|
|
51
|
+
- lib/vpndetection/api/database_wire_api.rb
|
|
52
|
+
- lib/vpndetection/api/lookup_wire_api.rb
|
|
53
53
|
- lib/vpndetection/api_client.rb
|
|
54
54
|
- lib/vpndetection/api_error.rb
|
|
55
55
|
- lib/vpndetection/api_model_base.rb
|
|
@@ -58,23 +58,26 @@ files:
|
|
|
58
58
|
- lib/vpndetection/cache.rb
|
|
59
59
|
- lib/vpndetection/client.rb
|
|
60
60
|
- lib/vpndetection/configuration.rb
|
|
61
|
-
- lib/vpndetection/
|
|
61
|
+
- lib/vpndetection/database_api.rb
|
|
62
62
|
- lib/vpndetection/errors.rb
|
|
63
63
|
- lib/vpndetection/models/class_detail.rb
|
|
64
|
-
- lib/vpndetection/models/
|
|
65
|
-
- lib/vpndetection/models/
|
|
66
|
-
- lib/vpndetection/models/
|
|
67
|
-
- lib/vpndetection/models/
|
|
68
|
-
- lib/vpndetection/models/
|
|
69
|
-
- lib/vpndetection/models/
|
|
64
|
+
- lib/vpndetection/models/database.rb
|
|
65
|
+
- lib/vpndetection/models/database_checksums_response.rb
|
|
66
|
+
- lib/vpndetection/models/database_format.rb
|
|
67
|
+
- lib/vpndetection/models/database_format_size.rb
|
|
68
|
+
- lib/vpndetection/models/database_list.rb
|
|
69
|
+
- lib/vpndetection/models/database_metadata.rb
|
|
70
|
+
- lib/vpndetection/models/database_metadata_column.rb
|
|
71
|
+
- lib/vpndetection/models/database_version.rb
|
|
72
|
+
- lib/vpndetection/models/db_checksums.rb
|
|
70
73
|
- lib/vpndetection/models/download.rb
|
|
71
74
|
- lib/vpndetection/models/download_list.rb
|
|
72
75
|
- lib/vpndetection/models/error_envelope.rb
|
|
73
|
-
- lib/vpndetection/models/
|
|
74
|
-
- lib/vpndetection/models/licensed_version.rb
|
|
76
|
+
- lib/vpndetection/models/license_type.rb
|
|
75
77
|
- lib/vpndetection/models/lookup_error.rb
|
|
76
78
|
- lib/vpndetection/models/lookup_response.rb
|
|
77
79
|
- lib/vpndetection/models/proxy_detail.rb
|
|
80
|
+
- lib/vpndetection/models/standing.rb
|
|
78
81
|
- lib/vpndetection/models/vpn_detail.rb
|
|
79
82
|
- lib/vpndetection/result.rb
|
|
80
83
|
- lib/vpndetection/retries.rb
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
=begin
|
|
2
|
-
#VPNDetection API
|
|
3
|
-
|
|
4
|
-
#The VPNDetection API: classify any IP address, and download the datasets 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.09
|
|
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 LookupApi
|
|
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: LookupApi.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 LookupApi.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 => :"LookupApi.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: LookupApi#lookup_ip\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
81
|
-
end
|
|
82
|
-
return data, status_code, headers
|
|
83
|
-
end
|
|
84
|
-
end
|
|
85
|
-
end
|