| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- namespace WeWork\Message;
- class Video implements ResponseMessageInterface, ReplyMessageInterface
- {
- /**
- * @var string
- */
- private $mediaId;
- /**
- * @var string
- */
- private $title;
- /**
- * @var string
- */
- private $description;
- /**
- * @param string $mediaId
- * @param string $title
- * @param string $description
- */
- public function __construct(string $mediaId, string $title = '', string $description = '')
- {
- $this->mediaId = $mediaId;
- $this->title = $title;
- $this->description = $description;
- }
- /**
- * @return array
- */
- public function formatForReply(): array
- {
- return [
- 'MsgType' => 'video',
- 'Video' => [
- 'MediaId' => $this->mediaId,
- 'Title' => $this->title,
- 'Description' => $this->description
- ]
- ];
- }
- /**
- * @return array
- */
- public function formatForResponse(): array
- {
- return [
- 'msgtype' => 'video',
- 'video' => [
- 'media_id' => $this->mediaId,
- 'title' => $this->title,
- 'description' => $this->description
- ]
- ];
- }
- }
|