Class: SwaggerClient::AccountContact
- Inherits:
-
Object
- Object
- SwaggerClient::AccountContact
- Defined in:
- lib/swagger_client/models/account_contact.rb
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
-
#address ⇒ Object
Returns the value of attribute address.
-
#address_id ⇒ Object
Returns the value of attribute address_id.
-
#contact_id ⇒ Object
Returns the value of attribute contact_id.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email_verified ⇒ Object
Returns the value of attribute email_verified.
-
#erp_id ⇒ Object
Returns the value of attribute erp_id.
-
#external_id ⇒ Object
Returns the value of attribute external_id.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phone_number ⇒ Object
Returns the value of attribute phone_number.
-
#state ⇒ Object
Returns the value of attribute state.
-
#title ⇒ Object
Returns the value of attribute title.
-
#updated_on ⇒ Object
Returns the value of attribute updated_on.
Class Method Summary collapse
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.swagger_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ AccountContact
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 = {}) ⇒ AccountContact
Initializes the object
121 122 123 124 125 126 127 128 129 130 131 132 133 134 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 |
# File 'lib/swagger_client/models/account_contact.rb', line 121 def initialize(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'id') self.id = attributes[:'id'] end if attributes.has_key?(:'contactId') self.contact_id = attributes[:'contactId'] end if attributes.has_key?(:'externalId') self.external_id = attributes[:'externalId'] end if attributes.has_key?(:'erpId') self.erp_id = attributes[:'erpId'] end if attributes.has_key?(:'accountId') self.account_id = attributes[:'accountId'] end if attributes.has_key?(:'firstName') self.first_name = attributes[:'firstName'] end if attributes.has_key?(:'lastName') self.last_name = attributes[:'lastName'] end if attributes.has_key?(:'email') self.email = attributes[:'email'] end if attributes.has_key?(:'emailVerified') self.email_verified = attributes[:'emailVerified'] end if attributes.has_key?(:'phoneNumber') self.phone_number = attributes[:'phoneNumber'] end if attributes.has_key?(:'title') self.title = attributes[:'title'] end if attributes.has_key?(:'addressId') self.address_id = attributes[:'addressId'] end if attributes.has_key?(:'address') self.address = attributes[:'address'] end if attributes.has_key?(:'state') self.state = attributes[:'state'] end if attributes.has_key?(:'createdOn') self.created_on = attributes[:'createdOn'] end if attributes.has_key?(:'updatedOn') self.updated_on = attributes[:'updatedOn'] end if attributes.has_key?(:'fullName') self.full_name = attributes[:'fullName'] end end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
25 26 27 |
# File 'lib/swagger_client/models/account_contact.rb', line 25 def account_id @account_id end |
#address ⇒ Object
Returns the value of attribute address.
41 42 43 |
# File 'lib/swagger_client/models/account_contact.rb', line 41 def address @address end |
#address_id ⇒ Object
Returns the value of attribute address_id.
39 40 41 |
# File 'lib/swagger_client/models/account_contact.rb', line 39 def address_id @address_id end |
#contact_id ⇒ Object
Returns the value of attribute contact_id.
19 20 21 |
# File 'lib/swagger_client/models/account_contact.rb', line 19 def contact_id @contact_id end |
#created_on ⇒ Object
Returns the value of attribute created_on.
45 46 47 |
# File 'lib/swagger_client/models/account_contact.rb', line 45 def created_on @created_on end |
#email ⇒ Object
Returns the value of attribute email.
31 32 33 |
# File 'lib/swagger_client/models/account_contact.rb', line 31 def email @email end |
#email_verified ⇒ Object
Returns the value of attribute email_verified.
33 34 35 |
# File 'lib/swagger_client/models/account_contact.rb', line 33 def email_verified @email_verified end |
#erp_id ⇒ Object
Returns the value of attribute erp_id.
23 24 25 |
# File 'lib/swagger_client/models/account_contact.rb', line 23 def erp_id @erp_id end |
#external_id ⇒ Object
Returns the value of attribute external_id.
21 22 23 |
# File 'lib/swagger_client/models/account_contact.rb', line 21 def external_id @external_id end |
#first_name ⇒ Object
Returns the value of attribute first_name.
27 28 29 |
# File 'lib/swagger_client/models/account_contact.rb', line 27 def first_name @first_name end |
#full_name ⇒ Object
Returns the value of attribute full_name.
49 50 51 |
# File 'lib/swagger_client/models/account_contact.rb', line 49 def full_name @full_name end |
#id ⇒ Object
Returns the value of attribute id.
17 18 19 |
# File 'lib/swagger_client/models/account_contact.rb', line 17 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
29 30 31 |
# File 'lib/swagger_client/models/account_contact.rb', line 29 def last_name @last_name end |
#phone_number ⇒ Object
Returns the value of attribute phone_number.
35 36 37 |
# File 'lib/swagger_client/models/account_contact.rb', line 35 def phone_number @phone_number end |
#state ⇒ Object
Returns the value of attribute state.
43 44 45 |
# File 'lib/swagger_client/models/account_contact.rb', line 43 def state @state end |
#title ⇒ Object
Returns the value of attribute title.
37 38 39 |
# File 'lib/swagger_client/models/account_contact.rb', line 37 def title @title end |
#updated_on ⇒ Object
Returns the value of attribute updated_on.
47 48 49 |
# File 'lib/swagger_client/models/account_contact.rb', line 47 def updated_on @updated_on end |
Class Method Details
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 |
# File 'lib/swagger_client/models/account_contact.rb', line 74 def self.attribute_map { :'id' => :'id', :'contact_id' => :'contactId', :'external_id' => :'externalId', :'erp_id' => :'erpId', :'account_id' => :'accountId', :'first_name' => :'firstName', :'last_name' => :'lastName', :'email' => :'email', :'email_verified' => :'emailVerified', :'phone_number' => :'phoneNumber', :'title' => :'title', :'address_id' => :'addressId', :'address' => :'address', :'state' => :'state', :'created_on' => :'createdOn', :'updated_on' => :'updatedOn', :'full_name' => :'fullName' } end |
.swagger_types ⇒ Object
Attribute type mapping.
97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/swagger_client/models/account_contact.rb', line 97 def self.swagger_types { :'id' => :'String', :'contact_id' => :'String', :'external_id' => :'String', :'erp_id' => :'String', :'account_id' => :'String', :'first_name' => :'String', :'last_name' => :'String', :'email' => :'String', :'email_verified' => :'BOOLEAN', :'phone_number' => :'String', :'title' => :'String', :'address_id' => :'String', :'address' => :'AccountAddress', :'state' => :'String', :'created_on' => :'Integer', :'updated_on' => :'Integer', :'full_name' => :'String' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
# File 'lib/swagger_client/models/account_contact.rb', line 391 def ==(o) return true if self.equal?(o) self.class == o.class && id == o.id && contact_id == o.contact_id && external_id == o.external_id && erp_id == o.erp_id && account_id == o.account_id && first_name == o.first_name && last_name == o.last_name && email == o.email && email_verified == o.email_verified && phone_number == o.phone_number && title == o.title && address_id == o.address_id && address == o.address && state == o.state && created_on == o.created_on && updated_on == o.updated_on && full_name == o.full_name end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 |
# File 'lib/swagger_client/models/account_contact.rb', line 449 def _deserialize(type, value) case type.to_sym when :DateTime DateTime.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 temp_model = SwaggerClient.const_get(type).new temp_model.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
515 516 517 518 519 520 521 522 523 524 525 526 527 |
# File 'lib/swagger_client/models/account_contact.rb', line 515 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 |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
# File 'lib/swagger_client/models/account_contact.rb', line 428 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if 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[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end # or else data not found in attributes(hash), not an issue as the data can be optional end self end |
#eql?(o) ⇒ Boolean
415 416 417 |
# File 'lib/swagger_client/models/account_contact.rb', line 415 def eql?(o) self == o end |
#hash ⇒ Fixnum
Calculates hash code according to all attributes.
421 422 423 |
# File 'lib/swagger_client/models/account_contact.rb', line 421 def hash [id, contact_id, external_id, erp_id, account_id, first_name, last_name, email, email_verified, phone_number, title, address_id, address, state, created_on, updated_on, full_name].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
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 |
# File 'lib/swagger_client/models/account_contact.rb', line 198 def list_invalid_properties invalid_properties = Array.new if !@external_id.nil? && @external_id.to_s.length > 36 invalid_properties.push('invalid value for "external_id", the character length must be smaller than or equal to 36.') end if !@external_id.nil? && @external_id.to_s.length < 0 invalid_properties.push('invalid value for "external_id", the character length must be great than or equal to 0.') end if !@erp_id.nil? && @erp_id.to_s.length > 100 invalid_properties.push('invalid value for "erp_id", the character length must be smaller than or equal to 100.') end if !@erp_id.nil? && @erp_id.to_s.length < 0 invalid_properties.push('invalid value for "erp_id", the character length must be great than or equal to 0.') end if !@first_name.nil? && @first_name.to_s.length > 255 invalid_properties.push('invalid value for "first_name", the character length must be smaller than or equal to 255.') end if !@first_name.nil? && @first_name.to_s.length < 0 invalid_properties.push('invalid value for "first_name", the character length must be great than or equal to 0.') end if !@last_name.nil? && @last_name.to_s.length > 255 invalid_properties.push('invalid value for "last_name", the character length must be smaller than or equal to 255.') end if !@last_name.nil? && @last_name.to_s.length < 0 invalid_properties.push('invalid value for "last_name", the character length must be great than or equal to 0.') end if !@email.nil? && @email.to_s.length > 255 invalid_properties.push('invalid value for "email", the character length must be smaller than or equal to 255.') end if !@email.nil? && @email.to_s.length < 0 invalid_properties.push('invalid value for "email", the character length must be great than or equal to 0.') end if !@phone_number.nil? && @phone_number.to_s.length > 255 invalid_properties.push('invalid value for "phone_number", the character length must be smaller than or equal to 255.') end if !@phone_number.nil? && @phone_number.to_s.length < 0 invalid_properties.push('invalid value for "phone_number", the character length must be great than or equal to 0.') end if !@title.nil? && @title.to_s.length > 255 invalid_properties.push('invalid value for "title", the character length must be smaller than or equal to 255.') end if !@title.nil? && @title.to_s.length < 0 invalid_properties.push('invalid value for "title", the character length must be great than or equal to 0.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
495 496 497 |
# File 'lib/swagger_client/models/account_contact.rb', line 495 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
501 502 503 504 505 506 507 508 509 |
# File 'lib/swagger_client/models/account_contact.rb', line 501 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) next if value.nil? hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
489 490 491 |
# File 'lib/swagger_client/models/account_contact.rb', line 489 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
# File 'lib/swagger_client/models/account_contact.rb', line 261 def valid? return false if !@external_id.nil? && @external_id.to_s.length > 36 return false if !@external_id.nil? && @external_id.to_s.length < 0 return false if !@erp_id.nil? && @erp_id.to_s.length > 100 return false if !@erp_id.nil? && @erp_id.to_s.length < 0 return false if !@first_name.nil? && @first_name.to_s.length > 255 return false if !@first_name.nil? && @first_name.to_s.length < 0 return false if !@last_name.nil? && @last_name.to_s.length > 255 return false if !@last_name.nil? && @last_name.to_s.length < 0 return false if !@email.nil? && @email.to_s.length > 255 return false if !@email.nil? && @email.to_s.length < 0 return false if !@phone_number.nil? && @phone_number.to_s.length > 255 return false if !@phone_number.nil? && @phone_number.to_s.length < 0 return false if !@title.nil? && @title.to_s.length > 255 return false if !@title.nil? && @title.to_s.length < 0 state_validator = EnumAttributeValidator.new('String', ['ACTIVE', 'DISABLED', 'EXPIRED']) return false unless state_validator.valid?(@state) true end |