forked from romanzipp/Laravel-Twitch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from own3d/update-endpoints
Update endpoints
- Loading branch information
Showing
9 changed files
with
401 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
namespace romanzipp\Twitch\Concerns\Api; | ||
|
||
use romanzipp\Twitch\Concerns\Operations\AbstractOperationsTrait; | ||
use romanzipp\Twitch\Concerns\Operations\AbstractValidationTrait; | ||
use romanzipp\Twitch\Result; | ||
|
||
trait ChannelsTrait | ||
{ | ||
use AbstractValidationTrait; | ||
use AbstractOperationsTrait; | ||
|
||
/** | ||
* Gets channel information for users. | ||
* | ||
* @see https://dev.twitch.tv/docs/api/reference/#get-channel-information | ||
* | ||
* @param array<string, mixed> $parameters | ||
* | ||
* @return \romanzipp\Twitch\Result | ||
*/ | ||
public function getChannels(array $parameters = []): Result | ||
{ | ||
$this->validateAnyRequired($parameters, ['broadcaster_id']); | ||
|
||
return $this->get('channels', $parameters); | ||
} | ||
|
||
/** | ||
* Modifies channel information for users. | ||
* | ||
* @see https://dev.twitch.tv/docs/api/reference/#modify-channel-information | ||
* | ||
* @param array<string, mixed> $parameters | ||
* @param array<string, mixed> $body | ||
* | ||
* @return \romanzipp\Twitch\Result | ||
*/ | ||
public function updateChannels(array $parameters = [], array $body = []): Result | ||
{ | ||
$this->validateAnyRequired($parameters, ['broadcaster_id']); | ||
|
||
return $this->patch('channels', $parameters, null, $body); | ||
} | ||
|
||
/** | ||
* Gets a list of users who have editor permissions for a specific channel. | ||
* | ||
* @see https://dev.twitch.tv/docs/api/reference#get-channel-editors | ||
* | ||
* @param array<string, mixed> $parameters | ||
* | ||
* @return \romanzipp\Twitch\Result | ||
*/ | ||
public function getChannelEditors(array $parameters = []): Result | ||
{ | ||
$this->validateAnyRequired($parameters, ['broadcaster_id']); | ||
|
||
return $this->patch('channels/editors', $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace romanzipp\Twitch\Concerns\Api; | ||
|
||
use romanzipp\Twitch\Concerns\Operations\AbstractOperationsTrait; | ||
use romanzipp\Twitch\Concerns\Operations\AbstractValidationTrait; | ||
use romanzipp\Twitch\Result; | ||
|
||
trait GoalsTrait | ||
{ | ||
use AbstractOperationsTrait; | ||
use AbstractValidationTrait; | ||
|
||
/** | ||
* Gets the broadcaster’s list of active goals. Use this to get the current progress of each goal. | ||
* Alternatively, you can subscribe to receive notifications when a goal makes progress using the channel.goal.progress subscription type. Read more. | ||
* | ||
* @see https://dev.twitch.tv/docs/api/reference#get-creator-goals | ||
* | ||
* @param array<string, mixed> $parameters | ||
* | ||
* @return \romanzipp\Twitch\Result | ||
*/ | ||
public function getCreatorGoals(array $parameters = []): Result | ||
{ | ||
$this->validateRequired($parameters, ['broadcaster_id']); | ||
|
||
return $this->get('goals', $parameters); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.