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,219 @@
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
+ class DomainIpRange < ApiModelBase
18
+ # The range.
19
+ attr_accessor :range
20
+
21
+ # Its registry name.
22
+ attr_accessor :name
23
+
24
+ # ISO 3166 country code.
25
+ attr_accessor :country
26
+
27
+ # Attribute mapping from ruby-style variable name to JSON key.
28
+ def self.attribute_map
29
+ {
30
+ :'range' => :'range',
31
+ :'name' => :'name',
32
+ :'country' => :'country'
33
+ }
34
+ end
35
+
36
+ # Returns attribute mapping this model knows about
37
+ def self.acceptable_attribute_map
38
+ attribute_map
39
+ end
40
+
41
+ # Returns all the JSON keys this model knows about
42
+ def self.acceptable_attributes
43
+ acceptable_attribute_map.values
44
+ end
45
+
46
+ # Attribute type mapping.
47
+ def self.openapi_types
48
+ {
49
+ :'range' => :'String',
50
+ :'name' => :'String',
51
+ :'country' => :'String'
52
+ }
53
+ end
54
+
55
+ # List of attributes with nullable: true
56
+ def self.openapi_nullable
57
+ Set.new([
58
+ ])
59
+ end
60
+
61
+ # Initializes the object
62
+ # @param [Hash] attributes Model attributes in the form of hash
63
+ def initialize(attributes = {})
64
+ if (!attributes.is_a?(Hash))
65
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::DomainIpRange` initialize method"
66
+ end
67
+
68
+ # check to see if the attribute exists and convert string to symbol for hash key
69
+ acceptable_attribute_map = self.class.acceptable_attribute_map
70
+ attributes = attributes.each_with_object({}) { |(k, v), h|
71
+ if (!acceptable_attribute_map.key?(k.to_sym))
72
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::DomainIpRange`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
73
+ end
74
+ h[k.to_sym] = v
75
+ }
76
+
77
+ if attributes.key?(:'range')
78
+ self.range = attributes[:'range']
79
+ else
80
+ self.range = nil
81
+ end
82
+
83
+ if attributes.key?(:'name')
84
+ self.name = attributes[:'name']
85
+ else
86
+ self.name = nil
87
+ end
88
+
89
+ if attributes.key?(:'country')
90
+ self.country = attributes[:'country']
91
+ else
92
+ self.country = nil
93
+ end
94
+ end
95
+
96
+ # Show invalid properties with the reasons. Usually used together with valid?
97
+ # @return Array for valid properties with the reasons
98
+ def list_invalid_properties
99
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
100
+ invalid_properties = Array.new
101
+ if @range.nil?
102
+ invalid_properties.push('invalid value for "range", range cannot be nil.')
103
+ end
104
+
105
+ if @name.nil?
106
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
107
+ end
108
+
109
+ if @country.nil?
110
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
111
+ end
112
+
113
+ invalid_properties
114
+ end
115
+
116
+ # Check to see if the all the properties in the model are valid
117
+ # @return true if the model is valid
118
+ def valid?
119
+ warn '[DEPRECATED] the `valid?` method is obsolete'
120
+ return false if @range.nil?
121
+ return false if @name.nil?
122
+ return false if @country.nil?
123
+ true
124
+ end
125
+
126
+ # Custom attribute writer method with validation
127
+ # @param [Object] range Value to be assigned
128
+ def range=(range)
129
+ if range.nil?
130
+ fail ArgumentError, 'range cannot be nil'
131
+ end
132
+
133
+ @range = range
134
+ end
135
+
136
+ # Custom attribute writer method with validation
137
+ # @param [Object] name Value to be assigned
138
+ def name=(name)
139
+ if name.nil?
140
+ fail ArgumentError, 'name cannot be nil'
141
+ end
142
+
143
+ @name = name
144
+ end
145
+
146
+ # Custom attribute writer method with validation
147
+ # @param [Object] country Value to be assigned
148
+ def country=(country)
149
+ if country.nil?
150
+ fail ArgumentError, 'country cannot be nil'
151
+ end
152
+
153
+ @country = country
154
+ end
155
+
156
+ # Checks equality by comparing each attribute.
157
+ # @param [Object] Object to be compared
158
+ def ==(o)
159
+ return true if self.equal?(o)
160
+ self.class == o.class &&
161
+ range == o.range &&
162
+ name == o.name &&
163
+ country == o.country
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Integer] Hash code
174
+ def hash
175
+ [range, name, country].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def self.build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ attributes = attributes.transform_keys(&:to_sym)
184
+ transformed_hash = {}
185
+ openapi_types.each_pair do |key, type|
186
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
187
+ transformed_hash["#{key}"] = nil
188
+ elsif type =~ /\AArray<(.*)>/i
189
+ # check to ensure the input is an array given that the attribute
190
+ # is documented as an array but the input is not
191
+ if attributes[attribute_map[key]].is_a?(Array)
192
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
193
+ end
194
+ elsif !attributes[attribute_map[key]].nil?
195
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
196
+ end
197
+ end
198
+ new(transformed_hash)
199
+ end
200
+
201
+ # Returns the object in the form of hash
202
+ # @return [Hash] Returns the object in the form of hash
203
+ def to_hash
204
+ hash = {}
205
+ self.class.attribute_map.each_pair do |attr, param|
206
+ value = self.send(attr)
207
+ if value.nil?
208
+ is_nullable = self.class.openapi_nullable.include?(attr)
209
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
210
+ end
211
+
212
+ hash[param] = _to_hash(value)
213
+ end
214
+ hash
215
+ end
216
+
217
+ end
218
+
219
+ end
@@ -0,0 +1,276 @@
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
+ # The organization's IP ranges, from Domain IP Ranges. Paid plans and the trial.
18
+ class DomainIpRanges < ApiModelBase
19
+ # The organization's domain.
20
+ attr_accessor :domain
21
+
22
+ # Where its home page redirects, when that is how it was reached.
23
+ attr_accessor :redirects_to
24
+
25
+ # How many ranges it holds.
26
+ attr_accessor :total
27
+
28
+ # IPv4 addresses across them.
29
+ attr_accessor :ipv4
30
+
31
+ # The first 1000, IPv4 before IPv6, the largest first.
32
+ attr_accessor :ranges
33
+
34
+ # Attribute mapping from ruby-style variable name to JSON key.
35
+ def self.attribute_map
36
+ {
37
+ :'domain' => :'domain',
38
+ :'redirects_to' => :'redirects_to',
39
+ :'total' => :'total',
40
+ :'ipv4' => :'ipv4',
41
+ :'ranges' => :'ranges'
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
+ :'domain' => :'String',
59
+ :'redirects_to' => :'String',
60
+ :'total' => :'Integer',
61
+ :'ipv4' => :'Integer',
62
+ :'ranges' => :'Array<DomainIpRange>'
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 `InternetData::DomainIpRanges` 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 `InternetData::DomainIpRanges`. 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?(:'domain')
89
+ self.domain = attributes[:'domain']
90
+ else
91
+ self.domain = nil
92
+ end
93
+
94
+ if attributes.key?(:'redirects_to')
95
+ self.redirects_to = attributes[:'redirects_to']
96
+ else
97
+ self.redirects_to = nil
98
+ end
99
+
100
+ if attributes.key?(:'total')
101
+ self.total = attributes[:'total']
102
+ else
103
+ self.total = nil
104
+ end
105
+
106
+ if attributes.key?(:'ipv4')
107
+ self.ipv4 = attributes[:'ipv4']
108
+ else
109
+ self.ipv4 = nil
110
+ end
111
+
112
+ if attributes.key?(:'ranges')
113
+ if (value = attributes[:'ranges']).is_a?(Array)
114
+ self.ranges = value
115
+ end
116
+ else
117
+ self.ranges = nil
118
+ end
119
+ end
120
+
121
+ # Show invalid properties with the reasons. Usually used together with valid?
122
+ # @return Array for valid properties with the reasons
123
+ def list_invalid_properties
124
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
125
+ invalid_properties = Array.new
126
+ if @domain.nil?
127
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
128
+ end
129
+
130
+ if @redirects_to.nil?
131
+ invalid_properties.push('invalid value for "redirects_to", redirects_to cannot be nil.')
132
+ end
133
+
134
+ if @total.nil?
135
+ invalid_properties.push('invalid value for "total", total cannot be nil.')
136
+ end
137
+
138
+ if @ipv4.nil?
139
+ invalid_properties.push('invalid value for "ipv4", ipv4 cannot be nil.')
140
+ end
141
+
142
+ if @ranges.nil?
143
+ invalid_properties.push('invalid value for "ranges", ranges cannot be nil.')
144
+ end
145
+
146
+ invalid_properties
147
+ end
148
+
149
+ # Check to see if the all the properties in the model are valid
150
+ # @return true if the model is valid
151
+ def valid?
152
+ warn '[DEPRECATED] the `valid?` method is obsolete'
153
+ return false if @domain.nil?
154
+ return false if @redirects_to.nil?
155
+ return false if @total.nil?
156
+ return false if @ipv4.nil?
157
+ return false if @ranges.nil?
158
+ true
159
+ end
160
+
161
+ # Custom attribute writer method with validation
162
+ # @param [Object] domain Value to be assigned
163
+ def domain=(domain)
164
+ if domain.nil?
165
+ fail ArgumentError, 'domain cannot be nil'
166
+ end
167
+
168
+ @domain = domain
169
+ end
170
+
171
+ # Custom attribute writer method with validation
172
+ # @param [Object] redirects_to Value to be assigned
173
+ def redirects_to=(redirects_to)
174
+ if redirects_to.nil?
175
+ fail ArgumentError, 'redirects_to cannot be nil'
176
+ end
177
+
178
+ @redirects_to = redirects_to
179
+ end
180
+
181
+ # Custom attribute writer method with validation
182
+ # @param [Object] total Value to be assigned
183
+ def total=(total)
184
+ if total.nil?
185
+ fail ArgumentError, 'total cannot be nil'
186
+ end
187
+
188
+ @total = total
189
+ end
190
+
191
+ # Custom attribute writer method with validation
192
+ # @param [Object] ipv4 Value to be assigned
193
+ def ipv4=(ipv4)
194
+ if ipv4.nil?
195
+ fail ArgumentError, 'ipv4 cannot be nil'
196
+ end
197
+
198
+ @ipv4 = ipv4
199
+ end
200
+
201
+ # Custom attribute writer method with validation
202
+ # @param [Object] ranges Value to be assigned
203
+ def ranges=(ranges)
204
+ if ranges.nil?
205
+ fail ArgumentError, 'ranges cannot be nil'
206
+ end
207
+
208
+ @ranges = ranges
209
+ end
210
+
211
+ # Checks equality by comparing each attribute.
212
+ # @param [Object] Object to be compared
213
+ def ==(o)
214
+ return true if self.equal?(o)
215
+ self.class == o.class &&
216
+ domain == o.domain &&
217
+ redirects_to == o.redirects_to &&
218
+ total == o.total &&
219
+ ipv4 == o.ipv4 &&
220
+ ranges == o.ranges
221
+ end
222
+
223
+ # @see the `==` method
224
+ # @param [Object] Object to be compared
225
+ def eql?(o)
226
+ self == o
227
+ end
228
+
229
+ # Calculates hash code according to all attributes.
230
+ # @return [Integer] Hash code
231
+ def hash
232
+ [domain, redirects_to, total, ipv4, ranges].hash
233
+ end
234
+
235
+ # Builds the object from hash
236
+ # @param [Hash] attributes Model attributes in the form of hash
237
+ # @return [Object] Returns the model itself
238
+ def self.build_from_hash(attributes)
239
+ return nil unless attributes.is_a?(Hash)
240
+ attributes = attributes.transform_keys(&:to_sym)
241
+ transformed_hash = {}
242
+ openapi_types.each_pair do |key, type|
243
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
244
+ transformed_hash["#{key}"] = nil
245
+ elsif type =~ /\AArray<(.*)>/i
246
+ # check to ensure the input is an array given that the attribute
247
+ # is documented as an array but the input is not
248
+ if attributes[attribute_map[key]].is_a?(Array)
249
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
250
+ end
251
+ elsif !attributes[attribute_map[key]].nil?
252
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
253
+ end
254
+ end
255
+ new(transformed_hash)
256
+ end
257
+
258
+ # Returns the object in the form of hash
259
+ # @return [Hash] Returns the object in the form of hash
260
+ def to_hash
261
+ hash = {}
262
+ self.class.attribute_map.each_pair do |attr, param|
263
+ value = self.send(attr)
264
+ if value.nil?
265
+ is_nullable = self.class.openapi_nullable.include?(attr)
266
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
267
+ end
268
+
269
+ hash[param] = _to_hash(value)
270
+ end
271
+ hash
272
+ end
273
+
274
+ end
275
+
276
+ end