diff --git a/src/CL/Slack/Model/Attachment.php b/src/CL/Slack/Model/Attachment.php index 1307548b..8a76881c 100644 --- a/src/CL/Slack/Model/Attachment.php +++ b/src/CL/Slack/Model/Attachment.php @@ -74,7 +74,9 @@ class Attachment extends AbstractModel * @var AttachmentField[]|ArrayCollection */ private $fields; - + + private $footer; + /** * @var Array */ @@ -278,4 +280,20 @@ public function getMrkdwnIn() { return $this->mrkdwnIn; } + + /** + * @return mixed + */ + public function getFooter() + { + return $this->footer; + } + + /** + * @param mixed $footer + */ + public function setFooter($footer) + { + $this->footer = $footer; + } } diff --git a/src/CL/Slack/Payload/ReactionsPayload.php b/src/CL/Slack/Payload/ReactionsPayload.php new file mode 100644 index 00000000..e34172bd --- /dev/null +++ b/src/CL/Slack/Payload/ReactionsPayload.php @@ -0,0 +1,70 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace CL\Slack\Payload; + +/** + * @author Cas Leentfaar + * + * @link Official documentation at https://api.slack.com/methods/channels.archive + */ +class ReactionsPayload extends AbstractPayload +{ + /** + * @var string + */ + private $channel; + + /** + * @var string + */ + private $timestamp; + + /** + * @param string $channelId + */ + public function setChannelId($channelId) + { + $this->channel = $channelId; + } + + /** + * @return string + */ + public function getChannelId() + { + return $this->channel; + } + + /** + * @return string + */ + public function getTimestamp() + { + return $this->timestamp; + } + + /** + * @param string $timestamp + */ + public function setTimestamp($timestamp) + { + $this->timestamp = $timestamp; + } + + /** + * @return string + */ + public function getMethod() + { + return 'reactions.get'; + } +} diff --git a/src/CL/Slack/Payload/ReactionsPayloadResponse.php b/src/CL/Slack/Payload/ReactionsPayloadResponse.php new file mode 100644 index 00000000..2f63dddd --- /dev/null +++ b/src/CL/Slack/Payload/ReactionsPayloadResponse.php @@ -0,0 +1,63 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace CL\Slack\Payload; + +/** + * @author Cas Leentfaar + */ +class ReactionsPayloadResponse extends AbstractPayloadResponse +{ + private $message; + + private $channel; + + /** + * @return mixed + */ + public function getMessage() + { + return $this->message; + } + + /** + * @param mixed $message + */ + public function setMessage($message) + { + $this->message = $message; + } + + /** + * @return mixed + */ + public function getChannel() + { + return $this->channel; + } + + /** + * @param mixed $channel + */ + public function setChannel($channel) + { + $this->channel = $channel; + } + + public function getReactions() + { + if (!isset($this->message['reactions'])) { + return []; + } + + return $this->message['reactions']; + } +} diff --git a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Attachment.yml b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Attachment.yml index 89ffe5a3..c561b41d 100644 --- a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Attachment.yml +++ b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Attachment.yml @@ -1,5 +1,16 @@ CL\Slack\Model\Attachment: properties: + titleLink: + type: string + authorName: + type: string + authorLink: + type: string + authorIcon: + type: string + mrkdwnIn: + type: array + title: type: string fallback: @@ -12,5 +23,7 @@ CL\Slack\Model\Attachment: type: string color: type: string + footer: + type: string fields: type: ArrayCollection diff --git a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.File.yml b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.File.yml index bf91b456..1e48eb3b 100644 --- a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.File.yml +++ b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.File.yml @@ -79,6 +79,6 @@ CL\Slack\Model\File: groups: type: array initialComment: - type: string + type: array numStars: type: integer diff --git a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleMessage.yml b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleMessage.yml index 3a888918..bf779af9 100644 --- a/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleMessage.yml +++ b/src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleMessage.yml @@ -7,7 +7,7 @@ CL\Slack\Model\SimpleMessage: subtype: type: string channel: - type: CL\Slack\Model\SimpleChannel + type: string user: type: string username: diff --git a/src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ReactionsPayloadResponse.yml b/src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ReactionsPayloadResponse.yml new file mode 100644 index 00000000..97b328d6 --- /dev/null +++ b/src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ReactionsPayloadResponse.yml @@ -0,0 +1,6 @@ +CL\Slack\Payload\ReactionsPayloadResponse: + properties: + channel: + type: string + message: + type: array