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