vpndetection 5.17.0 → 5.18.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.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -7
  3. data/lib/vpndetection/api/account_wire_api.rb +2 -2
  4. data/lib/vpndetection/api/api_keys_wire_api.rb +2 -2
  5. data/lib/vpndetection/api/authorization_wire_api.rb +2 -2
  6. data/lib/vpndetection/api/database_wire_api.rb +2 -2
  7. data/lib/vpndetection/api/entitlement_wire_api.rb +2 -2
  8. data/lib/vpndetection/api/lookup_wire_api.rb +4 -4
  9. data/lib/vpndetection/api/organization_wire_api.rb +2 -2
  10. data/lib/vpndetection/api_client.rb +2 -2
  11. data/lib/vpndetection/api_error.rb +2 -2
  12. data/lib/vpndetection/api_model_base.rb +2 -2
  13. data/lib/vpndetection/bogon.rb +11 -2
  14. data/lib/vpndetection/cache.rb +31 -2
  15. data/lib/vpndetection/client.rb +4 -3
  16. data/lib/vpndetection/configuration.rb +2 -2
  17. data/lib/vpndetection/models/abuse_contact.rb +236 -0
  18. data/lib/vpndetection/models/account_create_apikey_request.rb +2 -2
  19. data/lib/vpndetection/models/account_created_apikey.rb +2 -2
  20. data/lib/vpndetection/models/account_org.rb +2 -2
  21. data/lib/vpndetection/models/account_org_ref.rb +2 -2
  22. data/lib/vpndetection/models/account_org_wrap.rb +2 -2
  23. data/lib/vpndetection/models/account_rc.rb +2 -2
  24. data/lib/vpndetection/models/account_revealed_apikey.rb +2 -2
  25. data/lib/vpndetection/models/account_user.rb +2 -2
  26. data/lib/vpndetection/models/apikey_detail.rb +2 -2
  27. data/lib/vpndetection/models/apikey_list.rb +2 -2
  28. data/lib/vpndetection/models/asn.rb +26 -6
  29. data/lib/vpndetection/models/batch_lookup_error.rb +2 -2
  30. data/lib/vpndetection/models/batch_lookup_request.rb +2 -2
  31. data/lib/vpndetection/models/batch_lookup_response.rb +2 -2
  32. data/lib/vpndetection/models/bit_torrent_detail.rb +241 -0
  33. data/lib/vpndetection/models/carrier_detail.rb +189 -0
  34. data/lib/vpndetection/models/class_detail.rb +2 -2
  35. data/lib/vpndetection/models/client_registration.rb +2 -2
  36. data/lib/vpndetection/models/client_registration_request.rb +2 -2
  37. data/lib/vpndetection/models/company.rb +213 -0
  38. data/lib/vpndetection/models/database.rb +2 -2
  39. data/lib/vpndetection/models/database_checksums_response.rb +2 -2
  40. data/lib/vpndetection/models/database_format.rb +2 -2
  41. data/lib/vpndetection/models/database_format_size.rb +2 -2
  42. data/lib/vpndetection/models/database_list.rb +2 -2
  43. data/lib/vpndetection/models/database_metadata.rb +2 -2
  44. data/lib/vpndetection/models/database_metadata_column.rb +2 -2
  45. data/lib/vpndetection/models/database_version.rb +2 -2
  46. data/lib/vpndetection/models/db_checksums.rb +2 -2
  47. data/lib/vpndetection/models/device_authorization.rb +2 -2
  48. data/lib/vpndetection/models/dns_resolver_detail.rb +199 -0
  49. data/lib/vpndetection/models/download.rb +2 -2
  50. data/lib/vpndetection/models/download_list.rb +2 -2
  51. data/lib/vpndetection/models/entitlement.rb +2 -2
  52. data/lib/vpndetection/models/entitlement_apikey.rb +2 -2
  53. data/lib/vpndetection/models/entitlement_error.rb +2 -2
  54. data/lib/vpndetection/models/entitlement_plan.rb +3 -3
  55. data/lib/vpndetection/models/entitlement_usage.rb +2 -2
  56. data/lib/vpndetection/models/error_envelope.rb +2 -2
  57. data/lib/vpndetection/models/identity.rb +2 -2
  58. data/lib/vpndetection/models/location.rb +107 -7
  59. data/lib/vpndetection/models/lookup_error.rb +2 -2
  60. data/lib/vpndetection/models/lookup_response.rb +185 -5
  61. data/lib/vpndetection/models/oauth_error.rb +2 -2
  62. data/lib/vpndetection/models/oauth_metadata.rb +2 -2
  63. data/lib/vpndetection/models/proxy_detail.rb +2 -2
  64. data/lib/vpndetection/models/pubproxy_detail.rb +2 -2
  65. data/lib/vpndetection/models/satellite_detail.rb +209 -0
  66. data/lib/vpndetection/models/smtp_detail.rb +189 -0
  67. data/lib/vpndetection/models/ssh_detail.rb +199 -0
  68. data/lib/vpndetection/models/standing.rb +2 -2
  69. data/lib/vpndetection/models/token_response.rb +2 -2
  70. data/lib/vpndetection/models/vpn_detail.rb +2 -2
  71. data/lib/vpndetection/models/web_detail.rb +517 -0
  72. data/lib/vpndetection/result.rb +182 -12
  73. data/lib/vpndetection/transport.rb +10 -0
  74. data/lib/vpndetection/version.rb +1 -1
  75. metadata +10 -1
