vpndetection 4.0.1 → 5.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.
Files changed (55) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +20 -0
  3. data/lib/vpndetection/api/account_wire_api.rb +16 -16
  4. data/lib/vpndetection/api/api_keys_wire_api.rb +336 -0
  5. data/lib/vpndetection/api/authorization_wire_api.rb +421 -0
  6. data/lib/vpndetection/api/database_wire_api.rb +1 -1
  7. data/lib/vpndetection/api/entitlement_wire_api.rb +79 -0
  8. data/lib/vpndetection/api/lookup_wire_api.rb +3 -3
  9. data/lib/vpndetection/api/organization_wire_api.rb +136 -0
  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/client.rb +4 -4
  14. data/lib/vpndetection/configuration.rb +1 -1
  15. data/lib/vpndetection/models/account_create_apikey_request.rb +177 -0
  16. data/lib/vpndetection/models/account_created_apikey.rb +257 -0
  17. data/lib/vpndetection/models/account_org.rb +183 -0
  18. data/lib/vpndetection/models/account_org_ref.rb +164 -0
  19. data/lib/vpndetection/models/account_org_wrap.rb +190 -0
  20. data/lib/vpndetection/models/account_rc.rb +165 -0
  21. data/lib/vpndetection/models/account_revealed_apikey.rb +191 -0
  22. data/lib/vpndetection/models/account_user.rb +182 -0
  23. data/lib/vpndetection/models/apikey_detail.rb +307 -0
  24. data/lib/vpndetection/models/apikey_list.rb +192 -0
  25. data/lib/vpndetection/models/class_detail.rb +1 -1
  26. data/lib/vpndetection/models/database.rb +1 -1
  27. data/lib/vpndetection/models/database_checksums_response.rb +1 -1
  28. data/lib/vpndetection/models/database_format.rb +1 -1
  29. data/lib/vpndetection/models/database_format_size.rb +2 -2
  30. data/lib/vpndetection/models/database_list.rb +1 -1
  31. data/lib/vpndetection/models/database_metadata.rb +1 -1
  32. data/lib/vpndetection/models/database_metadata_column.rb +1 -1
  33. data/lib/vpndetection/models/database_version.rb +1 -1
  34. data/lib/vpndetection/models/db_checksums.rb +1 -1
  35. data/lib/vpndetection/models/device_authorization.rb +281 -0
  36. data/lib/vpndetection/models/download.rb +2 -2
  37. data/lib/vpndetection/models/download_list.rb +1 -1
  38. data/lib/vpndetection/models/{account_me.rb → entitlement.rb} +7 -7
  39. data/lib/vpndetection/models/{account_apikey.rb → entitlement_apikey.rb} +4 -4
  40. data/lib/vpndetection/models/{account_error.rb → entitlement_error.rb} +4 -4
  41. data/lib/vpndetection/models/{account_plan.rb → entitlement_plan.rb} +4 -4
  42. data/lib/vpndetection/models/{account_usage.rb → entitlement_usage.rb} +4 -4
  43. data/lib/vpndetection/models/error_envelope.rb +1 -1
  44. data/lib/vpndetection/models/identity.rb +245 -0
  45. data/lib/vpndetection/models/lookup_error.rb +1 -1
  46. data/lib/vpndetection/models/lookup_response.rb +1 -1
  47. data/lib/vpndetection/models/oauth_error.rb +173 -0
  48. data/lib/vpndetection/models/oauth_metadata.rb +288 -0
  49. data/lib/vpndetection/models/proxy_detail.rb +1 -1
  50. data/lib/vpndetection/models/standing.rb +1 -1
  51. data/lib/vpndetection/models/token_response.rb +235 -0
  52. data/lib/vpndetection/models/vpn_detail.rb +1 -1
  53. data/lib/vpndetection/transport.rb +5 -5
  54. data/lib/vpndetection/version.rb +1 -1
  55. metadata +25 -6
