class PureCloud::ExternalContact

Attributes

address[RW]
cell_phone[RW]
create_date[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

custom_fields[RW]

Custom fields defined in the schema referenced by schemaId and schemaVersion.

external_data_sources[RW]

Links to the sources of data (e.g. one source might be a CRM) that contributed data to this record. Read-only, and only populated when requested via expand param.

external_organization[RW]
external_system_url[RW]

A string that identifies an external system-of-record resource that may have more detailed information on the contact. It should be a valid URL (including the http/https protocol, port, and path [if any]). The value is automatically trimmed of any leading and trailing whitespace.

facebook_id[RW]
first_name[RW]

The first name of the contact.

home_phone[RW]
id[RW]

The globally unique identifier for the object.

last_name[RW]

The last name of the contact.

line_id[RW]
middle_name[RW]
modify_date[RW]

Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ

other_email[RW]
other_phone[RW]
personal_email[RW]
salutation[RW]
schema[RW]

The schema defining custom fields for this contact

self_uri[RW]

The URI for this object

survey_opt_out[RW]
title[RW]
twitter_id[RW]
whats_app_id[RW]
work_email[RW]
work_phone[RW]

Public Class Methods

attribute_map() click to toggle source

Attribute mapping from ruby-style variable name to JSON key.

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 86
def self.attribute_map
  {
    
    :'id' => :'id',
    
    :'first_name' => :'firstName',
    
    :'middle_name' => :'middleName',
    
    :'last_name' => :'lastName',
    
    :'salutation' => :'salutation',
    
    :'title' => :'title',
    
    :'work_phone' => :'workPhone',
    
    :'cell_phone' => :'cellPhone',
    
    :'home_phone' => :'homePhone',
    
    :'other_phone' => :'otherPhone',
    
    :'work_email' => :'workEmail',
    
    :'personal_email' => :'personalEmail',
    
    :'other_email' => :'otherEmail',
    
    :'address' => :'address',
    
    :'twitter_id' => :'twitterId',
    
    :'line_id' => :'lineId',
    
    :'whats_app_id' => :'whatsAppId',
    
    :'facebook_id' => :'facebookId',
    
    :'modify_date' => :'modifyDate',
    
    :'create_date' => :'createDate',
    
    :'external_organization' => :'externalOrganization',
    
    :'survey_opt_out' => :'surveyOptOut',
    
    :'external_system_url' => :'externalSystemUrl',
    
    :'schema' => :'schema',
    
    :'custom_fields' => :'customFields',
    
    :'external_data_sources' => :'externalDataSources',
    
    :'self_uri' => :'selfUri'
    
  }
end
new(attributes = {}) click to toggle source

Initializes the object @param [Hash] attributes Model attributes in the form of hash

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 209
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?(:'firstName')
    
    
    self.first_name = attributes[:'firstName']
    
  
  end

  
  if attributes.has_key?(:'middleName')
    
    
    self.middle_name = attributes[:'middleName']
    
  
  end

  
  if attributes.has_key?(:'lastName')
    
    
    self.last_name = attributes[:'lastName']
    
  
  end

  
  if attributes.has_key?(:'salutation')
    
    
    self.salutation = attributes[:'salutation']
    
  
  end

  
  if attributes.has_key?(:'title')
    
    
    self.title = attributes[:'title']
    
  
  end

  
  if attributes.has_key?(:'workPhone')
    
    
    self.work_phone = attributes[:'workPhone']
    
  
  end

  
  if attributes.has_key?(:'cellPhone')
    
    
    self.cell_phone = attributes[:'cellPhone']
    
  
  end

  
  if attributes.has_key?(:'homePhone')
    
    
    self.home_phone = attributes[:'homePhone']
    
  
  end

  
  if attributes.has_key?(:'otherPhone')
    
    
    self.other_phone = attributes[:'otherPhone']
    
  
  end

  
  if attributes.has_key?(:'workEmail')
    
    
    self.work_email = attributes[:'workEmail']
    
  
  end

  
  if attributes.has_key?(:'personalEmail')
    
    
    self.personal_email = attributes[:'personalEmail']
    
  
  end

  
  if attributes.has_key?(:'otherEmail')
    
    
    self.other_email = attributes[:'otherEmail']
    
  
  end

  
  if attributes.has_key?(:'address')
    
    
    self.address = attributes[:'address']
    
  
  end

  
  if attributes.has_key?(:'twitterId')
    
    
    self.twitter_id = attributes[:'twitterId']
    
  
  end

  
  if attributes.has_key?(:'lineId')
    
    
    self.line_id = attributes[:'lineId']
    
  
  end

  
  if attributes.has_key?(:'whatsAppId')
    
    
    self.whats_app_id = attributes[:'whatsAppId']
    
  
  end

  
  if attributes.has_key?(:'facebookId')
    
    
    self.facebook_id = attributes[:'facebookId']
    
  
  end

  
  if attributes.has_key?(:'modifyDate')
    
    
    self.modify_date = attributes[:'modifyDate']
    
  
  end

  
  if attributes.has_key?(:'createDate')
    
    
    self.create_date = attributes[:'createDate']
    
  
  end

  
  if attributes.has_key?(:'externalOrganization')
    
    
    self.external_organization = attributes[:'externalOrganization']
    
  
  end

  
  if attributes.has_key?(:'surveyOptOut')
    
    
    self.survey_opt_out = attributes[:'surveyOptOut']
    
  
  end

  
  if attributes.has_key?(:'externalSystemUrl')
    
    
    self.external_system_url = attributes[:'externalSystemUrl']
    
  
  end

  
  if attributes.has_key?(:'schema')
    
    
    self.schema = attributes[:'schema']
    
  
  end

  
  if attributes.has_key?(:'customFields')
    
    if (value = attributes[:'customFields']).is_a?(Array)
      self.custom_fields = value
    end
    
    
  
  end

  
  if attributes.has_key?(:'externalDataSources')
    
    if (value = attributes[:'externalDataSources']).is_a?(Array)
      self.external_data_sources = value
    end
    
    
  
  end

  
  if attributes.has_key?(:'selfUri')
    
    
    self.self_uri = attributes[:'selfUri']
    
  
  end

  
end
swagger_types() click to toggle source

Attribute type mapping.

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 147
def self.swagger_types
  {
    
    :'id' => :'String',
    
    :'first_name' => :'String',
    
    :'middle_name' => :'String',
    
    :'last_name' => :'String',
    
    :'salutation' => :'String',
    
    :'title' => :'String',
    
    :'work_phone' => :'PhoneNumber',
    
    :'cell_phone' => :'PhoneNumber',
    
    :'home_phone' => :'PhoneNumber',
    
    :'other_phone' => :'PhoneNumber',
    
    :'work_email' => :'String',
    
    :'personal_email' => :'String',
    
    :'other_email' => :'String',
    
    :'address' => :'ContactAddress',
    
    :'twitter_id' => :'TwitterId',
    
    :'line_id' => :'LineId',
    
    :'whats_app_id' => :'WhatsAppId',
    
    :'facebook_id' => :'FacebookId',
    
    :'modify_date' => :'DateTime',
    
    :'create_date' => :'DateTime',
    
    :'external_organization' => :'ExternalOrganization',
    
    :'survey_opt_out' => :'BOOLEAN',
    
    :'external_system_url' => :'String',
    
    :'schema' => :'DataSchema',
    
    :'custom_fields' => :'Hash<String, Object>',
    
    :'external_data_sources' => :'Array<ExternalDataSource>',
    
    :'self_uri' => :'String'
    
  }
end

Public Instance Methods

==(o) click to toggle source

Checks equality by comparing each attribute. @param [Object] Object to be compared

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 736
def ==(o)
  return true if self.equal?(o)
  self.class == o.class &&
      id == o.id &&
      first_name == o.first_name &&
      middle_name == o.middle_name &&
      last_name == o.last_name &&
      salutation == o.salutation &&
      title == o.title &&
      work_phone == o.work_phone &&
      cell_phone == o.cell_phone &&
      home_phone == o.home_phone &&
      other_phone == o.other_phone &&
      work_email == o.work_email &&
      personal_email == o.personal_email &&
      other_email == o.other_email &&
      address == o.address &&
      twitter_id == o.twitter_id &&
      line_id == o.line_id &&
      whats_app_id == o.whats_app_id &&
      facebook_id == o.facebook_id &&
      modify_date == o.modify_date &&
      create_date == o.create_date &&
      external_organization == o.external_organization &&
      survey_opt_out == o.survey_opt_out &&
      external_system_url == o.external_system_url &&
      schema == o.schema &&
      custom_fields == o.custom_fields &&
      external_data_sources == o.external_data_sources &&
      self_uri == o.self_uri
end
_deserialize(type, value) click to toggle source
# File lib/purecloudplatformclientv2/models/external_contact.rb, line 800
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 =~ /^(true|t|yes|y|1)$/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
    _model = Object.const_get("PureCloud").const_get(type).new
    _model.build_from_hash(value)
  end
end
_to_hash(value) click to toggle source

Method to output non-array value in the form of hash For object, use to_hash. Otherwise, just return the value

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 860
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) click to toggle source

