vpndetection 5.9.1 → 5.10.1

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 (64) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +7 -6
  3. data/lib/vpndetection/api/account_wire_api.rb +1 -1
  4. data/lib/vpndetection/api/api_keys_wire_api.rb +1 -1
  5. data/lib/vpndetection/api/authorization_wire_api.rb +1 -1
  6. data/lib/vpndetection/api/database_wire_api.rb +1 -1
  7. data/lib/vpndetection/api/entitlement_wire_api.rb +1 -1
  8. data/lib/vpndetection/api/lookup_wire_api.rb +5 -5
  9. data/lib/vpndetection/api/organization_wire_api.rb +1 -1
  10. data/lib/vpndetection/api_client.rb +1 -1
  11. data/lib/vpndetection/api_error.rb +1 -1
  12. data/lib/vpndetection/api_model_base.rb +1 -1
  13. data/lib/vpndetection/bogon.rb +4 -1
  14. data/lib/vpndetection/configuration.rb +1 -1
  15. data/lib/vpndetection/models/account_create_apikey_request.rb +1 -1
  16. data/lib/vpndetection/models/account_created_apikey.rb +1 -1
  17. data/lib/vpndetection/models/account_org.rb +1 -1
  18. data/lib/vpndetection/models/account_org_ref.rb +1 -1
  19. data/lib/vpndetection/models/account_org_wrap.rb +1 -1
  20. data/lib/vpndetection/models/account_rc.rb +1 -1
  21. data/lib/vpndetection/models/account_revealed_apikey.rb +1 -1
  22. data/lib/vpndetection/models/account_user.rb +1 -1
  23. data/lib/vpndetection/models/apikey_detail.rb +1 -1
  24. data/lib/vpndetection/models/apikey_list.rb +1 -1
  25. data/lib/vpndetection/models/asn.rb +274 -0
  26. data/lib/vpndetection/models/batch_lookup_error.rb +1 -1
  27. data/lib/vpndetection/models/batch_lookup_request.rb +1 -1
  28. data/lib/vpndetection/models/batch_lookup_response.rb +1 -1
  29. data/lib/vpndetection/models/class_detail.rb +1 -1
  30. data/lib/vpndetection/models/client_registration.rb +1 -1
  31. data/lib/vpndetection/models/client_registration_request.rb +1 -1
  32. data/lib/vpndetection/models/database.rb +29 -2
  33. data/lib/vpndetection/models/database_checksums_response.rb +1 -1
  34. data/lib/vpndetection/models/database_format.rb +1 -1
  35. data/lib/vpndetection/models/database_format_size.rb +1 -1
  36. data/lib/vpndetection/models/database_list.rb +1 -1
  37. data/lib/vpndetection/models/database_metadata.rb +1 -1
  38. data/lib/vpndetection/models/database_metadata_column.rb +1 -1
  39. data/lib/vpndetection/models/database_version.rb +1 -1
  40. data/lib/vpndetection/models/db_checksums.rb +1 -1
  41. data/lib/vpndetection/models/device_authorization.rb +1 -1
  42. data/lib/vpndetection/models/download.rb +29 -2
  43. data/lib/vpndetection/models/download_list.rb +1 -1
  44. data/lib/vpndetection/models/entitlement.rb +1 -1
  45. data/lib/vpndetection/models/entitlement_apikey.rb +1 -1
  46. data/lib/vpndetection/models/entitlement_error.rb +1 -1
  47. data/lib/vpndetection/models/entitlement_plan.rb +1 -1
  48. data/lib/vpndetection/models/entitlement_usage.rb +1 -1
  49. data/lib/vpndetection/models/error_envelope.rb +1 -1
  50. data/lib/vpndetection/models/identity.rb +1 -1
  51. data/lib/vpndetection/models/location.rb +409 -0
  52. data/lib/vpndetection/models/lookup_error.rb +1 -1
  53. data/lib/vpndetection/models/lookup_response.rb +40 -22
  54. data/lib/vpndetection/models/oauth_error.rb +1 -1
  55. data/lib/vpndetection/models/oauth_metadata.rb +1 -1
  56. data/lib/vpndetection/models/proxy_detail.rb +1 -1
  57. data/lib/vpndetection/models/pubproxy_detail.rb +1 -1
  58. data/lib/vpndetection/models/standing.rb +1 -1
  59. data/lib/vpndetection/models/token_response.rb +1 -1
  60. data/lib/vpndetection/models/vpn_detail.rb +4 -4
  61. data/lib/vpndetection/result.rb +41 -17
  62. data/lib/vpndetection/transport.rb +25 -3
  63. data/lib/vpndetection/version.rb +1 -1
  64. metadata +3 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4b8d521a64e7bfd1680e5e158d30a340602191565c1c6e0332662d546b163caa
