1 | <?php |
||
17 | class Channel |
||
18 | { |
||
19 | /** @var TwitchRequest */ |
||
20 | protected $request; |
||
21 | |||
22 | const URI_CHANNEL_AUTH = 'channel'; |
||
23 | const URI_CHANNELS = 'channels/'; |
||
24 | const URI_CHANNEL_KEY = 'channels/%s/stream_key'; |
||
25 | const URI_CHANNEL_EDITORS_AUTH = 'channels/%s/editors'; |
||
26 | const URI_CHANNEL_TEAMS = 'channels/%s/teams'; |
||
27 | |||
28 | public function __construct(TwitchRequest $request) |
||
32 | |||
33 | /** |
||
34 | * Update channel's status or game |
||
35 | * - requires scope 'channel_editor' |
||
36 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#put-channelschannel |
||
37 | * @param string $channel |
||
38 | * @param string $queryString |
||
39 | * @param string $data |
||
40 | * @return \stdClass |
||
41 | * @throws TwitchException |
||
42 | */ |
||
43 | public function setChannel($channel, $queryString, $data) |
||
49 | |||
50 | /** |
||
51 | * Get the authenticated channel |
||
52 | * - requires scope 'channel_read' |
||
53 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channel |
||
54 | * @param string $queryString |
||
55 | * @return \stdClass |
||
56 | * @throws TwitchException |
||
57 | */ |
||
58 | public function getChannel($queryString) |
||
64 | |||
65 | /** |
||
66 | * Resets channel's stream key |
||
67 | * - requires scope 'channel_stream' |
||
68 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#delete-channelschannelstream_key |
||
69 | * @param $channel |
||
70 | * @param $queryString |
||
71 | * @return \stdClass |
||
72 | * @throws TwitchException |
||
73 | */ |
||
74 | public function resetStreamKey($channel, $queryString) |
||
80 | |||
81 | /** |
||
82 | * Get the specified channel |
||
83 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschannel |
||
84 | * @param string $channel |
||
85 | * @return \stdClass |
||
86 | * @throws TwitchException |
||
87 | */ |
||
88 | public function getChannels($channel) |
||
94 | |||
95 | /** |
||
96 | * Returns an array of users who are editors of specified channel |
||
97 | * - requires scope 'channel_read' |
||
98 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschanneleditors |
||
99 | * @param string $channel |
||
100 | * @param string $queryString |
||
101 | * @return \stdClass |
||
102 | * @throws TwitchException |
||
103 | */ |
||
104 | public function getEditors($channel, $queryString) |
||
110 | |||
111 | /** |
||
112 | * Return team list for specified channel |
||
113 | * @see https://github.com/justintv/Twitch-API/blob/master/v3_resources/channels.md#get-channelschannelteams |
||
114 | * @param $channel |
||
115 | * @return \stdClass |
||
116 | * @throws TwitchException |
||
117 | */ |
||
118 | public function getTeams($channel) |
||
124 | } |
||
125 |