Class: HelpScout::Conversation
- Inherits:
-
Object
- Object
- HelpScout::Conversation
- Defined in:
- lib/helpscout/models.rb
Overview
Conversation developer.helpscout.net/objects/conversation/
Name Type Example Notes
id Int 2391938111 Unique identifier
folderId Int 1234 ID of the Folder to which
this conversation resides.
isDraft Boolean false Is this a draft?
number Int 349 The conversation number
displayed in the UI.
owner Person User of the Help Scout user
that is currently assigned
to this conversation
mailbox Mailbox Mailbox to which this
conversation belongs.
customer Person Customer to which this
conversation belongs.
threadCount Int 4 This count represents the
number of published threads
found on the conversation
(it does not include line
items, drafts or threads
held for review by Traffic
Cop).
status String active Status of the conversation.
subject String I need help!
preview String Hello, I...
createdBy Person Either the Customer or User
that created this
conversation.
Inspect the Source object
for clarification.
createdAt DateTime 2012-07-23T12:34:12Z UTC time when this
conversation was created.
modifiedAt DateTime 2012-07-24T20:18:33Z UTC time when this.
conversation was modified.
closedAt DateTime UTC time when this
conversation was closed.
Null if not closed.
closedBy Person User of the Help Scout user
that closed this
conversation.
source Source Specifies the method in
which this conversation was
created.
cc Array Collection of strings
representing emails.
bcc Array Collection of strings
representing emails.
tags Array Collection of strings
threads Array Collection of Thread
objects. Only available when
retrieving a single
Conversation
Possible values for status include:
-
STATUS_ACTIVE
-
STATUS_PENDING
-
STATUS_CLOSED
-
STATUS_SPAM
Defined Under Namespace
Classes: Attachment, AttachmentData, Thread
Constant Summary collapse
- STATUS_ACTIVE =
"active"
- STATUS_PENDING =
"pending"
- STATUS_CLOSED =
"closed"
- STATUS_SPAM =
"spam"
Instance Attribute Summary collapse
-
#bcc ⇒ Object
readonly
Returns the value of attribute bcc.
-
#cc ⇒ Object
readonly
Returns the value of attribute cc.
-
#closedAt ⇒ Object
readonly
Returns the value of attribute closedAt.
-
#closedBy ⇒ Object
readonly
Returns the value of attribute closedBy.
-
#createdAt ⇒ Object
readonly
Returns the value of attribute createdAt.
-
#createdBy ⇒ Object
readonly
Returns the value of attribute createdBy.
-
#customer ⇒ Object
readonly
Returns the value of attribute customer.
-
#folderId ⇒ Object
readonly
Returns the value of attribute folderId.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#isDraft ⇒ Object
readonly
Returns the value of attribute isDraft.
-
#mailbox ⇒ Object
readonly
Returns the value of attribute mailbox.
-
#modifiedAt ⇒ Object
readonly
Returns the value of attribute modifiedAt.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#owner ⇒ Object
readonly
Returns the value of attribute owner.
-
#preview ⇒ Object
readonly
Returns the value of attribute preview.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#threadCount ⇒ Object
readonly
Returns the value of attribute threadCount.
-
#threads ⇒ Object
readonly
Returns the value of attribute threads.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(object) ⇒ Conversation
constructor
Creates a new Conversation object from a Hash of attributes.
-
#to_s ⇒ Object
Returns a String suitable for display.
Constructor Details
#initialize(object) ⇒ Conversation
Creates a new Conversation object from a Hash of attributes
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 |
# File 'lib/helpscout/models.rb', line 171 def initialize(object) @createdAt = DateTime.iso8601(object["createdAt"]) if object["createdAt"] @modifiedAt = DateTime.iso8601(object["userModifiedAt"]) if object["userModifiedAt"] @closedAt = DateTime.iso8601(object["closedAt"]) if object["closedAt"] @id = object["id"] @type = object["type"] @folderId = object["folderId"] @isDraft = object["isDraft"] @number = object["number"] @owner = Person.new(object["owner"]) if object["owner"] @mailbox = Mailbox.new(object["mailbox"]) if object["mailbox"] @customer = Person.new(object["customer"]) if object["customer"] @threadCount = object["threadCount"] @status = object["status"] @subject = object["subject"] @preview = object["preview"] @closedBy = Person.new(object["closedBy"]) if object["closedBy"] @createdBy = Person.new(object["person"]) if object["person"] @source = Source.new(object["source"]) if object["source"] @cc = object["cc"] @bcc = object["bcc"] @tags = object["tags"] @threads = [] if object["threads"] object["threads"].each do |thread| @threads << Thread.new(thread) end end @url = "https://secure.helpscout.net/conversation/#{@id}/#{@number}/" end |
Instance Attribute Details
#bcc ⇒ Object (readonly)
Returns the value of attribute bcc.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def bcc @bcc end |
#cc ⇒ Object (readonly)
Returns the value of attribute cc.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def cc @cc end |
#closedAt ⇒ Object (readonly)
Returns the value of attribute closedAt.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def closedAt @closedAt end |
#closedBy ⇒ Object (readonly)
Returns the value of attribute closedBy.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def closedBy @closedBy end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def createdAt @createdAt end |
#createdBy ⇒ Object (readonly)
Returns the value of attribute createdBy.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def createdBy @createdBy end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def customer @customer end |
#folderId ⇒ Object (readonly)
Returns the value of attribute folderId.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def folderId @folderId end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def id @id end |
#isDraft ⇒ Object (readonly)
Returns the value of attribute isDraft.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def isDraft @isDraft end |
#mailbox ⇒ Object (readonly)
Returns the value of attribute mailbox.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def mailbox @mailbox end |
#modifiedAt ⇒ Object (readonly)
Returns the value of attribute modifiedAt.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def modifiedAt @modifiedAt end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def number @number end |
#owner ⇒ Object (readonly)
Returns the value of attribute owner.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def owner @owner end |
#preview ⇒ Object (readonly)
Returns the value of attribute preview.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def preview @preview end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def source @source end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def status @status end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def subject @subject end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def @tags end |
#threadCount ⇒ Object (readonly)
Returns the value of attribute threadCount.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def threadCount @threadCount end |
#threads ⇒ Object (readonly)
Returns the value of attribute threads.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def threads @threads end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
163 164 165 |
# File 'lib/helpscout/models.rb', line 163 def url @url end |
Instance Method Details
#to_s ⇒ Object
Returns a String suitable for display
206 207 208 |
# File 'lib/helpscout/models.rb', line 206 def to_s "Last Modified: #{@modifiedAt}\nStatus: #{@status}\nAssigned to: #{@owner}\nSubject: #{@subject}\n#{@preview}" end |