internetdata 2.10.0 → 2.11.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.
@@ -96,46 +96,32 @@ module InternetData
96
96
 
97
97
  if attributes.key?(:'entry')
98
98
  self.entry = attributes[:'entry']
99
- else
100
- self.entry = nil
101
99
  end
102
100
 
103
101
  if attributes.key?(:'exit')
104
102
  self.exit = attributes[:'exit']
105
- else
106
- self.exit = nil
107
103
  end
108
104
 
109
105
  if attributes.key?(:'protocols')
110
106
  if (value = attributes[:'protocols']).is_a?(Array)
111
107
  self.protocols = value
112
108
  end
113
- else
114
- self.protocols = nil
115
109
  end
116
110
 
117
111
  if attributes.key?(:'num_ports')
118
112
  self.num_ports = attributes[:'num_ports']
119
- else
120
- self.num_ports = nil
121
113
  end
122
114
 
123
115
  if attributes.key?(:'num_proxies')
124
116
  self.num_proxies = attributes[:'num_proxies']
125
- else
126
- self.num_proxies = nil
127
117
  end
128
118
 
129
119
  if attributes.key?(:'last_seen')
130
120
  self.last_seen = attributes[:'last_seen']
131
- else
132
- self.last_seen = nil
133
121
  end
134
122
 
135
123
  if attributes.key?(:'last_usable')
136
124
  self.last_usable = attributes[:'last_usable']
137
- else
138
- self.last_usable = nil
139
125
  end
140
126
  end
141
127
 
@@ -144,34 +130,6 @@ module InternetData
144
130
  def list_invalid_properties
145
131
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
146
132
  invalid_properties = Array.new
147
- if @entry.nil?
148
- invalid_properties.push('invalid value for "entry", entry cannot be nil.')
149
- end
150
-
151
- if @exit.nil?
152
- invalid_properties.push('invalid value for "exit", exit cannot be nil.')
153
- end
154
-
155
- if @protocols.nil?
156
- invalid_properties.push('invalid value for "protocols", protocols cannot be nil.')
157
- end
158
-
159
- if @num_ports.nil?
160
- invalid_properties.push('invalid value for "num_ports", num_ports cannot be nil.')
161
- end
162
-
163
- if @num_proxies.nil?
164
- invalid_properties.push('invalid value for "num_proxies", num_proxies cannot be nil.')
165
- end
166
-
167
- if @last_seen.nil?
168
- invalid_properties.push('invalid value for "last_seen", last_seen cannot be nil.')
169
- end
170
-
171
- if @last_usable.nil?
172
- invalid_properties.push('invalid value for "last_usable", last_usable cannot be nil.')
173
- end
174
-
175
133
  invalid_properties
176
134
  end
177
135
 
@@ -179,86 +137,9 @@ module InternetData
179
137
  # @return true if the model is valid
180
138
  def valid?
181
139
  warn '[DEPRECATED] the `valid?` method is obsolete'
182
- return false if @entry.nil?
183
- return false if @exit.nil?
184
- return false if @protocols.nil?
185
- return false if @num_ports.nil?
186
- return false if @num_proxies.nil?
187
- return false if @last_seen.nil?
188
- return false if @last_usable.nil?
189
140
  true
190
141
  end
191
142
 
