-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
It appears that while ratings are returned by the mailbox API when retrieving threads, the SDK has no support for interacting with thread ratings:
helpscout-api-php/src/Conversations/Threads/Thread.php
Lines 100 to 166 in 52078c2
| public function hydrate(array $data, array $embedded = []) | |
| { | |
| if (isset($data['id'])) { | |
| $this->setId((int) $data['id']); | |
| } | |
| $this->type = $data['type'] ?? null; | |
| $this->status = $data['status'] ?? null; | |
| $this->state = $data['state'] ?? null; | |
| if (isset($data['text'])) { | |
| $this->text = $data['text']; | |
| } elseif (isset($data['body'])) { | |
| $this->text = $data['body']; | |
| } | |
| if (isset($data['action'])) { | |
| $this->actionType = $data['action']['type'] ?? null; | |
| $this->actionText = $data['action']['text'] ?? null; | |
| } | |
| if (isset($data['source']) && is_array($data['source'])) { | |
| $this->hydrateSource($data['source']); | |
| } | |
| if (isset($data['createdBy'])) { | |
| $this->hydrateCreatedBy($data['createdBy']); | |
| } | |
| $this->assignedTo = $data['assignedTo'] ?? null; | |
| $this->savedReplyId = $data['savedReplyId'] ?? null; | |
| if (isset($data['to'])) { | |
| if (is_array($data['to'])) { | |
| $this->to = $data['to']; | |
| } else { | |
| $this->to = [ | |
| (string) $data['to'], | |
| ]; | |
| } | |
| } | |
| if (isset($data['cc'])) { | |
| $this->hydrateCC($data['cc']); | |
| } | |
| if (isset($data['bcc'])) { | |
| $this->hydrateBCC($data['bcc']); | |
| } | |
| $this->createdAt = $this->transformDateTime($data['createdAt'] ?? null); | |
| $this->openedAt = $this->transformDateTime($data['openedAt'] ?? null); | |
| if (isset($embedded['attachments'])) { | |
| $attachments = []; | |
| foreach ($embedded['attachments'] as $attachmentData) { | |
| $attachment = new Attachment(); | |
| $attachment->hydrate($attachmentData); | |
| $attachments[] = $attachment; | |
| } | |
| $this->setAttachments(new Collection($attachments)); | |
| } | |
| if (isset($data['imported']) && $data['imported']) { | |
| $this->setImported(true); | |
| } | |
| } |
Currently the only solution I can find is to make an additional request outside of the SDK in order to retrieve this data.
Am I reading the functionality correctly?
If so are there any plans to include ratings in a future release?
Thanks!
Metadata
Metadata
Assignees
Labels
No labels