@@ -0,0 +1,245 @@
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.15
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 Identity < ApiModelBase
18
+ attr_accessor :rc
19
+
20
+ attr_accessor :user
21
+
22
+ attr_accessor :org
23
+
24
+ # What this credential may do right now.
25
+ attr_accessor :scopes
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'rc' => :'rc',
31
+ :'user' => :'user',
32
+ :'org' => :'org',
33
+ :'scopes' => :'scopes'
34
+ }
35
+ end
36
+
37
+ # Returns attribute mapping this model knows about
38
+ def self.acceptable_attribute_map
39
+ attribute_map
40
+ end
41
+
42
+ # Returns all the JSON keys this model knows about
43
+ def self.acceptable_attributes
44
+ acceptable_attribute_map.values
45
+ end
46
+
47
+ # Attribute type mapping.
48
+ def self.openapi_types
49
+ {
50
+ :'rc' => :'String',
51
+ :'user' => :'AccountUser',
52
+ :'org' => :'AccountOrgRef',
53
+ :'scopes' => :'Array<String>'
54
+ }
55
+ end
56
+
57
+ # List of attributes with nullable: true
58
+ def self.openapi_nullable
59
+ Set.new([
60
+ ])
61
+ end
62
+
63
+ # Initializes the object
64
+ # @param [Hash] attributes Model attributes in the form of hash
65
+ def initialize(attributes = {})
66
+ if (!attributes.is_a?(Hash))
67
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::Identity` initialize method"
68
+ end
69
+
70
+ # check to see if the attribute exists and convert string to symbol for hash key
71
+ acceptable_attribute_map = self.class.acceptable_attribute_map
72
+ attributes = attributes.each_with_object({}) { |(k, v), h|
73
+ if (!acceptable_attribute_map.key?(k.to_sym))
74
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::Identity`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
75
+ end
76
+ h[k.to_sym] = v
77
+ }
78
+
79
+ if attributes.key?(:'rc')
80
+ self.rc = attributes[:'rc']
81
+ else
82
+ self.rc = nil
83
+ end
84
+
85
+ if attributes.key?(:'user')
86
+ self.user = attributes[:'user']
87
+ else
88
+ self.user = nil
89
+ end
90
+
91
+ if attributes.key?(:'org')
92
+ self.org = attributes[:'org']
93
+ else
94
+ self.org = nil
95
+ end
96
+
97
+ if attributes.key?(:'scopes')
98
+ if (value = attributes[:'scopes']).is_a?(Array)
99
+ self.scopes = value
100
+ end
101
+ else
102
+ self.scopes = nil
103
+ end
104
+ end
105
+
106
+ # Show invalid properties with the reasons. Usually used together with valid?
107
+ # @return Array for valid properties with the reasons
108
+ def list_invalid_properties
109
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
110
+ invalid_properties = Array.new
111
+ if @rc.nil?
112
+ invalid_properties.push('invalid value for "rc", rc cannot be nil.')
113
+ end
114
+
115
+ if @user.nil?
116
+ invalid_properties.push('invalid value for "user", user cannot be nil.')
117
+ end
118
+
119
+ if @org.nil?
120
+ invalid_properties.push('invalid value for "org", org cannot be nil.')
121
+ end
122
+
123
+ if @scopes.nil?
124
+ invalid_properties.push('invalid value for "scopes", scopes cannot be nil.')
125
+ end
126
+
127
+ invalid_properties
128
+ end
129
+
130
+ # Check to see if the all the properties in the model are valid
131
+ # @return true if the model is valid
132
+ def valid?
133
+ warn '[DEPRECATED] the `valid?` method is obsolete'
134
+ return false if @rc.nil?
135
+ return false if @user.nil?
136
+ return false if @org.nil?
137
+ return false if @scopes.nil?
138
+ true
139
+ end
140
+
141
+ # Custom attribute writer method with validation
142
+ # @param [Object] rc Value to be assigned
143
+ def rc=(rc)
144
+ if rc.nil?
145
+ fail ArgumentError, 'rc cannot be nil'
146
+ end
147
+
148
+ @rc = rc
149
+ end
150
+
151
+ # Custom attribute writer method with validation
152
+ # @param [Object] user Value to be assigned
153
+ def user=(user)
154
+ if user.nil?
155
+ fail ArgumentError, 'user cannot be nil'
156
+ end
157
+
158
+ @user = user
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] org Value to be assigned
163
+ def org=(org)
164
+ if org.nil?
165
+ fail ArgumentError, 'org cannot be nil'
166
+ end
167
+
168
+ @org = org
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] scopes Value to be assigned
173
+ def scopes=(scopes)
174
+ if scopes.nil?
175
+ fail ArgumentError, 'scopes cannot be nil'
176
+ end
177
+
178
+ @scopes = scopes
179
+ end
180
+
181
+ # Checks equality by comparing each attribute.
182
+ # @param [Object] Object to be compared
183
+ def ==(o)
184
+ return true if self.equal?(o)
185
+ self.class == o.class &&
186
+ rc == o.rc &&
187
+ user == o.user &&
188
+ org == o.org &&
189
+ scopes == o.scopes
190
+ end
191
+
192
+ # @see the `==` method
193
+ # @param [Object] Object to be compared
194
+ def eql?(o)
195
+ self == o
196
+ end
197
+
198
+ # Calculates hash code according to all attributes.
199
+ # @return [Integer] Hash code
200
+ def hash
201
+ [rc, user, org, scopes].hash
202
+ end
203
+
204
+ # Builds the object from hash
205
+ # @param [Hash] attributes Model attributes in the form of hash
206
+ # @return [Object] Returns the model itself
207
+ def self.build_from_hash(attributes)
208
+ return nil unless attributes.is_a?(Hash)
209
+ attributes = attributes.transform_keys(&:to_sym)
210
+ transformed_hash = {}
211
+ openapi_types.each_pair do |key, type|
212
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
213
+ transformed_hash["#{key}"] = nil
214
+ elsif type =~ /\AArray<(.*)>/i
215
+ # check to ensure the input is an array given that the attribute
216
+ # is documented as an array but the input is not
217
+ if attributes[attribute_map[key]].is_a?(Array)
218
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
219
+ end
220
+ elsif !attributes[attribute_map[key]].nil?
221
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
222
+ end
223
+ end
224
+ new(transformed_hash)
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ if value.nil?
234
+ is_nullable = self.class.openapi_nullable.include?(attr)
235
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
236
+ end
237
+
238
+ hash[param] = _to_hash(value)
239
+ end
240
+ hash
241
+ end
242
+
243
+ end
244
+
245
+ 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.09.13
6
+ The version of the OpenAPI document: 2026.09.15
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.09.13
6
+ The version of the OpenAPI document: 2026.09.15
7
7
  Contact: support@vpndetection.io
