internetdata 2.9.2 → 2.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +146 -9
  3. data/lib/internetdata/api/database_v2_api.rb +2 -2
  4. data/lib/internetdata/api_client.rb +2 -2
  5. data/lib/internetdata/api_error.rb +2 -2
  6. data/lib/internetdata/api_model_base.rb +2 -2
  7. data/lib/internetdata/asn_result.rb +107 -0
  8. data/lib/internetdata/bogon.rb +87 -0
  9. data/lib/internetdata/bogons.rb +93 -0
  10. data/lib/internetdata/cache.rb +35 -0
  11. data/lib/internetdata/client.rb +388 -16
  12. data/lib/internetdata/configuration.rb +23 -2
  13. data/lib/internetdata/domain_result.rb +124 -0
  14. data/lib/internetdata/errors.rb +29 -6
  15. data/lib/internetdata/models/abuse_contact.rb +236 -0
  16. data/lib/internetdata/models/asn.rb +294 -0
  17. data/lib/internetdata/models/asn_lookup_response.rb +405 -0
  18. data/lib/internetdata/models/asn_prefix.rb +329 -0
  19. data/lib/internetdata/models/batch_lookup_error.rb +192 -0
  20. data/lib/internetdata/models/bit_torrent_detail.rb +410 -0
  21. data/lib/internetdata/models/carrier_detail.rb +273 -0
  22. data/lib/internetdata/models/class_detail.rb +246 -0
  23. data/lib/internetdata/models/client_registration.rb +2 -2
  24. data/lib/internetdata/models/company.rb +213 -0
  25. data/lib/internetdata/models/database.rb +2 -2
  26. data/lib/internetdata/models/database_checksums_response.rb +2 -2
  27. data/lib/internetdata/models/database_format.rb +2 -2
  28. data/lib/internetdata/models/database_list.rb +2 -2
  29. data/lib/internetdata/models/database_metadata.rb +2 -2
  30. data/lib/internetdata/models/database_metadata_column.rb +2 -2
  31. data/lib/internetdata/models/database_version.rb +2 -2
  32. data/lib/internetdata/models/db_checksums.rb +2 -2
  33. data/lib/internetdata/models/device_authorization.rb +2 -2
  34. data/lib/internetdata/models/disposable_detail.rb +248 -0
  35. data/lib/internetdata/models/dns_address_record.rb +192 -0
  36. data/lib/internetdata/models/dns_cname_record.rb +192 -0
  37. data/lib/internetdata/models/dns_mx_record.rb +219 -0
  38. data/lib/internetdata/models/dns_ns_record.rb +192 -0
  39. data/lib/internetdata/models/dns_resolver_detail.rb +300 -0
  40. data/lib/internetdata/models/domain_dns.rb +279 -0
  41. data/lib/internetdata/models/domain_ip_range.rb +219 -0
  42. data/lib/internetdata/models/domain_ip_ranges.rb +276 -0
  43. data/lib/internetdata/models/domain_lookup_response.rb +376 -0
  44. data/lib/internetdata/models/download.rb +2 -2
  45. data/lib/internetdata/models/download_list.rb +2 -2
  46. data/lib/internetdata/models/entitlement.rb +243 -0
  47. data/lib/internetdata/models/entitlement_apikey.rb +207 -0
  48. data/lib/internetdata/models/entitlement_plan.rb +216 -0
  49. data/lib/internetdata/models/entitlement_usage.rb +259 -0
  50. data/lib/internetdata/models/error_envelope.rb +2 -2
  51. data/lib/internetdata/models/hosted_domains.rb +166 -0
  52. data/lib/internetdata/models/location.rb +509 -0
  53. data/lib/internetdata/models/lookup_response.rb +897 -0
  54. data/lib/internetdata/models/oauth_metadata.rb +2 -2
  55. data/lib/internetdata/models/proxy_detail.rb +327 -0
  56. data/lib/internetdata/models/pubproxy_detail.rb +329 -0
  57. data/lib/internetdata/models/rwhois.rb +301 -0
  58. data/lib/internetdata/models/satellite_detail.rb +327 -0
  59. data/lib/internetdata/models/smtp_detail.rb +273 -0
  60. data/lib/internetdata/models/ssh_detail.rb +300 -0
  61. data/lib/internetdata/models/standing.rb +2 -2
  62. data/lib/internetdata/models/token_response.rb +2 -2
  63. data/lib/internetdata/models/web_detail.rb +516 -0
  64. data/lib/internetdata/models/whois.rb +382 -0
  65. data/lib/internetdata/oauth_api.rb +1 -1
  66. data/lib/internetdata/result.rb +431 -0
  67. data/lib/internetdata/transport.rb +215 -27
  68. data/lib/internetdata/version.rb +1 -1
  69. data/lib/internetdata.rb +17 -2
  70. metadata +58 -3
