Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add method for retrieving stored messages #920

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/Api/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,22 @@ public function getMessageQueueStatus(string $domain, array $requestHeaders = []
return $this->hydrateResponse($response, QueueStatusResponse::class);
}

/**
* @param string $domain
* @param string $storageId
* @param array $requestHeaders
* @return ShowResponse
* @throws ClientExceptionInterface
*/
public function retrieveStoredMessage(string $domain, string $storageId, array $requestHeaders = []): ShowResponse
{
Assert::notEmpty($domain);
Assert::notEmpty($storageId);
$response = $this->httpGet(sprintf('/v3/domains/%s/messages/%s', $domain, $storageId), [], $requestHeaders);

return $this->hydrateResponse($response, ShowResponse::class);
}

/**
* @param array $filePath array('fileContent' => 'content') or array('filePath' => '/foo/bar')
*
Expand Down
10 changes: 10 additions & 0 deletions src/Model/Message/SendResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ private function __construct()
{
}

/**
* @param array $data
* @return self
*/
public static function create(array $data): self
{
$model = new self();
Expand All @@ -36,11 +40,17 @@ public static function create(array $data): self
return $model;
}

/**
* @return string
*/
public function getId(): string
{
return $this->id;
}

/**
* @return string
*/
public function getMessage(): string
{
return $this->message;
Expand Down
Loading