4
- data.tar.gz: 40dce453e2eca0badd693bdf188ab891d9ce43d77dc5dcaccf5b15ba9606cc9a
3
+ metadata.gz: 76106ede294f9b386872b7f1efe422ebda1069e555e68e13be3f581c40893c33
4
+ data.tar.gz: 66c563257fb096cb6f0ace3df367f247a73b01ee97314147f3ed394d712ec89d
5
5
  SHA512:
6
- metadata.gz: 0a52df204a1d0a4fdc8c7bc88c73b37dd26611efbd58708053d72a02f4b01aa1c83d1c2453b13b2e08217e9386e38ecd4042614284fb5e0302032b3e66789f49
7
- data.tar.gz: be8c767fc9bb2924505c16e89be1db7848fca3b725bcf045e5a5f21903389c4ca613a0dc605d9a2df02a4aafc3b90dabaa6044f3a1b157d646bca7537f419bb2
6
+ metadata.gz: 914b1f86249d2de078c30cb6afb3ef34a0c2a60fe54b2957590e019a300f6f89572bc67da3460cffbdcb7ee098d13d3cd126aadaca0900cdabf215365b2abbb6
7
+ data.tar.gz: bd0c45a754eb065322e2435e09cdf6d22958767313d2419d89137e190157492b00ba71ea38440a9f4d193546459990db86fbb83fa464e35d62ab2e670ac0b0a2
data/README.md CHANGED
@@ -23,7 +23,7 @@ Requires Ruby 3.3 or newer.
23
23
 
24
24
  ## Usage
25
25
 
26
- **No API key needed to start.** The free tier answers `ip` and `is_vpn`, and allows 1000 requests per day per source address.
26
+ **No API key needed to start.** Without a key, a lookup answers `ip` and `is_vpn`, up to 1000 a day per source address.
27
27
 
28
28
  ```ruby
29
29
  require 'vpndetection'
@@ -36,16 +36,17 @@ result.is_vpn # => true
36
36
 
37
37
  ### With an API key
38
38
 
39
- An API key raises your quota, and raises your features on a paid plan. Create one in the [console](https://app.vpndetection.io), then pass it in:
39
+ A free key adds Tor and relay detection, where the address is and the AS that announces it. Every paid plan answers every field, the same on each, and the plans differ only in how many lookups they include. Create a key in the [console](https://app.vpndetection.io), then pass it in:
40
40
 
41
41
  ```ruby
42
42
  client = VPNDetection::Client.new(api_key: ENV['VPNDETECTION_API_KEY'])
43
43
 
44
44
  result = client.lookup('45.83.91.1')
45
45
  result.is_vpn # => true
46
- result.vpn['provider'] # => "nordvpn"
47
- result.is_hosting # => true
48
- result.hosting['provider'] # => "M247"
46
+ result.location['country'] # the ISO 3166 country code
47
+ result.asn['name'] # who runs the announcing network
48
+ result.vpn['provider'] # => "nordvpn", on a paid plan
49
+ result.is_hosting # => true, on a paid plan
49
50
  ```
50
51
 
51
52
  ### Your own address
@@ -222,7 +223,7 @@ Check that `state` came back as you sent it before you exchange `code`, which wo
222
223
 
223
224
  ### Absent is not false
224
225
 
225
- Every field beyond `ip` and `is_vpn` is present when your plan includes it and `nil` when it does not. `nil` means "not in your plan"; `false` means "we checked, and no".
226
+ Without a key only `ip` and `is_vpn` come back, and a free key adds Tor, relay, `location` and `asn`. Every other field is present when your plan includes it and `nil` when it does not. `nil` means "not in your plan"; `false` means "we checked, and no".
226
227
 
227
228
  ```ruby
228
229
  result.hosting? # false when absent, for when you only want the flag
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -88,7 +88,7 @@ module VPNDetection
88
88
  end
89
89
 
90
90
  # Lookup
91
- # 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`.
91
+ # Answers what is known about a single IPv4 or IPv6 address. Which fields come back is decided by the presented key; with no key the answer is `ip` and `is_vpn`.
92
92
  # @param ip [String] The IPv4 or IPv6 address to classify.
93
93
  # @param [Hash] opts the optional parameters
94
94
  # @return [LookupResponse]
@@ -98,7 +98,7 @@ module VPNDetection
98
98
  end
99
99
 
100
100
  # Lookup
101
- # 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`.
101
+ # Answers what is known about a single IPv4 or IPv6 address. Which fields come back is decided by the presented key; with no key the answer is `ip` and `is_vpn`.
102
102
  # @param ip [String] The IPv4 or IPv6 address to classify.
103
103
  # @param [Hash] opts the optional parameters
