├── .gitignore ├── .php_cs ├── .scrutinizer.yml ├── .travis.yml ├── LICENSE ├── README.md ├── composer.json ├── phpunit.xml.dist ├── src └── CL │ └── Slack │ ├── Exception │ └── SlackException.php │ ├── Model │ ├── AbstractModel.php │ ├── AbstractSearchResultModel.php │ ├── Attachment.php │ ├── AttachmentField.php │ ├── Channel.php │ ├── Customizable.php │ ├── File.php │ ├── FileResult.php │ ├── FileResultItem.php │ ├── Group.php │ ├── GroupWithState.php │ ├── ImChannel.php │ ├── Message.php │ ├── MessageResult.php │ ├── MessageResultItem.php │ ├── Paging.php │ ├── SimpleChannel.php │ ├── SimpleMessage.php │ ├── StarredItem.php │ ├── Team.php │ ├── User.php │ └── UserProfile.php │ ├── Payload │ ├── AbstractPayload.php │ ├── AbstractPayloadResponse.php │ ├── AbstractSearchPayload.php │ ├── AbstractSearchPayloadResponse.php │ ├── AdvancedSerializeInterface.php │ ├── ApiTestPayload.php │ ├── ApiTestPayloadResponse.php │ ├── AuthTestPayload.php │ ├── AuthTestPayloadResponse.php │ ├── ChannelsArchivePayload.php │ ├── ChannelsArchivePayloadResponse.php │ ├── ChannelsCreatePayload.php │ ├── ChannelsCreatePayloadResponse.php │ ├── ChannelsHistoryPayload.php │ ├── ChannelsHistoryPayloadResponse.php │ ├── ChannelsInfoPayload.php │ ├── ChannelsInfoPayloadResponse.php │ ├── ChannelsInvitePayload.php │ ├── ChannelsInvitePayloadResponse.php │ ├── ChannelsJoinPayload.php │ ├── ChannelsJoinPayloadResponse.php │ ├── ChannelsKickPayload.php │ ├── ChannelsKickPayloadResponse.php │ ├── ChannelsLeavePayload.php │ ├── ChannelsLeavePayloadResponse.php │ ├── ChannelsListPayload.php │ ├── ChannelsListPayloadResponse.php │ ├── ChannelsMarkPayload.php │ ├── ChannelsMarkPayloadResponse.php │ ├── ChannelsRenamePayload.php │ ├── ChannelsRenamePayloadResponse.php │ ├── ChannelsSetPurposePayload.php │ ├── ChannelsSetPurposePayloadResponse.php │ ├── ChannelsSetTopicPayload.php │ ├── ChannelsSetTopicPayloadResponse.php │ ├── ChannelsUnarchivePayload.php │ ├── ChannelsUnarchivePayloadResponse.php │ ├── ChatDeletePayload.php │ ├── ChatDeletePayloadResponse.php │ ├── ChatPostMessagePayload.php │ ├── ChatPostMessagePayloadResponse.php │ ├── ChatUpdatePayload.php │ ├── ChatUpdatePayloadResponse.php │ ├── EmojiListPayload.php │ ├── EmojiListPayloadResponse.php │ ├── FilesInfoPayload.php │ ├── FilesInfoPayloadResponse.php │ ├── FilesListPayload.php │ ├── FilesListPayloadResponse.php │ ├── FilesUploadPayload.php │ ├── FilesUploadPayloadResponse.php │ ├── GroupsArchivePayload.php │ ├── GroupsArchivePayloadResponse.php │ ├── GroupsClosePayload.php │ ├── GroupsClosePayloadResponse.php │ ├── GroupsCreateChildPayload.php │ ├── GroupsCreateChildPayloadResponse.php │ ├── GroupsCreatePayload.php │ ├── GroupsCreatePayloadResponse.php │ ├── GroupsHistoryPayload.php │ ├── GroupsHistoryPayloadResponse.php │ ├── GroupsInfoPayload.php │ ├── GroupsInfoPayloadResponse.php │ ├── GroupsInvitePayload.php │ ├── GroupsInvitePayloadResponse.php │ ├── GroupsKickPayload.php │ ├── GroupsKickPayloadResponse.php │ ├── GroupsLeavePayload.php │ ├── GroupsLeavePayloadResponse.php │ ├── GroupsListPayload.php │ ├── GroupsListPayloadResponse.php │ ├── GroupsMarkPayload.php │ ├── GroupsMarkPayloadResponse.php │ ├── GroupsOpenPayload.php │ ├── GroupsOpenPayloadResponse.php │ ├── GroupsRenamePayload.php │ ├── GroupsRenamePayloadResponse.php │ ├── GroupsSetPurposePayload.php │ ├── GroupsSetPurposePayloadResponse.php │ ├── GroupsSetTopicPayload.php │ ├── GroupsSetTopicPayloadResponse.php │ ├── GroupsUnarchivePayload.php │ ├── GroupsUnarchivePayloadResponse.php │ ├── ImClosePayload.php │ ├── ImClosePayloadResponse.php │ ├── ImHistoryPayload.php │ ├── ImHistoryPayloadResponse.php │ ├── ImListPayload.php │ ├── ImListPayloadResponse.php │ ├── ImMarkPayload.php │ ├── ImMarkPayloadResponse.php │ ├── ImOpenPayload.php │ ├── ImOpenPayloadResponse.php │ ├── OauthAccessPayload.php │ ├── OauthAccessPayloadResponse.php │ ├── PayloadInterface.php │ ├── PayloadResponseInterface.php │ ├── RtmStartPayload.php │ ├── RtmStartPayloadResponse.php │ ├── SearchAllPayload.php │ ├── SearchAllPayloadResponse.php │ ├── SearchFilesPayload.php │ ├── SearchFilesPayloadResponse.php │ ├── SearchMessagesPayload.php │ ├── SearchMessagesPayloadResponse.php │ ├── StarsListPayload.php │ ├── StarsListPayloadResponse.php │ ├── TeamInfoPayload.php │ ├── TeamInfoPayloadResponse.php │ ├── UsersAdminInvitePayload.php │ ├── UsersAdminInvitePayloadResponse.php │ ├── UsersGetPresencePayload.php │ ├── UsersGetPresencePayloadResponse.php │ ├── UsersInfoPayload.php │ ├── UsersInfoPayloadResponse.php │ ├── UsersListPayload.php │ ├── UsersListPayloadResponse.php │ ├── UsersSetActivePayload.php │ ├── UsersSetActivePayloadResponse.php │ ├── UsersSetPresencePayload.php │ └── UsersSetPresencePayloadResponse.php │ ├── Resources │ ├── config │ │ └── serializer │ │ │ ├── CL.Slack.Model.AbstractSearchResultModel.yml │ │ │ ├── CL.Slack.Model.Attachment.yml │ │ │ ├── CL.Slack.Model.AttachmentField.yml │ │ │ ├── CL.Slack.Model.Channel.yml │ │ │ ├── CL.Slack.Model.Customizable.yml │ │ │ ├── CL.Slack.Model.File.yml │ │ │ ├── CL.Slack.Model.FileResult.yml │ │ │ ├── CL.Slack.Model.FileResultItem.yml │ │ │ ├── CL.Slack.Model.Group.yml │ │ │ ├── CL.Slack.Model.GroupWithState.yml │ │ │ ├── CL.Slack.Model.ImChannel.yml │ │ │ ├── CL.Slack.Model.Message.yml │ │ │ ├── CL.Slack.Model.MessageResult.yml │ │ │ ├── CL.Slack.Model.MessageResultItem.yml │ │ │ ├── CL.Slack.Model.Paging.yml │ │ │ ├── CL.Slack.Model.SimpleChannel.yml │ │ │ ├── CL.Slack.Model.SimpleMessage.yml │ │ │ ├── CL.Slack.Model.StarredItem.yml │ │ │ ├── CL.Slack.Model.Team.yml │ │ │ ├── CL.Slack.Model.User.yml │ │ │ ├── CL.Slack.Model.UserProfile.yml │ │ │ ├── CL.Slack.Payload.AbstractPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.AbstractSearchPayload.yml │ │ │ ├── CL.Slack.Payload.AbstractSearchPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ApiTestPayload.yml │ │ │ ├── CL.Slack.Payload.ApiTestPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.AuthTestPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsArchivePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsCreatePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsCreatePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsHistoryPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsHistoryPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsInfoPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsInfoPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsInvitePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsInvitePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsJoinPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsJoinPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsKickPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsLeavePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsLeavePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsListPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsMarkPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsRenamePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsRenamePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsSetPurposePayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsSetPurposePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChannelsSetTopicPayload.yml │ │ │ ├── CL.Slack.Payload.ChannelsSetTopicPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChatDeletePayload.yml │ │ │ ├── CL.Slack.Payload.ChatDeletePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChatPostMessagePayload.yml │ │ │ ├── CL.Slack.Payload.ChatPostMessagePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ChatUpdatePayload.yml │ │ │ ├── CL.Slack.Payload.ChatUpdatePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.EmojiListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.FilesInfoPayload.yml │ │ │ ├── CL.Slack.Payload.FilesInfoPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.FilesListPayload.yml │ │ │ ├── CL.Slack.Payload.FilesListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.FilesUploadPayload.yml │ │ │ ├── CL.Slack.Payload.FilesUploadPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsArchivePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsClosePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsClosePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsCreateChildPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsCreatePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsCreatePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsHistoryPayload.yml │ │ │ ├── CL.Slack.Payload.GroupsHistoryPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsInfoPayload.yml │ │ │ ├── CL.Slack.Payload.GroupsInfoPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsInvitePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsInvitePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsLeavePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsListPayload.yml │ │ │ ├── CL.Slack.Payload.GroupsListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsOpenPayload.yml │ │ │ ├── CL.Slack.Payload.GroupsOpenPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsRenamePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsRenamePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsSetPurposePayload.yml │ │ │ ├── CL.Slack.Payload.GroupsSetPurposePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.GroupsSetTopicPayload.yml │ │ │ ├── CL.Slack.Payload.GroupsSetTopicPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ImClosePayload.yml │ │ │ ├── CL.Slack.Payload.ImClosePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ImHistoryPayload.yml │ │ │ ├── CL.Slack.Payload.ImHistoryPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ImListPayload.yml │ │ │ ├── CL.Slack.Payload.ImListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.ImOpenPayload.yml │ │ │ ├── CL.Slack.Payload.ImOpenPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.OauthAccessPayload.yml │ │ │ ├── CL.Slack.Payload.OauthAccessPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.RtmStartPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.SearchAllPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.SearchFilesPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.SearchMessagesPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.StarsListPayload.yml │ │ │ ├── CL.Slack.Payload.StarsListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.TeamInfoPayload.yml │ │ │ ├── CL.Slack.Payload.TeamInfoPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.UsersGetPresencePayload.yml │ │ │ ├── CL.Slack.Payload.UsersGetPresencePayloadResponse.yml │ │ │ ├── CL.Slack.Payload.UsersInfoPayload.yml │ │ │ ├── CL.Slack.Payload.UsersInfoPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.UsersListPayload.yml │ │ │ ├── CL.Slack.Payload.UsersListPayloadResponse.yml │ │ │ ├── CL.Slack.Payload.UsersSetPresencePayload.yml │ │ │ └── CL.Slack.Test.MockPayloadResponse.yml │ └── doc │ │ ├── contributing.md │ │ ├── events.md │ │ ├── getting-started.md │ │ ├── installation.md │ │ ├── methods │ │ ├── api-test.md │ │ ├── auth-test.md │ │ ├── channels-archive.md │ │ ├── channels-create.md │ │ ├── channels-history.md │ │ ├── channels-info.md │ │ ├── channels-invite.md │ │ ├── channels-join.md │ │ ├── channels-kick.md │ │ ├── channels-leave.md │ │ ├── channels-list.md │ │ ├── channels-mark.md │ │ ├── channels-rename.md │ │ ├── channels-set-purpose.md │ │ ├── channels-set-topic.md │ │ ├── channels-unarchive.md │ │ ├── chat-delete.md │ │ ├── chat-post-message.md │ │ ├── chat-update.md │ │ ├── emoji-list.md │ │ ├── files-info.md │ │ ├── files-list.md │ │ ├── files-upload.md │ │ ├── groups-archive.md │ │ ├── groups-close.md │ │ ├── groups-create-child.md │ │ ├── groups-create.md │ │ ├── groups-history.md │ │ ├── groups-invite.md │ │ ├── index.md │ │ ├── search-all.md │ │ ├── search-files.md │ │ ├── search-messages.md │ │ ├── team-info.md │ │ └── users-list.md │ │ └── usage.md │ ├── Serializer │ ├── AbstractSerializer.php │ ├── PayloadResponseSerializer.php │ └── PayloadSerializer.php │ └── Transport │ ├── ApiClient.php │ ├── ApiClientInterface.php │ └── Events │ ├── RequestEvent.php │ └── ResponseEvent.php └── tests └── src └── CL └── Slack ├── Test ├── Model │ └── ModelTrait.php ├── Payload │ ├── MockPayloadResponse.php │ └── PayloadMock.php └── Transport │ └── MockApiClient.php └── Tests ├── Model ├── AbstractModelTest.php ├── AttachmentFieldTest.php ├── AttachmentTest.php ├── ChannelTest.php ├── CustomizableTest.php ├── FileResultItemTest.php ├── FileResultTest.php ├── FileTest.php ├── GroupTest.php ├── GroupWithStateTest.php ├── ImChannelTest.php ├── MessageResultItemTest.php ├── MessageResultTest.php ├── MessageTest.php ├── PagingTest.php ├── SimpleChannelTest.php ├── SimpleMessageTest.php ├── StarredItemTest.php ├── TeamInfoTest.php ├── UserProfileTest.php └── UserTest.php ├── Payload ├── AbstractPayloadResponseTestCase.php ├── AbstractPayloadTestCase.php ├── AbstractSearchPayloadResponseTest.php ├── AbstractSearchPayloadTest.php ├── ApiTestPayloadResponseTest.php ├── ApiTestPayloadTest.php ├── AuthTestPayloadResponseTest.php ├── AuthTestPayloadTest.php ├── ChannelsArchivePayloadResponseTest.php ├── ChannelsArchivePayloadTest.php ├── ChannelsCreatePayloadResponseTest.php ├── ChannelsCreatePayloadTest.php ├── ChannelsHistoryPayloadResponseTest.php ├── ChannelsHistoryPayloadTest.php ├── ChannelsInfoPayloadResponseTest.php ├── ChannelsInfoPayloadTest.php ├── ChannelsInvitePayloadResponseTest.php ├── ChannelsInvitePayloadTest.php ├── ChannelsJoinPayloadResponseTest.php ├── ChannelsJoinPayloadTest.php ├── ChannelsKickPayloadResponseTest.php ├── ChannelsKickPayloadTest.php ├── ChannelsLeavePayloadResponseTest.php ├── ChannelsLeavePayloadTest.php ├── ChannelsListPayloadResponseTest.php ├── ChannelsListPayloadTest.php ├── ChannelsMarkPayloadResponseTest.php ├── ChannelsMarkPayloadTest.php ├── ChannelsRenamePayloadResponseTest.php ├── ChannelsRenamePayloadTest.php ├── ChannelsSetPurposePayloadResponseTest.php ├── ChannelsSetPurposePayloadTest.php ├── ChannelsSetTopicPayloadResponseTest.php ├── ChannelsSetTopicPayloadTest.php ├── ChannelsUnarchivePayloadResponseTest.php ├── ChannelsUnarchivePayloadTest.php ├── ChatDeletePayloadResponseTest.php ├── ChatDeletePayloadTest.php ├── ChatPostMessagePayloadResponseTest.php ├── ChatPostMessagePayloadTest.php ├── ChatUpdatePayloadResponseTest.php ├── ChatUpdatePayloadTest.php ├── EmojiListPayloadResponseTest.php ├── EmojiListPayloadTest.php ├── FilesInfoPayloadResponseTest.php ├── FilesInfoPayloadTest.php ├── FilesListPayloadResponseTest.php ├── FilesListPayloadTest.php ├── FilesUploadPayloadResponseTest.php ├── FilesUploadPayloadTest.php ├── GroupsArchivePayloadResponseTest.php ├── GroupsArchivePayloadTest.php ├── GroupsClosePayloadResponseTest.php ├── GroupsClosePayloadTest.php ├── GroupsCreateChildPayloadResponseTest.php ├── GroupsCreateChildPayloadTest.php ├── GroupsCreatePayloadResponseTest.php ├── GroupsCreatePayloadTest.php ├── GroupsHistoryPayloadResponseTest.php ├── GroupsHistoryPayloadTest.php ├── GroupsInfoPayloadResponseTest.php ├── GroupsInfoPayloadTest.php ├── GroupsInvitePayloadResponseTest.php ├── GroupsInvitePayloadTest.php ├── GroupsKickPayloadResponseTest.php ├── GroupsKickPayloadTest.php ├── GroupsLeavePayloadResponseTest.php ├── GroupsLeavePayloadTest.php ├── GroupsListPayloadResponseTest.php ├── GroupsListPayloadTest.php ├── GroupsMarkPayloadResponseTest.php ├── GroupsMarkPayloadTest.php ├── GroupsOpenPayloadResponseTest.php ├── GroupsOpenPayloadTest.php ├── GroupsRenamePayloadResponseTest.php ├── GroupsRenamePayloadTest.php ├── GroupsSetPurposePayloadResponseTest.php ├── GroupsSetPurposePayloadTest.php ├── GroupsSetTopicPayloadResponseTest.php ├── GroupsSetTopicPayloadTest.php ├── GroupsUnarchivePayloadResponseTest.php ├── GroupsUnarchivePayloadTest.php ├── ImClosePayloadResponseTest.php ├── ImClosePayloadTest.php ├── ImHistoryPayloadResponseTest.php ├── ImHistoryPayloadTest.php ├── ImListPayloadResponseTest.php ├── ImListPayloadTest.php ├── ImMarkPayloadResponseTest.php ├── ImMarkPayloadTest.php ├── ImOpenPayloadResponseTest.php ├── ImOpenPayloadTest.php ├── OauthAccessPayloadResponseTest.php ├── OauthAccessPayloadTest.php ├── RtmStartPayloadResponseTest.php ├── RtmStartPayloadTest.php ├── SearchAllPayloadResponseTest.php ├── SearchAllPayloadTest.php ├── SearchFilesPayloadResponseTest.php ├── SearchFilesPayloadTest.php ├── SearchMessagesPayloadResponseTest.php ├── SearchMessagesPayloadTest.php ├── StarsListPayloadResponseTest.php ├── StarsListPayloadTest.php ├── TeamInfoPayloadResponseTest.php ├── TeamInfoPayloadTest.php ├── UsersAdminInvitePayloadResponseTest.php ├── UsersAdminInvitePayloadTest.php ├── UsersGetPresencePayloadResponseTest.php ├── UsersGetPresencePayloadTest.php ├── UsersInfoPayloadResponseTest.php ├── UsersInfoPayloadTest.php ├── UsersListPayloadResponseTest.php ├── UsersListPayloadTest.php ├── UsersSetActivePayloadResponseTest.php ├── UsersSetActivePayloadTest.php └── UsersSetPresencePayloadTest.php ├── Serializer ├── PayloadResponseSerializerTest.php └── PayloadSerializerTest.php └── Transport ├── ApiClientTest.php └── Events ├── RequestEventTest.php └── ResponseEventTest.php /.gitignore: -------------------------------------------------------------------------------- 1 | /.php_cs.cache 2 | /composer.lock 3 | /bin/* 4 | /vendor/* 5 | -------------------------------------------------------------------------------- /.php_cs: -------------------------------------------------------------------------------- 1 | setUsingCache(true) 5 | ->level(Symfony\CS\FixerInterface::SYMFONY_LEVEL) 6 | ->fixers([ 7 | 'concat_with_spaces', 8 | 'newline_after_open_tag', 9 | 'ordered_use', 10 | 'phpdoc_order', 11 | 'short_array_syntax', 12 | '-empty_return', 13 | '-concat_without_spaces', 14 | '-phpdoc_inline_tag', 15 | ]) 16 | ->finder( 17 | Symfony\CS\Finder\DefaultFinder::create()->in(['src', 'tests']) 18 | ) 19 | ; 20 | -------------------------------------------------------------------------------- /.scrutinizer.yml: -------------------------------------------------------------------------------- 1 | before_commands: 2 | - 'composer install --no-interaction' 3 | 4 | filter: 5 | paths: 6 | - src/* 7 | excluded_paths: 8 | - src/CL/Slack/Resources/* 9 | - src/CL/Slack/Test/* 10 | - src/CL/Slack/Tests/* 11 | 12 | tools: 13 | external_code_coverage: 14 | timeout: 600 15 | php_analyzer: true 16 | php_code_sniffer: true 17 | php_cs_fixer: true 18 | php_loc: true 19 | php_mess_detector: true 20 | php_pdepend: true 21 | sensiolabs_security_checker: true 22 | php_cs_fixer: 23 | config: 24 | level: symfony 25 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | 3 | language: php 4 | 5 | php: 6 | - 5.5 7 | - 5.6 8 | - 7.0 9 | 10 | matrix: 11 | fast_finish: true 12 | 13 | before_script: composer install 14 | 15 | script: ./bin/phpunit --coverage-clover=coverage.clover 16 | 17 | after_script: 18 | - if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi 19 | - if [ "$TRAVIS_PHP_VERSION" != "7.0" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Cas Leentfaar - https://github.com/cleentfaar 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | ./tests 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./src/CL/Slack/ 23 | 24 | ./src/CL/Slack/Resources 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Exception/SlackException.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Exception; 13 | 14 | class SlackException extends \Exception 15 | { 16 | } 17 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/AbstractModel.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | abstract class AbstractModel 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/FileResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/search.files 18 | */ 19 | class FileResult extends AbstractSearchResultModel 20 | { 21 | /** 22 | * @var FileResultItem[] 23 | */ 24 | private $matches = []; 25 | 26 | /** 27 | * @return FileResultItem[] 28 | */ 29 | public function getMatches() 30 | { 31 | return $this->matches; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/FileResultItem.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/types/file 18 | */ 19 | class FileResultItem extends File 20 | { 21 | /** 22 | * @var SimpleChannel 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return SimpleChannel The channel object on which the message was posted 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/GroupWithState.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/types/group 18 | */ 19 | class GroupWithState extends Group 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $isOpen; 25 | 26 | /** 27 | * @return bool 28 | */ 29 | public function isOpen() 30 | { 31 | return $this->isOpen; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/MessageResult.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/search.messages 18 | */ 19 | class MessageResult extends AbstractSearchResultModel 20 | { 21 | /** 22 | * @var MessageResultItem[] 23 | */ 24 | private $matches = []; 25 | 26 | /** 27 | * @return MessageResultItem[] 28 | */ 29 | public function getMatches() 30 | { 31 | return $this->matches; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/MessageResultItem.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/docs/formatting 18 | */ 19 | class MessageResultItem extends Message 20 | { 21 | /** 22 | * @var SimpleChannel|null 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return SimpleChannel|null The channel object on which the message was posted 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Model/StarredItem.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Model; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class StarredItem extends AbstractModel 18 | { 19 | /** 20 | * @var string 21 | */ 22 | private $type; 23 | 24 | /** 25 | * @var File 26 | */ 27 | private $file; 28 | 29 | /** 30 | * @var string 31 | */ 32 | private $comment; 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getType() 38 | { 39 | return $this->type; 40 | } 41 | 42 | /** 43 | * @return File 44 | */ 45 | public function getFile() 46 | { 47 | return $this->file; 48 | } 49 | 50 | /** 51 | * @return string 52 | */ 53 | public function getComment() 54 | { 55 | return $this->comment; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/AbstractPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | abstract class AbstractPayload implements PayloadInterface 18 | { 19 | /** 20 | * @inheritdoc 21 | */ 22 | public function getResponseClass() 23 | { 24 | return sprintf('%sResponse', get_class($this)); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/AbstractSearchPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | abstract class AbstractSearchPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string|null 21 | */ 22 | private $query; 23 | 24 | /** 25 | * @return string|null The query that was used to search 26 | */ 27 | public function getQuery() 28 | { 29 | return $this->query; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/AdvancedSerializeInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ApiTestPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var array 21 | */ 22 | protected $args = []; 23 | 24 | /** 25 | * @return array 26 | */ 27 | public function getArguments() 28 | { 29 | return $this->args; 30 | } 31 | 32 | /** 33 | * @param string $key 34 | * 35 | * @return mixed 36 | */ 37 | public function getArgument($key) 38 | { 39 | if (!array_key_exists($key, $this->args)) { 40 | throw new \InvalidArgumentException(sprintf('There is no argument with that name: "%s"', $key)); 41 | } 42 | 43 | return $this->args[$key]; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/AuthTestPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * Payload that triggers the auth.test-method; allowing you to test authentication with the Slack API. 16 | * 17 | * @author Cas Leentfaar 18 | * 19 | * @link Official documentation at https://api.slack.com/methods/auth.test 20 | */ 21 | class AuthTestPayload extends AbstractPayload 22 | { 23 | /** 24 | * @inheritdoc 25 | */ 26 | public function getMethod() 27 | { 28 | return 'auth.test'; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsArchivePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.archive 18 | */ 19 | class ChannelsArchivePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $channelId 28 | */ 29 | public function setChannelId($channelId) 30 | { 31 | $this->channel = $channelId; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getChannelId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * @return string 44 | */ 45 | public function getMethod() 46 | { 47 | return 'channels.archive'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsArchivePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsArchivePayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsCreatePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * Payload that triggers the channels.create-method; used to create a channel. 16 | * 17 | * @author Cas Leentfaar 18 | * 19 | * @link Official documentation at https://api.slack.com/methods/channels.create 20 | */ 21 | class ChannelsCreatePayload extends AbstractPayload 22 | { 23 | /** 24 | * @var string 25 | */ 26 | private $name; 27 | 28 | /** 29 | * @param string $name Name of channel to create 30 | */ 31 | public function setName($name) 32 | { 33 | $this->name = $name; 34 | } 35 | 36 | /** 37 | * @return string Name of channel to create 38 | */ 39 | public function getName() 40 | { 41 | return $this->name; 42 | } 43 | 44 | /** 45 | * @return string 46 | */ 47 | public function getMethod() 48 | { 49 | return 'channels.create'; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsCreatePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\SimpleChannel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsCreatePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var SimpleChannel 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return SimpleChannel 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsInfoPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.info 18 | */ 19 | class ChannelsInfoPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $channelId 28 | */ 29 | public function setChannelId($channelId) 30 | { 31 | $this->channel = $channelId; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getChannelId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'channels.info'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsInfoPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Channel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsInfoPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Channel|null 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return Channel|null 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsInvitePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Channel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsInvitePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Channel|null 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return Channel|null 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsJoinPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.join 18 | */ 19 | class ChannelsJoinPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $name; 25 | 26 | /** 27 | * @param string $channel 28 | */ 29 | public function setName($channel) 30 | { 31 | $this->name = $channel; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getName() 38 | { 39 | return $this->name; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'channels.join'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsJoinPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Channel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsJoinPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $alreadyInChannel; 25 | 26 | /** 27 | * @var Channel|null 28 | */ 29 | private $channel; 30 | 31 | /** 32 | * @return bool 33 | */ 34 | public function isAlreadyInChannel() 35 | { 36 | return $this->alreadyInChannel; 37 | } 38 | 39 | /** 40 | * @return Channel|null 41 | */ 42 | public function getChannel() 43 | { 44 | return $this->channel; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsKickPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsKickPayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsLeavePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.leave 18 | */ 19 | class ChannelsLeavePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $channelId ID of the channel to remove user from 28 | */ 29 | public function setChannelId($channelId) 30 | { 31 | $this->channel = $channelId; 32 | } 33 | 34 | /** 35 | * @return string ID of the channel to remove user from 36 | */ 37 | public function getChannelId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'channels.leave'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsLeavePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsLeavePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var bool 21 | */ 22 | private $notInChannel; 23 | 24 | /** 25 | * @return bool 26 | */ 27 | public function isNotInChannel() 28 | { 29 | return $this->notInChannel; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsListPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.list 18 | */ 19 | class ChannelsListPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $excludeArchived; 25 | 26 | /** 27 | * @inheritdoc 28 | */ 29 | public function getMethod() 30 | { 31 | return 'channels.list'; 32 | } 33 | 34 | /** 35 | * @param bool $excludeArchived 36 | */ 37 | public function setExcludeArchived($excludeArchived) 38 | { 39 | $this->excludeArchived = $excludeArchived; 40 | } 41 | 42 | /** 43 | * @return bool 44 | */ 45 | public function isExcludeArchived() 46 | { 47 | return $this->excludeArchived; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Channel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsListPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Channel[] 23 | */ 24 | private $channels; 25 | 26 | /** 27 | * @return Channel[] 28 | */ 29 | public function getChannels() 30 | { 31 | return $this->channels; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsMarkPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsMarkPayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsRenamePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Channel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ChannelsRenamePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Channel|null 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @return Channel|null 28 | */ 29 | public function getChannel() 30 | { 31 | return $this->channel; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsSetPurposePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsSetPurposePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string|null 21 | */ 22 | private $purpose; 23 | 24 | /** 25 | * @return string|null 26 | */ 27 | public function getPurpose() 28 | { 29 | return $this->purpose; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | */ 35 | protected function getPossibleErrors() 36 | { 37 | return array_merge(parent::getPossibleErrors(), [ 38 | 'too_long' => 'Purpose was longer than 250 characters.', 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsSetTopicPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsSetTopicPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string|null 21 | */ 22 | private $topic; 23 | 24 | /** 25 | * @return string|null 26 | */ 27 | public function getTopic() 28 | { 29 | return $this->topic; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | */ 35 | protected function getPossibleErrors() 36 | { 37 | return array_merge(parent::getPossibleErrors(), [ 38 | 'too_long' => 'Topic was longer than 250 characters.', 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsUnarchivePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.unarchive 18 | */ 19 | class ChannelsUnarchivePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $channelId 28 | */ 29 | public function setChannelId($channelId) 30 | { 31 | $this->channel = $channelId; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getChannelId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * @return string 44 | */ 45 | public function getMethod() 46 | { 47 | return 'channels.unarchive'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChannelsUnarchivePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChannelsUnarchivePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @inheritdoc 21 | */ 22 | protected function getPossibleErrors() 23 | { 24 | return array_merge(parent::getPossibleErrors(), [ 25 | 'not_archived' => 'Channel is not archived', 26 | ]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ChatPostMessagePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ChatPostMessagePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string|null 21 | */ 22 | private $ts; 23 | 24 | /** 25 | * @var string|null 26 | */ 27 | private $channel; 28 | 29 | /** 30 | * @return string|null The Slack timestamp on which your message has been posted, or null if the call failed 31 | */ 32 | public function getSlackTimestamp() 33 | { 34 | return $this->ts; 35 | } 36 | 37 | /** 38 | * @return string|null The Slack channel ID on which your message has been posted, or null if the call failed 39 | */ 40 | public function getChannelId() 41 | { 42 | return $this->channel; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/EmojiListPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/channels.list 18 | */ 19 | class EmojiListPayload extends AbstractPayload 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function getMethod() 25 | { 26 | return 'emoji.list'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/EmojiListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class EmojiListPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var array 21 | */ 22 | private $emoji = []; 23 | 24 | /** 25 | * @return array 26 | */ 27 | public function getEmojis() 28 | { 29 | return $this->emoji; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/FilesInfoPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\File; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class FilesInfoPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var File|null 23 | */ 24 | private $file; 25 | 26 | /** 27 | * @return File|null 28 | */ 29 | public function getFile() 30 | { 31 | return $this->file; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/FilesUploadPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\File; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | * 19 | * @link Official documentation at https://api.slack.com/methods/files.upload 20 | */ 21 | class FilesUploadPayloadResponse extends AbstractPayloadResponse 22 | { 23 | /** 24 | * @var File|null 25 | */ 26 | private $file; 27 | 28 | /** 29 | * @return File|null 30 | */ 31 | public function getFile() 32 | { 33 | return $this->file; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsArchivePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsArchivePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @inheritdoc 21 | */ 22 | protected function getPossibleErrors() 23 | { 24 | return array_merge(parent::getPossibleErrors(), [ 25 | 'channel_not_found' => 'Value passed for group was invalid', 26 | 'already_archived' => 'Group has already been archived', 27 | 'group_contains_others' => 'Restricted accounts cannot archive groups containing others', 28 | 'last_ra_channel' => 'You cannot archive the last channel for a restricted account', 29 | 'restricted_action' => 'A team preference prevents authenticated user from archiving', 30 | ]); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsCreateChildPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Group; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class GroupsCreateChildPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Group|null 23 | */ 24 | private $group; 25 | 26 | /** 27 | * @return Group|null 28 | */ 29 | public function getGroup() 30 | { 31 | return $this->group; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsCreatePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/groups.create 18 | */ 19 | class GroupsCreatePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string Name of group to create 23 | */ 24 | private $name; 25 | 26 | /** 27 | * @param string $name Name of group to create 28 | */ 29 | public function setName($name) 30 | { 31 | $this->name = $name; 32 | } 33 | 34 | /** 35 | * @return string Name of group to create 36 | */ 37 | public function getName() 38 | { 39 | return $this->name; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'groups.create'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsCreatePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\GroupWithState; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class GroupsCreatePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var GroupWithState|null 23 | */ 24 | private $group; 25 | 26 | /** 27 | * @return GroupWithState|null 28 | */ 29 | public function getGroup() 30 | { 31 | return $this->group; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsInfoPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Travis Raup 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/groups.info 18 | */ 19 | class GroupsInfoPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $channelId 28 | */ 29 | public function setGroupId($channelId) 30 | { 31 | $this->channel = $channelId; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getGroupId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * {@inheritdoc} 44 | */ 45 | public function getMethod() 46 | { 47 | return 'groups.info'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsInfoPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Group; 15 | 16 | /** 17 | * @author Travis Raup 18 | */ 19 | class GroupsInfoPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Group|null 23 | */ 24 | private $group; 25 | 26 | /** 27 | * @return Group|null 28 | */ 29 | public function getGroup() 30 | { 31 | return $this->group; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsInvitePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Group; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class GroupsInvitePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var bool|null 23 | */ 24 | private $alreadyInGroup; 25 | 26 | /** 27 | * @var Group|null 28 | */ 29 | private $group; 30 | 31 | /** 32 | * @return Group|null 33 | */ 34 | public function getGroup() 35 | { 36 | return $this->group; 37 | } 38 | 39 | /** 40 | * @return bool|null 41 | */ 42 | public function getAlreadyInGroup() 43 | { 44 | return $this->alreadyInGroup; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsKickPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsKickPayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsLeavePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsLeavePayloadResponse extends AbstractPayloadResponse 18 | { 19 | protected function getPossibleErrors() 20 | { 21 | return array_merge(parent::getPossibleErrors(), [ 22 | 'account_inactive' => 'Authentication token is for a deleted user or team', 23 | 'cant_leave_last_channel' => 'Authenticated user cannot leave the last channel they are in', 24 | 'channel_not_found' => 'Value passed for channel was invalid', 25 | 'invalid_auth' => 'Invalid authentication token', 26 | 'is_archived' => 'Group has been archived', 27 | 'last_member' => 'Authenticated user is the last member of a group and cannot leave it', 28 | 'not_authed' => 'No authentication token provided', 29 | ]); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsListPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/groups.list 18 | */ 19 | class GroupsListPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $excludeArchived; 25 | 26 | /** 27 | * @param bool $excludeArchived 28 | */ 29 | public function setExcludeArchived($excludeArchived) 30 | { 31 | $this->excludeArchived = $excludeArchived; 32 | } 33 | 34 | /** 35 | * @return bool 36 | */ 37 | public function isExcludeArchived() 38 | { 39 | return $this->excludeArchived; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'groups.list'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Group; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class GroupsListPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Group[] 23 | */ 24 | private $groups; 25 | 26 | /** 27 | * @return Group[] 28 | */ 29 | public function getGroups() 30 | { 31 | return $this->groups; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsMarkPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/groups.mark 18 | */ 19 | class GroupsMarkPayloadResponse extends AbstractPayloadResponse 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsOpenPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsOpenPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var bool 21 | */ 22 | private $noOp; 23 | 24 | /** 25 | * @var bool 26 | */ 27 | private $alreadyOpen; 28 | 29 | /** 30 | * @return bool 31 | */ 32 | public function isAlreadyOpen() 33 | { 34 | return $this->alreadyOpen; 35 | } 36 | 37 | /** 38 | * @return bool 39 | */ 40 | public function isNoOp() 41 | { 42 | return $this->noOp; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsRenamePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Group; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class GroupsRenamePayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Group|null 23 | */ 24 | private $group; 25 | 26 | /** 27 | * @return Group|null 28 | */ 29 | public function getGroup() 30 | { 31 | return $this->group; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsSetPurposePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsSetPurposePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string 21 | */ 22 | private $purpose; 23 | 24 | /** 25 | * @return string|null 26 | */ 27 | public function getPurpose() 28 | { 29 | return $this->purpose; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | */ 35 | protected function getPossibleErrors() 36 | { 37 | return array_merge(parent::getPossibleErrors(), [ 38 | 'too_long' => 'Purpose was longer than 250 characters.', 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsSetTopicPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsSetTopicPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string|null 21 | */ 22 | private $topic; 23 | 24 | /** 25 | * @return string|null 26 | */ 27 | public function getTopic() 28 | { 29 | return $this->topic; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | */ 35 | protected function getPossibleErrors() 36 | { 37 | return array_merge(parent::getPossibleErrors(), [ 38 | 'too_long' => 'Topic was longer than 250 characters.', 39 | ]); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsUnarchivePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/groups.unarchive 18 | */ 19 | class GroupsUnarchivePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $channel; 25 | 26 | /** 27 | * @param string $groupId ID of the group to remove user from 28 | */ 29 | public function setGroupId($groupId) 30 | { 31 | $this->channel = $groupId; 32 | } 33 | 34 | /** 35 | * @return string ID of the group to remove user from 36 | */ 37 | public function getGroupId() 38 | { 39 | return $this->channel; 40 | } 41 | 42 | /** 43 | * @return string 44 | */ 45 | public function getMethod() 46 | { 47 | return 'groups.unarchive'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/GroupsUnarchivePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class GroupsUnarchivePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @inheritdoc 21 | */ 22 | protected function getPossibleErrors() 23 | { 24 | return array_merge(parent::getPossibleErrors(), [ 25 | 'not_archived' => 'Group is not archived', 26 | ]); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImClosePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ImClosePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var bool 21 | */ 22 | private $noOp; 23 | 24 | /** 25 | * @var bool 26 | */ 27 | private $alreadyClosed; 28 | 29 | /** 30 | * @return bool 31 | */ 32 | public function isAlreadyClosed() 33 | { 34 | return $this->alreadyClosed; 35 | } 36 | 37 | /** 38 | * @return bool 39 | */ 40 | public function isNoOp() 41 | { 42 | return $this->noOp; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImListPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/im.list 18 | */ 19 | class ImListPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $excludeArchived; 25 | 26 | /** 27 | * @param bool $excludeArchived 28 | */ 29 | public function setExcludeArchived($excludeArchived) 30 | { 31 | $this->excludeArchived = $excludeArchived; 32 | } 33 | 34 | /** 35 | * @return bool 36 | */ 37 | public function isExcludeArchived() 38 | { 39 | return $this->excludeArchived; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'im.list'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\ImChannel; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ImListPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var ImChannel[] 23 | */ 24 | private $ims; 25 | 26 | /** 27 | * @return ImChannel[] 28 | */ 29 | public function getImChannels() 30 | { 31 | return $this->ims; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImMarkPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ImMarkPayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImOpenPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/im.open 18 | */ 19 | class ImOpenPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $user; 25 | 26 | /** 27 | * @param string $userId ID of the user to open a direct message channel with 28 | */ 29 | public function setUserId($userId) 30 | { 31 | $this->user = $userId; 32 | } 33 | 34 | /** 35 | * @return string ID of the user to open a direct message channel with 36 | */ 37 | public function getUserId() 38 | { 39 | return $this->user; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'im.open'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/ImOpenPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class ImOpenPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var bool 21 | */ 22 | private $noOp; 23 | 24 | /** 25 | * @var bool 26 | */ 27 | private $alreadyOpen; 28 | 29 | /** 30 | * @var array 31 | */ 32 | private $channel; 33 | 34 | /** 35 | * @return bool 36 | */ 37 | public function isAlreadyOpen() 38 | { 39 | return $this->alreadyOpen; 40 | } 41 | 42 | /** 43 | * @return bool 44 | */ 45 | public function isNoOp() 46 | { 47 | return $this->noOp; 48 | } 49 | 50 | /** 51 | * @return array 52 | */ 53 | public function getChannel() 54 | { 55 | return $this->channel; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/PayloadInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | interface PayloadInterface 18 | { 19 | /** 20 | * @return string 21 | */ 22 | public function getMethod(); 23 | 24 | /** 25 | * @return string 26 | */ 27 | public function getResponseClass(); 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/PayloadResponseInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | interface PayloadResponseInterface 18 | { 19 | /** 20 | * @return bool True if the request was handled successfully, false otherwise 21 | */ 22 | public function isOk(); 23 | 24 | /** 25 | * @return string|null Any error message returned by Slack (always null if response was 'ok') 26 | */ 27 | public function getError(); 28 | 29 | /** 30 | * @return string|null Any error message returned by Slack, converted into a more human-readable sentence 31 | * (always null if response was 'ok') 32 | */ 33 | public function getErrorExplanation(); 34 | } 35 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/RtmStartPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Travis Raup 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/rtm.start 18 | */ 19 | class RtmStartPayload extends AbstractPayload 20 | { 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function getMethod() 25 | { 26 | return 'rtm.start'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/RtmStartPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Travis Raup 16 | */ 17 | class RtmStartPayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string 21 | */ 22 | private $url; 23 | 24 | /** 25 | * @return string 26 | */ 27 | public function getUrl() 28 | { 29 | return $this->url; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchAllPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/search.all 18 | */ 19 | class SearchAllPayload extends AbstractSearchPayload 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function getMethod() 25 | { 26 | return 'search.all'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchAllPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\FileResult; 15 | use CL\Slack\Model\MessageResult; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class SearchAllPayloadResponse extends AbstractSearchPayloadResponse 21 | { 22 | /** 23 | * @var MessageResult 24 | */ 25 | private $messages; 26 | 27 | /** 28 | * @var FileResult 29 | */ 30 | private $files; 31 | 32 | /** 33 | * @return MessageResult 34 | */ 35 | public function getMessageResult() 36 | { 37 | return $this->messages; 38 | } 39 | 40 | /** 41 | * @return FileResult 42 | */ 43 | public function getFileResult() 44 | { 45 | return $this->files; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchFilesPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/search.files 18 | */ 19 | class SearchFilesPayload extends AbstractSearchPayload 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function getMethod() 25 | { 26 | return 'search.files'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchFilesPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\FileResult; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class SearchFilesPayloadResponse extends AbstractSearchPayloadResponse 20 | { 21 | /** 22 | * @var FileResult 23 | */ 24 | private $files; 25 | 26 | /** 27 | * @return FileResult 28 | */ 29 | public function getResult() 30 | { 31 | return $this->files; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchMessagesPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/search.messages 18 | */ 19 | class SearchMessagesPayload extends AbstractSearchPayload 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function getMethod() 25 | { 26 | return 'search.messages'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/SearchMessagesPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\MessageResult; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class SearchMessagesPayloadResponse extends AbstractSearchPayloadResponse 20 | { 21 | /** 22 | * @var MessageResult 23 | */ 24 | private $messages; 25 | 26 | /** 27 | * @return MessageResult 28 | */ 29 | public function getResult() 30 | { 31 | return $this->messages; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/StarsListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Paging; 15 | use CL\Slack\Model\StarredItem; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class StarsListPayloadResponse extends AbstractPayloadResponse 21 | { 22 | /** 23 | * @var StarredItem[] 24 | */ 25 | private $items = []; 26 | 27 | /** 28 | * @var Paging 29 | */ 30 | private $paging; 31 | 32 | /** 33 | * @return StarredItem[]|null 34 | */ 35 | public function getItems() 36 | { 37 | return $this->items; 38 | } 39 | 40 | /** 41 | * @return Paging|null 42 | */ 43 | public function getPaging() 44 | { 45 | return $this->paging; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/TeamInfoPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Nic Malan 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/team.info 18 | */ 19 | class TeamInfoPayload extends AbstractPayload 20 | { 21 | /** 22 | * {@inheritdoc} 23 | */ 24 | public function getMethod() 25 | { 26 | return 'team.info'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/TeamInfoPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\Team; 15 | 16 | /** 17 | * @author Nic Malan 18 | */ 19 | class TeamInfoPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var Team|null 23 | */ 24 | private $team; 25 | 26 | /** 27 | * @return Team|null 28 | */ 29 | public function getTeam() 30 | { 31 | return $this->team; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersAdminInvitePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * user that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Dries De Peuter 16 | * 17 | * @link Unofficial documentation at https://levels.io/slack-typeform-auto-invite-sign-ups/ 18 | */ 19 | class UsersAdminInvitePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $email; 25 | 26 | /** 27 | * @return string 28 | */ 29 | public function getEmail() 30 | { 31 | return $this->email; 32 | } 33 | 34 | /** 35 | * @param string $email 36 | */ 37 | public function setEmail($email) 38 | { 39 | $this->email = $email; 40 | } 41 | 42 | /** 43 | * {@inheritdoc} 44 | */ 45 | public function getMethod() 46 | { 47 | return 'users.admin.invite'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersAdminInvitePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Dries De Peuter 16 | */ 17 | class UsersAdminInvitePayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersGetPresencePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/presence.set 18 | */ 19 | class UsersGetPresencePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string ID of the user 23 | */ 24 | private $user; 25 | 26 | /** 27 | * @param string $user ID of the user 28 | */ 29 | public function setUserId($user) 30 | { 31 | $this->user = $user; 32 | } 33 | 34 | /** 35 | * @return string ID of the user 36 | */ 37 | public function getUserId() 38 | { 39 | return $this->user; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'users.getPresence'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersGetPresencePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class UsersGetPresencePayloadResponse extends AbstractPayloadResponse 18 | { 19 | /** 20 | * @var string 21 | */ 22 | private $presence; 23 | 24 | /** 25 | * @return string 26 | */ 27 | public function getPresence() 28 | { 29 | return $this->presence; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersInfoPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * user that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/users.info 18 | */ 19 | class UsersInfoPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string ID of the user to get info on 23 | */ 24 | private $user; 25 | 26 | /** 27 | * @param string $user ID of the user to get info on 28 | */ 29 | public function setUserId($user) 30 | { 31 | $this->user = $user; 32 | } 33 | 34 | /** 35 | * @return string ID of the user to get info on 36 | */ 37 | public function getUserId() 38 | { 39 | return $this->user; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'users.info'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersInfoPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\User; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class UsersInfoPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var User|null 23 | */ 24 | private $user; 25 | 26 | /** 27 | * @return User|null 28 | */ 29 | public function getUser() 30 | { 31 | return $this->user; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersListPayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/users.list 18 | */ 19 | class UsersListPayload extends AbstractPayload 20 | { 21 | /** 22 | * @var bool 23 | */ 24 | private $presence; 25 | 26 | /** 27 | * @param bool $presence Whether to include presence data in the output 28 | */ 29 | public function setPresence($presence) 30 | { 31 | $this->presence = $presence; 32 | } 33 | 34 | /** 35 | * @return bool Whether to include presence data in the output 36 | */ 37 | public function isPresence() 38 | { 39 | return $this->presence; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'users.list'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersListPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | use CL\Slack\Model\User; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class UsersListPayloadResponse extends AbstractPayloadResponse 20 | { 21 | /** 22 | * @var User[] 23 | */ 24 | private $members; 25 | 26 | /** 27 | * Returns 1 or more members of the team, in no particular order. 28 | * 29 | * For deactivated users, deleted will be true. 30 | * The color property is used in some clients to display a colored username. 31 | * 32 | * @return User[] 33 | */ 34 | public function getUsers() 35 | { 36 | return $this->members; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersSetActivePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/users.setActive 18 | */ 19 | class UsersSetActivePayload extends AbstractPayload 20 | { 21 | /** 22 | * @inheritdoc 23 | */ 24 | public function getMethod() 25 | { 26 | return 'users.setActive'; 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersSetActivePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class UsersSetActivePayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersSetPresencePayload.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | * 17 | * @link Official documentation at https://api.slack.com/methods/presence.set 18 | */ 19 | class UsersSetPresencePayload extends AbstractPayload 20 | { 21 | /** 22 | * @var string 23 | */ 24 | private $presence; 25 | 26 | /** 27 | * @param string $presence 28 | */ 29 | public function setPresence($presence) 30 | { 31 | $this->presence = $presence; 32 | } 33 | 34 | /** 35 | * @return string 36 | */ 37 | public function getPresence() 38 | { 39 | return $this->presence; 40 | } 41 | 42 | /** 43 | * @inheritdoc 44 | */ 45 | public function getMethod() 46 | { 47 | return 'user.setPresence'; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/CL/Slack/Payload/UsersSetPresencePayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Payload; 13 | 14 | /** 15 | * @author Cas Leentfaar 16 | */ 17 | class UsersSetPresencePayloadResponse extends AbstractPayloadResponse 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.AbstractSearchResultModel.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\AbstractSearchResultModel: 2 | properties: 3 | pagination: 4 | type: CL\Slack\Model\Paging 5 | paging: 6 | type: CL\Slack\Model\Paging 7 | total: 8 | type: integer 9 | channel: 10 | type: string 11 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Attachment.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Attachment: 2 | properties: 3 | title: 4 | type: string 5 | fallback: 6 | type: string 7 | preText: 8 | type: string 9 | imageUrl: 10 | type: string 11 | text: 12 | type: string 13 | color: 14 | type: string 15 | fields: 16 | type: ArrayCollection 17 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.AttachmentField.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\AttachmentField: 2 | properties: 3 | title: 4 | type: string 5 | value: 6 | type: string 7 | short: 8 | type: boolean 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Channel.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Channel: 2 | properties: 3 | id: 4 | type: string 5 | name: 6 | type: string 7 | created: 8 | type: DateTime<'U'> 9 | creator: 10 | type: string 11 | isArchived: 12 | type: boolean 13 | isGeneral: 14 | type: boolean 15 | latest: 16 | type: CL\Slack\Model\SimpleMessage 17 | lastRead: 18 | type: string 19 | isMember: 20 | type: boolean 21 | members: 22 | type: array 23 | topic: 24 | type: CL\Slack\Model\Customizable 25 | purpose: 26 | type: CL\Slack\Model\Customizable 27 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Customizable.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Customizable: 2 | properties: 3 | value: 4 | type: string 5 | creator: 6 | type: string 7 | type: 8 | type: string 9 | lastSet: 10 | type: DateTime<'U'> 11 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.FileResult.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\FileResult: 2 | properties: 3 | matches: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.FileResultItem.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\FileResultItem: 2 | properties: 3 | channel: 4 | type: CL\Slack\Model\SimpleChannel 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Group.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Group: 2 | properties: 3 | id: 4 | type: string 5 | name: 6 | type: string 7 | created: 8 | type: DateTime<'U'> 9 | creator: 10 | type: string 11 | isArchived: 12 | type: boolean 13 | members: 14 | type: array 15 | topic: 16 | type: CL\Slack\Model\Customizable 17 | purpose: 18 | type: CL\Slack\Model\Customizable 19 | isGroup: 20 | type: boolean 21 | lastRead: 22 | type: string 23 | latest: 24 | type: CL\Slack\Model\Message 25 | unreadCount: 26 | type: integer 27 | unreadCountDisplay: 28 | type: integer 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.GroupWithState.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\GroupWithState: 2 | properties: 3 | isOpen: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.ImChannel.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\ImChannel: 2 | properties: 3 | id: 4 | type: string 5 | created: 6 | type: DateTime<'U'> 7 | user: 8 | type: string 9 | isIm: 10 | type: boolean 11 | isUserDeleted: 12 | type: boolean 13 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Message.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Message: 2 | properties: 3 | ts: 4 | type: string 5 | type: 6 | type: string 7 | user: 8 | type: string 9 | username: 10 | type: string 11 | text: 12 | type: string 13 | permalink: 14 | type: string 15 | channel: 16 | type: CL\Slack\Model\Channel 17 | previous: 18 | type: CL\Slack\Model\Message 19 | next: 20 | type: CL\Slack\Model\Message -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.MessageResult.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\MessageResult: 2 | properties: 3 | matches: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.MessageResultItem.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\MessageResultItem: 2 | properties: 3 | ts: 4 | type: string 5 | type: 6 | type: string 7 | channel: 8 | type: CL\Slack\Model\SimpleChannel 9 | user: 10 | type: string 11 | username: 12 | type: string 13 | text: 14 | type: string 15 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Paging.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Paging: 2 | properties: 3 | total: 4 | type: integer 5 | count: 6 | type: integer 7 | page: 8 | type: integer 9 | pages: 10 | type: integer 11 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleChannel.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\SimpleChannel: 2 | properties: 3 | id: 4 | type: string 5 | name: 6 | type: string 7 | created: 8 | type: DateTime<'U'> 9 | creator: 10 | type: string 11 | isArchived: 12 | type: boolean 13 | isGeneral: 14 | type: boolean 15 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.SimpleMessage.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\SimpleMessage: 2 | properties: 3 | ts: 4 | type: string 5 | type: 6 | type: string 7 | subtype: 8 | type: string 9 | channel: 10 | type: CL\Slack\Model\SimpleChannel 11 | user: 12 | type: string 13 | username: 14 | type: string 15 | text: 16 | type: string 17 | attachments: 18 | type: array 19 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.StarredItem.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\StarredItem: 2 | properties: 3 | type: 4 | type: string 5 | comment: 6 | type: string 7 | file: 8 | type: CL\Slack\Model\File 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.Team.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\Team: 2 | properties: 3 | id: 4 | type: string 5 | name: 6 | type: string 7 | domain: 8 | type: string 9 | emailDomain: 10 | type: string 11 | serialized_name: email_domain 12 | icon: 13 | type: array 14 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.User.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\User: 2 | properties: 3 | id: 4 | type: string 5 | name: 6 | type: string 7 | color: 8 | type: string 9 | profile: 10 | type: CL\Slack\Model\UserProfile 11 | isAdmin: 12 | type: boolean 13 | isBot: 14 | type: boolean 15 | isRestricted: 16 | type: boolean 17 | isUltraRestricted: 18 | type: boolean 19 | deleted: 20 | type: boolean 21 | hasFiles: 22 | type: boolean 23 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Model.UserProfile.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Model\UserProfile: 2 | properties: 3 | realName: 4 | type: string 5 | firstName: 6 | type: string 7 | lastName: 8 | type: string 9 | skype: 10 | type: string 11 | phone: 12 | type: string 13 | email: 14 | type: string 15 | image24: 16 | type: string 17 | serialized_name: image_24 18 | image32: 19 | type: string 20 | serialized_name: image_32 21 | image48: 22 | type: string 23 | serialized_name: image_48 24 | image72: 25 | type: string 26 | serialized_name: image_72 27 | image192: 28 | type: string 29 | serialized_name: image_192 30 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.AbstractPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\AbstractPayloadResponse: 2 | properties: 3 | ok: 4 | type: boolean 5 | error: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.AbstractSearchPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\AbstractSearchPayload: 2 | properties: 3 | query: 4 | type: string 5 | count: 6 | type: integer 7 | page: 8 | type: integer 9 | highlight: 10 | type: boolean 11 | sort: 12 | type: string 13 | sort_dir: 14 | type: string 15 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.AbstractSearchPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\AbstractSearchPayloadResponse: 2 | properties: 3 | query: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ApiTestPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ApiTestPayload: 2 | properties: 3 | args: 4 | type: array 5 | inline: true 6 | error: 7 | type: string 8 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ApiTestPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ApiTestPayloadResponse: 2 | properties: 3 | args: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.AuthTestPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\AuthTestPayloadResponse: 2 | properties: 3 | user: 4 | type: string 5 | userId: 6 | type: string 7 | team: 8 | type: string 9 | teamId: 10 | type: string 11 | url: 12 | type: string 13 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsArchivePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsArchivePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsCreatePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsCreatePayload: 2 | properties: 3 | name: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsCreatePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsCreatePayloadResponse: 2 | properties: 3 | channel: 4 | type: CL\Slack\Model\Channel 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsHistoryPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsHistoryPayload: 2 | properties: 3 | channel: 4 | type: string 5 | oldest: 6 | type: string 7 | latest: 8 | type: string 9 | count: 10 | type: integer 11 | inclusive: 12 | type: boolean 13 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsHistoryPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsHistoryPayloadResponse: 2 | properties: 3 | latest: 4 | type: string 5 | messages: 6 | type: array 7 | hasMore: 8 | type: boolean 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsInfoPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsInfoPayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsInfoPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsInfoPayloadResponse: 2 | properties: 3 | channel: 4 | type: CL\Slack\Model\Channel 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsInvitePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsInvitePayload: 2 | properties: 3 | channel: 4 | type: string 5 | user: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsInvitePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsInvitePayloadResponse: 2 | properties: 3 | channel: 4 | type: CL\Slack\Model\Channel 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsJoinPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsJoinPayload: 2 | properties: 3 | name: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsJoinPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsJoinPayloadResponse: 2 | properties: 3 | alreadyInChannel: 4 | type: boolean 5 | channel: 6 | type: CL\Slack\Model\Channel 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsKickPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsKickPayload: 2 | properties: 3 | channel: 4 | type: string 5 | user: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsLeavePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsLeavePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsLeavePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsLeavePayloadResponse: 2 | properties: 3 | notInChannel: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsListPayload: 2 | properties: 3 | alreadyArchived: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsListPayloadResponse: 2 | properties: 3 | channels: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsMarkPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsMarkPayload: 2 | properties: 3 | channel: 4 | type: string 5 | ts: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsRenamePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsRenamePayload: 2 | properties: 3 | channel: 4 | type: string 5 | name: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsRenamePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsRenamePayloadResponse: 2 | properties: 3 | channel: 4 | type: CL\Slack\Model\Channel 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsSetPurposePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsSetPurposePayload: 2 | properties: 3 | channel: 4 | type: string 5 | purpose: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsSetPurposePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsSetPurposePayloadResponse: 2 | properties: 3 | purpose: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsSetTopicPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsSetTopicPayload: 2 | properties: 3 | channel: 4 | type: string 5 | topic: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChannelsSetTopicPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChannelsSetTopicPayloadResponse: 2 | properties: 3 | topic: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatDeletePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatDeletePayload: 2 | properties: 3 | channel: 4 | type: string 5 | ts: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatDeletePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatDeletePayloadResponse: 2 | properties: 3 | channel: 4 | type: string 5 | ts: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatPostMessagePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatPostMessagePayload: 2 | exclusion_policy: ALL 3 | properties: 4 | channel: 5 | type: string 6 | text: 7 | type: string 8 | username: 9 | type: string 10 | iconEmoji: 11 | type: string 12 | iconUrl: 13 | type: string 14 | unfurlLinks: 15 | type: string 16 | unfurlMedia: 17 | type: string 18 | linkNames: 19 | type: string 20 | parse: 21 | type: string 22 | asUser: 23 | type: boolean 24 | attachments: 25 | type: string 26 | accessor: 27 | getter: getAttachmentsJson -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatPostMessagePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatPostMessagePayloadResponse: 2 | properties: 3 | ts: 4 | type: string 5 | channel: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatUpdatePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatUpdatePayload: 2 | properties: 3 | text: 4 | type: string 5 | channel: 6 | type: string 7 | ts: 8 | type: string 9 | parse: 10 | type: string 11 | linkNames: 12 | type: string 13 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ChatUpdatePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ChatUpdatePayloadResponse: 2 | properties: 3 | text: 4 | type: string 5 | channel: 6 | type: string 7 | ts: 8 | type: string 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.EmojiListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\EmojiListPayloadResponse: 2 | properties: 3 | emoji: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesInfoPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesInfoPayload: 2 | properties: 3 | file: 4 | type: string 5 | count: 6 | type: integer 7 | page: 8 | type: integer 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesInfoPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesInfoPayloadResponse: 2 | properties: 3 | file: 4 | type: CL\Slack\Model\File 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesListPayload: 2 | properties: 3 | user: 4 | type: string 5 | tsFrom: 6 | type: DateTime<'U'> 7 | tsTo: 8 | type: DateTime<'U'> 9 | count: 10 | type: integer 11 | page: 12 | type: integer 13 | types: 14 | type: array 15 | accesor: 16 | setter: setTypesFromString 17 | getter: getTypesAsString 18 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesListPayloadResponse: 2 | properties: 3 | files: 4 | type: array 5 | paging: 6 | type: CL\Slack\Model\Paging 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesUploadPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesUploadPayload: 2 | properties: 3 | content: 4 | type: string 5 | file: 6 | type: string 7 | fileType: 8 | type: string 9 | filename: 10 | type: string 11 | title: 12 | type: string 13 | channels: 14 | type: string 15 | accessor: 16 | setter: setChannelsFromString 17 | getter: getChannelsAsString 18 | initialComment: 19 | type: string 20 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.FilesUploadPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\FilesUploadPayloadResponse: 2 | properties: 3 | file: 4 | type: CL\Slack\Model\File 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsArchivePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsArchivePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsClosePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsClosePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsClosePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsClosePayloadResponse: 2 | properties: 3 | noOp: 4 | type: boolean 5 | alreadyClosed: 6 | type: boolean 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsCreateChildPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsCreateChildPayloadResponse: 2 | properties: 3 | group: 4 | type: CL\Slack\Model\Group 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsCreatePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsCreatePayload: 2 | properties: 3 | name: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsCreatePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsCreatePayloadResponse: 2 | properties: 3 | group: 4 | type: CL\Slack\Model\Group 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsHistoryPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsHistoryPayload: 2 | properties: 3 | channel: 4 | type: string 5 | oldest: 6 | type: string 7 | latest: 8 | type: string 9 | count: 10 | type: integer 11 | inclusive: 12 | type: boolean 13 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsHistoryPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsHistoryPayloadResponse: 2 | properties: 3 | latest: 4 | type: string 5 | messages: 6 | type: array 7 | hasMore: 8 | type: boolean 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsInfoPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsInfoPayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsInfoPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsInfoPayloadResponse: 2 | properties: 3 | group: 4 | type: CL\Slack\Model\Group 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsInvitePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsInvitePayload: 2 | properties: 3 | channel: 4 | type: string 5 | user: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsInvitePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsInvitePayloadResponse: 2 | properties: 3 | group: 4 | type: CL\Slack\Model\Group 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsLeavePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsLeavePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsListPayload: 2 | properties: 3 | excludeArchived: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsListPayloadResponse: 2 | properties: 3 | groups: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsOpenPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsOpenPayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsOpenPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsOpenPayloadResponse: 2 | properties: 3 | noOp: 4 | type: boolean 5 | alreadyOpen: 6 | type: boolean 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsRenamePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsRenamePayload: 2 | properties: 3 | channel: 4 | type: string 5 | name: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsRenamePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsRenamePayloadResponse: 2 | properties: 3 | group: 4 | type: CL\Slack\Model\Group 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsSetPurposePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsSetPurposePayload: 2 | properties: 3 | channel: 4 | type: string 5 | purpose: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsSetPurposePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsSetPurposePayloadResponse: 2 | properties: 3 | purpose: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsSetTopicPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsSetTopicPayload: 2 | properties: 3 | channel: 4 | type: string 5 | topic: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.GroupsSetTopicPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\GroupsSetTopicPayloadResponse: 2 | properties: 3 | topic: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImClosePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImClosePayload: 2 | properties: 3 | channel: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImClosePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImClosePayloadResponse: 2 | properties: 3 | noOp: 4 | type: boolean 5 | alreadyClosed: 6 | type: boolean 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImHistoryPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImHistoryPayload: 2 | properties: 3 | channel: 4 | type: string 5 | inclusive: 6 | type: boolean 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImHistoryPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImHistoryPayloadResponse: 2 | properties: 3 | latest: 4 | type: string 5 | hasMore: 6 | type: boolean 7 | messages: 8 | type: array 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImListPayload: 2 | properties: 3 | alreadyArchived: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImListPayloadResponse: 2 | properties: 3 | ims: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImOpenPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImOpenPayload: 2 | properties: 3 | user: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.ImOpenPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\ImOpenPayloadResponse: 2 | properties: 3 | noOp: 4 | type: boolean 5 | alreadyOpen: 6 | type: boolean 7 | channel: 8 | type: array 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.OauthAccessPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\OauthAccessPayload: 2 | properties: 3 | clientId: 4 | type: string 5 | clientSecret: 6 | type: string 7 | code: 8 | type: string 9 | redirectUri: 10 | type: string 11 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.OauthAccessPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\OauthAccessPayloadResponse: 2 | properties: 3 | accessToken: 4 | type: string 5 | scope: 6 | type: string 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.RtmStartPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\RtmStartPayloadResponse: 2 | properties: 3 | url: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.SearchAllPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\SearchAllPayloadResponse: 2 | properties: 3 | files: 4 | type: CL\Slack\Model\FileResult 5 | messages: 6 | type: CL\Slack\Model\MessageResult 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.SearchFilesPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\SearchFilesPayloadResponse: 2 | properties: 3 | files: 4 | type: CL\Slack\Model\FileResult 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.SearchMessagesPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\SearchMessagesPayloadResponse: 2 | properties: 3 | messages: 4 | type: CL\Slack\Model\MessageResult 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.StarsListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\StarsListPayload: 2 | properties: 3 | count: 4 | type: integer 5 | page: 6 | type: integer 7 | user: 8 | type: string 9 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.StarsListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\StarsListPayloadResponse: 2 | properties: 3 | items: 4 | type: array 5 | paging: 6 | type: CL\Slack\Model\Paging 7 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.TeamInfoPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\TeamInfoPayload: 2 | properties: 3 | error: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.TeamInfoPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\TeamInfoPayloadResponse: 2 | properties: 3 | team: 4 | type: CL\Slack\Model\Team 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersGetPresencePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersGetPresencePayload: 2 | properties: 3 | user: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersGetPresencePayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersGetPresencePayloadResponse: 2 | properties: 3 | presence: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersInfoPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersInfoPayload: 2 | properties: 3 | user: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersInfoPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersInfoPayloadResponse: 2 | properties: 3 | user: 4 | type: CL\Slack\Model\User 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersListPayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersListPayload: 2 | properties: 3 | presence: 4 | type: boolean 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersListPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersListPayloadResponse: 2 | properties: 3 | members: 4 | type: array 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Payload.UsersSetPresencePayload.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Payload\UsersSetPresencePayload: 2 | properties: 3 | presence: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/config/serializer/CL.Slack.Test.MockPayloadResponse.yml: -------------------------------------------------------------------------------- 1 | CL\Slack\Test\MockPayloadResponse: 2 | properties: 3 | foo: 4 | type: string 5 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/doc/contributing.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Coding standards 4 | 5 | Your code should follow [Symfony's coding standards](http://symfony.com/doc/current/contributing/code/standards.html) as close as possible. 6 | 7 | 8 | ## Conventions 9 | 10 | Your code should follow [Symfony's code conventions](http://symfony.com/doc/current/contributing/code/conventions.html) as close as possible. 11 | 12 | 13 | ## Testing your code locally 14 | 15 | Please make sure the unit tests run without failures before and after contributing. To do this, simply run your tests 16 | using the phpunit version bundled with the library, like this: 17 | 18 | ./bin/phpunit Tests/Path/To/Your/Test.php 19 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/doc/events.md: -------------------------------------------------------------------------------- 1 | ## Events 2 | 3 | In some scenarios, you might want to keep track of what data is passed to Slack, and what data is returned. 4 | For this, two events have been made available that you can listen to: `EVENT_REQUEST` and `EVENT_RESPONSE`. 5 | 6 | Below is an example of how you could use this to display debugging information to a command-line user (e.g. in a `Command`): 7 | ```php 8 | addRequestListener(function (RequestEvent $event) { 13 | echo "Sent payload:\n"; 14 | var_dump($event->getRawPayload()); // array containing the data that was sent to Slack 15 | }); 16 | 17 | $apiClient->addResponseListener(function (ResponseEvent $event) use ($output, $self) { 18 | echo "Received payload response:\n"; 19 | var_dump($event->getRawPayloadResponse()); // array containing the data that was returned by Slack 20 | }); 21 | 22 | // ... 23 | 24 | $apiClient->send($payload); // will trigger both events sequentially 25 | 26 | ``` 27 | 28 | This example is taken from the [Slack CLI](https://github.com/cleentfaar/slack-cli/blob/master/src/CL/SlackCli/Command/AbstractApiCommand.php#L266) package. 29 | -------------------------------------------------------------------------------- /src/CL/Slack/Resources/doc/installation.md: -------------------------------------------------------------------------------- 1 | ## Installation 2 | 3 | ### Step 1) Get the library 4 | 5 | First you need to get a hold of this library. There are two ways of doing this: 6 | 7 | 8 | #### Method a) Using composer 9 | 10 | 1. Install Composer (see http://getcomposer.org/) 11 | 2. Run `$ composer require cleentfaar/slack ~0.14` 12 | 3. Jump to [step 2](https://github.com/cleentfaar/slack/blob/master/src/CL/Slack/Resources/doc/installation.md#step-2-start-using-this-package). 13 | 14 | 15 | #### Method b) Using submodules 16 | 17 | Run the following commands to bring in the needed libraries as submodules. 18 | 19 | ```bash 20 | git submodule add https://github.com/cleentfaar/slack.git vendor/bundles/CL/Slack 21 | ``` 22 | 23 | Add the following two namespace entries to the `registerNamespaces` call in your autoloader: 24 | 25 | ``` php 26 | // app/autoload.php 27 | $loader->registerNamespaces(array( 28 | // ... 29 | 'CL\Slack' => __DIR__ . '/../vendor/bundles/cleentfaar/slack', 30 | // ... 31 | )); 32 | ``` 33 | 34 | 35 | ### Step 2) Start using this package! 36 | 37 | Check out the [usage documentation](https://github.com/cleentfaar/slack/blob/master/src/CL/Slack/Resources/doc/usage.md)! 38 | -------------------------------------------------------------------------------- /src/CL/Slack/Serializer/AbstractSerializer.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Serializer; 13 | 14 | use JMS\Serializer\SerializerBuilder; 15 | use JMS\Serializer\SerializerInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | abstract class AbstractSerializer 21 | { 22 | /** 23 | * @var SerializerInterface 24 | */ 25 | protected $serializer; 26 | 27 | final public function __construct() 28 | { 29 | $metaDir = __DIR__ . '/../Resources/config/serializer'; 30 | $this->serializer = SerializerBuilder::create()->addMetadataDir($metaDir)->build(); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/CL/Slack/Transport/ApiClientInterface.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Transport; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | interface ApiClientInterface 21 | { 22 | /** 23 | * @param PayloadInterface $payload The payload to send 24 | * @param string|null $token Optional token to use during the API-call, 25 | * defaults to the one configured during construction 26 | * 27 | * @return PayloadResponseInterface Actual class depends on the payload used, 28 | * e.g. chat.postMessage will return an instance of ChatPostMessagePayloadResponse 29 | */ 30 | public function send(PayloadInterface $payload, $token = null); 31 | } 32 | -------------------------------------------------------------------------------- /src/CL/Slack/Transport/Events/RequestEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Transport\Events; 13 | 14 | use Symfony\Component\EventDispatcher\Event; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class RequestEvent extends Event 20 | { 21 | /** 22 | * @var array 23 | */ 24 | private $rawPayload; 25 | 26 | /** 27 | * @param array $rawPayload 28 | */ 29 | public function __construct(array $rawPayload) 30 | { 31 | $this->rawPayload = $rawPayload; 32 | } 33 | 34 | /** 35 | * @return array 36 | */ 37 | public function getRawPayload() 38 | { 39 | return $this->rawPayload; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/CL/Slack/Transport/Events/ResponseEvent.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Transport\Events; 13 | 14 | use Symfony\Component\EventDispatcher\Event; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ResponseEvent extends Event 20 | { 21 | /** 22 | * @var array 23 | */ 24 | private $rawPayloadResponse; 25 | 26 | /** 27 | * @param array $rawPayloadResponse 28 | */ 29 | public function __construct(array $rawPayloadResponse) 30 | { 31 | $this->rawPayloadResponse = $rawPayloadResponse; 32 | } 33 | 34 | /** 35 | * @return array 36 | */ 37 | public function getRawPayloadResponse() 38 | { 39 | return $this->rawPayloadResponse; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Test/Payload/MockPayloadResponse.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Test\Payload; 13 | 14 | use CL\Slack\Payload\AbstractPayloadResponse; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class MockPayloadResponse extends AbstractPayloadResponse 20 | { 21 | } 22 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Test/Payload/PayloadMock.php: -------------------------------------------------------------------------------- 1 | fruit = $fruit; 20 | } 21 | 22 | /** 23 | * @return string 24 | */ 25 | public function getFruit() 26 | { 27 | return $this->fruit; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | */ 33 | public function getMethod() 34 | { 35 | return 'mock'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | */ 41 | public function getResponseClass() 42 | { 43 | return MockPayloadResponse::class; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/ChannelTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\Channel; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createChannel(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\Channel'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param Channel $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertChannel($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/FileResultItemTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\FileResultItem; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class FileResultItemTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createFileResultItem(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\FileResultItem'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param FileResultItem $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertFileResultItem($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/FileTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\File; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class FileTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createFile(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\File'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param File $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertFile($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/GroupTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\Group; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createGroup(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\Group'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param Group $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertGroup($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/GroupWithStateTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\GroupWithState; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupWithStateTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createGroupWithState(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\GroupWithState'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param GroupWithState $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertGroupWithState($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/ImChannelTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\ImChannel; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImChannelTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createImChannel(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\ImChannel'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param ImChannel $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertImChannel($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/MessageResultItemTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * message that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\MessageResultItem; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class MessageResultItemTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createMessageResultItem(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\MessageResultItem'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param MessageResultItem $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertMessageResultItem($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/MessageTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\Message; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class MessageTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createMessage(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\Message'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param Message $actual 42 | */ 43 | protected function assertModel(array $expected, AbstractModel $actual) 44 | { 45 | $this->assertMessage($expected, $actual); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/PagingTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\Paging; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class PagingTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createPaging(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\Paging'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param Paging $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertPaging($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/SimpleMessageTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\SimpleMessage; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class SimpleMessageTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createSimpleMessage(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\SimpleMessage'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param SimpleMessage $actual 42 | */ 43 | protected function assertModel(array $expected, AbstractModel $actual) 44 | { 45 | $this->assertSimpleMessage($expected, $actual); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/StarredItemTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\StarredItem; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class StarredItemTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createStarredItem(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\StarredItem'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param StarredItem $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertStarredItem($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/TeamInfoTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\Team; 16 | 17 | /** 18 | * @author Nic Malan 19 | */ 20 | class TeamInfoTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createTeam(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\Team'; 36 | } 37 | 38 | /** 39 | * {@inheritdoc} 40 | * 41 | * @param Team $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertTeam($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/UserProfileTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\UserProfile; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UserProfileTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createUserProfile(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\UserProfile'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param UserProfile $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertUserProfile($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Model/UserTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Model; 13 | 14 | use CL\Slack\Model\AbstractModel; 15 | use CL\Slack\Model\User; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UserTest extends AbstractModelTest 21 | { 22 | /** 23 | * @return array 24 | */ 25 | protected function getModelData() 26 | { 27 | return $this->createUser(); 28 | } 29 | 30 | /** 31 | * @return string 32 | */ 33 | protected function getModelClass() 34 | { 35 | return 'CL\Slack\Model\User'; 36 | } 37 | 38 | /** 39 | * @inheritdoc 40 | * 41 | * @param User $actualModel 42 | */ 43 | protected function assertModel(array $expectedData, AbstractModel $actualModel) 44 | { 45 | $this->assertUser($expectedData, $actualModel); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ApiTestPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ApiTestPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ApiTestPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ApiTestPayload(); 28 | $payload->setError('fake-error'); 29 | $payload->addArgument('foo', 'bar'); 30 | 31 | return $payload; 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | * 37 | * @param ApiTestPayload $payload 38 | */ 39 | protected function getExpectedPayloadData(PayloadInterface $payload) 40 | { 41 | return [ 42 | 'error' => $payload->getError(), 43 | 'foo' => $payload->getArgument('foo'), 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/AuthTestPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\AuthTestPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class AuthTestPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new AuthTestPayload(); 28 | 29 | return $payload; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param AuthTestPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return []; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsArchivePayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsArchivePayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsArchivePayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return [ 28 | 'channel' => 'acme_channel', 29 | ]; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param array $responseData 36 | * @param ChannelsArchivePayloadResponse $payloadResponse 37 | */ 38 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 39 | { 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsArchivePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsArchivePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsArchivePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsArchivePayload(); 28 | $payload->setChannelId('C1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsArchivePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getChannelId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsCreatePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsCreatePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsCreatePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsCreatePayload(); 28 | $payload->setName('acme_channel'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsCreatePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'name' => $payload->getName(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsInfoPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsInfoPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsInfoPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsInfoPayload(); 28 | $payload->setChannelId('C1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsInfoPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getChannelId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsJoinPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsJoinPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsJoinPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsJoinPayload(); 28 | $payload->setName('#acme_channel'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsJoinPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'name' => $payload->getName(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsKickPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsKickPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsKickPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param ChannelsKickPayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsLeavePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsLeavePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsLeavePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsLeavePayload(); 28 | $payload->setChannelId('C1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsLeavePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getChannelId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsListPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsListPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsListPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsListPayload(); 28 | $payload->setExcludeArchived(true); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsListPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'exclude_archived' => $payload->isExcludeArchived(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsMarkPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsMarkPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsMarkPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param ChannelsMarkPayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsUnarchivePayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsUnarchivePayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsUnarchivePayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param ChannelsUnarchivePayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ChannelsUnarchivePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChannelsUnarchivePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ChannelsUnarchivePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ChannelsUnarchivePayload(); 28 | $payload->setChannelId('C1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChannelsUnarchivePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getChannelId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/EmojiListPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\EmojiListPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class EmojiListPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new EmojiListPayload(); 28 | 29 | return $payload; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param EmojiListPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return []; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/FilesInfoPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\FilesInfoPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class FilesInfoPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return [ 28 | 'file' => $this->createFile(), 29 | ]; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param array $responseData 36 | * @param FilesInfoPayloadResponse $payloadResponse 37 | */ 38 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 39 | { 40 | $this->assertFile($responseData['file'], $payloadResponse->getFile()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/FilesUploadPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\FilesUploadPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class FilesUploadPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return [ 28 | 'file' => $this->createFile(), 29 | ]; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param array $responseData 36 | * @param FilesUploadPayloadResponse $payloadResponse 37 | */ 38 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 39 | { 40 | $this->assertFile($responseData['file'], $payloadResponse->getFile()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsArchivePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsArchivePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsArchivePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsArchivePayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsArchivePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsClosePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsClosePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsClosePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsClosePayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsClosePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsCreateChildPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsCreateChildPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsCreateChildPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsCreateChildPayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsCreateChildPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsCreatePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsCreatePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsCreatePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsCreatePayload(); 28 | $payload->setName('acme_channel'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsCreatePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'name' => $payload->getName(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsInfoPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsInfoPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Travis Raup 19 | */ 20 | class GroupsInfoPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsInfoPayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | * 36 | * @param GroupsInfoPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsKickPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsKickPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsKickPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param GroupsKickPayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsKickPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsKickPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsKickPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsKickPayload(); 28 | $payload->setGroupId('G1234567'); 29 | $payload->setUserId('U1234567'); 30 | 31 | return $payload; 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | * 37 | * @param GroupsKickPayload $payload 38 | */ 39 | protected function getExpectedPayloadData(PayloadInterface $payload) 40 | { 41 | return [ 42 | 'channel' => $payload->getGroupId(), 43 | 'user' => $payload->getUserId(), 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsLeavePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsLeavePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsLeavePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsLeavePayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsLeavePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsListPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsListPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsListPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsListPayload(); 28 | $payload->setExcludeArchived(true); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsListPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'exclude_archived' => $payload->isExcludeArchived(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsMarkPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsMarkPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsMarkPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param GroupsMarkPayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsOpenPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsOpenPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsOpenPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsOpenPayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsOpenPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsUnarchivePayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsUnarchivePayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsUnarchivePayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param GroupsUnarchivePayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/GroupsUnarchivePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\GroupsUnarchivePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class GroupsUnarchivePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new GroupsUnarchivePayload(); 28 | $payload->setGroupId('G1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param GroupsUnarchivePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getGroupId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ImClosePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ImClosePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImClosePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ImClosePayload(); 28 | $payload->setImId('I1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ImClosePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'channel' => $payload->getImId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ImListPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ImListPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImListPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ImListPayload(); 28 | $payload->setExcludeArchived(true); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ImListPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'exclude_archived' => $payload->isExcludeArchived(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ImMarkPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ImMarkPayloadResponse; 15 | use CL\Slack\Payload\PayloadResponseInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImMarkPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param ImMarkPayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ImMarkPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ImMarkPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImMarkPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ImMarkPayload(); 28 | $payload->setImId('I1234567'); 29 | $payload->setSlackTimestamp('12345678.12345678'); 30 | 31 | return $payload; 32 | } 33 | 34 | /** 35 | * @inheritdoc 36 | * 37 | * @param ImMarkPayload $payload 38 | */ 39 | protected function getExpectedPayloadData(PayloadInterface $payload) 40 | { 41 | return [ 42 | 'ts' => $payload->getSlackTimestamp(), 43 | 'channel' => $payload->getImId(), 44 | ]; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/ImOpenPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ImOpenPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class ImOpenPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new ImOpenPayload(); 28 | $payload->setUserId('U1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ImOpenPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'user' => $payload->getUserId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/RtmStartPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\RtmStartPayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | 17 | /** 18 | * @author Travis Raup 19 | */ 20 | class RtmStartPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new RtmStartPayload(); 28 | 29 | return $payload; 30 | } 31 | 32 | /** 33 | * {@inheritdoc} 34 | * 35 | * @param RtmStartPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return []; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/SearchAllPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\SearchAllPayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class SearchAllPayloadTest extends AbstractSearchPayloadTest 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new SearchAllPayload(); 28 | 29 | return parent::createPayload($payload); 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param SearchAllPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return parent::getExpectedPayloadData($payload); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/SearchFilesPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\SearchFilesPayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class SearchFilesPayloadTest extends AbstractSearchPayloadTest 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new SearchFilesPayload(); 28 | 29 | return parent::createPayload($payload); 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param SearchFilesPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return parent::getExpectedPayloadData($payload); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/SearchMessagesPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\SearchMessagesPayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class SearchMessagesPayloadTest extends AbstractSearchPayloadTest 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new SearchMessagesPayload(); 28 | 29 | return parent::createPayload($payload); 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param SearchMessagesPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return parent::getExpectedPayloadData($payload); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/TeamInfoPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\TeamInfoPayload; 16 | 17 | /** 18 | * @author Nic Malan 19 | */ 20 | class TeamInfoPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new TeamInfoPayload(); 28 | return $payload; 29 | } 30 | 31 | /** 32 | * {@inheritdoc} 33 | * 34 | * @param TeamInfoPayload $payload 35 | */ 36 | protected function getExpectedPayloadData(PayloadInterface $payload) 37 | { 38 | return []; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersAdminInvitePayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadResponseInterface; 15 | use CL\Slack\Payload\UsersAdminInvitePayloadResponse; 16 | 17 | /** 18 | * @author Dries De Peuter 19 | */ 20 | class UsersAdminInvitePayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * {@inheritdoc} 32 | * 33 | * @param array $responseData 34 | * @param UsersAdminInvitePayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersAdminInvitePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\UsersAdminInvitePayload; 16 | 17 | /** 18 | * @author Dries De Peuter 19 | */ 20 | class UsersAdminInvitePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * {@inheritdoc} 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new UsersAdminInvitePayload(); 28 | $payload->setEmail('test@domain.org'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | * 36 | * @param UsersAdminInvitePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'email' => $payload->getEmail(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersGetPresencePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\UsersGetPresencePayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersGetPresencePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new UsersGetPresencePayload(); 28 | $payload->setUserId('U1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param UsersGetPresencePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'user' => $payload->getUserId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersInfoPayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadResponseInterface; 15 | use CL\Slack\Payload\UsersInfoPayloadResponse; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersInfoPayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return [ 28 | 'user' => $this->createUser(), 29 | ]; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param array $responseData 36 | * @param UsersInfoPayloadResponse $payloadResponse 37 | */ 38 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 39 | { 40 | $this->assertUser($responseData['user'], $payloadResponse->getUser()); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersInfoPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\UsersInfoPayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersInfoPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new UsersInfoPayload(); 28 | $payload->setUserId('U1234567'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param UsersInfoPayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'user' => $payload->getUserId(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersListPayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\UsersListPayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersListPayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new UsersListPayload(); 28 | 29 | return $payload; 30 | } 31 | 32 | /** 33 | * @inheritdoc 34 | * 35 | * @param UsersListPayload $payload 36 | */ 37 | protected function getExpectedPayloadData(PayloadInterface $payload) 38 | { 39 | return []; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersSetActivePayloadResponseTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadResponseInterface; 15 | use CL\Slack\Payload\UsersSetActivePayloadResponse; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersSetActivePayloadResponseTest extends AbstractPayloadResponseTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | public function createResponseData() 26 | { 27 | return []; 28 | } 29 | 30 | /** 31 | * @inheritdoc 32 | * 33 | * @param array $responseData 34 | * @param UsersSetActivePayloadResponse $payloadResponse 35 | */ 36 | protected function assertResponse(array $responseData, PayloadResponseInterface $payloadResponse) 37 | { 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersSetActivePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\ChatDeletePayload; 15 | use CL\Slack\Payload\PayloadInterface; 16 | use CL\Slack\Payload\UsersSetActivePayload; 17 | 18 | /** 19 | * @author Cas Leentfaar 20 | */ 21 | class UsersSetActivePayloadTest extends AbstractPayloadTestCase 22 | { 23 | /** 24 | * @inheritdoc 25 | */ 26 | protected function createPayload() 27 | { 28 | $payload = new UsersSetActivePayload(); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param ChatDeletePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return []; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Payload/UsersSetPresencePayloadTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Payload; 13 | 14 | use CL\Slack\Payload\PayloadInterface; 15 | use CL\Slack\Payload\UsersSetPresencePayload; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class UsersSetPresencePayloadTest extends AbstractPayloadTestCase 21 | { 22 | /** 23 | * @inheritdoc 24 | */ 25 | protected function createPayload() 26 | { 27 | $payload = new UsersSetPresencePayload(); 28 | $payload->setPresence('my'); 29 | 30 | return $payload; 31 | } 32 | 33 | /** 34 | * @inheritdoc 35 | * 36 | * @param UsersSetPresencePayload $payload 37 | */ 38 | protected function getExpectedPayloadData(PayloadInterface $payload) 39 | { 40 | return [ 41 | 'presence' => $payload->getPresence(), 42 | ]; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Transport/Events/RequestEventTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Transport\Events; 13 | 14 | use CL\Slack\Test\Model\ModelTrait; 15 | use CL\Slack\Transport\Events\RequestEvent; 16 | 17 | /** 18 | * @author Cas Leentfaar 19 | */ 20 | class RequestEventTest extends \PHPUnit_Framework_TestCase 21 | { 22 | use ModelTrait; 23 | 24 | /** 25 | * @test 26 | */ 27 | public function it_can_return_a_raw_payload() 28 | { 29 | $expectedPayload = []; 30 | $event = new RequestEvent($expectedPayload); 31 | $actualPayload = $event->getRawPayload(); 32 | 33 | $this->assertEquals($expectedPayload, $actualPayload); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /tests/src/CL/Slack/Tests/Transport/Events/ResponseEventTest.php: -------------------------------------------------------------------------------- 1 | 7 | * 8 | * For the full copyright and license information, please view the LICENSE 9 | * file that was distributed with this source code. 10 | */ 11 | 12 | namespace CL\Slack\Tests\Transport\Events; 13 | 14 | use CL\Slack\Transport\Events\ResponseEvent; 15 | 16 | /** 17 | * @author Cas Leentfaar 18 | */ 19 | class ResponseEventTest extends \PHPUnit_Framework_TestCase 20 | { 21 | /** 22 | * @test 23 | */ 24 | public function it_can_return_a_raw_payload_response() 25 | { 26 | $expectedPayloadResponse = []; 27 | $event = new ResponseEvent($expectedPayloadResponse); 28 | $actualPayloadResponse = $event->getRawPayloadResponse(); 29 | 30 | $this->assertEquals($expectedPayloadResponse, $actualPayloadResponse); 31 | } 32 | } 33 | --------------------------------------------------------------------------------