8
8
  Generated by: https://openapi-generator.tech
9
9
  Generator version: 7.25.0
@@ -0,0 +1,173 @@
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.15
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 OauthError < ApiModelBase
18
+ attr_accessor :error
19
+
20
+ attr_accessor :error_description
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'error' => :'error',
26
+ :'error_description' => :'error_description'
27
+ }
28
+ end
29
+
30
+ # Returns attribute mapping this model knows about
31
+ def self.acceptable_attribute_map
32
+ attribute_map
33
+ end
34
+
35
+ # Returns all the JSON keys this model knows about
36
+ def self.acceptable_attributes
37
+ acceptable_attribute_map.values
38
+ end
39
+
40
+ # Attribute type mapping.
41
+ def self.openapi_types
42
+ {
43
+ :'error' => :'String',
44
+ :'error_description' => :'String'
45
+ }
46
+ end
47
+
48
+ # List of attributes with nullable: true
49
+ def self.openapi_nullable
50
+ Set.new([
51
+ ])
52
+ end
53
+
54
+ # Initializes the object
55
+ # @param [Hash] attributes Model attributes in the form of hash
56
+ def initialize(attributes = {})
57
+ if (!attributes.is_a?(Hash))
58
+ fail ArgumentError, "The input argument (attributes) must be a hash in `VPNDetection::OauthError` initialize method"
59
+ end
60
+
61
+ # check to see if the attribute exists and convert string to symbol for hash key
62
+ acceptable_attribute_map = self.class.acceptable_attribute_map
63
+ attributes = attributes.each_with_object({}) { |(k, v), h|
64
+ if (!acceptable_attribute_map.key?(k.to_sym))
65
+ fail ArgumentError, "`#{k}` is not a valid attribute in `VPNDetection::OauthError`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
66
+ end
67
+ h[k.to_sym] = v
68
+ }
69
+
70
+ if attributes.key?(:'error')
71
+ self.error = attributes[:'error']
72
+ else
73
+ self.error = nil
74
+ end
75
+
76
+ if attributes.key?(:'error_description')
77
+ self.error_description = attributes[:'error_description']
78
+ end
79
+ end
80
+
81
+ # Show invalid properties with the reasons. Usually used together with valid?
82
+ # @return Array for valid properties with the reasons
83
+ def list_invalid_properties
84
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
85
+ invalid_properties = Array.new
86
+ if @error.nil?
87
+ invalid_properties.push('invalid value for "error", error cannot be nil.')
88
+ end
89
+
90
+ invalid_properties
91
+ end
92
+
93
+ # Check to see if the all the properties in the model are valid
94
+ # @return true if the model is valid
95
+ def valid?
96
+ warn '[DEPRECATED] the `valid?` method is obsolete'
97
+ return false if @error.nil?
98
+ true
99
+ end
100
+
101
+ # Custom attribute writer method with validation
102
+ # @param [Object] error Value to be assigned
103
+ def error=(error)
104
+ if error.nil?
105
+ fail ArgumentError, 'error cannot be nil'
106
+ end
107
+
108
+ @error = error
109
+ end
110
+
111
+ # Checks equality by comparing each attribute.
112
+ # @param [Object] Object to be compared
113
+ def ==(o)
114
+ return true if self.equal?(o)
115
+ self.class == o.class &&
116
+ error == o.error &&
117
+ error_description == o.error_description
118
+ end
119
+
120
+ # @see the `==` method
121
+ # @param [Object] Object to be compared
122
+ def eql?(o)
123
+ self == o
124
+ end
125
+
126
+ # Calculates hash code according to all attributes.
127
+ # @return [Integer] Hash code
128
+ def hash
129
+ [error, error_description].hash
130
+ end
131
+
132
+ # Builds the object from hash
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ # @return [Object] Returns the model itself
135
+ def self.build_from_hash(attributes)
136
+ return nil unless attributes.is_a?(Hash)
137
+ attributes = attributes.transform_keys(&:to_sym)
138
+ transformed_hash = {}
139
+ openapi_types.each_pair do |key, type|
140
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
141
+ transformed_hash["#{key}"] = nil
142
+ elsif type =~ /\AArray<(.*)>/i
143
+ # check to ensure the input is an array given that the attribute
144
+ # is documented as an array but the input is not
145
+ if attributes[attribute_map[key]].is_a?(Array)
146
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
147
+ end
148
+ elsif !attributes[attribute_map[key]].nil?
149
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
150
+ end
151
+ end
152
+ new(transformed_hash)
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ if value.nil?
162
+ is_nullable = self.class.openapi_nullable.include?(attr)
163
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
164
+ end
165
+
166
+ hash[param] = _to_hash(value)
167
+ end
168
+ hash
169
+ end
170
+
171
+ end
172
+
173
+ end