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.
- checksums.yaml +4 -4
- data/README.md +146 -9
- data/lib/internetdata/api/database_v2_api.rb +2 -2
- data/lib/internetdata/api_client.rb +2 -2
- data/lib/internetdata/api_error.rb +2 -2
- data/lib/internetdata/api_model_base.rb +2 -2
- data/lib/internetdata/asn_result.rb +107 -0
- data/lib/internetdata/bogon.rb +87 -0
- data/lib/internetdata/bogons.rb +93 -0
- data/lib/internetdata/cache.rb +35 -0
- data/lib/internetdata/client.rb +388 -16
- data/lib/internetdata/configuration.rb +23 -2
- data/lib/internetdata/domain_result.rb +124 -0
- data/lib/internetdata/errors.rb +29 -6
- data/lib/internetdata/models/abuse_contact.rb +236 -0
- data/lib/internetdata/models/asn.rb +294 -0
- data/lib/internetdata/models/asn_lookup_response.rb +405 -0
- data/lib/internetdata/models/asn_prefix.rb +329 -0
- data/lib/internetdata/models/batch_lookup_error.rb +192 -0
- data/lib/internetdata/models/bit_torrent_detail.rb +410 -0
- data/lib/internetdata/models/carrier_detail.rb +273 -0
- data/lib/internetdata/models/class_detail.rb +246 -0
- data/lib/internetdata/models/client_registration.rb +2 -2
- data/lib/internetdata/models/company.rb +213 -0
- data/lib/internetdata/models/database.rb +2 -2
- data/lib/internetdata/models/database_checksums_response.rb +2 -2
- data/lib/internetdata/models/database_format.rb +2 -2
- data/lib/internetdata/models/database_list.rb +2 -2
- data/lib/internetdata/models/database_metadata.rb +2 -2
- data/lib/internetdata/models/database_metadata_column.rb +2 -2
- data/lib/internetdata/models/database_version.rb +2 -2
- data/lib/internetdata/models/db_checksums.rb +2 -2
- data/lib/internetdata/models/device_authorization.rb +2 -2
- data/lib/internetdata/models/disposable_detail.rb +248 -0
- data/lib/internetdata/models/dns_address_record.rb +192 -0
- data/lib/internetdata/models/dns_cname_record.rb +192 -0
- data/lib/internetdata/models/dns_mx_record.rb +219 -0
- data/lib/internetdata/models/dns_ns_record.rb +192 -0
- data/lib/internetdata/models/dns_resolver_detail.rb +300 -0
- data/lib/internetdata/models/domain_dns.rb +279 -0
- data/lib/internetdata/models/domain_ip_range.rb +219 -0
- data/lib/internetdata/models/domain_ip_ranges.rb +276 -0
- data/lib/internetdata/models/domain_lookup_response.rb +376 -0
- data/lib/internetdata/models/download.rb +2 -2
- data/lib/internetdata/models/download_list.rb +2 -2
- data/lib/internetdata/models/entitlement.rb +243 -0
- data/lib/internetdata/models/entitlement_apikey.rb +207 -0
- data/lib/internetdata/models/entitlement_plan.rb +216 -0
- data/lib/internetdata/models/entitlement_usage.rb +259 -0
- data/lib/internetdata/models/error_envelope.rb +2 -2
- data/lib/internetdata/models/hosted_domains.rb +166 -0
- data/lib/internetdata/models/location.rb +509 -0
- data/lib/internetdata/models/lookup_response.rb +897 -0
- data/lib/internetdata/models/oauth_metadata.rb +2 -2
- data/lib/internetdata/models/proxy_detail.rb +327 -0
- data/lib/internetdata/models/pubproxy_detail.rb +329 -0
- data/lib/internetdata/models/rwhois.rb +301 -0
- data/lib/internetdata/models/satellite_detail.rb +327 -0
- data/lib/internetdata/models/smtp_detail.rb +273 -0
- data/lib/internetdata/models/ssh_detail.rb +300 -0
- data/lib/internetdata/models/standing.rb +2 -2
- data/lib/internetdata/models/token_response.rb +2 -2
- data/lib/internetdata/models/web_detail.rb +516 -0
- data/lib/internetdata/models/whois.rb +382 -0
- data/lib/internetdata/oauth_api.rb +12 -5
- data/lib/internetdata/result.rb +431 -0
- data/lib/internetdata/transport.rb +215 -27
- data/lib/internetdata/version.rb +1 -1
- data/lib/internetdata.rb +17 -2
- metadata +58 -3
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
=begin
|
|
2
2
|
#InternetData API
|
|
3
3
|
|
|
4
|
-
#The InternetData API: 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.
|
|
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
5
|
|
|
6
|
-
The version of the OpenAPI document: 2026.11.
|
|
6
|
+
The version of the OpenAPI document: 2026.11.13
|
|
7
7
|
Contact: support@internetdata.io
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.25.0
|
|
@@ -0,0 +1,327 @@
|
|
|
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 ProxyDetail < ApiModelBase
|
|
18
|
+
# The proxy pool's ID in its catalog, empty where unattributed.
|
|
19
|
+
attr_accessor :provider
|
|
20
|
+
|
|
21
|
+
# The name the catalog gives it.
|
|
22
|
+
attr_accessor :provider_name
|
|
23
|
+
|
|
24
|
+
# The first day of the window the address was seen as an exit.
|
|
25
|
+
attr_accessor :first_seen
|
|
26
|
+
|
|
27
|
+
# The last day it was.
|
|
28
|
+
attr_accessor :last_seen
|
|
29
|
+
|
|
30
|
+
# How many times it was seen in the window.
|
|
31
|
+
attr_accessor :hits
|
|
32
|
+
|
|
33
|
+
# On what share of the window's days, in percent.
|
|
34
|
+
attr_accessor :hits_days_pct
|
|
35
|
+
|
|
36
|
+
# How many pools it was seen in.
|
|
37
|
+
attr_accessor :providers_num
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'provider' => :'provider',
|
|
43
|
+
:'provider_name' => :'provider_name',
|
|
44
|
+
:'first_seen' => :'first_seen',
|
|
45
|
+
:'last_seen' => :'last_seen',
|
|
46
|
+
:'hits' => :'hits',
|
|
47
|
+
:'hits_days_pct' => :'hits_days_pct',
|
|
48
|
+
:'providers_num' => :'providers_num'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'provider' => :'String',
|
|
66
|
+
:'provider_name' => :'String',
|
|
67
|
+
:'first_seen' => :'String',
|
|
68
|
+
:'last_seen' => :'String',
|
|
69
|
+
:'hits' => :'Integer',
|
|
70
|
+
:'hits_days_pct' => :'Integer',
|
|
71
|
+
:'providers_num' => :'Integer'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List of attributes with nullable: true
|
|
76
|
+
def self.openapi_nullable
|
|
77
|
+
Set.new([
|
|
78
|
+
])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::ProxyDetail` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::ProxyDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'provider')
|
|
98
|
+
self.provider = attributes[:'provider']
|
|
99
|
+
else
|
|
100
|
+
self.provider = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'provider_name')
|
|
104
|
+
self.provider_name = attributes[:'provider_name']
|
|
105
|
+
else
|
|
106
|
+
self.provider_name = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'first_seen')
|
|
110
|
+
self.first_seen = attributes[:'first_seen']
|
|
111
|
+
else
|
|
112
|
+
self.first_seen = nil
|
|
113
|
+
end
|
|
114
|
+
|
|
115
|
+
if attributes.key?(:'last_seen')
|
|
116
|
+
self.last_seen = attributes[:'last_seen']
|
|
117
|
+
else
|
|
118
|
+
self.last_seen = nil
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
if attributes.key?(:'hits')
|
|
122
|
+
self.hits = attributes[:'hits']
|
|
123
|
+
else
|
|
124
|
+
self.hits = nil
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
if attributes.key?(:'hits_days_pct')
|
|
128
|
+
self.hits_days_pct = attributes[:'hits_days_pct']
|
|
129
|
+
else
|
|
130
|
+
self.hits_days_pct = nil
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
if attributes.key?(:'providers_num')
|
|
134
|
+
self.providers_num = attributes[:'providers_num']
|
|
135
|
+
else
|
|
136
|
+
self.providers_num = nil
|
|
137
|
+
end
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
141
|
+
# @return Array for valid properties with the reasons
|
|
142
|
+
def list_invalid_properties
|
|
143
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
144
|
+
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 @first_seen.nil?
|
|
154
|
+
invalid_properties.push('invalid value for "first_seen", first_seen cannot be nil.')
|
|
155
|
+
end
|
|
156
|
+
|
|
157
|
+
if @last_seen.nil?
|
|
158
|
+
invalid_properties.push('invalid value for "last_seen", last_seen cannot be nil.')
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
if @hits.nil?
|
|
162
|
+
invalid_properties.push('invalid value for "hits", hits cannot be nil.')
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
if @hits_days_pct.nil?
|
|
166
|
+
invalid_properties.push('invalid value for "hits_days_pct", hits_days_pct cannot be nil.')
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
if @providers_num.nil?
|
|
170
|
+
invalid_properties.push('invalid value for "providers_num", providers_num cannot be nil.')
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
invalid_properties
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
# Check to see if the all the properties in the model are valid
|
|
177
|
+
# @return true if the model is valid
|
|
178
|
+
def valid?
|
|
179
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
180
|
+
return false if @provider.nil?
|
|
181
|
+
return false if @provider_name.nil?
|
|
182
|
+
return false if @first_seen.nil?
|
|
183
|
+
return false if @last_seen.nil?
|
|
184
|
+
return false if @hits.nil?
|
|
185
|
+
return false if @hits_days_pct.nil?
|
|
186
|
+
return false if @providers_num.nil?
|
|
187
|
+
true
|
|
188
|
+
end
|
|
189
|
+
|
|
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] first_seen Value to be assigned
|
|
212
|
+
def first_seen=(first_seen)
|
|
213
|
+
if first_seen.nil?
|
|
214
|
+
fail ArgumentError, 'first_seen cannot be nil'
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
@first_seen = first_seen
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
# Custom attribute writer method with validation
|
|
221
|
+
# @param [Object] last_seen Value to be assigned
|
|
222
|
+
def last_seen=(last_seen)
|
|
223
|
+
if last_seen.nil?
|
|
224
|
+
fail ArgumentError, 'last_seen cannot be nil'
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
@last_seen = last_seen
|
|
228
|
+
end
|
|
229
|
+
|
|
230
|
+
# Custom attribute writer method with validation
|
|
231
|
+
# @param [Object] hits Value to be assigned
|
|
232
|
+
def hits=(hits)
|
|
233
|
+
if hits.nil?
|
|
234
|
+
fail ArgumentError, 'hits cannot be nil'
|
|
235
|
+
end
|
|
236
|
+
|
|
237
|
+
@hits = hits
|
|
238
|
+
end
|
|
239
|
+
|
|
240
|
+
# Custom attribute writer method with validation
|
|
241
|
+
# @param [Object] hits_days_pct Value to be assigned
|
|
242
|
+
def hits_days_pct=(hits_days_pct)
|
|
243
|
+
if hits_days_pct.nil?
|
|
244
|
+
fail ArgumentError, 'hits_days_pct cannot be nil'
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
@hits_days_pct = hits_days_pct
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Custom attribute writer method with validation
|
|
251
|
+
# @param [Object] providers_num Value to be assigned
|
|
252
|
+
def providers_num=(providers_num)
|
|
253
|
+
if providers_num.nil?
|
|
254
|
+
fail ArgumentError, 'providers_num cannot be nil'
|
|
255
|
+
end
|
|
256
|
+
|
|
257
|
+
@providers_num = providers_num
|
|
258
|
+
end
|
|
259
|
+
|
|
260
|
+
# Checks equality by comparing each attribute.
|
|
261
|
+
# @param [Object] Object to be compared
|
|
262
|
+
def ==(o)
|
|
263
|
+
return true if self.equal?(o)
|
|
264
|
+
self.class == o.class &&
|
|
265
|
+
provider == o.provider &&
|
|
266
|
+
provider_name == o.provider_name &&
|
|
267
|
+
first_seen == o.first_seen &&
|
|
268
|
+
last_seen == o.last_seen &&
|
|
269
|
+
hits == o.hits &&
|
|
270
|
+
hits_days_pct == o.hits_days_pct &&
|
|
271
|
+
providers_num == o.providers_num
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# @see the `==` method
|
|
275
|
+
# @param [Object] Object to be compared
|
|
276
|
+
def eql?(o)
|
|
277
|
+
self == o
|
|
278
|
+
end
|
|
279
|
+
|
|
280
|
+
# Calculates hash code according to all attributes.
|
|
281
|
+
# @return [Integer] Hash code
|
|
282
|
+
def hash
|
|
283
|
+
[provider, provider_name, first_seen, last_seen, hits, hits_days_pct, providers_num].hash
|
|
284
|
+
end
|
|
285
|
+
|
|
286
|
+
# Builds the object from hash
|
|
287
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
288
|
+
# @return [Object] Returns the model itself
|
|
289
|
+
def self.build_from_hash(attributes)
|
|
290
|
+
return nil unless attributes.is_a?(Hash)
|
|
291
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
292
|
+
transformed_hash = {}
|
|
293
|
+
openapi_types.each_pair do |key, type|
|
|
294
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
295
|
+
transformed_hash["#{key}"] = nil
|
|
296
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
297
|
+
# check to ensure the input is an array given that the attribute
|
|
298
|
+
# is documented as an array but the input is not
|
|
299
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
300
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
301
|
+
end
|
|
302
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
303
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
304
|
+
end
|
|
305
|
+
end
|
|
306
|
+
new(transformed_hash)
|
|
307
|
+
end
|
|
308
|
+
|
|
309
|
+
# Returns the object in the form of hash
|
|
310
|
+
# @return [Hash] Returns the object in the form of hash
|
|
311
|
+
def to_hash
|
|
312
|
+
hash = {}
|
|
313
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
314
|
+
value = self.send(attr)
|
|
315
|
+
if value.nil?
|
|
316
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
317
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
318
|
+
end
|
|
319
|
+
|
|
320
|
+
hash[param] = _to_hash(value)
|
|
321
|
+
end
|
|
322
|
+
hash
|
|
323
|
+
end
|
|
324
|
+
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
end
|
|
@@ -0,0 +1,329 @@
|
|
|
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 PubproxyDetail < ApiModelBase
|
|
18
|
+
# A public proxy listens here.
|
|
19
|
+
attr_accessor :entry
|
|
20
|
+
|
|
21
|
+
# Public proxies' traffic leaves from here.
|
|
22
|
+
attr_accessor :exit
|
|
23
|
+
|
|
24
|
+
# The protocols at either end, `[]` when unknown.
|
|
25
|
+
attr_accessor :protocols
|
|
26
|
+
|
|
27
|
+
# How many ports a proxy listens on here.
|
|
28
|
+
attr_accessor :num_ports
|
|
29
|
+
|
|
30
|
+
# How many proxies' traffic left from here.
|
|
31
|
+
attr_accessor :num_proxies
|
|
32
|
+
|
|
33
|
+
# The last day one was seen.
|
|
34
|
+
attr_accessor :last_seen
|
|
35
|
+
|
|
36
|
+
# The last day one answered a request, empty when none did.
|
|
37
|
+
attr_accessor :last_usable
|
|
38
|
+
|
|
39
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
40
|
+
def self.attribute_map
|
|
41
|
+
{
|
|
42
|
+
:'entry' => :'entry',
|
|
43
|
+
:'exit' => :'exit',
|
|
44
|
+
:'protocols' => :'protocols',
|
|
45
|
+
:'num_ports' => :'num_ports',
|
|
46
|
+
:'num_proxies' => :'num_proxies',
|
|
47
|
+
:'last_seen' => :'last_seen',
|
|
48
|
+
:'last_usable' => :'last_usable'
|
|
49
|
+
}
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
# Returns attribute mapping this model knows about
|
|
53
|
+
def self.acceptable_attribute_map
|
|
54
|
+
attribute_map
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Returns all the JSON keys this model knows about
|
|
58
|
+
def self.acceptable_attributes
|
|
59
|
+
acceptable_attribute_map.values
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Attribute type mapping.
|
|
63
|
+
def self.openapi_types
|
|
64
|
+
{
|
|
65
|
+
:'entry' => :'Boolean',
|
|
66
|
+
:'exit' => :'Boolean',
|
|
67
|
+
:'protocols' => :'Array<String>',
|
|
68
|
+
:'num_ports' => :'Integer',
|
|
69
|
+
:'num_proxies' => :'Integer',
|
|
70
|
+
:'last_seen' => :'String',
|
|
71
|
+
:'last_usable' => :'String'
|
|
72
|
+
}
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
# List of attributes with nullable: true
|
|
76
|
+
def self.openapi_nullable
|
|
77
|
+
Set.new([
|
|
78
|
+
])
|
|
79
|
+
end
|
|
80
|
+
|
|
81
|
+
# Initializes the object
|
|
82
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
83
|
+
def initialize(attributes = {})
|
|
84
|
+
if (!attributes.is_a?(Hash))
|
|
85
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::PubproxyDetail` initialize method"
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
89
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
90
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
91
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
92
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::PubproxyDetail`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
93
|
+
end
|
|
94
|
+
h[k.to_sym] = v
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if attributes.key?(:'entry')
|
|
98
|
+
self.entry = attributes[:'entry']
|
|
99
|
+
else
|
|
100
|
+
self.entry = nil
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
if attributes.key?(:'exit')
|
|
104
|
+
self.exit = attributes[:'exit']
|
|
105
|
+
else
|
|
106
|
+
self.exit = nil
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
if attributes.key?(:'protocols')
|
|
110
|
+
if (value = attributes[:'protocols']).is_a?(Array)
|
|
111
|
+
self.protocols = value
|
|
112
|
+
end
|
|
113
|
+
else
|
|
114
|
+
self.protocols = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
if attributes.key?(:'num_ports')
|
|
118
|
+
self.num_ports = attributes[:'num_ports']
|
|
119
|
+
else
|
|
120
|
+
self.num_ports = nil
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
if attributes.key?(:'num_proxies')
|
|
124
|
+
self.num_proxies = attributes[:'num_proxies']
|
|
125
|
+
else
|
|
126
|
+
self.num_proxies = nil
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
if attributes.key?(:'last_seen')
|
|
130
|
+
self.last_seen = attributes[:'last_seen']
|
|
131
|
+
else
|
|
132
|
+
self.last_seen = nil
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
if attributes.key?(:'last_usable')
|
|
136
|
+
self.last_usable = attributes[:'last_usable']
|
|
137
|
+
else
|
|
138
|
+
self.last_usable = nil
|
|
139
|
+
end
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
143
|
+
# @return Array for valid properties with the reasons
|
|
144
|
+
def list_invalid_properties
|
|
145
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
146
|
+
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
|
+
invalid_properties
|
|
176
|
+
end
|
|
177
|
+
|
|
178
|
+
# Check to see if the all the properties in the model are valid
|
|
179
|
+
# @return true if the model is valid
|
|
180
|
+
def valid?
|
|
181
|
+
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
|
+
true
|
|
190
|
+
end
|
|
191
|
+
|
|
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
|
+
# Checks equality by comparing each attribute.
|
|
263
|
+
# @param [Object] Object to be compared
|
|
264
|
+
def ==(o)
|
|
265
|
+
return true if self.equal?(o)
|
|
266
|
+
self.class == o.class &&
|
|
267
|
+
entry == o.entry &&
|
|
268
|
+
exit == o.exit &&
|
|
269
|
+
protocols == o.protocols &&
|
|
270
|
+
num_ports == o.num_ports &&
|
|
271
|
+
num_proxies == o.num_proxies &&
|
|
272
|
+
last_seen == o.last_seen &&
|
|
273
|
+
last_usable == o.last_usable
|
|
274
|
+
end
|
|
275
|
+
|
|
276
|
+
# @see the `==` method
|
|
277
|
+
# @param [Object] Object to be compared
|
|
278
|
+
def eql?(o)
|
|
279
|
+
self == o
|
|
280
|
+
end
|
|
281
|
+
|
|
282
|
+
# Calculates hash code according to all attributes.
|
|
283
|
+
# @return [Integer] Hash code
|
|
284
|
+
def hash
|
|
285
|
+
[entry, exit, protocols, num_ports, num_proxies, last_seen, last_usable].hash
|
|
286
|
+
end
|
|
287
|
+
|
|
288
|
+
# Builds the object from hash
|
|
289
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
290
|
+
# @return [Object] Returns the model itself
|
|
291
|
+
def self.build_from_hash(attributes)
|
|
292
|
+
return nil unless attributes.is_a?(Hash)
|
|
293
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
294
|
+
transformed_hash = {}
|
|
295
|
+
openapi_types.each_pair do |key, type|
|
|
296
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
297
|
+
transformed_hash["#{key}"] = nil
|
|
298
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
299
|
+
# check to ensure the input is an array given that the attribute
|
|
300
|
+
# is documented as an array but the input is not
|
|
301
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
302
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
303
|
+
end
|
|
304
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
305
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
306
|
+
end
|
|
307
|
+
end
|
|
308
|
+
new(transformed_hash)
|
|
309
|
+
end
|
|
310
|
+
|
|
311
|
+
# Returns the object in the form of hash
|
|
312
|
+
# @return [Hash] Returns the object in the form of hash
|
|
313
|
+
def to_hash
|
|
314
|
+
hash = {}
|
|
315
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
316
|
+
value = self.send(attr)
|
|
317
|
+
if value.nil?
|
|
318
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
319
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
320
|
+
end
|
|
321
|
+
|
|
322
|
+
hash[param] = _to_hash(value)
|
|
323
|
+
end
|
|
324
|
+
hash
|
|
325
|
+
end
|
|
326
|
+
|
|
327
|
+
end
|
|
328
|
+
|
|
329
|
+
end
|