1 | <?php |
||
15 | class Channel |
||
16 | { |
||
17 | /** @var TwitchRequest */ |
||
18 | protected $request; |
||
19 | |||
20 | const URI_CHANNEL_AUTH = 'channel'; |
||
21 | const URI_CHANNELS = 'channels/'; |
||
22 | const URI_CHANNEL_KEY = 'channels/%s/stream_key'; |
||
23 | const URI_CHANNEL_EDITORS_AUTH = 'channels/%s/editors'; |
||
24 | const URI_CHANNEL_TEAMS = 'channels/%s/teams'; |
||
25 | |||
26 | public function __construct(TwitchRequest $request) |
||
30 | |||
31 | /** |
||
32 | * Update channel's status or game |
||
33 | * - requires scope 'channel_editor' |
||
34 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#put-channelschannel |
||
35 | * @param string $channel |
||
36 | * @param string $queryString |
||
37 | * @param string $data |
||
38 | * @return \stdClass |
||
39 | * @throws TwitchSDKException |
||
40 | */ |
||
41 | public function setChannel($channel, $queryString, $data) |
||
45 | |||
46 | /** |
||
47 | * Get the authenticated channel |
||
48 | * - requires scope 'channel_read' |
||
49 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channel |
||
50 | * @param string $queryString |
||
51 | * @return \stdClass |
||
52 | * @throws TwitchSDKException |
||
53 | */ |
||
54 | public function getChannel($queryString) |
||
58 | |||
59 | /** |
||
60 | * Resets channel's stream key |
||
61 | * - requires scope 'channel_stream' |
||
62 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#delete-channelschannelstream_key |
||
63 | * @param string $channel |
||
64 | * @param string $queryString |
||
65 | * @return \stdClass |
||
66 | * @throws TwitchSDKException |
||
67 | */ |
||
68 | public function resetStreamKey($channel, $queryString) |
||
72 | |||
73 | /** |
||
74 | * Get the specified channel |
||
75 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschannel |
||
76 | * @param string $channel |
||
77 | * @return \stdClass |
||
78 | * @throws TwitchSDKException |
||
79 | */ |
||
80 | public function getChannels($channel) |
||
84 | |||
85 | /** |
||
86 | * Returns an array of users who are editors of specified channel |
||
87 | * - requires scope 'channel_read' |
||
88 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschanneleditors |
||
89 | * @param string $channel |
||
90 | * @param string $queryString |
||
91 | * @return \stdClass |
||
92 | * @throws TwitchSDKException |
||
93 | */ |
||
94 | public function getEditors($channel, $queryString) |
||
98 | |||
99 | /** |
||
100 | * Return team list for specified channel |
||
101 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschannelteams |
||
102 | * @param string $channel |
||
103 | * @return \stdClass |
||
104 | * @throws TwitchSDKException |
||
105 | */ |
||
106 | public function getTeams($channel) |
||
110 | } |
||
111 |