Class: WhoisFreaks::InetNum
- Inherits:
-
Object
- Object
- WhoisFreaks::InetNum
- Defined in:
- lib/whoisfreaks/models/inet_num.rb
Instance Attribute Summary collapse
-
#assignment_size ⇒ Object
Returns the value of attribute assignment_size.
-
#cidr ⇒ Object
Returns the value of attribute cidr.
-
#city ⇒ Object
Returns the value of attribute city.
-
#countries ⇒ Object
Returns the value of attribute countries.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#date_updated ⇒ Object
Returns the value of attribute date_updated.
-
#description ⇒ Object
Returns the value of attribute description.
-
#end_ip ⇒ Object
Returns the value of attribute end_ip.
-
#geofeed ⇒ Object
Returns the value of attribute geofeed.
-
#languages ⇒ Object
Returns the value of attribute languages.
-
#latitude ⇒ Object
Returns the value of attribute latitude.
-
#longitude ⇒ Object
Returns the value of attribute longitude.
-
#mnt_by ⇒ Object
Returns the value of attribute mnt_by.
-
#mnt_domains ⇒ Object
Returns the value of attribute mnt_domains.
-
#mnt_irt ⇒ Object
Returns the value of attribute mnt_irt.
-
#mnt_lower ⇒ Object
Returns the value of attribute mnt_lower.
-
#mnt_routes ⇒ Object
Returns the value of attribute mnt_routes.
-
#net_handle ⇒ Object
Returns the value of attribute net_handle.
-
#net_name ⇒ Object
Returns the value of attribute net_name.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#organization ⇒ Object
Returns the value of attribute organization.
-
#parents ⇒ Object
Returns the value of attribute parents.
-
#remarks ⇒ Object
Returns the value of attribute remarks.
-
#source ⇒ Object
Returns the value of attribute source.
-
#sponsoring_organization ⇒ Object
Returns the value of attribute sponsoring_organization.
-
#start_ip ⇒ Object
Returns the value of attribute start_ip.
-
#status ⇒ Object
Returns the value of attribute status.
Class Method Summary collapse
-
._deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ InetNum
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ InetNum
Initializes the object
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 151 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::InetNum` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `WhoisFreaks::InetNum`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'start_ip') self.start_ip = attributes[:'start_ip'] end if attributes.key?(:'end_ip') self.end_ip = attributes[:'end_ip'] end if attributes.key?(:'cidr') if (value = attributes[:'cidr']).is_a?(Array) self.cidr = value end end if attributes.key?(:'net_name') self.net_name = attributes[:'net_name'] end if attributes.key?(:'net_handle') self.net_handle = attributes[:'net_handle'] end if attributes.key?(:'description') if (value = attributes[:'description']).is_a?(Array) self.description = value end end if attributes.key?(:'countries') if (value = attributes[:'countries']).is_a?(Array) self.countries = value end end if attributes.key?(:'geofeed') self.geofeed = attributes[:'geofeed'] end if attributes.key?(:'latitude') self.latitude = attributes[:'latitude'] end if attributes.key?(:'longitude') self.longitude = attributes[:'longitude'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'languages') if (value = attributes[:'languages']).is_a?(Array) self.languages = value end end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'organization') self.organization = attributes[:'organization'] end if attributes.key?(:'sponsoring_organization') self.sponsoring_organization = attributes[:'sponsoring_organization'] end if attributes.key?(:'remarks') if (value = attributes[:'remarks']).is_a?(Array) self.remarks = value end end if attributes.key?(:'assignment_size') self.assignment_size = attributes[:'assignment_size'] end if attributes.key?(:'notify') if (value = attributes[:'notify']).is_a?(Array) self.notify = value end end if attributes.key?(:'mnt_by') if (value = attributes[:'mnt_by']).is_a?(Array) self.mnt_by = value end end if attributes.key?(:'mnt_lower') if (value = attributes[:'mnt_lower']).is_a?(Array) self.mnt_lower = value end end if attributes.key?(:'mnt_domains') if (value = attributes[:'mnt_domains']).is_a?(Array) self.mnt_domains = value end end if attributes.key?(:'mnt_routes') if (value = attributes[:'mnt_routes']).is_a?(Array) self.mnt_routes = value end end if attributes.key?(:'mnt_irt') if (value = attributes[:'mnt_irt']).is_a?(Array) self.mnt_irt = value end end if attributes.key?(:'date_created') self.date_created = attributes[:'date_created'] end if attributes.key?(:'date_updated') self.date_updated = attributes[:'date_updated'] end if attributes.key?(:'source') self.source = attributes[:'source'] end if attributes.key?(:'parents') if (value = attributes[:'parents']).is_a?(Array) self.parents = value end end end |
Instance Attribute Details
#assignment_size ⇒ Object
Returns the value of attribute assignment_size.
50 51 52 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 50 def assignment_size @assignment_size end |
#cidr ⇒ Object
Returns the value of attribute cidr.
22 23 24 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 22 def cidr @cidr end |
#city ⇒ Object
Returns the value of attribute city.
38 39 40 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 38 def city @city end |
#countries ⇒ Object
Returns the value of attribute countries.
30 31 32 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 30 def countries @countries end |
#date_created ⇒ Object
Returns the value of attribute date_created.
64 65 66 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 64 def date_created @date_created end |
#date_updated ⇒ Object
Returns the value of attribute date_updated.
66 67 68 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 66 def date_updated @date_updated end |
#description ⇒ Object
Returns the value of attribute description.
28 29 30 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 28 def description @description end |
#end_ip ⇒ Object
Returns the value of attribute end_ip.
20 21 22 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 20 def end_ip @end_ip end |
#geofeed ⇒ Object
Returns the value of attribute geofeed.
32 33 34 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 32 def geofeed @geofeed end |
#languages ⇒ Object
Returns the value of attribute languages.
40 41 42 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 40 def languages @languages end |
#latitude ⇒ Object
Returns the value of attribute latitude.
34 35 36 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 34 def latitude @latitude end |
#longitude ⇒ Object
Returns the value of attribute longitude.
36 37 38 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 36 def longitude @longitude end |
#mnt_by ⇒ Object
Returns the value of attribute mnt_by.
54 55 56 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 54 def mnt_by @mnt_by end |
#mnt_domains ⇒ Object
Returns the value of attribute mnt_domains.
58 59 60 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 58 def mnt_domains @mnt_domains end |
#mnt_irt ⇒ Object
Returns the value of attribute mnt_irt.
62 63 64 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 62 def mnt_irt @mnt_irt end |
#mnt_lower ⇒ Object
Returns the value of attribute mnt_lower.
56 57 58 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 56 def mnt_lower @mnt_lower end |
#mnt_routes ⇒ Object
Returns the value of attribute mnt_routes.
60 61 62 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 60 def mnt_routes @mnt_routes end |
#net_handle ⇒ Object
Returns the value of attribute net_handle.
26 27 28 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 26 def net_handle @net_handle end |
#net_name ⇒ Object
Returns the value of attribute net_name.
24 25 26 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 24 def net_name @net_name end |
#notify ⇒ Object
Returns the value of attribute notify.
52 53 54 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 52 def notify @notify end |
#organization ⇒ Object
Returns the value of attribute organization.
44 45 46 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 44 def organization @organization end |
#parents ⇒ Object
Returns the value of attribute parents.
70 71 72 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 70 def parents @parents end |
#remarks ⇒ Object
Returns the value of attribute remarks.
48 49 50 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 48 def remarks @remarks end |
#source ⇒ Object
Returns the value of attribute source.
68 69 70 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 68 def source @source end |
#sponsoring_organization ⇒ Object
Returns the value of attribute sponsoring_organization.
46 47 48 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 46 def sponsoring_organization @sponsoring_organization end |
#start_ip ⇒ Object
Returns the value of attribute start_ip.
18 19 20 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 18 def start_ip @start_ip end |
#status ⇒ Object
Returns the value of attribute status.
42 43 44 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 42 def status @status end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 385 def self._deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = WhoisFreaks.const_get(type) klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
106 107 108 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 106 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 73 def self.attribute_map { :'start_ip' => :'start_ip', :'end_ip' => :'end_ip', :'cidr' => :'cidr', :'net_name' => :'net_name', :'net_handle' => :'net_handle', :'description' => :'description', :'countries' => :'countries', :'geofeed' => :'geofeed', :'latitude' => :'latitude', :'longitude' => :'longitude', :'city' => :'city', :'languages' => :'languages', :'status' => :'status', :'organization' => :'organization', :'sponsoring_organization' => :'sponsoring_organization', :'remarks' => :'remarks', :'assignment_size' => :'assignment_size', :'notify' => :'notify', :'mnt_by' => :'mnt_by', :'mnt_lower' => :'mnt_lower', :'mnt_domains' => :'mnt_domains', :'mnt_routes' => :'mnt_routes', :'mnt_irt' => :'mnt_irt', :'date_created' => :'date_created', :'date_updated' => :'date_updated', :'source' => :'source', :'parents' => :'parents' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 361 def self.build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) transformed_hash = {} openapi_types.each_pair do |key, type| if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = nil elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[attribute_map[key]].is_a?(Array) transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) } end elsif !attributes[attribute_map[key]].nil? transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]]) end end new(transformed_hash) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
144 145 146 147 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 144 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 111 def self.openapi_types { :'start_ip' => :'String', :'end_ip' => :'String', :'cidr' => :'Array<String>', :'net_name' => :'String', :'net_handle' => :'String', :'description' => :'Array<String>', :'countries' => :'Array<String>', :'geofeed' => :'String', :'latitude' => :'Float', :'longitude' => :'Float', :'city' => :'String', :'languages' => :'Array<String>', :'status' => :'String', :'organization' => :'String', :'sponsoring_organization' => :'String', :'remarks' => :'Array<String>', :'assignment_size' => :'String', :'notify' => :'Array<String>', :'mnt_by' => :'Array<String>', :'mnt_lower' => :'Array<String>', :'mnt_domains' => :'Array<String>', :'mnt_routes' => :'Array<String>', :'mnt_irt' => :'Array<String>', :'date_created' => :'String', :'date_updated' => :'String', :'source' => :'String', :'parents' => :'Array<String>' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 314 def ==(o) return true if self.equal?(o) self.class == o.class && start_ip == o.start_ip && end_ip == o.end_ip && cidr == o.cidr && net_name == o.net_name && net_handle == o.net_handle && description == o.description && countries == o.countries && geofeed == o.geofeed && latitude == o.latitude && longitude == o.longitude && city == o.city && languages == o.languages && status == o.status && organization == o.organization && sponsoring_organization == o.sponsoring_organization && remarks == o.remarks && assignment_size == o.assignment_size && notify == o.notify && mnt_by == o.mnt_by && mnt_lower == o.mnt_lower && mnt_domains == o.mnt_domains && mnt_routes == o.mnt_routes && mnt_irt == o.mnt_irt && date_created == o.date_created && date_updated == o.date_updated && source == o.source && parents == o.parents end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
456 457 458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 456 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#eql?(o) ⇒ Boolean
348 349 350 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 348 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
354 355 356 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 354 def hash [start_ip, end_ip, cidr, net_name, net_handle, description, countries, geofeed, latitude, longitude, city, languages, status, organization, sponsoring_organization, remarks, assignment_size, notify, mnt_by, mnt_lower, mnt_domains, mnt_routes, mnt_irt, date_created, date_updated, source, parents].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
299 300 301 302 303 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 299 def list_invalid_properties warn '[DEPRECATED] the `list_invalid_properties` method is obsolete' invalid_properties = Array.new invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
432 433 434 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 432 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
438 439 440 441 442 443 444 445 446 447 448 449 450 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 438 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
426 427 428 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 426 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
307 308 309 310 |
# File 'lib/whoisfreaks/models/inet_num.rb', line 307 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |