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