104
104
  # @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers
@@ -151,7 +151,7 @@ module VPNDetection
151
151
  end
152
152
 
153
153
  # My IP
154
- # 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.
154
+ # Answers what is known about the address this request came from, which is the same answer `GET /{ip}` gives for that address: 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.
155
155
  # @param [Hash] opts the optional parameters
156
156
  # @return [LookupResponse]
157
157
  def lookup_my_ip(opts = {})
@@ -160,7 +160,7 @@ module VPNDetection
160
160
  end
161
161
 
162
162
  # My IP
163
- # Answers what is known about the address this request came from, which is the same answer &#x60;GET /{ip}&#x60; 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.
163
+ # Answers what is known about the address this request came from, which is the same answer &#x60;GET /{ip}&#x60; gives for that address: 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.
164
164
  # @param [Hash] opts the optional parameters
165
165
  # @return [Array<(LookupResponse, Integer, Hash)>] LookupResponse data, response status code and response headers
166
166
  def lookup_my_ip_with_http_info(opts = {})
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -32,7 +32,8 @@ module VPNDetection
32
32
  end
33
33
 
34
34
  # The answer a bogon gets, in the full shape the API serves at its widest
35
- # plan: every flag present and false, every detail object present and empty.
35
+ # plan: every flag present and false, every detail object present and empty,
36
+ # and a location and AS of empty strings and AS 0.
36
37
  #
37
38
  # `is_bogon` marks it as computed rather than served. Note this is
38
39
  # deliberately the WIDEST shape regardless of your plan, so do not infer
@@ -41,6 +42,8 @@ module VPNDetection
41
42
  raw = { 'ip' => ip, 'is_bogon' => true }
42
43
  Result::FLAGS.each { |flag| raw[flag] = false }
43
44
  Result::DETAILS.each { |detail| raw[detail] = {} }
45
+ raw['location'] = Result::LOCATION.to_h { |member| [member, ''] }
46
+ raw['asn'] = Result::ASN.to_h { |member| [member, member == 'asn' ? 0 : ''] }
44
47
  Result.new(raw, bogon: true)
45
48
  end
