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