internetdata 2.9.1 → 2.10.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 (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 +87 -0
  9. data/lib/internetdata/bogons.rb +93 -0
  10. data/lib/internetdata/cache.rb +35 -0
  11. data/lib/internetdata/client.rb +388 -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 +410 -0
  21. data/lib/internetdata/models/carrier_detail.rb +273 -0
  22. data/lib/internetdata/models/class_detail.rb +246 -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 +248 -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 +300 -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 +327 -0
  56. data/lib/internetdata/models/pubproxy_detail.rb +329 -0
  57. data/lib/internetdata/models/rwhois.rb +301 -0
  58. data/lib/internetdata/models/satellite_detail.rb +327 -0
  59. data/lib/internetdata/models/smtp_detail.rb +273 -0
  60. data/lib/internetdata/models/ssh_detail.rb +300 -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 +12 -5
  66. data/lib/internetdata/result.rb +431 -0
  67. data/lib/internetdata/transport.rb +215 -27
  68. data/lib/internetdata/version.rb +1 -1
  69. data/lib/internetdata.rb +17 -2
  70. metadata +58 -3
@@ -0,0 +1,509 @@
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
+ # Where the address is.
18
+ class Location < ApiModelBase
19
+ # Continent code.
20
+ attr_accessor :continent
21
+
22
+ # Continent name.
23
+ attr_accessor :continent_name
24
+
25
+ # ISO 3166-1 alpha-2 country code.
26
+ attr_accessor :country
27
+
28
+ # Country name.
29
+ attr_accessor :country_name
30
+
31
+ # IANA timezone.
32
+ attr_accessor :timezone
33
+
34
+ # ISO 4217 code.
35
+ attr_accessor :currency_code
36
+
37
+ # Currency name.
38
+ attr_accessor :currency_name
39
+
40
+ # Currency symbol.
41
+ attr_accessor :currency_symbol
42
+
43
+ # The country's flag.
44
+ attr_accessor :flag_emoji
45
+
46
+ # Its code points, `U+1F1E6 U+1F1F9`.
47
+ attr_accessor :flag_unicode
48
+
49
+ # Region (state or province). Paid plans and the trial.
50
+ attr_accessor :region
51
+
52
+ # ISO 3166-2 region code. Paid plans and the trial.
53
+ attr_accessor :region_code
54
+
55
+ # City. Paid plans and the trial.
56
+ attr_accessor :city
57
+
58
+ # Postal code. Paid plans and the trial.
59
+ attr_accessor :postal_code
60
+
61
+ # Latitude of the city. Paid plans and the trial.
62
+ attr_accessor :latitude
63
+
64
+ # Longitude of the city. Paid plans and the trial.
65
+ attr_accessor :longitude
66
+
67
+ # Radius in km holding the true location with 67% confidence. Paid plans and the trial.
68
+ attr_accessor :accuracy_radius
69
+
70
+ # GeoNames ID of the city. Paid plans and the trial.
71
+ attr_accessor :geoname_id
72
+
73
+ # US TV market (DMA) code. Paid plans and the trial.
74
+ attr_accessor :dma_code
75
+
76
+ # The day the range's location last changed. Paid plans and the trial.
77
+ attr_accessor :last_changed
78
+
79
+ # Attribute mapping from ruby-style variable name to JSON key.
80
+ def self.attribute_map
81
+ {
82
+ :'continent' => :'continent',
83
+ :'continent_name' => :'continent_name',
84
+ :'country' => :'country',
85
+ :'country_name' => :'country_name',
86
+ :'timezone' => :'timezone',
87
+ :'currency_code' => :'currency_code',
88
+ :'currency_name' => :'currency_name',
89
+ :'currency_symbol' => :'currency_symbol',
90
+ :'flag_emoji' => :'flag_emoji',
91
+ :'flag_unicode' => :'flag_unicode',
92
+ :'region' => :'region',
93
+ :'region_code' => :'region_code',
94
+ :'city' => :'city',
95
+ :'postal_code' => :'postal_code',
96
+ :'latitude' => :'latitude',
97
+ :'longitude' => :'longitude',
98
+ :'accuracy_radius' => :'accuracy_radius',
99
+ :'geoname_id' => :'geoname_id',
100
+ :'dma_code' => :'dma_code',
101
+ :'last_changed' => :'last_changed'
102
+ }
103
+ end
104
+
105
+ # Returns attribute mapping this model knows about
106
+ def self.acceptable_attribute_map
107
+ attribute_map
108
+ end
109
+
110
+ # Returns all the JSON keys this model knows about
111
+ def self.acceptable_attributes
112
+ acceptable_attribute_map.values
113
+ end
114
+
115
+ # Attribute type mapping.
116
+ def self.openapi_types
117
+ {
118
+ :'continent' => :'String',
119
+ :'continent_name' => :'String',
120
+ :'country' => :'String',
121
+ :'country_name' => :'String',
122
+ :'timezone' => :'String',
123
+ :'currency_code' => :'String',
124
+ :'currency_name' => :'String',
125
+ :'currency_symbol' => :'String',
126
+ :'flag_emoji' => :'String',
127
+ :'flag_unicode' => :'String',
128
+ :'region' => :'String',
129
+ :'region_code' => :'String',
130
+ :'city' => :'String',
131
+ :'postal_code' => :'String',
132
+ :'latitude' => :'Float',
133
+ :'longitude' => :'Float',
134
+ :'accuracy_radius' => :'Integer',
135
+ :'geoname_id' => :'String',
136
+ :'dma_code' => :'String',
137
+ :'last_changed' => :'String'
138
+ }
139
+ end
140
+
141
+ # List of attributes with nullable: true
142
+ def self.openapi_nullable
143
+ Set.new([
144
+ ])
145
+ end
146
+
147
+ # Initializes the object
148
+ # @param [Hash] attributes Model attributes in the form of hash
149
+ def initialize(attributes = {})
150
+ if (!attributes.is_a?(Hash))
151
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::Location` initialize method"
152
+ end
153
+
154
+ # check to see if the attribute exists and convert string to symbol for hash key
155
+ acceptable_attribute_map = self.class.acceptable_attribute_map
156
+ attributes = attributes.each_with_object({}) { |(k, v), h|
157
+ if (!acceptable_attribute_map.key?(k.to_sym))
158
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::Location`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
159
+ end
160
+ h[k.to_sym] = v
161
+ }
162
+
163
+ if attributes.key?(:'continent')
164
+ self.continent = attributes[:'continent']
165
+ else
166
+ self.continent = nil
167
+ end
168
+
169
+ if attributes.key?(:'continent_name')
170
+ self.continent_name = attributes[:'continent_name']
171
+ else
172
+ self.continent_name = nil
173
+ end
174
+
175
+ if attributes.key?(:'country')
176
+ self.country = attributes[:'country']
177
+ else
178
+ self.country = nil
179
+ end
180
+
181
+ if attributes.key?(:'country_name')
182
+ self.country_name = attributes[:'country_name']
183
+ else
184
+ self.country_name = nil
185
+ end
186
+
187
+ if attributes.key?(:'timezone')
188
+ self.timezone = attributes[:'timezone']
189
+ else
190
+ self.timezone = nil
191
+ end
192
+
193
+ if attributes.key?(:'currency_code')
194
+ self.currency_code = attributes[:'currency_code']
195
+ else
196
+ self.currency_code = nil
197
+ end
198
+
199
+ if attributes.key?(:'currency_name')
200
+ self.currency_name = attributes[:'currency_name']
201
+ else
202
+ self.currency_name = nil
203
+ end
204
+
205
+ if attributes.key?(:'currency_symbol')
206
+ self.currency_symbol = attributes[:'currency_symbol']
207
+ else
208
+ self.currency_symbol = nil
209
+ end
210
+
211
+ if attributes.key?(:'flag_emoji')
212
+ self.flag_emoji = attributes[:'flag_emoji']
213
+ else
214
+ self.flag_emoji = nil
215
+ end
216
+
217
+ if attributes.key?(:'flag_unicode')
218
+ self.flag_unicode = attributes[:'flag_unicode']
219
+ else
220
+ self.flag_unicode = nil
221
+ end
222
+
223
+ if attributes.key?(:'region')
224
+ self.region = attributes[:'region']
225
+ end
226
+
227
+ if attributes.key?(:'region_code')
228
+ self.region_code = attributes[:'region_code']
229
+ end
230
+
231
+ if attributes.key?(:'city')
232
+ self.city = attributes[:'city']
233
+ end
234
+
235
+ if attributes.key?(:'postal_code')
236
+ self.postal_code = attributes[:'postal_code']
237
+ end
238
+
239
+ if attributes.key?(:'latitude')
240
+ self.latitude = attributes[:'latitude']
241
+ end
242
+
243
+ if attributes.key?(:'longitude')
244
+ self.longitude = attributes[:'longitude']
245
+ end
246
+
247
+ if attributes.key?(:'accuracy_radius')
248
+ self.accuracy_radius = attributes[:'accuracy_radius']
249
+ end
250
+
251
+ if attributes.key?(:'geoname_id')
252
+ self.geoname_id = attributes[:'geoname_id']
253
+ end
254
+
255
+ if attributes.key?(:'dma_code')
256
+ self.dma_code = attributes[:'dma_code']
257
+ end
258
+
259
+ if attributes.key?(:'last_changed')
260
+ self.last_changed = attributes[:'last_changed']
261
+ end
262
+ end
263
+
264
+ # Show invalid properties with the reasons. Usually used together with valid?
265
+ # @return Array for valid properties with the reasons
266
+ def list_invalid_properties
267
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
268
+ invalid_properties = Array.new
269
+ if @continent.nil?
270
+ invalid_properties.push('invalid value for "continent", continent cannot be nil.')
271
+ end
272
+
273
+ if @continent_name.nil?
274
+ invalid_properties.push('invalid value for "continent_name", continent_name cannot be nil.')
275
+ end
276
+
277
+ if @country.nil?
278
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
279
+ end
280
+
281
+ if @country_name.nil?
282
+ invalid_properties.push('invalid value for "country_name", country_name cannot be nil.')
283
+ end
284
+
285
+ if @timezone.nil?
286
+ invalid_properties.push('invalid value for "timezone", timezone cannot be nil.')
287
+ end
288
+
289
+ if @currency_code.nil?
290
+ invalid_properties.push('invalid value for "currency_code", currency_code cannot be nil.')
291
+ end
292
+
293
+ if @currency_name.nil?
294
+ invalid_properties.push('invalid value for "currency_name", currency_name cannot be nil.')
295
+ end
296
+
297
+ if @currency_symbol.nil?
298
+ invalid_properties.push('invalid value for "currency_symbol", currency_symbol cannot be nil.')
299
+ end
300
+
301
+ if @flag_emoji.nil?
302
+ invalid_properties.push('invalid value for "flag_emoji", flag_emoji cannot be nil.')
303
+ end
304
+
305
+ if @flag_unicode.nil?
306
+ invalid_properties.push('invalid value for "flag_unicode", flag_unicode cannot be nil.')
307
+ end
308
+
309
+ invalid_properties
310
+ end
311
+
312
+ # Check to see if the all the properties in the model are valid
313
+ # @return true if the model is valid
314
+ def valid?
315
+ warn '[DEPRECATED] the `valid?` method is obsolete'
316
+ return false if @continent.nil?
317
+ return false if @continent_name.nil?
318
+ return false if @country.nil?
319
+ return false if @country_name.nil?
320
+ return false if @timezone.nil?
321
+ return false if @currency_code.nil?
322
+ return false if @currency_name.nil?
323
+ return false if @currency_symbol.nil?
324
+ return false if @flag_emoji.nil?
325
+ return false if @flag_unicode.nil?
326
+ true
327
+ end
328
+
329
+ # Custom attribute writer method with validation
330
+ # @param [Object] continent Value to be assigned
331
+ def continent=(continent)
332
+ if continent.nil?
333
+ fail ArgumentError, 'continent cannot be nil'
334
+ end
335
+
336
+ @continent = continent
337
+ end
338
+
339
+ # Custom attribute writer method with validation
340
+ # @param [Object] continent_name Value to be assigned
341
+ def continent_name=(continent_name)
342
+ if continent_name.nil?
343
+ fail ArgumentError, 'continent_name cannot be nil'
344
+ end
345
+
346
+ @continent_name = continent_name
347
+ end
348
+
349
+ # Custom attribute writer method with validation
350
+ # @param [Object] country Value to be assigned
351
+ def country=(country)
352
+ if country.nil?
353
+ fail ArgumentError, 'country cannot be nil'
354
+ end
355
+
356
+ @country = country
357
+ end
358
+
359
+ # Custom attribute writer method with validation
360
+ # @param [Object] country_name Value to be assigned
361
+ def country_name=(country_name)
362
+ if country_name.nil?
363
+ fail ArgumentError, 'country_name cannot be nil'
364
+ end
365
+
366
+ @country_name = country_name
367
+ end
368
+
369
+ # Custom attribute writer method with validation
370
+ # @param [Object] timezone Value to be assigned
371
+ def timezone=(timezone)
372
+ if timezone.nil?
373
+ fail ArgumentError, 'timezone cannot be nil'
374
+ end
375
+
376
+ @timezone = timezone
377
+ end
378
+
379
+ # Custom attribute writer method with validation
380
+ # @param [Object] currency_code Value to be assigned
381
+ def currency_code=(currency_code)
382
+ if currency_code.nil?
383
+ fail ArgumentError, 'currency_code cannot be nil'
384
+ end
385
+
386
+ @currency_code = currency_code
387
+ end
388
+
389
+ # Custom attribute writer method with validation
390
+ # @param [Object] currency_name Value to be assigned
391
+ def currency_name=(currency_name)
392
+ if currency_name.nil?
393
+ fail ArgumentError, 'currency_name cannot be nil'
394
+ end
395
+
396
+ @currency_name = currency_name
397
+ end
398
+
399
+ # Custom attribute writer method with validation
400
+ # @param [Object] currency_symbol Value to be assigned
401
+ def currency_symbol=(currency_symbol)
402
+ if currency_symbol.nil?
403
+ fail ArgumentError, 'currency_symbol cannot be nil'
404
+ end
405
+
406
+ @currency_symbol = currency_symbol
407
+ end
408
+
409
+ # Custom attribute writer method with validation
410
+ # @param [Object] flag_emoji Value to be assigned
411
+ def flag_emoji=(flag_emoji)
412
+ if flag_emoji.nil?
413
+ fail ArgumentError, 'flag_emoji cannot be nil'
414
+ end
415
+
416
+ @flag_emoji = flag_emoji
417
+ end
418
+
419
+ # Custom attribute writer method with validation
420
+ # @param [Object] flag_unicode Value to be assigned
421
+ def flag_unicode=(flag_unicode)
422
+ if flag_unicode.nil?
423
+ fail ArgumentError, 'flag_unicode cannot be nil'
424
+ end
425
+
426
+ @flag_unicode = flag_unicode
427
+ end
428
+
429
+ # Checks equality by comparing each attribute.
430
+ # @param [Object] Object to be compared
431
+ def ==(o)
432
+ return true if self.equal?(o)
433
+ self.class == o.class &&
434
+ continent == o.continent &&
435
+ continent_name == o.continent_name &&
436
+ country == o.country &&
437
+ country_name == o.country_name &&
438
+ timezone == o.timezone &&
439
+ currency_code == o.currency_code &&
440
+ currency_name == o.currency_name &&
441
+ currency_symbol == o.currency_symbol &&
442
+ flag_emoji == o.flag_emoji &&
443
+ flag_unicode == o.flag_unicode &&
444
+ region == o.region &&
445
+ region_code == o.region_code &&
446
+ city == o.city &&
447
+ postal_code == o.postal_code &&
448
+ latitude == o.latitude &&
449
+ longitude == o.longitude &&
450
+ accuracy_radius == o.accuracy_radius &&
451
+ geoname_id == o.geoname_id &&
452
+ dma_code == o.dma_code &&
453
+ last_changed == o.last_changed
454
+ end
455
+
456
+ # @see the `==` method
457
+ # @param [Object] Object to be compared
458
+ def eql?(o)
459
+ self == o
460
+ end
461
+
462
+ # Calculates hash code according to all attributes.
463
+ # @return [Integer] Hash code
464
+ def hash
465
+ [continent, continent_name, country, country_name, timezone, currency_code, currency_name, currency_symbol, flag_emoji, flag_unicode, region, region_code, city, postal_code, latitude, longitude, accuracy_radius, geoname_id, dma_code, last_changed].hash
466
+ end
467
+
468
+ # Builds the object from hash
469
+ # @param [Hash] attributes Model attributes in the form of hash
470
+ # @return [Object] Returns the model itself
471
+ def self.build_from_hash(attributes)
472
+ return nil unless attributes.is_a?(Hash)
473
+ attributes = attributes.transform_keys(&:to_sym)
474
+ transformed_hash = {}
475
+ openapi_types.each_pair do |key, type|
476
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
477
+ transformed_hash["#{key}"] = nil
478
+ elsif type =~ /\AArray<(.*)>/i
479
+ # check to ensure the input is an array given that the attribute
480
+ # is documented as an array but the input is not
481
+ if attributes[attribute_map[key]].is_a?(Array)
482
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
483
+ end
484
+ elsif !attributes[attribute_map[key]].nil?
485
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
486
+ end
487
+ end
488
+ new(transformed_hash)
489
+ end
490
+
491
+ # Returns the object in the form of hash
492
+ # @return [Hash] Returns the object in the form of hash
493
+ def to_hash
494
+ hash = {}
495
+ self.class.attribute_map.each_pair do |attr, param|
496
+ value = self.send(attr)
497
+ if value.nil?
498
+ is_nullable = self.class.openapi_nullable.include?(attr)
499
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
500
+ end
501
+
502
+ hash[param] = _to_hash(value)
503
+ end
504
+ hash
505
+ end
506
+
507
+ end
508
+
509
+ end