Skip to content

Commit

Permalink
Add method for retrieving stored messages
Browse files Browse the repository at this point in the history
  • Loading branch information
oleksandr-mykhailenko committed Aug 17, 2024
1 parent e0293c9 commit 1986acf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
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

0 comments on commit 1986acf

Please sign in to comment.