192
- # Custom attribute writer method with validation
193
- # @param [Object] entry Value to be assigned
194
- def entry=(entry)
195
- if entry.nil?
196
- fail ArgumentError, 'entry cannot be nil'
197
- end
198
-
199
- @entry = entry
200
- end
201
-
202
- # Custom attribute writer method with validation
203
- # @param [Object] exit Value to be assigned
204
- def exit=(exit)
205
- if exit.nil?
206
- fail ArgumentError, 'exit cannot be nil'
207
- end
208
-
209
- @exit = exit
210
- end
211
-
212
- # Custom attribute writer method with validation
213
- # @param [Object] protocols Value to be assigned
214
- def protocols=(protocols)
215
- if protocols.nil?
216
- fail ArgumentError, 'protocols cannot be nil'
217
- end
218
-
219
- @protocols = protocols
220
- end
221
-
222
- # Custom attribute writer method with validation
223
- # @param [Object] num_ports Value to be assigned
224
- def num_ports=(num_ports)
225
- if num_ports.nil?
226
- fail ArgumentError, 'num_ports cannot be nil'
227
- end
228
-
229
- @num_ports = num_ports
230
- end
231
-
232
- # Custom attribute writer method with validation
233
- # @param [Object] num_proxies Value to be assigned
234
- def num_proxies=(num_proxies)
235
- if num_proxies.nil?
236
- fail ArgumentError, 'num_proxies cannot be nil'
237
- end
238
-
239
- @num_proxies = num_proxies
240
- end
241
-
242
- # Custom attribute writer method with validation
243
- # @param [Object] last_seen Value to be assigned
244
- def last_seen=(last_seen)
245
- if last_seen.nil?
246
- fail ArgumentError, 'last_seen cannot be nil'
247
- end
248
-
249
- @last_seen = last_seen
250
- end
251
-
252
- # Custom attribute writer method with validation
253
- # @param [Object] last_usable Value to be assigned
254
- def last_usable=(last_usable)
255
- if last_usable.nil?
256
- fail ArgumentError, 'last_usable cannot be nil'
257
- end
258
-
259
- @last_usable = last_usable
260
- end
261
-
262
143
  # Checks equality by comparing each attribute.
263
144
  # @param [Object] Object to be compared
264
145
  def ==(o)
@@ -96,44 +96,30 @@ module InternetData
96
96
 
97
97
  if attributes.key?(:'provider')
98
98
  self.provider = attributes[:'provider']
99
- else
100
- self.provider = nil
101
99
  end
102
100
 
103
101
  if attributes.key?(:'provider_name')
104
102
  self.provider_name = attributes[:'provider_name']
105
- else
106
- self.provider_name = nil
107
103
  end
108
104
 
109
105
  if attributes.key?(:'orbit')
110
106
  self.orbit = attributes[:'orbit']
111
- else
112
- self.orbit = nil
113
107
  end
114
108
 
115
109
  if attributes.key?(:'segment')
116
110
  self.segment = attributes[:'segment']
117
- else
118
- self.segment = nil
119
111
  end
120
112
 
121
113
  if attributes.key?(:'country')
122
114
  self.country = attributes[:'country']
123
- else
124
- self.country = nil
125
115
  end
126
116
 
127
117
  if attributes.key?(:'asn')
128
118
  self.asn = attributes[:'asn']
129
- else
130
- self.asn = nil
131
119
  end
132
120
 
133
121
  if attributes.key?(:'confidence')
134
122
  self.confidence = attributes[:'confidence']
135
- else
136
- self.confidence = nil
137
123
  end
138
124
  end
139
125
 
@@ -142,34 +128,6 @@ module InternetData
142
128
  def list_invalid_properties
143
129
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
144
130
  invalid_properties = Array.new
145
- if @provider.nil?
146
- invalid_properties.push('invalid value for "provider", provider cannot be nil.')
147
- end
148
-
149
- if @provider_name.nil?
150
- invalid_properties.push('invalid value for "provider_name", provider_name cannot be nil.')
151
- end
152
-
153
- if @orbit.nil?
154
- invalid_properties.push('invalid value for "orbit", orbit cannot be nil.')
155
- end
156
-
157
- if @segment.nil?
158
- invalid_properties.push('invalid value for "segment", segment cannot be nil.')
159
- end
160
-
161
- if @country.nil?
162
- invalid_properties.push('invalid value for "country", country cannot be nil.')
163
- end
164
-
165
- if @asn.nil?
166
- invalid_properties.push('invalid value for "asn", asn cannot be nil.')
167
- end
168
-
169
- if @confidence.nil?
170
- invalid_properties.push('invalid value for "confidence", confidence cannot be nil.')
171
- end
172
-
173
131
  invalid_properties
174
132
  end
175
133
 
@@ -177,86 +135,9 @@ module InternetData
177
135
  # @return true if the model is valid
178
136
  def valid?
179
137
  warn '[DEPRECATED] the `valid?` method is obsolete'
