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