46
49
 
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -0,0 +1,274 @@
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.10.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
+ # The autonomous system that announces the address. Free and paid plans. Each field is present whenever the object is: `asn` is 0 and the rest empty where no announcement covers the address.
18
+ class Asn < ApiModelBase
19
+ # The AS number, 0 when no announcement covers the address.
20
+ attr_accessor :asn
21
+
22
+ # Name of the organization that operates the AS.
23
+ attr_accessor :name
24
+
25
+ # The AS operator's own registrable domain.
26
+ attr_accessor :domain
27
+
28
+ # The kind of network the AS runs: isp, hosting, education, government or business.
29
+ attr_accessor :type
30
+
31
+ # The announced BGP prefix that covers the address, the most specific when several do.
32
+ attr_accessor :prefix
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'asn' => :'asn',
38
+ :'name' => :'name',
39
+ :'domain' => :'domain',
40
+ :'type' => :'type',
41
+ :'prefix' => :'prefix'
42
+ }
43
+ end
44
+
45
+ # Returns attribute mapping this model knows about
46
+ def self.acceptable_attribute_map
47
+ attribute_map
48
+ end
49
+
50
+ # Returns all the JSON keys this model knows about
51
+ def self.acceptable_attributes
52
+ acceptable_attribute_map.values
53
+ end
54
+
55
+ # Attribute type mapping.
56
+ def self.openapi_types
57
+ {
58
+ :'asn' => :'Integer',
59
+ :'name' => :'String',
60
+ :'domain' => :'String',
61
+ :'type' => :'String',
62
+ :'prefix' => :'String'
63
+ }
64
+ end
65
+
66
+ # List of attributes with nullable: true
67
+ def self.openapi_nullable
68
+ Set.new([
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::Asn` 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::Asn`. 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?(:'asn')
89
+ self.asn = attributes[:'asn']
90
+ else
91
+ self.asn = nil
92
+ end
93
+
94
+ if attributes.key?(:'name')
95
+ self.name = attributes[:'name']
96
+ else
97
+ self.name = nil
98
+ end
99
+
100
+ if attributes.key?(:'domain')
101
+ self.domain = attributes[:'domain']
102
+ else
103
+ self.domain = nil
104
+ end
105
+
106
+ if attributes.key?(:'type')
107
+ self.type = attributes[:'type']
108
+ else
109
+ self.type = nil
110
+ end
111
+
112
+ if attributes.key?(:'prefix')
113
+ self.prefix = attributes[:'prefix']
114
+ else
115
+ self.prefix = 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 @asn.nil?
125
+ invalid_properties.push('invalid value for "asn", asn cannot be nil.')
126
+ end
127
+
128
+ if @name.nil?
129
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
130
+ end
131
+
132
+ if @domain.nil?
133
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
134
+ end
135
+
136
+ if @type.nil?
137
+ invalid_properties.push('invalid value for "type", type cannot be nil.')
138
+ end
139
+
140
+ if @prefix.nil?
141
+ invalid_properties.push('invalid value for "prefix", prefix cannot be nil.')
142
+ end
143
+
144
+ invalid_properties
145
+ end
146
+
147
+ # Check to see if the all the properties in the model are valid
148
+ # @return true if the model is valid
149
+ def valid?
150
+ warn '[DEPRECATED] the `valid?` method is obsolete'
151
+ return false if @asn.nil?
152
+ return false if @name.nil?
153
+ return false if @domain.nil?
154
+ return false if @type.nil?
155
+ return false if @prefix.nil?
156
+ true
157
+ end
158
+
159
+ # Custom attribute writer method with validation
160
+ # @param [Object] asn Value to be assigned
161
+ def asn=(asn)
162
+ if asn.nil?
163
+ fail ArgumentError, 'asn cannot be nil'
164
+ end
165
+
166
+ @asn = asn
167
+ end
168
+
169
+ # Custom attribute writer method with validation
170
+ # @param [Object] name Value to be assigned
171
+ def name=(name)
172
+ if name.nil?
173
+ fail ArgumentError, 'name cannot be nil'
174
+ end
175
+
176
+ @name = name
177
+ end
178
+
179
+ # Custom attribute writer method with validation
180
+ # @param [Object] domain Value to be assigned
181
+ def domain=(domain)
182
+ if domain.nil?
183
+ fail ArgumentError, 'domain cannot be nil'
184
+ end
185
+
186
+ @domain = domain
187
+ end
188
+
189
+ # Custom attribute writer method with validation
190
+ # @param [Object] type Value to be assigned
191
+ def type=(type)
192
+ if type.nil?
193
+ fail ArgumentError, 'type cannot be nil'
194
+ end
195
+
196
+ @type = type
197
+ end
198
+
199
+ # Custom attribute writer method with validation
200
+ # @param [Object] prefix Value to be assigned
201
+ def prefix=(prefix)
202
+ if prefix.nil?
203
+ fail ArgumentError, 'prefix cannot be nil'
204
+ end
205
+
206
+ @prefix = prefix
207
+ end
208
+
209
+ # Checks equality by comparing each attribute.
210
+ # @param [Object] Object to be compared
211
+ def ==(o)
212
+ return true if self.equal?(o)
213
+ self.class == o.class &&
214
+ asn == o.asn &&
215
+ name == o.name &&
216
+ domain == o.domain &&
217
+ type == o.type &&
218
+ prefix == o.prefix
219
+ end
220
+
221
+ # @see the `==` method
222
+ # @param [Object] Object to be compared
223
+ def eql?(o)
224
+ self == o
225
+ end
226
+
227
+ # Calculates hash code according to all attributes.
228
+ # @return [Integer] Hash code
229
+ def hash
230
+ [asn, name, domain, type, prefix].hash
231
+ end
232
+
233
+ # Builds the object from hash
234
+ # @param [Hash] attributes Model attributes in the form of hash
235
+ # @return [Object] Returns the model itself
236
+ def self.build_from_hash(attributes)
237
+ return nil unless attributes.is_a?(Hash)
238
+ attributes = attributes.transform_keys(&:to_sym)
239
+ transformed_hash = {}
240
+ openapi_types.each_pair do |key, type|
241
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
242
+ transformed_hash["#{key}"] = nil
243
+ elsif type =~ /\AArray<(.*)>/i
244
+ # check to ensure the input is an array given that the attribute
245
+ # is documented as an array but the input is not
246
+ if attributes[attribute_map[key]].is_a?(Array)
247
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
248
+ end
249
+ elsif !attributes[attribute_map[key]].nil?
250
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
251
+ end
252
+ end
253
+ new(transformed_hash)
254
+ end
255
+
256
+ # Returns the object in the form of hash
257
+ # @return [Hash] Returns the object in the form of hash
258
+ def to_hash
259
+ hash = {}
260
+ self.class.attribute_map.each_pair do |attr, param|
261
+ value = self.send(attr)
262
+ if value.nil?
263
+ is_nullable = self.class.openapi_nullable.include?(attr)
264
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
265
+ end
266
+
267
+ hash[param] = _to_hash(value)
268
+ end
269
+ hash
270
+ end
271
+
272
+ end
273
+
274
+ end
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -3,7 +3,7 @@
3
3
 
4
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.10.19
6
+ The version of the OpenAPI document: 2026.10.20
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0