180
- return false if @provider.nil?
181
- return false if @provider_name.nil?
182
- return false if @orbit.nil?
183
- return false if @segment.nil?
184
- return false if @country.nil?
185
- return false if @asn.nil?
186
- return false if @confidence.nil?
187
138
  true
188
139
  end
189
140
 
190
- # Custom attribute writer method with validation
191
- # @param [Object] provider Value to be assigned
192
- def provider=(provider)
193
- if provider.nil?
194
- fail ArgumentError, 'provider cannot be nil'
195
- end
196
-
197
- @provider = provider
198
- end
199
-
200
- # Custom attribute writer method with validation
201
- # @param [Object] provider_name Value to be assigned
202
- def provider_name=(provider_name)
203
- if provider_name.nil?
204
- fail ArgumentError, 'provider_name cannot be nil'
205
- end
206
-
207
- @provider_name = provider_name
208
- end
209
-
210
- # Custom attribute writer method with validation
211
- # @param [Object] orbit Value to be assigned
212
- def orbit=(orbit)
213
- if orbit.nil?
214
- fail ArgumentError, 'orbit cannot be nil'
215
- end
216
-
217
- @orbit = orbit
218
- end
219
-
220
- # Custom attribute writer method with validation
221
- # @param [Object] segment Value to be assigned
222
- def segment=(segment)
223
- if segment.nil?
224
- fail ArgumentError, 'segment cannot be nil'
225
- end
226
-
227
- @segment = segment
228
- end
229
-
230
- # Custom attribute writer method with validation
231
- # @param [Object] country Value to be assigned
232
- def country=(country)
233
- if country.nil?
234
- fail ArgumentError, 'country cannot be nil'
235
- end
236
-
237
- @country = country
238
- end
239
-
240
- # Custom attribute writer method with validation
241
- # @param [Object] asn Value to be assigned
242
- def asn=(asn)
243
- if asn.nil?
244
- fail ArgumentError, 'asn cannot be nil'
245
- end
246
-
247
- @asn = asn
248
- end
249
-
250
- # Custom attribute writer method with validation
251
- # @param [Object] confidence Value to be assigned
252
- def confidence=(confidence)
253
- if confidence.nil?
254
- fail ArgumentError, 'confidence cannot be nil'
255
- end
256
-
257
- @confidence = confidence
258
- end
259
-
260
141
  # Checks equality by comparing each attribute.
261
142
  # @param [Object] Object to be compared
262
143
  def ==(o)
@@ -86,32 +86,22 @@ module InternetData
86
86
 
87
87
  if attributes.key?(:'port')
88
88
  self.port = attributes[:'port']
89
- else
90
- self.port = nil
91
89
  end
92
90
 
93
91
  if attributes.key?(:'banner')
94
92
  self.banner = attributes[:'banner']
95
- else
96
- self.banner = nil
97
93
  end
98
94
 
99
95
  if attributes.key?(:'session_ok')
100
96
  self.session_ok = attributes[:'session_ok']
101
- else
102
- self.session_ok = nil
103
97
  end
104
98
 
105
99
  if attributes.key?(:'first_seen')
106
100
  self.first_seen = attributes[:'first_seen']
107
- else
108
- self.first_seen = nil
109
101
  end
110
102
 
111
103
  if attributes.key?(:'last_seen')
112
104
  self.last_seen = attributes[:'last_seen']
113
- else
114
- self.last_seen = nil
115
105
  end
116
106
  end
117
107
 
@@ -120,26 +110,6 @@ module InternetData
120
110
  def list_invalid_properties
121
111
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
122
112
  invalid_properties = Array.new
123
- if @port.nil?
124
- invalid_properties.push('invalid value for "port", port cannot be nil.')
125
- end
126
-
127
- if @banner.nil?
128
- invalid_properties.push('invalid value for "banner", banner cannot be nil.')
129
- end
130
-
131
- if @session_ok.nil?
132
- invalid_properties.push('invalid value for "session_ok", session_ok cannot be nil.')
133
- end
134
-
135
- if @first_seen.nil?
136
- invalid_properties.push('invalid value for "first_seen", first_seen cannot be nil.')
137
- end
138
-
139
- if @last_seen.nil?
140
- invalid_properties.push('invalid value for "last_seen", last_seen cannot be nil.')
141
- end
142
-
143
113
  invalid_properties
