internetdata 2.9.2 → 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 +1 -1
  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,405 @@
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
+ # What every database says about one AS.
18
+ class AsnLookupResponse < ApiModelBase
19
+ # The AS number.
20
+ attr_accessor :asn
21
+
22
+ # Its operator.
23
+ attr_accessor :name
24
+
25
+ # The country its registry assigned it to.
26
+ attr_accessor :country
27
+
28
+ # The registry that allocated it.
29
+ attr_accessor :registry
30
+
31
+ # When.
32
+ attr_accessor :allocated
33
+
34
+ # Its operator's domain.
35
+ attr_accessor :domain
36
+
37
+ # The kind of network it runs. Paid plans and the trial.
38
+ attr_accessor :type
39
+
40
+ # IPv4 addresses it announces. Paid plans and the trial.
41
+ attr_accessor :num_ips
42
+
43
+ # IPv4 prefixes it announces. Paid plans and the trial.
44
+ attr_accessor :num_prefixes4
45
+
46
+ # IPv6 prefixes it announces. Paid plans and the trial.
47
+ attr_accessor :num_prefixes6
48
+
49
+ # Its announcements RPKI calls valid. Paid plans and the trial.
50
+ attr_accessor :rpki_valid
51
+
52
+ # Invalid. Paid plans and the trial.
53
+ attr_accessor :rpki_invalid
54
+
55
+ # With no RPKI record. Paid plans and the trial.
56
+ attr_accessor :rpki_not_found
57
+
58
+ # Its ASN Whois record, every column, empty where the registry states nothing. Paid plans and the trial.
59
+ attr_accessor :whois
60
+
61
+ # What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial.
62
+ attr_accessor :prefixes
63
+
64
+ # On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
65
+ attr_accessor :trial_expired
66
+
67
+ # Attribute mapping from ruby-style variable name to JSON key.
68
+ def self.attribute_map
69
+ {
70
+ :'asn' => :'asn',
71
+ :'name' => :'name',
72
+ :'country' => :'country',
73
+ :'registry' => :'registry',
74
+ :'allocated' => :'allocated',
75
+ :'domain' => :'domain',
76
+ :'type' => :'type',
77
+ :'num_ips' => :'num_ips',
78
+ :'num_prefixes4' => :'num_prefixes4',
79
+ :'num_prefixes6' => :'num_prefixes6',
80
+ :'rpki_valid' => :'rpki_valid',
81
+ :'rpki_invalid' => :'rpki_invalid',
82
+ :'rpki_not_found' => :'rpki_not_found',
83
+ :'whois' => :'whois',
84
+ :'prefixes' => :'prefixes',
85
+ :'trial_expired' => :'trial_expired'
86
+ }
87
+ end
88
+
89
+ # Returns attribute mapping this model knows about
90
+ def self.acceptable_attribute_map
91
+ attribute_map
92
+ end
93
+
94
+ # Returns all the JSON keys this model knows about
95
+ def self.acceptable_attributes
96
+ acceptable_attribute_map.values
97
+ end
98
+
99
+ # Attribute type mapping.
100
+ def self.openapi_types
101
+ {
102
+ :'asn' => :'Integer',
103
+ :'name' => :'String',
104
+ :'country' => :'String',
105
+ :'registry' => :'String',
106
+ :'allocated' => :'String',
107
+ :'domain' => :'String',
108
+ :'type' => :'String',
109
+ :'num_ips' => :'Integer',
110
+ :'num_prefixes4' => :'Integer',
111
+ :'num_prefixes6' => :'Integer',
112
+ :'rpki_valid' => :'Integer',
113
+ :'rpki_invalid' => :'Integer',
114
+ :'rpki_not_found' => :'Integer',
115
+ :'whois' => :'Hash<String, String>',
116
+ :'prefixes' => :'Array<AsnPrefix>',
117
+ :'trial_expired' => :'Boolean'
118
+ }
119
+ end
120
+
121
+ # List of attributes with nullable: true
122
+ def self.openapi_nullable
123
+ Set.new([
124
+ ])
125
+ end
126
+
127
+ # Initializes the object
128
+ # @param [Hash] attributes Model attributes in the form of hash
129
+ def initialize(attributes = {})
130
+ if (!attributes.is_a?(Hash))
131
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::AsnLookupResponse` initialize method"
132
+ end
133
+
134
+ # check to see if the attribute exists and convert string to symbol for hash key
135
+ acceptable_attribute_map = self.class.acceptable_attribute_map
136
+ attributes = attributes.each_with_object({}) { |(k, v), h|
137
+ if (!acceptable_attribute_map.key?(k.to_sym))
138
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::AsnLookupResponse`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
139
+ end
140
+ h[k.to_sym] = v
141
+ }
142
+
143
+ if attributes.key?(:'asn')
144
+ self.asn = attributes[:'asn']
145
+ else
146
+ self.asn = nil
147
+ end
148
+
149
+ if attributes.key?(:'name')
150
+ self.name = attributes[:'name']
151
+ else
152
+ self.name = nil
153
+ end
154
+
155
+ if attributes.key?(:'country')
156
+ self.country = attributes[:'country']
157
+ else
158
+ self.country = nil
159
+ end
160
+
161
+ if attributes.key?(:'registry')
162
+ self.registry = attributes[:'registry']
163
+ else
164
+ self.registry = nil
165
+ end
166
+
167
+ if attributes.key?(:'allocated')
168
+ self.allocated = attributes[:'allocated']
169
+ else
170
+ self.allocated = nil
171
+ end
172
+
173
+ if attributes.key?(:'domain')
174
+ self.domain = attributes[:'domain']
175
+ else
176
+ self.domain = nil
177
+ end
178
+
179
+ if attributes.key?(:'type')
180
+ self.type = attributes[:'type']
181
+ end
182
+
183
+ if attributes.key?(:'num_ips')
184
+ self.num_ips = attributes[:'num_ips']
185
+ end
186
+
187
+ if attributes.key?(:'num_prefixes4')
188
+ self.num_prefixes4 = attributes[:'num_prefixes4']
189
+ end
190
+
191
+ if attributes.key?(:'num_prefixes6')
192
+ self.num_prefixes6 = attributes[:'num_prefixes6']
193
+ end
194
+
195
+ if attributes.key?(:'rpki_valid')
196
+ self.rpki_valid = attributes[:'rpki_valid']
197
+ end
198
+
199
+ if attributes.key?(:'rpki_invalid')
200
+ self.rpki_invalid = attributes[:'rpki_invalid']
201
+ end
202
+
203
+ if attributes.key?(:'rpki_not_found')
204
+ self.rpki_not_found = attributes[:'rpki_not_found']
205
+ end
206
+
207
+ if attributes.key?(:'whois')
208
+ if (value = attributes[:'whois']).is_a?(Hash)
209
+ self.whois = value
210
+ end
211
+ end
212
+
213
+ if attributes.key?(:'prefixes')
214
+ if (value = attributes[:'prefixes']).is_a?(Array)
215
+ self.prefixes = value
216
+ end
217
+ end
218
+
219
+ if attributes.key?(:'trial_expired')
220
+ self.trial_expired = attributes[:'trial_expired']
221
+ end
222
+ end
223
+
224
+ # Show invalid properties with the reasons. Usually used together with valid?
225
+ # @return Array for valid properties with the reasons
226
+ def list_invalid_properties
227
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
228
+ invalid_properties = Array.new
229
+ if @asn.nil?
230
+ invalid_properties.push('invalid value for "asn", asn cannot be nil.')
231
+ end
232
+
233
+ if @name.nil?
234
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
235
+ end
236
+
237
+ if @country.nil?
238
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
239
+ end
240
+
241
+ if @registry.nil?
242
+ invalid_properties.push('invalid value for "registry", registry cannot be nil.')
243
+ end
244
+
245
+ if @allocated.nil?
246
+ invalid_properties.push('invalid value for "allocated", allocated cannot be nil.')
247
+ end
248
+
249
+ if @domain.nil?
250
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
251
+ end
252
+
253
+ invalid_properties
254
+ end
255
+
256
+ # Check to see if the all the properties in the model are valid
257
+ # @return true if the model is valid
258
+ def valid?
259
+ warn '[DEPRECATED] the `valid?` method is obsolete'
260
+ return false if @asn.nil?
261
+ return false if @name.nil?
262
+ return false if @country.nil?
263
+ return false if @registry.nil?
264
+ return false if @allocated.nil?
265
+ return false if @domain.nil?
266
+ true
267
+ end
268
+
269
+ # Custom attribute writer method with validation
270
+ # @param [Object] asn Value to be assigned
271
+ def asn=(asn)
272
+ if asn.nil?
273
+ fail ArgumentError, 'asn cannot be nil'
274
+ end
275
+
276
+ @asn = asn
277
+ end
278
+
279
+ # Custom attribute writer method with validation
280
+ # @param [Object] name Value to be assigned
281
+ def name=(name)
282
+ if name.nil?
283
+ fail ArgumentError, 'name cannot be nil'
284
+ end
285
+
286
+ @name = name
287
+ end
288
+
289
+ # Custom attribute writer method with validation
290
+ # @param [Object] country Value to be assigned
291
+ def country=(country)
292
+ if country.nil?
293
+ fail ArgumentError, 'country cannot be nil'
294
+ end
295
+
296
+ @country = country
297
+ end
298
+
299
+ # Custom attribute writer method with validation
300
+ # @param [Object] registry Value to be assigned
301
+ def registry=(registry)
302
+ if registry.nil?
303
+ fail ArgumentError, 'registry cannot be nil'
304
+ end
305
+
306
+ @registry = registry
307
+ end
308
+
309
+ # Custom attribute writer method with validation
310
+ # @param [Object] allocated Value to be assigned
311
+ def allocated=(allocated)
312
+ if allocated.nil?
313
+ fail ArgumentError, 'allocated cannot be nil'
314
+ end
315
+
316
+ @allocated = allocated
317
+ end
318
+
319
+ # Custom attribute writer method with validation
320
+ # @param [Object] domain Value to be assigned
321
+ def domain=(domain)
322
+ if domain.nil?
323
+ fail ArgumentError, 'domain cannot be nil'
324
+ end
325
+
326
+ @domain = domain
327
+ end
328
+
329
+ # Checks equality by comparing each attribute.
330
+ # @param [Object] Object to be compared
331
+ def ==(o)
332
+ return true if self.equal?(o)
333
+ self.class == o.class &&
334
+ asn == o.asn &&
335
+ name == o.name &&
336
+ country == o.country &&
337
+ registry == o.registry &&
338
+ allocated == o.allocated &&
339
+ domain == o.domain &&
340
+ type == o.type &&
341
+ num_ips == o.num_ips &&
342
+ num_prefixes4 == o.num_prefixes4 &&
343
+ num_prefixes6 == o.num_prefixes6 &&
344
+ rpki_valid == o.rpki_valid &&
345
+ rpki_invalid == o.rpki_invalid &&
346
+ rpki_not_found == o.rpki_not_found &&
347
+ whois == o.whois &&
348
+ prefixes == o.prefixes &&
349
+ trial_expired == o.trial_expired
350
+ end
351
+
352
+ # @see the `==` method
353
+ # @param [Object] Object to be compared
354
+ def eql?(o)
355
+ self == o
356
+ end
357
+
358
+ # Calculates hash code according to all attributes.
359
+ # @return [Integer] Hash code
360
+ def hash
361
+ [asn, name, country, registry, allocated, domain, type, num_ips, num_prefixes4, num_prefixes6, rpki_valid, rpki_invalid, rpki_not_found, whois, prefixes, trial_expired].hash
362
+ end
363
+
364
+ # Builds the object from hash
365
+ # @param [Hash] attributes Model attributes in the form of hash
366
+ # @return [Object] Returns the model itself
367
+ def self.build_from_hash(attributes)
368
+ return nil unless attributes.is_a?(Hash)
369
+ attributes = attributes.transform_keys(&:to_sym)
370
+ transformed_hash = {}
371
+ openapi_types.each_pair do |key, type|
372
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
373
+ transformed_hash["#{key}"] = nil
374
+ elsif type =~ /\AArray<(.*)>/i
375
+ # check to ensure the input is an array given that the attribute
376
+ # is documented as an array but the input is not
377
+ if attributes[attribute_map[key]].is_a?(Array)
378
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
379
+ end
380
+ elsif !attributes[attribute_map[key]].nil?
381
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
382
+ end
383
+ end
384
+ new(transformed_hash)
385
+ end
386
+
387
+ # Returns the object in the form of hash
388
+ # @return [Hash] Returns the object in the form of hash
389
+ def to_hash
390
+ hash = {}
391
+ self.class.attribute_map.each_pair do |attr, param|
392
+ value = self.send(attr)
393
+ if value.nil?
394
+ is_nullable = self.class.openapi_nullable.include?(attr)
395
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
396
+ end
397
+
398
+ hash[param] = _to_hash(value)
399
+ end
400
+ hash
401
+ end
402
+
403
+ end
404
+
405
+ end