Skip to content

Commit

Permalink
API object update - League and Match changes, Tournament v4 (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
dolejska-daniel committed Dec 12, 2018
1 parent c0d34bf commit 2e1856e
Show file tree
Hide file tree
Showing 22 changed files with 62 additions and 45 deletions.
1 change: 1 addition & 0 deletions src/RiotAPI/Objects/LeagueItemDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Used in:
* league (v4)
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getChallengerLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getGrandmasterLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueById
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getMasterLeague
*
Expand Down
1 change: 1 addition & 0 deletions src/RiotAPI/Objects/LeagueListDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* Used in:
* league (v4)
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getChallengerLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getGrandmasterLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueById
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getMasterLeague
*
Expand Down
20 changes: 10 additions & 10 deletions src/RiotAPI/Objects/LeaguePositionDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
* Class LeaguePositionDto
*
* Used in:
* league (v3)
* @link https://developer.riotgames.com/api-methods/#league-v3/GET_getAllLeaguePositionsForSummoner
* league (v4)
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getAllLeaguePositionsForSummoner
*
* @package RiotAPI\Objects
*/
class LeaguePositionDto extends ApiObject
{
/** @var string $rank */
public $rank;

/** @var string $queueType */
public $queueType;

/** @var string $summonerName */
public $summonerName;

/** @var bool $hotStreak */
public $hotStreak;

Expand All @@ -58,21 +58,21 @@ class LeaguePositionDto extends ApiObject
/** @var string $leagueId */
public $leagueId;

/** @var string $playerOrTeamName */
public $playerOrTeamName;

/** @var bool $inactive */
public $inactive;

/** @var string $playerOrTeamId */
public $playerOrTeamId;
/** @var string $rank */
public $rank;

/** @var string $leagueName */
public $leagueName;

/** @var string $tier */
public $tier;

/** @var string $summonerId */
public $summonerId;

/** @var int $leaguePoints */
public $leaguePoints;
}
2 changes: 2 additions & 0 deletions src/RiotAPI/Objects/LobbyEventDtoWrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Used in:
* tournament-stub (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-stub-v4/GET_getLobbyEventsByCode
* tournament (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-v4/GET_getLobbyEventsByCode
*
* @iterable $eventList
*
Expand Down
2 changes: 1 addition & 1 deletion src/RiotAPI/Objects/MatchFrameDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MatchFrameDto extends ApiObject
/** @var float $timestamp */
public $timestamp;

/** @var MatchParticipantFrameDto[] $participantFrames */
/** @var MatchParticipantFrameDto[] $participantFrames */
public $participantFrames;

/** @var MatchEventDto[] $events */
Expand Down
4 changes: 2 additions & 2 deletions src/RiotAPI/Objects/MatchParticipantFrameDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Class MatchParticipantFrameDto
*
* Used in:
* match (v3)
* @link https://developer.riotgames.com/api-methods/#match-v3/GET_getMatchTimeline
* match (v4)
* @link https://developer.riotgames.com/api-methods/#match-v4/GET_getMatchTimeline
*
* @package RiotAPI\Objects
*/
Expand Down
2 changes: 2 additions & 0 deletions src/RiotAPI/Objects/MiniSeriesDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,10 @@
* Used in:
* league (v4)
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getChallengerLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getGrandmasterLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getLeagueById
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getMasterLeague
* @link https://developer.riotgames.com/api-methods/#league-v4/GET_getAllLeaguePositionsForSummoner
*
* @package RiotAPI\Objects
*/
Expand Down
14 changes: 7 additions & 7 deletions src/RiotAPI/Objects/ParticipantTimelineDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,36 +47,36 @@ class ParticipantTimelineDto extends ApiObject
* Creep score difference versus the calculated lane opponent(s) for a
* specified period.
*
* @var double[] $csDiffPerMinDeltas
* @var double[] $csDiffPerMinDeltas
*/
public $csDiffPerMinDeltas;

/**
* Gold for a specified period.
*
* @var double[] $goldPerMinDeltas
* @var double[] $goldPerMinDeltas
*/
public $goldPerMinDeltas;

/**
* Experience difference versus the calculated lane opponent(s) for a
* specified period.
*
* @var double[] $xpDiffPerMinDeltas
* @var double[] $xpDiffPerMinDeltas
*/
public $xpDiffPerMinDeltas;

/**
* Creeps for a specified period.
*
* @var double[] $creepsPerMinDeltas
* @var double[] $creepsPerMinDeltas
*/
public $creepsPerMinDeltas;

/**
* Experience change for a specified period.
*
* @var double[] $xpPerMinDeltas
* @var double[] $xpPerMinDeltas
*/
public $xpPerMinDeltas;

Expand All @@ -92,14 +92,14 @@ class ParticipantTimelineDto extends ApiObject
* Damage taken difference versus the calculated lane opponent(s) for a
* specified period.
*
* @var double[] $damageTakenDiffPerMinDeltas
* @var double[] $damageTakenDiffPerMinDeltas
*/
public $damageTakenDiffPerMinDeltas;

/**
* Damage taken for a specified period.
*
* @var double[] $damageTakenPerMinDeltas
* @var double[] $damageTakenPerMinDeltas
*/
public $damageTakenPerMinDeltas;
}
2 changes: 2 additions & 0 deletions src/RiotAPI/Objects/ProviderRegistrationParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Used in:
* tournament-stub (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-stub-v4/POST_registerProviderData
* tournament (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_registerProviderData
*
* @package RiotAPI\Objects
*/
Expand Down
6 changes: 3 additions & 3 deletions src/RiotAPI/Objects/TournamentCodeDto.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
* Class TournamentCodeDto
*
* Used in:
* tournament (v3)
* @link https://developer.riotgames.com/api-methods/#tournament-v3/GET_getTournamentCode
* tournament (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-v4/GET_getTournamentCode
*
* @package RiotAPI\Objects
*/
Expand Down Expand Up @@ -74,7 +74,7 @@ class TournamentCodeDto extends ApiObject
*/
public $teamSize;

/** @var int[] $participants */
/** @var string[] $participants */
public $participants;

/**
Expand Down
2 changes: 2 additions & 0 deletions src/RiotAPI/Objects/TournamentCodeParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Used in:
* tournament-stub (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-stub-v4/POST_createTournamentCode
* tournament (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_createTournamentCode
*
* @package RiotAPI\Objects
*/
Expand Down
2 changes: 2 additions & 0 deletions src/RiotAPI/Objects/TournamentRegistrationParameters.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
* Used in:
* tournament-stub (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-stub-v4/POST_registerTournament
* tournament (v4)
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_registerTournament
*
* @package RiotAPI\Objects
*/
Expand Down
30 changes: 15 additions & 15 deletions src/RiotAPI/RiotAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -2157,11 +2157,11 @@ public function getThirdPartyCodeBySummonerId( string $encrypted_summoner_id ):
/**
* ==================================================================d=d=
* Tournament Endpoint Methods
* @link https://developer.riotgames.com/api-methods/#tournament-v3
* @link https://developer.riotgames.com/api-methods/#tournament-v4
* ==================================================================d=d=
**/
const RESOURCE_TOURNAMENT = '1231:tournament';
const RESOURCE_TOURNAMENT_V3 = 'v3';
const RESOURCE_TOURNAMENT = '1436:tournament';
const RESOURCE_TOURNAMENT_VERSION = 'v4';

/**
* Creates set of tournament codes for given tournament.
Expand All @@ -2178,7 +2178,7 @@ public function getThirdPartyCodeBySummonerId( string $encrypted_summoner_id ):
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/POST_createTournamentCode
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_createTournamentCode
*/
public function createTournamentCodes( int $tournament_id, int $count, TournamentCodeParameters $parameters ): array
{
Expand Down Expand Up @@ -2208,7 +2208,7 @@ public function createTournamentCodes( int $tournament_id, int $count, Tournamen

$data = json_encode($parameters);

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/codes")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/codes")
->setResource(self::RESOURCE_TOURNAMENT, "/codes")
->addQuery('tournamentId', $tournament_id)
->addQuery('count', $count)
Expand All @@ -2233,7 +2233,7 @@ public function createTournamentCodes( int $tournament_id, int $count, Tournamen
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/PUT_updateCode
* @link https://developer.riotgames.com/api-methods/#tournament-v4/PUT_updateCode
*/
public function editTournamentCode( string $tournament_code, TournamentCodeUpdateParameters $parameters )
{
Expand All @@ -2251,7 +2251,7 @@ public function editTournamentCode( string $tournament_code, TournamentCodeUpdat

$data = json_encode($parameters);

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/codes/{$tournament_code}")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/codes/{$tournament_code}")
->setResource(self::RESOURCE_TOURNAMENT, "/codes/%s")
->setData($data)
->useKey(self::SET_TOURNAMENT_KEY)
Expand All @@ -2272,14 +2272,14 @@ public function editTournamentCode( string $tournament_code, TournamentCodeUpdat
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/GET_getTournamentCode
* @link https://developer.riotgames.com/api-methods/#tournament-v4/GET_getTournamentCode
*/
public function getTournamentCodeData( string $tournament_code ): Objects\TournamentCodeDto
{
if ($this->getSetting(self::SET_INTERIM, false))
throw new RequestException('This endpoint is not available in interim mode.');

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/codes/{$tournament_code}")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/codes/{$tournament_code}")
->setResource(self::RESOURCE_TOURNAMENT, "/codes/%s")
->useKey(self::SET_TOURNAMENT_KEY)
->makeCall(Region::AMERICAS);
Expand All @@ -2300,7 +2300,7 @@ public function getTournamentCodeData( string $tournament_code ): Objects\Tourna
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/POST_registerProviderData
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_registerProviderData
*/
public function createTournamentProvider( ProviderRegistrationParameters $parameters ): int
{
Expand All @@ -2317,7 +2317,7 @@ public function createTournamentProvider( ProviderRegistrationParameters $parame

$data = json_encode($parameters, JSON_UNESCAPED_SLASHES);

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/providers")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/providers")
->setResource(self::RESOURCE_TOURNAMENT, "/providers")
->setData($data)
->useKey(self::SET_TOURNAMENT_KEY)
Expand All @@ -2339,7 +2339,7 @@ public function createTournamentProvider( ProviderRegistrationParameters $parame
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/POST_registerTournament
* @link https://developer.riotgames.com/api-methods/#tournament-v4/POST_registerTournament
*/
public function createTournament( TournamentRegistrationParameters $parameters ): int
{
Expand All @@ -2354,7 +2354,7 @@ public function createTournament( TournamentRegistrationParameters $parameters )

$data = json_encode($parameters, JSON_UNESCAPED_SLASHES);

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/tournaments")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/tournaments")
->setResource(self::RESOURCE_TOURNAMENT, "/tournaments")
->setData($data)
->useKey(self::SET_TOURNAMENT_KEY)
Expand All @@ -2375,14 +2375,14 @@ public function createTournament( TournamentRegistrationParameters $parameters )
* @throws ServerException
* @throws ServerLimitException
*
* @link https://developer.riotgames.com/api-methods/#tournament-v3/GET_getLobbyEventsByCode
* @link https://developer.riotgames.com/api-methods/#tournament-v4/GET_getLobbyEventsByCode
*/
public function getTournamentLobbyEvents( string $tournament_code ): Objects\LobbyEventDtoWrapper
{
if ($this->getSetting(self::SET_INTERIM, false))
return $this->getTournamentLobbyEvents_STUB($tournament_code);

$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_V3 . "/lobby-events/by-code/{$tournament_code}")
$this->setEndpoint("/lol/tournament/" . self::RESOURCE_TOURNAMENT_VERSION . "/lobby-events/by-code/{$tournament_code}")
->setResource(self::RESOURCE_TOURNAMENT, "/lobby-events/by-code/%s")
->useKey(self::SET_TOURNAMENT_KEY)
->makeCall(Region::AMERICAS);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Wed, 12 Dec 2018 21:15:23 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"6:10,6:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:3:"728";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:728:"{"id":14390181,"providerId":3339,"tournamentId":465010,"code":"EUNE045c8-8f1f371e-dbc3-494c-8dd5-c5a3acf89506","region":"EUNE","map":"SUMMONERS_RIFT","teamSize":5,"spectators":"ALL","pickType":"ALL_RANDOM","lobbyName":"b61417ec-1805-49fa-873a-87b74ff7e5b7","password":"21d6f8fe0a9948798cd0f225afe604","participants":["wk07XyBvsx0tT6qVY1qKeH-PqCJgEFwKecEfew","AOc8l0ucYYH2UPDY_QFSsRMvnkc7xDH3zf9-Bg","w7j8mTu_r1FFx9Z46l-qW-ryNlQM_3KyI5JTRA","RvCDqKrSsX3b2j7Q-666QvoTR54tH4c3ZF0e9w","CW_QDuT7YoVesISw_7lw7g5roBxjjDVkX6RmEQ","0s4wsmI0ruT6y3YKOZNH1MEqyq64nYfNEeyk_g","UO4uklosNOReoERwfrXEHwnmCSR4_znfOgk11A","AdyAWnr4FwFWutSPvsFFRxUWA_PQ3vSvvsi1TA","kOokFfNudFZ8pM7Tvoo_dm1pXVBps_zSJ37AVg","oI2eFR83UGC3N5OltKkz3NSP_Th_C8nw_0sGcw"]}";s:4:"code";i:200;}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Thu, 29 Nov 2018 09:47:04 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"3:10,3:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:1:"4";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:4:"3338";s:4:"code";i:200;}
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Wed, 12 Dec 2018 21:14:13 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"4:10,4:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:2:"16";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:16:"{"eventList":[]}";s:4:"code";i:200;}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1 +1 @@
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Thu, 29 Nov 2018 12:06:11 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"1:10,1:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:1:"4";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:4:"3339";s:4:"code";i:200;}
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Wed, 12 Dec 2018 21:15:19 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"2:10,2:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:1:"4";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:4:"3339";s:4:"code";i:200;}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Thu, 29 Nov 2018 12:17:13 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"5:10,7:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:1:"6";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:6:"465004";s:4:"code";i:200;}
a:3:{s:7:"headers";a:11:{i:0;s:15:"HTTP/1.1 200 OK";s:28:"Access-Control-Allow-Headers";s:41:"Content-Type, Authorization, X-Riot-Token";s:12:"Content-Type";s:30:"application/json;charset=utf-8";s:4:"Date";s:29:"Wed, 12 Dec 2018 21:15:20 GMT";s:4:"Vary";s:15:"Accept-Encoding";s:16:"X-App-Rate-Limit";s:16:"500:10,30000:600";s:22:"X-App-Rate-Limit-Count";s:10:"3:10,3:600";s:19:"X-Method-Rate-Limit";s:20:"20000:10,1200000:600";s:25:"X-Method-Rate-Limit-Count";s:10:"1:10,1:600";s:14:"Content-Length";s:1:"6";s:10:"Connection";s:10:"keep-alive";}s:8:"response";s:6:"470080";s:4:"code";i:200;}
Loading

0 comments on commit 2e1856e

Please sign in to comment.