144
114
  end
145
115
 
@@ -147,64 +117,9 @@ module InternetData
147
117
  # @return true if the model is valid
148
118
  def valid?
149
119
  warn '[DEPRECATED] the `valid?` method is obsolete'
150
- return false if @port.nil?
151
- return false if @banner.nil?
152
- return false if @session_ok.nil?
153
- return false if @first_seen.nil?
154
- return false if @last_seen.nil?
155
120
  true
156
121
  end
157
122
 
158
- # Custom attribute writer method with validation
159
- # @param [Object] port Value to be assigned
160
- def port=(port)
161
- if port.nil?
162
- fail ArgumentError, 'port cannot be nil'
163
- end
164
-
165
- @port = port
166
- end
167
-
168
- # Custom attribute writer method with validation
169
- # @param [Object] banner Value to be assigned
170
- def banner=(banner)
171
- if banner.nil?
172
- fail ArgumentError, 'banner cannot be nil'
173
- end
174
-
175
- @banner = banner
176
- end
177
-
178
- # Custom attribute writer method with validation
179
- # @param [Object] session_ok Value to be assigned
180
- def session_ok=(session_ok)
181
- if session_ok.nil?
182
- fail ArgumentError, 'session_ok cannot be nil'
183
- end
184
-
185
- @session_ok = session_ok
186
- end
187
-
188
- # Custom attribute writer method with validation
189
- # @param [Object] first_seen Value to be assigned
190
- def first_seen=(first_seen)
191
- if first_seen.nil?
192
- fail ArgumentError, 'first_seen cannot be nil'
193
- end
194
-
195
- @first_seen = first_seen
196
- end
197
-
198
- # Custom attribute writer method with validation
199
- # @param [Object] last_seen Value to be assigned
200
- def last_seen=(last_seen)
201
- if last_seen.nil?
202
- fail ArgumentError, 'last_seen cannot be nil'
203
- end
204
-
205
- @last_seen = last_seen
206
- end
207
-
208
123
  # Checks equality by comparing each attribute.
209
124
  # @param [Object] Object to be compared
210
125
  def ==(o)
@@ -91,38 +91,26 @@ module InternetData
91
91
 
92
92
  if attributes.key?(:'port')
93
93
  self.port = attributes[:'port']
94
- else
95
- self.port = nil
96
94
  end
97
95
 
98
96
  if attributes.key?(:'banner')
99
97
  self.banner = attributes[:'banner']
100
- else
101
- self.banner = nil
102
98
  end
103
99
 
104
100
  if attributes.key?(:'host_key_fp')
105
101
  self.host_key_fp = attributes[:'host_key_fp']
106
- else
107
- self.host_key_fp = nil
108
102
  end
109
103
 
110
104
  if attributes.key?(:'session_ok')
111
105
  self.session_ok = attributes[:'session_ok']
112
- else
113
- self.session_ok = nil
114
106
  end
115
107
 
116
108
  if attributes.key?(:'first_seen')
117
109
  self.first_seen = attributes[:'first_seen']
118
- else
119
- self.first_seen = nil
120
110
  end
121
111
 
122
112
  if attributes.key?(:'last_seen')
123
113
  self.last_seen = attributes[:'last_seen']
124
- else
125
- self.last_seen = nil
126
114
  end
127
115
  end
128
116
 
@@ -131,30 +119,6 @@ module InternetData
131
119
  def list_invalid_properties
132
120
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
133
121
  invalid_properties = Array.new
134
- if @port.nil?
135
- invalid_properties.push('invalid value for "port", port cannot be nil.')
136
- end
137
-
138
- if @banner.nil?
139
- invalid_properties.push('invalid value for "banner", banner cannot be nil.')
140
- end
141
-
142
- if @host_key_fp.nil?
143
- invalid_properties.push('invalid value for "host_key_fp", host_key_fp cannot be nil.')
144
- end
145
-
146
- if @session_ok.nil?
147
- invalid_properties.push('invalid value for "session_ok", session_ok cannot be nil.')
148
- end
149
-
150
- if @first_seen.nil?
151
- invalid_properties.push('invalid value for "first_seen", first_seen cannot be nil.')
152
- end
153
-
154
- if @last_seen.nil?
155
- invalid_properties.push('invalid value for "last_seen", last_seen cannot be nil.')
156
- end
157
-
158
122
  invalid_properties
