Class: HelpScout::Conversation::Thread
- Inherits:
-
Object
- Object
- HelpScout::Conversation::Thread
- Defined in:
- lib/helpscout/models.rb
Overview
Conversation::Thread developer.helpscout.net/objects/conversation/thread/
Name Type Example Notes
id Int 88171881 Unique identifier
assignedTo Person User of the Help Scout user
to which this conversation
has been assigned.
status String active Status of the thread. Thread
status is only updated when
there is a status change.
Otherwise, the status will
be set to STATUS_NO_CHANGE.
createdAt DateTime 2012-07-23T12:34:12Z UTC time when this thread
was created.
createdBy Person Either the Customer or User
that created this
conversation. Inspect the
Source object for
clarification.
source Source
fromMailbox Mailbox If the conversation was
moved, fromMailbox
represents the Mailbox from
which it was moved.
type String message The type of thread.
state String published The state of the thread.
customer Person If type is message, this is
the Customer of the customer
in which the message was
sent. If type is customer,
this is the Customer of the
customer that initiated the
thread.
body String Thank you.
to Array Collection of Strings
representing emails.
cc Array Collection of Strings
representing emails.
bcc Array Collection of Strings
representing emails.
attachments Array Collection of Attachment
objects, if they exist.
Possible values for state include:
-
STATE_PUBLISHED
-
STATE_DRAFT
-
STATE_UNDER_REVIEW
A state of STATE_UNDER_REVIEW means the thread has been stopped by Traffic Cop and is waiting to be confirmed (or discarded) by the person that created the thread.
Traffic Cop is the Help Scout feature that stops a thread from going out if multiple Users act on the same Help Scout simultaneously.
Possible values for status include:
-
STATUS_ACTIVE
-
STATUS_NO_CHANGE
-
STATUS_PENDING
-
STATUS_CLOSED
-
STATUS_SPAM
Possible values for type include:
-
TYPE_NOTE
-
TYPE_MESSAGE
-
TYPE_CUSTOMER
-
TYPE_LINEITEM
-
TYPE_FWD_PARENT
-
TYPE_FWD_CHILD
TYPE_LINEITEM represents a change of state on the conversation. This could include, but not limited to, the conversation was assigned, the status changed, the conversation was moved from one mailbox to another, etc. A line item won’t have a body, to/cc/bcc lists, or attachments.
When a conversation is forwarded, a new conversation is created to represent the forwarded conversation.
-
TYPE_FWD_PARENT is the type set on the thread of the original conversation that initiated the forward event.
-
TYPE_FWD_CHILD is the type set on the first thread of the new forwarded conversation.
Constant Summary collapse
- STATE_PUBLISHED =
"published"
- STATE_DRAFT =
"draft"
- STATE_UNDER_REVIEW =
"underreview"
- STATUS_ACTIVE =
"active"
- STATUS_NO_CHANGE =
"nochange"
- STATUS_PENDING =
"pending"
- STATUS_CLOSED =
"closed"
- STATUS_SPAM =
"spam"
- TYPE_NOTE =
"note"
- TYPE_MESSAGE =
"message"
- TYPE_CUSTOMER =
"customer"
- TYPE_LINEITEM =
"lineitem"
- TYPE_FWD_PARENT =
"forwardparent"
- TYPE_FWD_CHILD =
"forwardchild"
Instance Attribute Summary collapse
-
#assignedTo ⇒ Object
readonly
Returns the value of attribute assignedTo.
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#bcc ⇒ Object
readonly
Returns the value of attribute bcc.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#cc ⇒ Object
readonly
Returns the value of attribute cc.
-
#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.
-
#fromMailbox ⇒ Object
readonly
Returns the value of attribute fromMailbox.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(object) ⇒ Thread
constructor
Creates a new Conversation::Thread object from a Hash of attributes.
-
#to_s ⇒ Object
Returns a String suitable for display.
Constructor Details
#initialize(object) ⇒ Thread
Creates a new Conversation::Thread object from a Hash of attributes
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 |
# File 'lib/helpscout/models.rb', line 315 def initialize(object) @createdAt = DateTime.iso8601(object["createdAt"]) if object["createdAt"] @id = object["id"] @assignedTo = Person.new(object["assignedTo"]) if object["assignedTo"] @createdBy = Person.new(object["createdBy"]) if object["createdBy"] @status = object["status"] @source = Source.new(object["source"]) if object["source"] @fromMailbox = Mailbox.new(object["fromMailbox"]) if object["fromMailbox"] @type = object["type"] @state = object["state"] @customer = Person.new(object["customer"]) if object["customer"] @body = object["body"] @to = object["to"] @cc = object["cc"] @bcc = object["bcc"] @attachments = [] if object["attachments"] object["attachments"].each do |item| @attachments << Attachment.new(item) end end end |
Instance Attribute Details
#assignedTo ⇒ Object (readonly)
Returns the value of attribute assignedTo.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def assignedTo @assignedTo end |
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def @attachments end |
#bcc ⇒ Object (readonly)
Returns the value of attribute bcc.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def bcc @bcc end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def body @body end |
#cc ⇒ Object (readonly)
Returns the value of attribute cc.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def cc @cc end |
#createdAt ⇒ Object (readonly)
Returns the value of attribute createdAt.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def createdAt @createdAt end |
#createdBy ⇒ Object (readonly)
Returns the value of attribute createdBy.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def createdBy @createdBy end |
#customer ⇒ Object (readonly)
Returns the value of attribute customer.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def customer @customer end |
#fromMailbox ⇒ Object (readonly)
Returns the value of attribute fromMailbox.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def fromMailbox @fromMailbox end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def id @id end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def source @source end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def state @state end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def status @status end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def to @to end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
295 296 297 |
# File 'lib/helpscout/models.rb', line 295 def type @type end |
Instance Method Details
#to_s ⇒ Object
Returns a String suitable for display
341 342 343 |
# File 'lib/helpscout/models.rb', line 341 def to_s "#{@customer}: #{@body}" end |