internetdata 2.9.2 → 2.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 (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +146 -9
  3. data/lib/internetdata/api/database_v2_api.rb +2 -2
  4. data/lib/internetdata/api_client.rb +2 -2
  5. data/lib/internetdata/api_error.rb +2 -2
  6. data/lib/internetdata/api_model_base.rb +2 -2
  7. data/lib/internetdata/asn_result.rb +107 -0
  8. data/lib/internetdata/bogon.rb +92 -0
  9. data/lib/internetdata/bogons.rb +93 -0
  10. data/lib/internetdata/cache.rb +35 -0
  11. data/lib/internetdata/client.rb +396 -16
  12. data/lib/internetdata/configuration.rb +23 -2
  13. data/lib/internetdata/domain_result.rb +124 -0
  14. data/lib/internetdata/errors.rb +29 -6
  15. data/lib/internetdata/models/abuse_contact.rb +236 -0
  16. data/lib/internetdata/models/asn.rb +294 -0
  17. data/lib/internetdata/models/asn_lookup_response.rb +405 -0
  18. data/lib/internetdata/models/asn_prefix.rb +329 -0
  19. data/lib/internetdata/models/batch_lookup_error.rb +192 -0
  20. data/lib/internetdata/models/bit_torrent_detail.rb +240 -0
  21. data/lib/internetdata/models/carrier_detail.rb +188 -0
  22. data/lib/internetdata/models/class_detail.rb +178 -0
  23. data/lib/internetdata/models/client_registration.rb +2 -2
  24. data/lib/internetdata/models/company.rb +213 -0
  25. data/lib/internetdata/models/database.rb +2 -2
  26. data/lib/internetdata/models/database_checksums_response.rb +2 -2
  27. data/lib/internetdata/models/database_format.rb +2 -2
  28. data/lib/internetdata/models/database_list.rb +2 -2
  29. data/lib/internetdata/models/database_metadata.rb +2 -2
  30. data/lib/internetdata/models/database_metadata_column.rb +2 -2
  31. data/lib/internetdata/models/database_version.rb +2 -2
  32. data/lib/internetdata/models/db_checksums.rb +2 -2
  33. data/lib/internetdata/models/device_authorization.rb +2 -2
  34. data/lib/internetdata/models/disposable_detail.rb +180 -0
  35. data/lib/internetdata/models/dns_address_record.rb +192 -0
  36. data/lib/internetdata/models/dns_cname_record.rb +192 -0
  37. data/lib/internetdata/models/dns_mx_record.rb +219 -0
  38. data/lib/internetdata/models/dns_ns_record.rb +192 -0
  39. data/lib/internetdata/models/dns_resolver_detail.rb +198 -0
  40. data/lib/internetdata/models/domain_dns.rb +279 -0
  41. data/lib/internetdata/models/domain_ip_range.rb +219 -0
  42. data/lib/internetdata/models/domain_ip_ranges.rb +276 -0
  43. data/lib/internetdata/models/domain_lookup_response.rb +376 -0
  44. data/lib/internetdata/models/download.rb +2 -2
  45. data/lib/internetdata/models/download_list.rb +2 -2
  46. data/lib/internetdata/models/entitlement.rb +243 -0
  47. data/lib/internetdata/models/entitlement_apikey.rb +207 -0
  48. data/lib/internetdata/models/entitlement_plan.rb +216 -0
  49. data/lib/internetdata/models/entitlement_usage.rb +259 -0
  50. data/lib/internetdata/models/error_envelope.rb +2 -2
  51. data/lib/internetdata/models/hosted_domains.rb +166 -0
  52. data/lib/internetdata/models/location.rb +509 -0
  53. data/lib/internetdata/models/lookup_response.rb +897 -0
  54. data/lib/internetdata/models/oauth_metadata.rb +2 -2
  55. data/lib/internetdata/models/proxy_detail.rb +208 -0
  56. data/lib/internetdata/models/pubproxy_detail.rb +210 -0
  57. data/lib/internetdata/models/rwhois.rb +301 -0
  58. data/lib/internetdata/models/satellite_detail.rb +208 -0
  59. data/lib/internetdata/models/smtp_detail.rb +188 -0
  60. data/lib/internetdata/models/ssh_detail.rb +198 -0
  61. data/lib/internetdata/models/standing.rb +2 -2
  62. data/lib/internetdata/models/token_response.rb +2 -2
  63. data/lib/internetdata/models/web_detail.rb +516 -0
  64. data/lib/internetdata/models/whois.rb +382 -0
  65. data/lib/internetdata/oauth_api.rb +1 -1
  66. data/lib/internetdata/result.rb +431 -0
  67. data/lib/internetdata/transport.rb +210 -26
  68. data/lib/internetdata/version.rb +1 -1
  69. data/lib/internetdata.rb +17 -2
  70. metadata +58 -3
@@ -0,0 +1,382 @@
1
+ =begin
2
+ #InternetData API
3
+
4
+ #The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
5
+
6
+ The version of the OpenAPI document: 2026.11.13
7
+ Contact: support@internetdata.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 InternetData
17
+ # IP Whois's most specific record covering the address. Paid plans and the trial.
18
+ class Whois < ApiModelBase
19
+ # Network name of the most specific record covering the address.
20
+ attr_accessor :id
21
+
22
+ # Its holder.
23
+ attr_accessor :name
24
+
25
+ # The registry's handle for the holder.
26
+ attr_accessor :org
27
+
28
+ # ISO 3166 country code.
29
+ attr_accessor :country
30
+
31
+ # The registry's assignment status.
32
+ attr_accessor :status
33
+
34
+ # The registry, or rwhois.
35
+ attr_accessor :source
36
+
37
+ # The holder's domain.
38
+ attr_accessor :domain
39
+
40
+ # The record's abuse contact.
41
+ attr_accessor :abuse_email
42
+
43
+ # The AS announcing the record's start address.
44
+ attr_accessor :asn
45
+
46
+ # Attribute mapping from ruby-style variable name to JSON key.
47
+ def self.attribute_map
48
+ {
49
+ :'id' => :'id',
50
+ :'name' => :'name',
51
+ :'org' => :'org',
52
+ :'country' => :'country',
53
+ :'status' => :'status',
54
+ :'source' => :'source',
55
+ :'domain' => :'domain',
56
+ :'abuse_email' => :'abuse_email',
57
+ :'asn' => :'asn'
58
+ }
59
+ end
60
+
61
+ # Returns attribute mapping this model knows about
62
+ def self.acceptable_attribute_map
63
+ attribute_map
64
+ end
65
+
66
+ # Returns all the JSON keys this model knows about
67
+ def self.acceptable_attributes
68
+ acceptable_attribute_map.values
69
+ end
70
+
71
+ # Attribute type mapping.
72
+ def self.openapi_types
73
+ {
74
+ :'id' => :'String',
75
+ :'name' => :'String',
76
+ :'org' => :'String',
77
+ :'country' => :'String',
78
+ :'status' => :'String',
79
+ :'source' => :'String',
80
+ :'domain' => :'String',
81
+ :'abuse_email' => :'String',
82
+ :'asn' => :'Integer'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::Whois` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ acceptable_attribute_map = self.class.acceptable_attribute_map
101
+ attributes = attributes.each_with_object({}) { |(k, v), h|
102
+ if (!acceptable_attribute_map.key?(k.to_sym))
103
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::Whois`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
104
+ end
105
+ h[k.to_sym] = v
106
+ }
107
+
108
+ if attributes.key?(:'id')
109
+ self.id = attributes[:'id']
110
+ else
111
+ self.id = nil
112
+ end
113
+
114
+ if attributes.key?(:'name')
115
+ self.name = attributes[:'name']
116
+ else
117
+ self.name = nil
118
+ end
119
+
120
+ if attributes.key?(:'org')
121
+ self.org = attributes[:'org']
122
+ else
123
+ self.org = nil
124
+ end
125
+
126
+ if attributes.key?(:'country')
127
+ self.country = attributes[:'country']
128
+ else
129
+ self.country = nil
130
+ end
131
+
132
+ if attributes.key?(:'status')
133
+ self.status = attributes[:'status']
134
+ else
135
+ self.status = nil
136
+ end
137
+
138
+ if attributes.key?(:'source')
139
+ self.source = attributes[:'source']
140
+ else
141
+ self.source = nil
142
+ end
143
+
144
+ if attributes.key?(:'domain')
145
+ self.domain = attributes[:'domain']
146
+ else
147
+ self.domain = nil
148
+ end
149
+
150
+ if attributes.key?(:'abuse_email')
151
+ self.abuse_email = attributes[:'abuse_email']
152
+ else
153
+ self.abuse_email = nil
154
+ end
155
+
156
+ if attributes.key?(:'asn')
157
+ self.asn = attributes[:'asn']
158
+ else
159
+ self.asn = nil
160
+ end
161
+ end
162
+
163
+ # Show invalid properties with the reasons. Usually used together with valid?
164
+ # @return Array for valid properties with the reasons
165
+ def list_invalid_properties
166
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
167
+ invalid_properties = Array.new
168
+ if @id.nil?
169
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
170
+ end
171
+
172
+ if @name.nil?
173
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
174
+ end
175
+
176
+ if @org.nil?
177
+ invalid_properties.push('invalid value for "org", org cannot be nil.')
178
+ end
179
+
180
+ if @country.nil?
181
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
182
+ end
183
+
184
+ if @status.nil?
185
+ invalid_properties.push('invalid value for "status", status cannot be nil.')
186
+ end
187
+
188
+ if @source.nil?
189
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
190
+ end
191
+
192
+ if @domain.nil?
193
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
194
+ end
195
+
196
+ if @abuse_email.nil?
197
+ invalid_properties.push('invalid value for "abuse_email", abuse_email cannot be nil.')
198
+ end
199
+
200
+ if @asn.nil?
201
+ invalid_properties.push('invalid value for "asn", asn cannot be nil.')
202
+ end
203
+
204
+ invalid_properties
205
+ end
206
+
207
+ # Check to see if the all the properties in the model are valid
208
+ # @return true if the model is valid
209
+ def valid?
210
+ warn '[DEPRECATED] the `valid?` method is obsolete'
211
+ return false if @id.nil?
212
+ return false if @name.nil?
213
+ return false if @org.nil?
214
+ return false if @country.nil?
215
+ return false if @status.nil?
216
+ return false if @source.nil?
217
+ return false if @domain.nil?
218
+ return false if @abuse_email.nil?
219
+ return false if @asn.nil?
220
+ true
221
+ end
222
+
223
+ # Custom attribute writer method with validation
224
+ # @param [Object] id Value to be assigned
225
+ def id=(id)
226
+ if id.nil?
227
+ fail ArgumentError, 'id cannot be nil'
228
+ end
229
+
230
+ @id = id
231
+ end
232
+
233
+ # Custom attribute writer method with validation
234
+ # @param [Object] name Value to be assigned
235
+ def name=(name)
236
+ if name.nil?
237
+ fail ArgumentError, 'name cannot be nil'
238
+ end
239
+
240
+ @name = name
241
+ end
242
+
243
+ # Custom attribute writer method with validation
244
+ # @param [Object] org Value to be assigned
245
+ def org=(org)
246
+ if org.nil?
247
+ fail ArgumentError, 'org cannot be nil'
248
+ end
249
+
250
+ @org = org
251
+ end
252
+
253
+ # Custom attribute writer method with validation
254
+ # @param [Object] country Value to be assigned
255
+ def country=(country)
256
+ if country.nil?
257
+ fail ArgumentError, 'country cannot be nil'
258
+ end
259
+
260
+ @country = country
261
+ end
262
+
263
+ # Custom attribute writer method with validation
264
+ # @param [Object] status Value to be assigned
265
+ def status=(status)
266
+ if status.nil?
267
+ fail ArgumentError, 'status cannot be nil'
268
+ end
269
+
270
+ @status = status
271
+ end
272
+
273
+ # Custom attribute writer method with validation
274
+ # @param [Object] source Value to be assigned
275
+ def source=(source)
276
+ if source.nil?
277
+ fail ArgumentError, 'source cannot be nil'
278
+ end
279
+
280
+ @source = source
281
+ end
282
+
283
+ # Custom attribute writer method with validation
284
+ # @param [Object] domain Value to be assigned
285
+ def domain=(domain)
286
+ if domain.nil?
287
+ fail ArgumentError, 'domain cannot be nil'
288
+ end
289
+
290
+ @domain = domain
291
+ end
292
+
293
+ # Custom attribute writer method with validation
294
+ # @param [Object] abuse_email Value to be assigned
295
+ def abuse_email=(abuse_email)
296
+ if abuse_email.nil?
297
+ fail ArgumentError, 'abuse_email cannot be nil'
298
+ end
299
+
300
+ @abuse_email = abuse_email
301
+ end
302
+
303
+ # Custom attribute writer method with validation
304
+ # @param [Object] asn Value to be assigned
305
+ def asn=(asn)
306
+ if asn.nil?
307
+ fail ArgumentError, 'asn cannot be nil'
308
+ end
309
+
310
+ @asn = asn
311
+ end
312
+
313
+ # Checks equality by comparing each attribute.
314
+ # @param [Object] Object to be compared
315
+ def ==(o)
316
+ return true if self.equal?(o)
317
+ self.class == o.class &&
318
+ id == o.id &&
319
+ name == o.name &&
320
+ org == o.org &&
321
+ country == o.country &&
322
+ status == o.status &&
323
+ source == o.source &&
324
+ domain == o.domain &&
325
+ abuse_email == o.abuse_email &&
326
+ asn == o.asn
327
+ end
328
+
329
+ # @see the `==` method
330
+ # @param [Object] Object to be compared
331
+ def eql?(o)
332
+ self == o
333
+ end
334
+
335
+ # Calculates hash code according to all attributes.
336
+ # @return [Integer] Hash code
337
+ def hash
338
+ [id, name, org, country, status, source, domain, abuse_email, asn].hash
339
+ end
340
+
341
+ # Builds the object from hash
342
+ # @param [Hash] attributes Model attributes in the form of hash
343
+ # @return [Object] Returns the model itself
344
+ def self.build_from_hash(attributes)
345
+ return nil unless attributes.is_a?(Hash)
346
+ attributes = attributes.transform_keys(&:to_sym)
347
+ transformed_hash = {}
348
+ openapi_types.each_pair do |key, type|
349
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
350
+ transformed_hash["#{key}"] = nil
351
+ elsif type =~ /\AArray<(.*)>/i
352
+ # check to ensure the input is an array given that the attribute
353
+ # is documented as an array but the input is not
354
+ if attributes[attribute_map[key]].is_a?(Array)
355
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
356
+ end
357
+ elsif !attributes[attribute_map[key]].nil?
358
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
359
+ end
360
+ end
361
+ new(transformed_hash)
362
+ end
363
+
364
+ # Returns the object in the form of hash
365
+ # @return [Hash] Returns the object in the form of hash
366
+ def to_hash
367
+ hash = {}
368
+ self.class.attribute_map.each_pair do |attr, param|
369
+ value = self.send(attr)
370
+ if value.nil?
371
+ is_nullable = self.class.openapi_nullable.include?(attr)
372
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
373
+ end
374
+
375
+ hash[param] = _to_hash(value)
376
+ end
377
+ hash
378
+ end
379
+
380
+ end
381
+
382
+ end
@@ -135,7 +135,7 @@ module InternetData
135
135
  optional = { 'scope' => scope, 'state' => state, 'resource' => resource }.reject { |_, v| v.nil? || v.empty? }
136
136
  params = { 'response_type' => 'code', **required, 'code_challenge_method' => 'S256', **optional }
137
137
  query = params.map { |name, value| "#{name}=#{percent_encode(name, value)}" }.join('&')
138
- "#{@transport.config.base_url}#{AUTHORIZE_PATH}?#{query}"
138
+ "#{@transport.oauth_base_url}#{AUTHORIZE_PATH}?#{query}"
139
139
  end
140
140
 
141
141
  # A fresh PKCE pair for one sign-in, from 32 bytes of SecureRandom.