build the object from hash

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 781
def build_from_hash(attributes)
  return nil unless attributes.is_a?(Hash)
  self.class.swagger_types.each_pair do |key, type|
    if type =~ /^Array<(.*)>/i
      if attributes[self.class.attribute_map[key]].is_a?(Array)
        self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
      else
        #TODO show warning in debug mode
      end
    elsif !attributes[self.class.attribute_map[key]].nil?
      self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
    else
      # data not found in attributes(hash), not an issue as the data can be optional
    end
  end

  self
end
eql?(o) click to toggle source

@see the `==` method @param [Object] Object to be compared

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 770
def eql?(o)
  self == o
end
hash() click to toggle source

Calculates hash code according to all attributes. @return [Fixnum] Hash code

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 776
def hash
  [id, first_name, middle_name, last_name, salutation, title, work_phone, cell_phone, home_phone, other_phone, work_email, personal_email, other_email, address, twitter_id, line_id, whats_app_id, facebook_id, modify_date, create_date, external_organization, survey_opt_out, external_system_url, schema, custom_fields, external_data_sources, self_uri].hash
end
list_invalid_properties() click to toggle source

Show invalid properties with the reasons. Usually used together with valid? @return Array for valid properies with the reasons

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 467
def list_invalid_properties
  invalid_properties = Array.new
  
  
  return invalid_properties
end
to_body() click to toggle source

to_body is an alias to to_body (backward compatibility))

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 843
def to_body
  to_hash
end
to_hash() click to toggle source

return the object in the form of hash

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 848
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() click to toggle source
# File lib/purecloudplatformclientv2/models/external_contact.rb, line 838
def to_s
  to_hash.to_s
end
valid?() click to toggle source

Check to see if the all the properties in the model are valid @return true if the model is valid

# File lib/purecloudplatformclientv2/models/external_contact.rb, line 476
def valid?
  
  
  
  
  
  
  if @first_name.nil?
    return false
  end

  
  
  
  
  
  
  
  
  
  if @last_name.nil?
    return false
  end

  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
  
end