@@ -0,0 +1,517 @@
1
+ =begin
2
+ #VPNDetection API
3
+
4
+ #The VPNDetection API: classify any IP address, and download the databases behind the answers. Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key). 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.11.20
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
+ # One port of the address that answered as a web server, from our Web IP database.
18
+ class WebDetail < ApiModelBase
19
+ # 80 or 443.
20
+ attr_accessor :port
21
+
22
+ # A TLS handshake completed.
23
+ attr_accessor :tls_ok
24
+
25
+ # An HTTP response came back.
26
+ attr_accessor :session_ok
27
+
28
+ # Its status, 0 where none came.
29
+ attr_accessor :status_code
30
+
31
+ # Its `Server` header.
32
+ attr_accessor :server
33
+
34
+ # Where it redirected.
35
+ attr_accessor :location
36
+
37
+ # The page's title.
38
+ attr_accessor :title
39
+
40
+ # The certificate's subject common name.
41
+ attr_accessor :cert_subject_cn
42
+
43
+ # Its subject organization.
44
+ attr_accessor :cert_subject_o
45
+
46
+ # Its issuer.
47
+ attr_accessor :cert_issuer_dn
48
+
49
+ # Browsers trust it.
50
+ attr_accessor :cert_browser_trusted
51
+
52
+ # The TLS version negotiated, empty without TLS.
53
+ attr_accessor :tls_version
54
+
55
+ # The first day the port was open.
56
+ attr_accessor :first_seen
57
+
58
+ # The last day it was.
59
+ attr_accessor :last_seen
60
+
61
+ # Attribute mapping from ruby-style variable name to JSON key.
62
+ def self.attribute_map
63
+ {
64
+ :'port' => :'port',
65
+ :'tls_ok' => :'tls_ok',
66
+ :'session_ok' => :'session_ok',
67
+ :'status_code' => :'status_code',
68
+ :'server' => :'server',
69
+ :'location' => :'location',
70
+ :'title' => :'title',
71
+ :'cert_subject_cn' => :'cert_subject_cn',
72
+ :'cert_subject_o' => :'cert_subject_o',
73
+ :'cert_issuer_dn' => :'cert_issuer_dn',
74
+ :'cert_browser_trusted' => :'cert_browser_trusted',
75
+ :'tls_version' => :'tls_version',
76
+ :'first_seen' => :'first_seen',
77
+ :'last_seen' => :'last_seen'
78
+ }
79
+ end
80
+
81
+ # Returns attribute mapping this model knows about
82
+ def self.acceptable_attribute_map
83
+ attribute_map
84
+ end
85
+
86
+ # Returns all the JSON keys this model knows about
87
+ def self.acceptable_attributes
88
+ acceptable_attribute_map.values
89
+ end
90
+
91
+ # Attribute type mapping.
92
+ def self.openapi_types
93
+ {
94
+ :'port' => :'Integer',
95
+ :'tls_ok' => :'Boolean',
96
+ :'session_ok' => :'Boolean',
97
+ :'status_code' => :'Integer',
98
+ :'server' => :'String',
99
+ :'location' => :'String',
100
+ :'title' => :'String',
101
+ :'cert_subject_cn' => :'String',
102
+ :'cert_subject_o' => :'String',
103
+ :'cert_issuer_dn' => :'String',
104
+ :'cert_browser_trusted' => :'Boolean',
105
+ :'tls_version' => :'String',
106
+ :'first_seen' => :'String',
107
+ :'last_seen' => :'String'
108
+ }
109
+ end
110
+
111
+ # List of attributes with nullable: true
112
+ def self.openapi_nullable
113
+ Set.new([
114
+ ])
115
+ end
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ def initialize(attributes = {})
120
+ if (!attributes.is_a?(Hash))
121
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::WebDetail` initialize method"
122
+ end
123
+
124
+ # check to see if the attribute exists and convert string to symbol for hash key
125
+ acceptable_attribute_map = self.class.acceptable_attribute_map
126
+ attributes = attributes.each_with_object({}) { |(k, v), h|
127
+ if (!acceptable_attribute_map.key?(k.to_sym))
128
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::WebDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
129
+ end
130
+ h[k.to_sym] = v
131
+ }
132
+
133
+ if attributes.key?(:'port')
134
+ self.port = attributes[:'port']
135
+ else
136
+ self.port = nil
137
+ end
138
+
139
+ if attributes.key?(:'tls_ok')
140
+ self.tls_ok = attributes[:'tls_ok']
141
+ else
142
+ self.tls_ok = nil
143
+ end
144
+
145
+ if attributes.key?(:'session_ok')
146
+ self.session_ok = attributes[:'session_ok']
147
+ else
148
+ self.session_ok = nil
149
+ end
150
+
151
+ if attributes.key?(:'status_code')
152
+ self.status_code = attributes[:'status_code']
153
+ else
154
+ self.status_code = nil
155
+ end
156
+
157
+ if attributes.key?(:'server')
158
+ self.server = attributes[:'server']
159
+ else
160
+ self.server = nil
161
+ end
162
+
163
+ if attributes.key?(:'location')
164
+ self.location = attributes[:'location']
165
+ else
166
+ self.location = nil
167
+ end
168
+
169
+ if attributes.key?(:'title')
170
+ self.title = attributes[:'title']
171
+ else
172
+ self.title = nil
173
+ end
174
+
175
+ if attributes.key?(:'cert_subject_cn')
176
+ self.cert_subject_cn = attributes[:'cert_subject_cn']
177
+ else
178
+ self.cert_subject_cn = nil
179
+ end
180
+
181
+ if attributes.key?(:'cert_subject_o')
182
+ self.cert_subject_o = attributes[:'cert_subject_o']
183
+ else
184
+ self.cert_subject_o = nil
185
+ end
186
+
187
+ if attributes.key?(:'cert_issuer_dn')
188
+ self.cert_issuer_dn = attributes[:'cert_issuer_dn']
189
+ else
190
+ self.cert_issuer_dn = nil
191
+ end
192
+
193
+ if attributes.key?(:'cert_browser_trusted')
194
+ self.cert_browser_trusted = attributes[:'cert_browser_trusted']
195
+ else
196
+ self.cert_browser_trusted = nil
197
+ end
198
+
199
+ if attributes.key?(:'tls_version')
200
+ self.tls_version = attributes[:'tls_version']
201
+ else
202
+ self.tls_version = nil
203
+ end
204
+
205
+ if attributes.key?(:'first_seen')
206
+ self.first_seen = attributes[:'first_seen']
207
+ else
208
+ self.first_seen = nil
209
+ end
210
+
211
+ if attributes.key?(:'last_seen')
212
+ self.last_seen = attributes[:'last_seen']
213
+ else
214
+ self.last_seen = nil
215
+ end
216
+ end
217
+
218
+ # Show invalid properties with the reasons. Usually used together with valid?
219
+ # @return Array for valid properties with the reasons
220
+ def list_invalid_properties
221
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
222
+ invalid_properties = Array.new
223
+ if @port.nil?
224
+ invalid_properties.push('invalid value for "port", port cannot be nil.')
225
+ end
226
+
227
+ if @tls_ok.nil?
228
+ invalid_properties.push('invalid value for "tls_ok", tls_ok cannot be nil.')
229
+ end
230
+
231
+ if @session_ok.nil?
232
+ invalid_properties.push('invalid value for "session_ok", session_ok cannot be nil.')
233
+ end
234
+
235
+ if @status_code.nil?
236
+ invalid_properties.push('invalid value for "status_code", status_code cannot be nil.')
237
+ end
238
+
239
+ if @server.nil?
240
+ invalid_properties.push('invalid value for "server", server cannot be nil.')
241
+ end
242
+
243
+ if @location.nil?
244
+ invalid_properties.push('invalid value for "location", location cannot be nil.')
245
+ end
246
+
247
+ if @title.nil?
248
+ invalid_properties.push('invalid value for "title", title cannot be nil.')
249
+ end
250
+
251
+ if @cert_subject_cn.nil?
252
+ invalid_properties.push('invalid value for "cert_subject_cn", cert_subject_cn cannot be nil.')
253
+ end
254
+
255
+ if @cert_subject_o.nil?
256
+ invalid_properties.push('invalid value for "cert_subject_o", cert_subject_o cannot be nil.')
257
+ end
258
+
259
+ if @cert_issuer_dn.nil?
260
+ invalid_properties.push('invalid value for "cert_issuer_dn", cert_issuer_dn cannot be nil.')
261
+ end
262
+
263
+ if @cert_browser_trusted.nil?
264
+ invalid_properties.push('invalid value for "cert_browser_trusted", cert_browser_trusted cannot be nil.')
265
+ end
266
+
267
+ if @tls_version.nil?
268
+ invalid_properties.push('invalid value for "tls_version", tls_version cannot be nil.')
269
+ end
270
+
271
+ if @first_seen.nil?
272
+ invalid_properties.push('invalid value for "first_seen", first_seen cannot be nil.')
273
+ end
274
+
275
+ if @last_seen.nil?
276
+ invalid_properties.push('invalid value for "last_seen", last_seen cannot be nil.')
277
+ end
278
+
279
+ invalid_properties
280
+ end
281
+
282
+ # Check to see if the all the properties in the model are valid
283
+ # @return true if the model is valid
284
+ def valid?
285
+ warn '[DEPRECATED] the `valid?` method is obsolete'
286
+ return false if @port.nil?
287
+ return false if @tls_ok.nil?
288
+ return false if @session_ok.nil?
289
+ return false if @status_code.nil?
290
+ return false if @server.nil?
291
+ return false if @location.nil?
292
+ return false if @title.nil?
293
+ return false if @cert_subject_cn.nil?
294
+ return false if @cert_subject_o.nil?
295
+ return false if @cert_issuer_dn.nil?
296
+ return false if @cert_browser_trusted.nil?
297
+ return false if @tls_version.nil?
298
+ return false if @first_seen.nil?
299
+ return false if @last_seen.nil?
300
+ true
301
+ end
302
+
303
+ # Custom attribute writer method with validation
304
+ # @param [Object] port Value to be assigned
305
+ def port=(port)
306
+ if port.nil?
307
+ fail ArgumentError, 'port cannot be nil'
308
+ end
309
+
310
+ @port = port
311
+ end
312
+
313
+ # Custom attribute writer method with validation
314
+ # @param [Object] tls_ok Value to be assigned
315
+ def tls_ok=(tls_ok)
316
+ if tls_ok.nil?
317
+ fail ArgumentError, 'tls_ok cannot be nil'
318
+ end
319
+
320
+ @tls_ok = tls_ok
321
+ end
322
+
323
+ # Custom attribute writer method with validation
324
+ # @param [Object] session_ok Value to be assigned
325
+ def session_ok=(session_ok)
326
+ if session_ok.nil?
327
+ fail ArgumentError, 'session_ok cannot be nil'
328
+ end
329
+
330
+ @session_ok = session_ok
331
+ end
332
+
333
+ # Custom attribute writer method with validation
334
+ # @param [Object] status_code Value to be assigned
335
+ def status_code=(status_code)
336
+ if status_code.nil?
337
+ fail ArgumentError, 'status_code cannot be nil'
338
+ end
339
+
340
+ @status_code = status_code
341
+ end
342
+
343
+ # Custom attribute writer method with validation
344
+ # @param [Object] server Value to be assigned
345
+ def server=(server)
346
+ if server.nil?
347
+ fail ArgumentError, 'server cannot be nil'
348
+ end
349
+
350
+ @server = server
351
+ end
352
+
353
+ # Custom attribute writer method with validation
354
+ # @param [Object] location Value to be assigned
355
+ def location=(location)
356
+ if location.nil?
357
+ fail ArgumentError, 'location cannot be nil'
358
+ end
359
+
360
+ @location = location
361
+ end
362
+
363
+ # Custom attribute writer method with validation
364
+ # @param [Object] title Value to be assigned
365
+ def title=(title)
366
+ if title.nil?
367
+ fail ArgumentError, 'title cannot be nil'
368
+ end
369
+
370
+ @title = title
371
+ end
372
+
373
+ # Custom attribute writer method with validation
374
+ # @param [Object] cert_subject_cn Value to be assigned
375
+ def cert_subject_cn=(cert_subject_cn)
376
+ if cert_subject_cn.nil?
377
+ fail ArgumentError, 'cert_subject_cn cannot be nil'
378
+ end
379
+
380
+ @cert_subject_cn = cert_subject_cn
381
+ end
382
+
383
+ # Custom attribute writer method with validation
384
+ # @param [Object] cert_subject_o Value to be assigned
385
+ def cert_subject_o=(cert_subject_o)
386
+ if cert_subject_o.nil?
387
+ fail ArgumentError, 'cert_subject_o cannot be nil'
388
+ end
389
+
390
+ @cert_subject_o = cert_subject_o
391
+ end
392
+
393
+ # Custom attribute writer method with validation
394
+ # @param [Object] cert_issuer_dn Value to be assigned
395
+ def cert_issuer_dn=(cert_issuer_dn)
396
+ if cert_issuer_dn.nil?
397
+ fail ArgumentError, 'cert_issuer_dn cannot be nil'
398
+ end
399
+
400
+ @cert_issuer_dn = cert_issuer_dn
401
+ end
402
+
403
+ # Custom attribute writer method with validation
404
+ # @param [Object] cert_browser_trusted Value to be assigned
405
+ def cert_browser_trusted=(cert_browser_trusted)
406
+ if cert_browser_trusted.nil?
407
+ fail ArgumentError, 'cert_browser_trusted cannot be nil'
408
+ end
409
+
410
+ @cert_browser_trusted = cert_browser_trusted
411
+ end
412
+
413
+ # Custom attribute writer method with validation
414
+ # @param [Object] tls_version Value to be assigned
415
+ def tls_version=(tls_version)
416
+ if tls_version.nil?
417
+ fail ArgumentError, 'tls_version cannot be nil'
418
+ end
419
+
420
+ @tls_version = tls_version
421
+ end
422
+
423
+ # Custom attribute writer method with validation
424
+ # @param [Object] first_seen Value to be assigned
425
+ def first_seen=(first_seen)
426
+ if first_seen.nil?
427
+ fail ArgumentError, 'first_seen cannot be nil'
428
+ end
429
+
430
+ @first_seen = first_seen
431
+ end
432
+
433
+ # Custom attribute writer method with validation
434
+ # @param [Object] last_seen Value to be assigned
435
+ def last_seen=(last_seen)
436
+ if last_seen.nil?
437
+ fail ArgumentError, 'last_seen cannot be nil'
438
+ end
439
+
440
+ @last_seen = last_seen
441
+ end
442
+
443
+ # Checks equality by comparing each attribute.
444
+ # @param [Object] Object to be compared
445
+ def ==(o)
446
+ return true if self.equal?(o)
447
+ self.class == o.class &&
448
+ port == o.port &&
449
+ tls_ok == o.tls_ok &&
450
+ session_ok == o.session_ok &&
451
+ status_code == o.status_code &&
452
+ server == o.server &&
453
+ location == o.location &&
454
+ title == o.title &&
455
+ cert_subject_cn == o.cert_subject_cn &&
456
+ cert_subject_o == o.cert_subject_o &&
457
+ cert_issuer_dn == o.cert_issuer_dn &&
458
+ cert_browser_trusted == o.cert_browser_trusted &&
459
+ tls_version == o.tls_version &&
460
+ first_seen == o.first_seen &&
461
+ last_seen == o.last_seen
462
+ end
463
+
464
+ # @see the `==` method
465
+ # @param [Object] Object to be compared
466
+ def eql?(o)
467
+ self == o
468
+ end
469
+
470
+ # Calculates hash code according to all attributes.
471
+ # @return [Integer] Hash code
472
+ def hash
473
+ [port, tls_ok, session_ok, status_code, server, location, title, cert_subject_cn, cert_subject_o, cert_issuer_dn, cert_browser_trusted, tls_version, first_seen, last_seen].hash
474
+ end
475
+
476
+ # Builds the object from hash
477
+ # @param [Hash] attributes Model attributes in the form of hash
478
+ # @return [Object] Returns the model itself
479
+ def self.build_from_hash(attributes)
480
+ return nil unless attributes.is_a?(Hash)
481
+ attributes = attributes.transform_keys(&:to_sym)
482
+ transformed_hash = {}
483
+ openapi_types.each_pair do |key, type|
484
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
485
+ transformed_hash["#{key}"] = nil
486
+ elsif type =~ /\AArray<(.*)>/i
487
+ # check to ensure the input is an array given that the attribute
488
+ # is documented as an array but the input is not
489
+ if attributes[attribute_map[key]].is_a?(Array)
490
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
491
+ end
492
+ elsif !attributes[attribute_map[key]].nil?
493
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
494
+ end
495
+ end
496
+ new(transformed_hash)
497
+ end
498
+
499
+ # Returns the object in the form of hash
500
+ # @return [Hash] Returns the object in the form of hash
501
+ def to_hash
502
+ hash = {}
503
+ self.class.attribute_map.each_pair do |attr, param|
504
+ value = self.send(attr)
505
+ if value.nil?
506
+ is_nullable = self.class.openapi_nullable.include?(attr)
507
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
508
+ end
509
+
510
+ hash[param] = _to_hash(value)
511
+ end
512
+ hash
513
+ end
514
+
515
+ end
516
+
517
+ end