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