159
123
  end
160
124
 
@@ -162,75 +126,9 @@ module InternetData
162
126
  # @return true if the model is valid
163
127
  def valid?
164
128
  warn '[DEPRECATED] the `valid?` method is obsolete'
165
- return false if @port.nil?
166
- return false if @banner.nil?
167
- return false if @host_key_fp.nil?
168
- return false if @session_ok.nil?
169
- return false if @first_seen.nil?
170
- return false if @last_seen.nil?
171
129
  true
172
130
  end
173
131
 
174
- # Custom attribute writer method with validation
175
- # @param [Object] port Value to be assigned
176
- def port=(port)
177
- if port.nil?
178
- fail ArgumentError, 'port cannot be nil'
179
- end
180
-
181
- @port = port
182
- end
183
-
184
- # Custom attribute writer method with validation
185
- # @param [Object] banner Value to be assigned
186
- def banner=(banner)
187
- if banner.nil?
188
- fail ArgumentError, 'banner cannot be nil'
189
- end
190
-
191
- @banner = banner
192
- end
193
-
194
- # Custom attribute writer method with validation
195
- # @param [Object] host_key_fp Value to be assigned
196
- def host_key_fp=(host_key_fp)
197
- if host_key_fp.nil?
198
- fail ArgumentError, 'host_key_fp cannot be nil'
199
- end
200
-
201
- @host_key_fp = host_key_fp
202
- end
203
-
204
- # Custom attribute writer method with validation
205
- # @param [Object] session_ok Value to be assigned
206
- def session_ok=(session_ok)
207
- if session_ok.nil?
208
- fail ArgumentError, 'session_ok cannot be nil'
209
- end
210
-
211
- @session_ok = session_ok
212
- end
213
-
214
- # Custom attribute writer method with validation
215
- # @param [Object] first_seen Value to be assigned
216
- def first_seen=(first_seen)
217
- if first_seen.nil?
218
- fail ArgumentError, 'first_seen cannot be nil'
219
- end
220
-
221
- @first_seen = first_seen
222
- end
223
-
224
- # Custom attribute writer method with validation
225
- # @param [Object] last_seen Value to be assigned
226
- def last_seen=(last_seen)
227
- if last_seen.nil?
228
- fail ArgumentError, 'last_seen cannot be nil'
229
- end
230
-
231
- @last_seen = last_seen
232
- end
233
-
234
132
  # Checks equality by comparing each attribute.
235
133
  # @param [Object] Object to be compared
236
134
  def ==(o)
@@ -64,6 +64,10 @@ module InternetData
64
64
  self.scheme = uri.scheme
65
65
  self.host = uri.port == uri.default_port ? uri.host : "#{uri.host}:#{uri.port}"
66
66
  self.base_path = uri.path
67
+ # Every request goes to this base URL. The spec gives each lookup path a
68
+ # server of its own, production's, which an operation the generator
69
+ # emitted would otherwise be sent to whatever base URL the client has.
70
+ self.ignore_operation_servers = true
67
71
  self.access_token = Transport.checked_key(api_key)
68
72
  self.timeout = timeout.nil? ? nil : Transport.checked_timeout(timeout)
69
73
  end
@@ -349,23 +353,23 @@ module InternetData
349
353
  # there and not null: the generated reader skips the writer of a list or map
350
354
  # member that is not one, so `"versions": null` came back as a family with no
351
355
  # versions (2.8.1, measured 2026-10-19). A member the spec does not require is
352
- # one a plan may leave out. test/database_test.rb holds this to
356
+ # one a plan may leave out, every member of a detail object among them, which
357
+ # is `{}` under a false flag. test/database_test.rb holds this to
353
358
  # spec/openapi.yaml.
