Class: HelpScout::Customer

Inherits:
Object
  • Object
show all
Defined in:
lib/helpscout/models.rb

Overview

Customer developer.helpscout.net/objects/customer/

Attributes marked with a * are returned when listing customers. Other attributes are only returned when fetching a single customer.

Name          Type      Example               Notes

*id Int 29418 Unique identifier *firstName String Vernon

*lastName String Bear

*email String [email protected] If the customer has multiple

emails, only one is returned.

*photoUrl String

*photoType String twitter Type of photo. *gender String Male Gender of this customer. *age String 30-35

*organization String Acme, Inc

*jobTitle String CEO and Co-Founder

*location String Austin *createdAt DateTime 2012-07-23T12:34:12Z UTC time when this customer

was created.

*modifiedAt DateTime 2012-07-24T20:18:33Z UTC time when this customer

                                              was modified.
background      String   I've worked with...  This is the Background Info 
                                              field from the UI.
address         Address
socialProfiles  Array                         Array of SocialProfiles    
emails          Array                         Array of Emails
phones          Array                         Array of Phones
chats           Array                         Array of Chats
websites        Array                         Array of Websites

Possible values for photoType include:

  • PHOTO_TYPE_UNKNOWN

  • PHOTO_TYPE_GRAVATAR

  • PHOTO_TYPE_TWITTER

  • PHOTO_TYPE_FACEBOOK

  • PHOTO_TYPE_GOOGLE_PROFILE

  • PHOTO_TYPE_GOOGLE_PLUS

  • PHOTO_TYPE_LINKEDIN

Possible values for gender include:

  • GENDER_MALE

  • GENDER_FEMALE

  • GENDER_UNKNOWN

Defined Under Namespace

Classes: Address, Chat, Email, Phone, SocialProfile, Website

Constant Summary collapse

PHOTO_TYPE_UNKNOWN =
"unknown"
PHOTO_TYPE_GRAVATAR =
"gravatar"
PHOTO_TYPE_TWITTER =
"twitter"
PHOTO_TYPE_FACEBOOK =
"facebook"
PHOTO_TYPE_GOOGLE_PROFILE =
"googleprofile"
PHOTO_TYPE_GOOGLE_PLUS =
"googleplus"
PHOTO_TYPE_LINKEDIN =
"linkedin"
GENDER_MALE =
"male"
GENDER_FEMALE =
"female"
GENDER_UNKNOWN =
"unknown"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(object) ⇒ Customer

Creates a new Customer object from a Hash of attributes



549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
# File 'lib/helpscout/models.rb', line 549

def initialize(object)
  @createdAt = DateTime.iso8601(object["createdAt"]) if object["createdAt"]
  @modifiedAt = DateTime.iso8601(object["modifiedAt"]) if object["modifiedAt"]

  @id = object["id"]
  @firstName = object["firstName"]
  @lastName = object["lastName"]
  @photoUrl = object["photoUrl"]
  @photoType = object["photoType"]
  @gender = object["gender"]
  @age = object["age"]
  @organization = object["organization"]
  @jobTitle = object["jobTitle"]
  @location = object["location"]
  @background = object["background"]

  @address = nil
  if object["address"]
    @address = Address.new(object["address"])
  end

  @socialProfiles = []
  if object["socialProfiles"]
    object["socialProfiles"].each do |item|
      @socialProfiles << SocialProfile.new(item)
    end
  end

  @emails = []
  if object["emails"]
    object["emails"].each do |item|
      @emails << Email.new(item)
    end
  end

  @phones = []
  if object["phones"]
    object["phones"].each do |item|
      @phones << Phone.new(item)
    end
  end

  @chats = []
  if object["chats"]
    object["chats"].each do |item|
      @chats << Chat.new(item)
    end
  end

  @websites = []
  if object["websites"]
    object["websites"].each do |item|
      @websites << Website.new(item)
    end
  end
end

Instance Attribute Details

#addressObject (readonly)

Returns the value of attribute address.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def address
  @address
end

#ageObject (readonly)

Returns the value of attribute age.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def age
  @age
end

#backgroundObject (readonly)

Returns the value of attribute background.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def background
  @background
end

#chatsObject (readonly)

Returns the value of attribute chats.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def chats
  @chats
end

#createdAtObject (readonly)

Returns the value of attribute createdAt.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def createdAt
  @createdAt
end

#emailsObject (readonly)

Returns the value of attribute emails.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def emails
  @emails
end

#firstNameObject (readonly)

Returns the value of attribute firstName.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def firstName
  @firstName
end

#genderObject (readonly)

Returns the value of attribute gender.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def gender
  @gender
end

#idObject (readonly)

Returns the value of attribute id.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def id
  @id
end

#jobTitleObject (readonly)

Returns the value of attribute jobTitle.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def jobTitle
  @jobTitle
end

#lastNameObject (readonly)

Returns the value of attribute lastName.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def lastName
  @lastName
end

#locationObject (readonly)

Returns the value of attribute location.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def location
  @location
end

#modifiedAtObject (readonly)

Returns the value of attribute modifiedAt.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def modifiedAt
  @modifiedAt
end

#organizationObject (readonly)

Returns the value of attribute organization.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def organization
  @organization
end

#phonesObject (readonly)

Returns the value of attribute phones.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def phones
  @phones
end

#photoTypeObject (readonly)

Returns the value of attribute photoType.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def photoType
  @photoType
end

#photoUrlObject (readonly)

Returns the value of attribute photoUrl.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def photoUrl
  @photoUrl
end

#socialProfilesObject (readonly)

Returns the value of attribute socialProfiles.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def socialProfiles
  @socialProfiles
end

#websitesObject (readonly)

Returns the value of attribute websites.



534
535
536
# File 'lib/helpscout/models.rb', line 534

def websites
  @websites
end

Instance Method Details

#to_sObject

Returns a String suitable for display



607
608
609
# File 'lib/helpscout/models.rb', line 607

def to_s
  "#{@firstName} #{@lastName}"
end