internetdata 2.14.3 → 2.15.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/lib/internetdata/domain_result.rb +38 -1
- data/lib/internetdata/models/cohosted_domains.rb +222 -0
- data/lib/internetdata/models/domain_backlinks.rb +195 -0
- data/lib/internetdata/models/domain_host.rb +193 -0
- data/lib/internetdata/models/domain_lookup_response.rb +49 -1
- data/lib/internetdata/models/domain_redirects.rb +195 -0
- data/lib/internetdata/models/domain_web.rb +273 -0
- data/lib/internetdata/models/domain_web_links.rb +195 -0
- data/lib/internetdata/transport.rb +6 -0
- data/lib/internetdata/version.rb +1 -1
- metadata +7 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 31e59c6791ff66337309a43f54bfcdeb9d4edbf18defffb3d0763b8121887c69
|
|
4
|
+
data.tar.gz: 830ce27a3740c60040f186edfab4a016074d69af4400f3c2a4ffaaf144923d5c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8730334359647443493f41b90370c45ae661ee63e54dc568a23a0fd45e48ecfe42acd1e10e2a464b770c97fe24e72b33fc9ac29f99f1a8d2867ac6cc99db623d
|
|
7
|
+
data.tar.gz: 9545aeb5a4d7f6942a4337a11f5f83b744cf1c442fa946d7e9389222e2f4244bc4f54c22a9f4b108600604a19ff95c534b4d6b6be59d4674be612fbf5a6c0691
|
|
@@ -6,7 +6,9 @@ module InternetData
|
|
|
6
6
|
# As with {Result}, an absent member is one your plan does not include, and
|
|
7
7
|
# reads as `nil`, never as false: Unlimited answers whether the domain is
|
|
8
8
|
# registered and which record types it has, and paid plans and the trial add
|
|
9
|
-
# the records themselves,
|
|
9
|
+
# the records themselves, the network announcing each address, the other
|
|
10
|
+
# domains on its first IPv4 address, its organization's IP ranges, Disposable
|
|
11
|
+
# Domain, its home page and the domains redirecting or linking to it.
|
|
10
12
|
# Each flag has the three readers {Result}'s have: `is_disposable`,
|
|
11
13
|
# `disposable?` and `included?(:is_disposable)`.
|
|
12
14
|
class DomainResult
|
|
@@ -94,6 +96,20 @@ module InternetData
|
|
|
94
96
|
@raw['dns']
|
|
95
97
|
end
|
|
96
98
|
|
|
99
|
+
# The network announcing each address in `dns.a` and then `dns.aaaa`, from
|
|
100
|
+
# IP ASN, as wire hashes (`result.hosting.first['asn']['name']`); `[]` where
|
|
101
|
+
# it resolves to none. Paid plans and the trial.
|
|
102
|
+
def hosting
|
|
103
|
+
@raw['hosting']
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
# From IP Hosted Domains, as a wire hash: the other registered domains on
|
|
107
|
+
# its first IPv4 address (`ip`), how many (`total`) and up to 10, the most
|
|
108
|
+
# popular first (`domains`). Paid plans and the trial.
|
|
109
|
+
def cohosted_domains
|
|
110
|
+
@raw['cohosted_domains']
|
|
111
|
+
end
|
|
112
|
+
|
|
97
113
|
# Its organization's IP ranges, from Domain IP Ranges. Paid plans and the
|
|
98
114
|
# trial.
|
|
99
115
|
def ip_ranges
|
|
@@ -106,6 +122,27 @@ module InternetData
|
|
|
106
122
|
@raw['disposable']
|
|
107
123
|
end
|
|
108
124
|
|
|
125
|
+
# What our crawl last read of its home page, as a wire hash: `url`,
|
|
126
|
+
# `title`, `description`, `last_seen` and the external hosts it links to
|
|
127
|
+
# (`links`), each empty where it holds none. Paid plans and the trial.
|
|
128
|
+
def web
|
|
129
|
+
@raw['web']
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
# The registered domains whose home page redirects to it, as a wire hash:
|
|
133
|
+
# how many (`total`) and up to 10, the most popular first (`domains`). Paid
|
|
134
|
+
# plans and the trial.
|
|
135
|
+
def redirects
|
|
136
|
+
@raw['redirects']
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# The registered domains whose home page links to it, as a wire hash: how
|
|
140
|
+
# many (`total`) and up to 10, the most popular first (`domains`). Paid
|
|
141
|
+
# plans and the trial.
|
|
142
|
+
def backlinks
|
|
143
|
+
@raw['backlinks']
|
|
144
|
+
end
|
|
145
|
+
|
|
109
146
|
# On answers to a key on the free plan only: false while its organization's
|
|
110
147
|
# trial of every field lasts, true once the answer has Unlimited's; nil on any other.
|
|
111
148
|
def trial_expired
|
|
@@ -0,0 +1,222 @@
|
|
|
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.20
|
|
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
|
+
# From IP Hosted Domains: the other registered domains on the domain's first IPv4 address, how many and the 10 most popular. Paid plans and the trial.
|
|
18
|
+
class CohostedDomains < ApiModelBase
|
|
19
|
+
# The domain's first IPv4 address, `''` where it has none.
|
|
20
|
+
attr_accessor :ip
|
|
21
|
+
|
|
22
|
+
# How many other registered domains resolve to it.
|
|
23
|
+
attr_accessor :total
|
|
24
|
+
|
|
25
|
+
# Up to 10 of them, the most popular first, the domain itself left out; `[]` when none does.
|
|
26
|
+
attr_accessor :domains
|
|
27
|
+
|
|
28
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
29
|
+
def self.attribute_map
|
|
30
|
+
{
|
|
31
|
+
:'ip' => :'ip',
|
|
32
|
+
:'total' => :'total',
|
|
33
|
+
:'domains' => :'domains'
|
|
34
|
+
}
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
# Returns attribute mapping this model knows about
|
|
38
|
+
def self.acceptable_attribute_map
|
|
39
|
+
attribute_map
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# Returns all the JSON keys this model knows about
|
|
43
|
+
def self.acceptable_attributes
|
|
44
|
+
acceptable_attribute_map.values
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# Attribute type mapping.
|
|
48
|
+
def self.openapi_types
|
|
49
|
+
{
|
|
50
|
+
:'ip' => :'String',
|
|
51
|
+
:'total' => :'Integer',
|
|
52
|
+
:'domains' => :'Array<String>'
|
|
53
|
+
}
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
# List of attributes with nullable: true
|
|
57
|
+
def self.openapi_nullable
|
|
58
|
+
Set.new([
|
|
59
|
+
])
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
# Initializes the object
|
|
63
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
64
|
+
def initialize(attributes = {})
|
|
65
|
+
if (!attributes.is_a?(Hash))
|
|
66
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::CohostedDomains` initialize method"
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
70
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
71
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
72
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
73
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::CohostedDomains`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
74
|
+
end
|
|
75
|
+
h[k.to_sym] = v
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if attributes.key?(:'ip')
|
|
79
|
+
self.ip = attributes[:'ip']
|
|
80
|
+
else
|
|
81
|
+
self.ip = nil
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
if attributes.key?(:'total')
|
|
85
|
+
self.total = attributes[:'total']
|
|
86
|
+
else
|
|
87
|
+
self.total = nil
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
if attributes.key?(:'domains')
|
|
91
|
+
if (value = attributes[:'domains']).is_a?(Array)
|
|
92
|
+
self.domains = value
|
|
93
|
+
end
|
|
94
|
+
else
|
|
95
|
+
self.domains = nil
|
|
96
|
+
end
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
100
|
+
# @return Array for valid properties with the reasons
|
|
101
|
+
def list_invalid_properties
|
|
102
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
103
|
+
invalid_properties = Array.new
|
|
104
|
+
if @ip.nil?
|
|
105
|
+
invalid_properties.push('invalid value for "ip", ip cannot be nil.')
|
|
106
|
+
end
|
|
107
|
+
|
|
108
|
+
if @total.nil?
|
|
109
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
|
110
|
+
end
|
|
111
|
+
|
|
112
|
+
if @domains.nil?
|
|
113
|
+
invalid_properties.push('invalid value for "domains", domains cannot be nil.')
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
invalid_properties
|
|
117
|
+
end
|
|
118
|
+
|
|
119
|
+
# Check to see if the all the properties in the model are valid
|
|
120
|
+
# @return true if the model is valid
|
|
121
|
+
def valid?
|
|
122
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
123
|
+
return false if @ip.nil?
|
|
124
|
+
return false if @total.nil?
|
|
125
|
+
return false if @domains.nil?
|
|
126
|
+
true
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Custom attribute writer method with validation
|
|
130
|
+
# @param [Object] ip Value to be assigned
|
|
131
|
+
def ip=(ip)
|
|
132
|
+
if ip.nil?
|
|
133
|
+
fail ArgumentError, 'ip cannot be nil'
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
@ip = ip
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Custom attribute writer method with validation
|
|
140
|
+
# @param [Object] total Value to be assigned
|
|
141
|
+
def total=(total)
|
|
142
|
+
if total.nil?
|
|
143
|
+
fail ArgumentError, 'total cannot be nil'
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
@total = total
|
|
147
|
+
end
|
|
148
|
+
|
|
149
|
+
# Custom attribute writer method with validation
|
|
150
|
+
# @param [Object] domains Value to be assigned
|
|
151
|
+
def domains=(domains)
|
|
152
|
+
if domains.nil?
|
|
153
|
+
fail ArgumentError, 'domains cannot be nil'
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
@domains = domains
|
|
157
|
+
end
|
|
158
|
+
|
|
159
|
+
# Checks equality by comparing each attribute.
|
|
160
|
+
# @param [Object] Object to be compared
|
|
161
|
+
def ==(o)
|
|
162
|
+
return true if self.equal?(o)
|
|
163
|
+
self.class == o.class &&
|
|
164
|
+
ip == o.ip &&
|
|
165
|
+
total == o.total &&
|
|
166
|
+
domains == o.domains
|
|
167
|
+
end
|
|
168
|
+
|
|
169
|
+
# @see the `==` method
|
|
170
|
+
# @param [Object] Object to be compared
|
|
171
|
+
def eql?(o)
|
|
172
|
+
self == o
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Calculates hash code according to all attributes.
|
|
176
|
+
# @return [Integer] Hash code
|
|
177
|
+
def hash
|
|
178
|
+
[ip, total, domains].hash
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Builds the object from hash
|
|
182
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
183
|
+
# @return [Object] Returns the model itself
|
|
184
|
+
def self.build_from_hash(attributes)
|
|
185
|
+
return nil unless attributes.is_a?(Hash)
|
|
186
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
187
|
+
transformed_hash = {}
|
|
188
|
+
openapi_types.each_pair do |key, type|
|
|
189
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
190
|
+
transformed_hash["#{key}"] = nil
|
|
191
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
192
|
+
# check to ensure the input is an array given that the attribute
|
|
193
|
+
# is documented as an array but the input is not
|
|
194
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
195
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
196
|
+
end
|
|
197
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
198
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
new(transformed_hash)
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
# Returns the object in the form of hash
|
|
205
|
+
# @return [Hash] Returns the object in the form of hash
|
|
206
|
+
def to_hash
|
|
207
|
+
hash = {}
|
|
208
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
209
|
+
value = self.send(attr)
|
|
210
|
+
if value.nil?
|
|
211
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
212
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
213
|
+
end
|
|
214
|
+
|
|
215
|
+
hash[param] = _to_hash(value)
|
|
216
|
+
end
|
|
217
|
+
hash
|
|
218
|
+
end
|
|
219
|
+
|
|
220
|
+
end
|
|
221
|
+
|
|
222
|
+
end
|
|
@@ -0,0 +1,195 @@
|
|
|
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.20
|
|
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
|
+
# The registered domains whose home page links to this one, how many and the 10 most popular. Paid plans and the trial.
|
|
18
|
+
class DomainBacklinks < ApiModelBase
|
|
19
|
+
# How many registered domains have a home page that links to this domain.
|
|
20
|
+
attr_accessor :total
|
|
21
|
+
|
|
22
|
+
# Up to 10 of them, the most popular first; `[]` when none does.
|
|
23
|
+
attr_accessor :domains
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'total' => :'total',
|
|
29
|
+
:'domains' => :'domains'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'total' => :'Integer',
|
|
47
|
+
:'domains' => :'Array<String>'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::DomainBacklinks` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::DomainBacklinks`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'total')
|
|
74
|
+
self.total = attributes[:'total']
|
|
75
|
+
else
|
|
76
|
+
self.total = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'domains')
|
|
80
|
+
if (value = attributes[:'domains']).is_a?(Array)
|
|
81
|
+
self.domains = value
|
|
82
|
+
end
|
|
83
|
+
else
|
|
84
|
+
self.domains = nil
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
89
|
+
# @return Array for valid properties with the reasons
|
|
90
|
+
def list_invalid_properties
|
|
91
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
92
|
+
invalid_properties = Array.new
|
|
93
|
+
if @total.nil?
|
|
94
|
+
invalid_properties.push('invalid value for "total", total cannot be nil.')
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
if @domains.nil?
|
|
98
|
+
invalid_properties.push('invalid value for "domains", domains cannot be nil.')
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
invalid_properties
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Check to see if the all the properties in the model are valid
|
|
105
|
+
# @return true if the model is valid
|
|
106
|
+
def valid?
|
|
107
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
108
|
+
return false if @total.nil?
|
|
109
|
+
return false if @domains.nil?
|
|
110
|
+
true
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
# Custom attribute writer method with validation
|
|
114
|
+
# @param [Object] total Value to be assigned
|
|
115
|
+
def total=(total)
|
|
116
|
+
if total.nil?
|
|
117
|
+
fail ArgumentError, 'total cannot be nil'
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
@total = total
|
|
121
|
+
end
|
|
122
|
+
|
|
123
|
+
# Custom attribute writer method with validation
|
|
124
|
+
# @param [Object] domains Value to be assigned
|
|
125
|
+
def domains=(domains)
|
|
126
|
+
if domains.nil?
|
|
127
|
+
fail ArgumentError, 'domains cannot be nil'
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
@domains = domains
|
|
131
|
+
end
|
|
132
|
+
|
|
133
|
+
# Checks equality by comparing each attribute.
|
|
134
|
+
# @param [Object] Object to be compared
|
|
135
|
+
def ==(o)
|
|
136
|
+
return true if self.equal?(o)
|
|
137
|
+
self.class == o.class &&
|
|
138
|
+
total == o.total &&
|
|
139
|
+
domains == o.domains
|
|
140
|
+
end
|
|
141
|
+
|
|
142
|
+
# @see the `==` method
|
|
143
|
+
# @param [Object] Object to be compared
|
|
144
|
+
def eql?(o)
|
|
145
|
+
self == o
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
# Calculates hash code according to all attributes.
|
|
149
|
+
# @return [Integer] Hash code
|
|
150
|
+
def hash
|
|
151
|
+
[total, domains].hash
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
# Builds the object from hash
|
|
155
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
156
|
+
# @return [Object] Returns the model itself
|
|
157
|
+
def self.build_from_hash(attributes)
|
|
158
|
+
return nil unless attributes.is_a?(Hash)
|
|
159
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
160
|
+
transformed_hash = {}
|
|
161
|
+
openapi_types.each_pair do |key, type|
|
|
162
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
163
|
+
transformed_hash["#{key}"] = nil
|
|
164
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
165
|
+
# check to ensure the input is an array given that the attribute
|
|
166
|
+
# is documented as an array but the input is not
|
|
167
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
168
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
169
|
+
end
|
|
170
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
171
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
172
|
+
end
|
|
173
|
+
end
|
|
174
|
+
new(transformed_hash)
|
|
175
|
+
end
|
|
176
|
+
|
|
177
|
+
# Returns the object in the form of hash
|
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
|
179
|
+
def to_hash
|
|
180
|
+
hash = {}
|
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
182
|
+
value = self.send(attr)
|
|
183
|
+
if value.nil?
|
|
184
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
185
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
hash[param] = _to_hash(value)
|
|
189
|
+
end
|
|
190
|
+
hash
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|
|
194
|
+
|
|
195
|
+
end
|
|
@@ -0,0 +1,193 @@
|
|
|
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.20
|
|
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
|
+
# An address the domain resolves to and the network announcing it.
|
|
18
|
+
class DomainHost < ApiModelBase
|
|
19
|
+
# One address the domain resolves to.
|
|
20
|
+
attr_accessor :ip
|
|
21
|
+
|
|
22
|
+
# The network announcing it, as an address lookup's `asn`; every member empty where IP ASN holds none.
|
|
23
|
+
attr_accessor :asn
|
|
24
|
+
|
|
25
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
|
26
|
+
def self.attribute_map
|
|
27
|
+
{
|
|
28
|
+
:'ip' => :'ip',
|
|
29
|
+
:'asn' => :'asn'
|
|
30
|
+
}
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
# Returns attribute mapping this model knows about
|
|
34
|
+
def self.acceptable_attribute_map
|
|
35
|
+
attribute_map
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# Returns all the JSON keys this model knows about
|
|
39
|
+
def self.acceptable_attributes
|
|
40
|
+
acceptable_attribute_map.values
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# Attribute type mapping.
|
|
44
|
+
def self.openapi_types
|
|
45
|
+
{
|
|
46
|
+
:'ip' => :'String',
|
|
47
|
+
:'asn' => :'Asn'
|
|
48
|
+
}
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# List of attributes with nullable: true
|
|
52
|
+
def self.openapi_nullable
|
|
53
|
+
Set.new([
|
|
54
|
+
])
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
# Initializes the object
|
|
58
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
59
|
+
def initialize(attributes = {})
|
|
60
|
+
if (!attributes.is_a?(Hash))
|
|
61
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `InternetData::DomainHost` initialize method"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
65
|
+
acceptable_attribute_map = self.class.acceptable_attribute_map
|
|
66
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
67
|
+
if (!acceptable_attribute_map.key?(k.to_sym))
|
|
68
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `InternetData::DomainHost`. Please check the name to make sure it's valid. List of attributes: " + acceptable_attribute_map.keys.inspect
|
|
69
|
+
end
|
|
70
|
+
h[k.to_sym] = v
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if attributes.key?(:'ip')
|
|
74
|
+
self.ip = attributes[:'ip']
|
|
75
|
+
else
|
|
76
|
+
self.ip = nil
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
if attributes.key?(:'asn')
|
|
80
|
+
self.asn = attributes[:'asn']
|
|
81
|
+
else
|
|
82
|
+
self.asn = nil
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
|
87
|
+
# @return Array for valid properties with the reasons
|
|
88
|
+
def list_invalid_properties
|
|
89
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
|
90
|
+
invalid_properties = Array.new
|
|
91
|
+
if @ip.nil?
|
|
92
|
+
invalid_properties.push('invalid value for "ip", ip cannot be nil.')
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
if @asn.nil?
|
|
96
|
+
invalid_properties.push('invalid value for "asn", asn cannot be nil.')
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
invalid_properties
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
# Check to see if the all the properties in the model are valid
|
|
103
|
+
# @return true if the model is valid
|
|
104
|
+
def valid?
|
|
105
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
|
106
|
+
return false if @ip.nil?
|
|
107
|
+
return false if @asn.nil?
|
|
108
|
+
true
|
|
109
|
+
end
|
|
110
|
+
|
|
111
|
+
# Custom attribute writer method with validation
|
|
112
|
+
# @param [Object] ip Value to be assigned
|
|
113
|
+
def ip=(ip)
|
|
114
|
+
if ip.nil?
|
|
115
|
+
fail ArgumentError, 'ip cannot be nil'
|
|
116
|
+
end
|
|
117
|
+
|
|
118
|
+
@ip = ip
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
# Custom attribute writer method with validation
|
|
122
|
+
# @param [Object] asn Value to be assigned
|
|
123
|
+
def asn=(asn)
|
|
124
|
+
if asn.nil?
|
|
125
|
+
fail ArgumentError, 'asn cannot be nil'
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
@asn = asn
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
# Checks equality by comparing each attribute.
|
|
132
|
+
# @param [Object] Object to be compared
|
|
133
|
+
def ==(o)
|
|
134
|
+
return true if self.equal?(o)
|
|
135
|
+
self.class == o.class &&
|
|
136
|
+
ip == o.ip &&
|
|
137
|
+
asn == o.asn
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
# @see the `==` method
|
|
141
|
+
# @param [Object] Object to be compared
|
|
142
|
+
def eql?(o)
|
|
143
|
+
self == o
|
|
144
|
+
end
|
|
145
|
+
|
|
146
|
+
# Calculates hash code according to all attributes.
|
|
147
|
+
# @return [Integer] Hash code
|
|
148
|
+
def hash
|
|
149
|
+
[ip, asn].hash
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
# Builds the object from hash
|
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
154
|
+
# @return [Object] Returns the model itself
|
|
155
|
+
def self.build_from_hash(attributes)
|
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
|
157
|
+
attributes = attributes.transform_keys(&:to_sym)
|
|
158
|
+
transformed_hash = {}
|
|
159
|
+
openapi_types.each_pair do |key, type|
|
|
160
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
|
161
|
+
transformed_hash["#{key}"] = nil
|
|
162
|
+
elsif type =~ /\AArray<(.*)>/i
|
|
163
|
+
# check to ensure the input is an array given that the attribute
|
|
164
|
+
# is documented as an array but the input is not
|
|
165
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
|
166
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
|
167
|
+
end
|
|
168
|
+
elsif !attributes[attribute_map[key]].nil?
|
|
169
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
|
170
|
+
end
|
|
171
|
+
end
|
|
172
|
+
new(transformed_hash)
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
# Returns the object in the form of hash
|
|
176
|
+
# @return [Hash] Returns the object in the form of hash
|
|
177
|
+
def to_hash
|
|
178
|
+
hash = {}
|
|
179
|
+
self.class.attribute_map.each_pair do |attr, param|
|
|
180
|
+
value = self.send(attr)
|
|
181
|
+
if value.nil?
|
|
182
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
183
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
184
|
+
end
|
|
185
|
+
|
|
186
|
+
hash[param] = _to_hash(value)
|
|
187
|
+
end
|
|
188
|
+
hash
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
end
|