354
359
  REQUIRED = {
355
360
  'LookupResponse' => %i[ip is_bogon is_tor is_relay is_anycast is_carrier is_satellite is_ssh is_smtp
356
361
  is_web is_dns_resolver is_bittorrent tor relay location asn company hostname abuse],
357
- 'ClassDetail' => %i[provider provider_name confidence last_seen],
358
- 'ProxyDetail' => %i[provider provider_name first_seen last_seen hits hits_days_pct providers_num],
359
- 'PubproxyDetail' => %i[entry exit protocols num_ports num_proxies last_seen last_usable],
360
- 'CarrierDetail' => %i[name mcc mnc country confidence],
361
- 'SatelliteDetail' => %i[provider provider_name orbit segment country asn confidence],
362
- 'SshDetail' => %i[port banner host_key_fp session_ok first_seen last_seen],
363
- 'SmtpDetail' => %i[port banner session_ok first_seen last_seen],
362
+ 'ClassDetail' => [],
363
+ 'ProxyDetail' => [],
364
+ 'PubproxyDetail' => [],
365
+ 'CarrierDetail' => [],
366
+ 'SatelliteDetail' => [],
367
+ 'SshDetail' => [],
368
+ 'SmtpDetail' => [],
364
369
  'WebDetail' => %i[port tls_ok session_ok status_code server location title cert_subject_cn
365
370
  cert_subject_o cert_issuer_dn cert_browser_trusted tls_version first_seen last_seen],
366
- 'DnsResolverDetail' => %i[port recursion_available rcode answer_correct first_seen last_seen],
367
- 'BitTorrentDetail' => %i[verified id_matches_ip first_seen last_seen last_reachable days_seen num_ports
368
- peak_num_ports indexer clients],
371
+ 'DnsResolverDetail' => [],
372
+ 'BitTorrentDetail' => [],
369
373
  'Location' => %i[continent continent_name country country_name timezone currency_code currency_name
370
374
  currency_symbol flag_emoji flag_unicode],
371
375
  'Asn' => %i[asn name domain type prefix],
@@ -384,7 +388,7 @@ module InternetData
384
388
  'DnsCnameRecord' => %i[target last_seen],
385
389
  'DomainIpRanges' => %i[domain redirects_to total ipv4 ranges],
386
390
  'DomainIpRange' => %i[range name country],
387
- 'DisposableDetail' => %i[confidence providers first_seen last_seen],
391
+ 'DisposableDetail' => [],
388
392
  'BatchLookupError' => %i[status error],
389
393
  'Entitlement' => %i[org_id apikey plan usage],
390
394
  'EntitlementApikey' => %i[id expires allowed_cidrs],
@@ -401,13 +405,6 @@ module InternetData
401
405
  'Download' => %i[dataset_id format outcome sample open bytes http_status apikey_id client_ip user_agent created],
402
406
  }.freeze
403
407
 
404
- # The detail objects, each `{}` under a false flag (the spec's `allOf`
405
- # members), so an empty one is present and empty, while a populated one
406
- # carries every member the spec requires of it. test/database_test.rb holds
407
- # this to spec/openapi.yaml.
408
- DETAILS = %w[ClassDetail ProxyDetail PubproxyDetail CarrierDetail SatelliteDetail SshDetail SmtpDetail
409
- DnsResolverDetail BitTorrentDetail DisposableDetail].freeze
410
-
411
408
  # RFC 3339's full-date, the spec's `date`, and its date-time, the spec's
412
409
  # `date-time`, its `T` and `Z` in either case, as RFC 3339 allows: through
413
410
  # 2.8.4 a lowercase one failed the call. Anything else reached the
@@ -452,8 +449,7 @@ module InternetData
452
449
  else
453
450
  model = InternetData.const_get(type)
454
451
  if model.respond_to?(:openapi_types)
455
- value.is_a?(Hash) && ((value.empty? && DETAILS.include?(type)) ||
456
- model.openapi_types.all? { |attr, member| check_member!(model, attr, member, value, where) })
452
+ value.is_a?(Hash) && model.openapi_types.all? { |attr, member| check_member!(model, attr, member, value, where) }
457
453
  else
458
454
  value.is_a?(String) # an enum
459
455
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module InternetData
4
- VERSION = '2.10.0'
4
+ VERSION = '2.11.0'
5
5
  end