@@ -0,0 +1,301 @@
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
+ # IP RWHOIS's most specific network covering the address. Paid plans and the trial.
18
+ class Rwhois < ApiModelBase
19
+ # The network's identifier on the operator's RWHOIS server.
20
+ attr_accessor :id
21
+
22
+ # Its assignee.
23
+ attr_accessor :name
24
+
25
+ # ISO 3166 country code.
26
+ attr_accessor :country
27
+
28
+ # The operator that published it.
29
+ attr_accessor :source
30
+
31
+ # The contact emails' domain.
32
+ attr_accessor :domain
33
+
34
+ # Its abuse contact.
35
+ attr_accessor :abuse_email
36
+
37
+ # Attribute mapping from ruby-style variable name to JSON key.
38
+ def self.attribute_map
39
+ {
40
+ :'id' => :'id',
41
+ :'name' => :'name',
42
+ :'country' => :'country',
43
+ :'source' => :'source',
44
+ :'domain' => :'domain',
45
+ :'abuse_email' => :'abuse_email'
46
+ }
47
+ end
48
+
49
+ # Returns attribute mapping this model knows about
50
+ def self.acceptable_attribute_map
51
+ attribute_map
52
+ end
53
+
54
+ # Returns all the JSON keys this model knows about
55
+ def self.acceptable_attributes
56
+ acceptable_attribute_map.values
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.openapi_types
61
+ {
62
+ :'id' => :'String',
63
+ :'name' => :'String',
64
+ :'country' => :'String',
65
+ :'source' => :'String',
66
+ :'domain' => :'String',
67
+ :'abuse_email' => :'String'
68
+ }
69
+ end
70
+
71
+ # List of attributes with nullable: true
72
+ def self.openapi_nullable
73
+ Set.new([
74
+ ])
75
+ end
76
+
77
+ # Initializes the object
78
+ # @param [Hash] attributes Model attributes in the form of hash
79
+ def initialize(attributes = {})
80
+ if (!attributes.is_a?(Hash))
81
+ fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::Rwhois` initialize method"
82
+ end
83
+
84
+ # check to see if the attribute exists and convert string to symbol for hash key
85
+ acceptable_attribute_map = self.class.acceptable_attribute_map
86
+ attributes = attributes.each_with_object({}) { |(k, v), h|
87
+ if (!acceptable_attribute_map.key?(k.to_sym))
88
+ fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::Rwhois`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
89
+ end
90
+ h[k.to_sym] = v
91
+ }
92
+
93
+ if attributes.key?(:'id')
94
+ self.id = attributes[:'id']
95
+ else
96
+ self.id = nil
97
+ end
98
+
99
+ if attributes.key?(:'name')
100
+ self.name = attributes[:'name']
101
+ else
102
+ self.name = 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?(:'source')
112
+ self.source = attributes[:'source']
113
+ else
114
+ self.source = nil
115
+ end
116
+
117
+ if attributes.key?(:'domain')
118
+ self.domain = attributes[:'domain']
119
+ else
120
+ self.domain = nil
121
+ end
122
+
123
+ if attributes.key?(:'abuse_email')
124
+ self.abuse_email = attributes[:'abuse_email']
125
+ else
126
+ self.abuse_email = nil
127
+ end
128
+ end
129
+
130
+ # Show invalid properties with the reasons. Usually used together with valid?
131
+ # @return Array for valid properties with the reasons
132
+ def list_invalid_properties
133
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
134
+ invalid_properties = Array.new
135
+ if @id.nil?
136
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
137
+ end
138
+
139
+ if @name.nil?
140
+ invalid_properties.push('invalid value for "name", name cannot be nil.')
141
+ end
142
+
143
+ if @country.nil?
144
+ invalid_properties.push('invalid value for "country", country cannot be nil.')
145
+ end
146
+
147
+ if @source.nil?
148
+ invalid_properties.push('invalid value for "source", source cannot be nil.')
149
+ end
150
+
151
+ if @domain.nil?
152
+ invalid_properties.push('invalid value for "domain", domain cannot be nil.')
153
+ end
154
+
155
+ if @abuse_email.nil?
156
+ invalid_properties.push('invalid value for "abuse_email", abuse_email cannot be nil.')
157
+ end
158
+
159
+ invalid_properties
160
+ end
161
+
162
+ # Check to see if the all the properties in the model are valid
163
+ # @return true if the model is valid
164
+ def valid?
165
+ warn '[DEPRECATED] the `valid?` method is obsolete'
166
+ return false if @id.nil?
167
+ return false if @name.nil?
168
+ return false if @country.nil?
169
+ return false if @source.nil?
170
+ return false if @domain.nil?
171
+ return false if @abuse_email.nil?
172
+ true
173
+ end
174
+
175
+ # Custom attribute writer method with validation
176
+ # @param [Object] id Value to be assigned
177
+ def id=(id)
178
+ if id.nil?
179
+ fail ArgumentError, 'id cannot be nil'
180
+ end
181
+
182
+ @id = id
183
+ end
184
+
185
+ # Custom attribute writer method with validation
186
+ # @param [Object] name Value to be assigned
187
+ def name=(name)
188
+ if name.nil?
189
+ fail ArgumentError, 'name cannot be nil'
190
+ end
191
+
192
+ @name = name
193
+ end
194
+
195
+ # Custom attribute writer method with validation
196
+ # @param [Object] country Value to be assigned
197
+ def country=(country)
198
+ if country.nil?
199
+ fail ArgumentError, 'country cannot be nil'
200
+ end
201
+
202
+ @country = country
203
+ end
204
+
205
+ # Custom attribute writer method with validation
206
+ # @param [Object] source Value to be assigned
207
+ def source=(source)
208
+ if source.nil?
209
+ fail ArgumentError, 'source cannot be nil'
210
+ end
211
+
212
+ @source = source
213
+ end
214
+
215
+ # Custom attribute writer method with validation
216
+ # @param [Object] domain Value to be assigned
217
+ def domain=(domain)
218
+ if domain.nil?
219
+ fail ArgumentError, 'domain cannot be nil'
220
+ end
221
+
222
+ @domain = domain
223
+ end
224
+
225
+ # Custom attribute writer method with validation
226
+ # @param [Object] abuse_email Value to be assigned
227
+ def abuse_email=(abuse_email)
228
+ if abuse_email.nil?
229
+ fail ArgumentError, 'abuse_email cannot be nil'
230
+ end
231
+
232
+ @abuse_email = abuse_email
233
+ end
234
+
235
+ # Checks equality by comparing each attribute.
236
+ # @param [Object] Object to be compared
237
+ def ==(o)
238
+ return true if self.equal?(o)
239
+ self.class == o.class &&
240
+ id == o.id &&
241
+ name == o.name &&
242
+ country == o.country &&
243
+ source == o.source &&
244
+ domain == o.domain &&
245
+ abuse_email == o.abuse_email
246
+ end
247
+
248
+ # @see the `==` method
249
+ # @param [Object] Object to be compared
250
+ def eql?(o)
251
+ self == o
252
+ end
253
+
254
+ # Calculates hash code according to all attributes.
255
+ # @return [Integer] Hash code
256
+ def hash
257
+ [id, name, country, source, domain, abuse_email].hash
258
+ end
259
+
260
+ # Builds the object from hash
261
+ # @param [Hash] attributes Model attributes in the form of hash
262
+ # @return [Object] Returns the model itself
263
+ def self.build_from_hash(attributes)
264
+ return nil unless attributes.is_a?(Hash)
265
+ attributes = attributes.transform_keys(&:to_sym)
266
+ transformed_hash = {}
267
+ openapi_types.each_pair do |key, type|
268
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
269
+ transformed_hash["#{key}"] = nil
270
+ elsif type =~ /\AArray<(.*)>/i
271
+ # check to ensure the input is an array given that the attribute
272
+ # is documented as an array but the input is not
273
+ if attributes[attribute_map[key]].is_a?(Array)
274
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
275
+ end
276
+ elsif !attributes[attribute_map[key]].nil?
277
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
278
+ end
279
+ end
280
+ new(transformed_hash)
281
+ end
282
+
283
+ # Returns the object in the form of hash
284
+ # @return [Hash] Returns the object in the form of hash
285
+ def to_hash
286
+ hash = {}
287
+ self.class.attribute_map.each_pair do |attr, param|
288
+ value = self.send(attr)
289
+ if value.nil?
290
+ is_nullable = self.class.openapi_nullable.include?(attr)
291
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
292
+ end
293
+
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ end
300
+
301
+ end
@@ -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 SatelliteDetail < ApiModelBase
18
+ # The operator's ID in Satellite IP Provider.
19
+ attr_accessor :provider
20
+
21
+ # The operator's name.
22
+ attr_accessor :provider_name
23
+
24
+ # The orbit: `leo`, `meo` or `geo`.
25
+ attr_accessor :orbit
26
+
27
+ # Who the space serves, such as consumer or maritime.
28
+ attr_accessor :segment
29
+
30
+ # ISO 3166 country code.
31
+ attr_accessor :country
32
+
33
+ # The AS the operator announces it from.
34
+ attr_accessor :asn
35
+
36
+ # `high`, `medium` or `low`.
37
+ attr_accessor :confidence
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
+ :'orbit' => :'orbit',
45
+ :'segment' => :'segment',
46
+ :'country' => :'country',
47
+ :'asn' => :'asn',
48
+ :'confidence' => :'confidence'
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
+ :'orbit' => :'String',
68
+ :'segment' => :'String',
69
+ :'country' => :'String',
70
+ :'asn' => :'Integer',
71
+ :'confidence' => :'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::SatelliteDetail` 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::SatelliteDetail`. 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?(:'orbit')
110
+ self.orbit = attributes[:'orbit']
111
+ else
112
+ self.orbit = nil
113
+ end
114
+
115
+ if attributes.key?(:'segment')
116
+ self.segment = attributes[:'segment']
117
+ else
118
+ self.segment = nil
119
+ end
120
+
121
+ if attributes.key?(:'country')
122
+ self.country = attributes[:'country']
123
+ else
124
+ self.country = nil
125
+ end
126
+
127
+ if attributes.key?(:'asn')
128
+ self.asn = attributes[:'asn']
129
+ else
130
+ self.asn = nil
131
+ end
132
+
133
+ if attributes.key?(:'confidence')
134
+ self.confidence = attributes[:'confidence']
135
+ else
136
+ self.confidence = 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 @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
+ 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 @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
+ 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] 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
+ # 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
+ orbit == o.orbit &&
268
+ segment == o.segment &&
269
+ country == o.country &&
270
+ asn == o.asn &&
271
+ confidence == o.confidence
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, orbit, segment, country, asn, confidence].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