Class: WhoisFreaks::WhoisPerson
- Inherits:
-
Object
- Object
- WhoisFreaks::WhoisPerson
- Defined in:
- lib/whoisfreaks/models/whois_person.rb
Instance Attribute Summary collapse
-
#abuse_mailbox ⇒ Object
Returns the value of attribute abuse_mailbox.
-
#address ⇒ Object
Returns the value of attribute address.
-
#admin_contacts ⇒ Object
Returns the value of attribute admin_contacts.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#date_created ⇒ Object
Returns the value of attribute date_created.
-
#date_updated ⇒ Object
Returns the value of attribute date_updated.
-
#district ⇒ Object
Returns the value of attribute district.
-
#email ⇒ Object
Returns the value of attribute email.
-
#fax_no ⇒ Object
Returns the value of attribute fax_no.
-
#handle ⇒ Object
Returns the value of attribute handle.
-
#mnt_by ⇒ Object
Returns the value of attribute mnt_by.
-
#mnt_ref ⇒ Object
Returns the value of attribute mnt_ref.
-
#name ⇒ Object
Returns the value of attribute name.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#organizations ⇒ Object
Returns the value of attribute organizations.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#remarks ⇒ Object
Returns the value of attribute remarks.
-
#source ⇒ Object
Returns the value of attribute source.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#tech_contacts ⇒ Object
Returns the value of attribute tech_contacts.
-
#zip_code ⇒ Object
Returns the value of attribute zip_code.
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 = {}) ⇒ WhoisPerson
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 = {}) ⇒ WhoisPerson
Initializes the object
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 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 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 135 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `WhoisFreaks::WhoisPerson` 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::WhoisPerson`. 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?(:'handle') self.handle = attributes[:'handle'] end if attributes.key?(:'name') self.name = attributes[:'name'] end if attributes.key?(:'address') if (value = attributes[:'address']).is_a?(Array) self.address = value end end if attributes.key?(:'street') self.street = attributes[:'street'] end if attributes.key?(:'city') self.city = attributes[:'city'] end if attributes.key?(:'district') self.district = attributes[:'district'] end if attributes.key?(:'state') self.state = attributes[:'state'] end if attributes.key?(:'zip_code') self.zip_code = attributes[:'zip_code'] end if attributes.key?(:'country') self.country = attributes[:'country'] end if attributes.key?(:'email') if (value = attributes[:'email']).is_a?(Array) self.email = value end end if attributes.key?(:'abuse_mailbox') if (value = attributes[:'abuse_mailbox']).is_a?(Array) self.abuse_mailbox = value end end if attributes.key?(:'phone') if (value = attributes[:'phone']).is_a?(Array) self.phone = value end end if attributes.key?(:'fax_no') if (value = attributes[:'fax_no']).is_a?(Array) self.fax_no = value end end if attributes.key?(:'organizations') if (value = attributes[:'organizations']).is_a?(Array) self.organizations = value end end if attributes.key?(:'admin_contacts') if (value = attributes[:'admin_contacts']).is_a?(Array) self.admin_contacts = value end end if attributes.key?(:'tech_contacts') if (value = attributes[:'tech_contacts']).is_a?(Array) self.tech_contacts = value end end if attributes.key?(:'remarks') if (value = attributes[:'remarks']).is_a?(Array) self.remarks = value end 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_ref') if (value = attributes[:'mnt_ref']).is_a?(Array) self.mnt_ref = 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 end |
Instance Attribute Details
#abuse_mailbox ⇒ Object
Returns the value of attribute abuse_mailbox.
38 39 40 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 38 def abuse_mailbox @abuse_mailbox end |
#address ⇒ Object
Returns the value of attribute address.
22 23 24 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 22 def address @address end |
#admin_contacts ⇒ Object
Returns the value of attribute admin_contacts.
46 47 48 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 46 def admin_contacts @admin_contacts end |
#city ⇒ Object
Returns the value of attribute city.
26 27 28 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 26 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
34 35 36 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 34 def country @country end |
#date_created ⇒ Object
Returns the value of attribute date_created.
58 59 60 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 58 def date_created @date_created end |
#date_updated ⇒ Object
Returns the value of attribute date_updated.
60 61 62 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 60 def date_updated @date_updated end |
#district ⇒ Object
Returns the value of attribute district.
28 29 30 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 28 def district @district end |
#email ⇒ Object
Returns the value of attribute email.
36 37 38 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 36 def email @email end |
#fax_no ⇒ Object
Returns the value of attribute fax_no.
42 43 44 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 42 def fax_no @fax_no end |
#handle ⇒ Object
Returns the value of attribute handle.
18 19 20 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 18 def handle @handle end |
#mnt_by ⇒ Object
Returns the value of attribute mnt_by.
54 55 56 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 54 def mnt_by @mnt_by end |
#mnt_ref ⇒ Object
Returns the value of attribute mnt_ref.
56 57 58 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 56 def mnt_ref @mnt_ref end |
#name ⇒ Object
Returns the value of attribute name.
20 21 22 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 20 def name @name end |
#notify ⇒ Object
Returns the value of attribute notify.
52 53 54 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 52 def notify @notify end |
#organizations ⇒ Object
Returns the value of attribute organizations.
44 45 46 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 44 def organizations @organizations end |
#phone ⇒ Object
Returns the value of attribute phone.
40 41 42 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 40 def phone @phone end |
#remarks ⇒ Object
Returns the value of attribute remarks.
50 51 52 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 50 def remarks @remarks end |
#source ⇒ Object
Returns the value of attribute source.
62 63 64 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 62 def source @source end |
#state ⇒ Object
Returns the value of attribute state.
30 31 32 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 30 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
24 25 26 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 24 def street @street end |
#tech_contacts ⇒ Object
Returns the value of attribute tech_contacts.
48 49 50 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 48 def tech_contacts @tech_contacts end |
#zip_code ⇒ Object
Returns the value of attribute zip_code.
32 33 34 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 32 def zip_code @zip_code end |
Class Method Details
._deserialize(type, value) ⇒ Object
Deserializes the data based on type
349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 349 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
94 95 96 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 94 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 65 def self.attribute_map { :'handle' => :'handle', :'name' => :'name', :'address' => :'address', :'street' => :'street', :'city' => :'city', :'district' => :'district', :'state' => :'state', :'zip_code' => :'zip_code', :'country' => :'country', :'email' => :'email', :'abuse_mailbox' => :'abuse_mailbox', :'phone' => :'phone', :'fax_no' => :'fax_no', :'organizations' => :'organizations', :'admin_contacts' => :'admin_contacts', :'tech_contacts' => :'tech_contacts', :'remarks' => :'remarks', :'notify' => :'notify', :'mnt_by' => :'mnt_by', :'mnt_ref' => :'mnt_ref', :'date_created' => :'date_created', :'date_updated' => :'date_updated', :'source' => :'source' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 325 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
128 129 130 131 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 128 def self.openapi_nullable Set.new([ ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 99 def self.openapi_types { :'handle' => :'String', :'name' => :'String', :'address' => :'Array<String>', :'street' => :'String', :'city' => :'String', :'district' => :'String', :'state' => :'String', :'zip_code' => :'String', :'country' => :'String', :'email' => :'Array<String>', :'abuse_mailbox' => :'Array<String>', :'phone' => :'Array<String>', :'fax_no' => :'Array<String>', :'organizations' => :'Array<String>', :'admin_contacts' => :'Array<String>', :'tech_contacts' => :'Array<String>', :'remarks' => :'Array<String>', :'notify' => :'Array<String>', :'mnt_by' => :'Array<String>', :'mnt_ref' => :'Array<String>', :'date_created' => :'String', :'date_updated' => :'String', :'source' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 282 def ==(o) return true if self.equal?(o) self.class == o.class && handle == o.handle && name == o.name && address == o.address && street == o.street && city == o.city && district == o.district && state == o.state && zip_code == o.zip_code && country == o.country && email == o.email && abuse_mailbox == o.abuse_mailbox && phone == o.phone && fax_no == o.fax_no && organizations == o.organizations && admin_contacts == o.admin_contacts && tech_contacts == o.tech_contacts && remarks == o.remarks && notify == o.notify && mnt_by == o.mnt_by && mnt_ref == o.mnt_ref && date_created == o.date_created && date_updated == o.date_updated && source == o.source end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
420 421 422 423 424 425 426 427 428 429 430 431 432 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 420 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
312 313 314 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 312 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
318 319 320 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 318 def hash [handle, name, address, street, city, district, state, zip_code, country, email, abuse_mailbox, phone, fax_no, organizations, admin_contacts, tech_contacts, remarks, notify, mnt_by, mnt_ref, date_created, date_updated, source].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
267 268 269 270 271 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 267 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)
396 397 398 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 396 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
402 403 404 405 406 407 408 409 410 411 412 413 414 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 402 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
390 391 392 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 390 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
275 276 277 278 |
# File 'lib/whoisfreaks/models/whois_person.rb', line 275 def valid? warn '[DEPRECATED] the `valid?` method is obsolete' true end |