Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
348 lines (309 sloc) 7.6 KB
<?php
namespace JasonRoman\NbaApi\Request\Stats\Stats\Players;
use JasonRoman\NbaApi\Constraints as ApiAssert;
use JasonRoman\NbaApi\Params\LeagueIdParam;
use JasonRoman\NbaApi\Params\PlayerIdParam;
use JasonRoman\NbaApi\Params\SeasonParam;
use JasonRoman\NbaApi\Params\Stats\ConferenceParam;
use JasonRoman\NbaApi\Params\Stats\DivisionParam;
use JasonRoman\NbaApi\Params\Stats\GameSegmentParam;
use JasonRoman\NbaApi\Params\Stats\LastNGamesParam;
use JasonRoman\NbaApi\Params\Stats\LocationParam;
use JasonRoman\NbaApi\Params\Stats\MeasureTypeParam;
use JasonRoman\NbaApi\Params\Stats\MonthParam;
use JasonRoman\NbaApi\Params\Stats\OutcomeParam;
use JasonRoman\NbaApi\Params\Stats\PeriodParam;
use JasonRoman\NbaApi\Params\Stats\PerModeParam;
use JasonRoman\NbaApi\Params\Stats\SeasonSegmentParam;
use JasonRoman\NbaApi\Params\Stats\SeasonTypeParam;
use JasonRoman\NbaApi\Params\TeamIdParam;
use JasonRoman\NbaApi\Request\Stats\Stats\AbstractStatsStatsRequest;
use Symfony\Component\Validator\Constraints as Assert;
class PlayersVsPlayersRequest extends AbstractStatsStatsRequest
{
const ENDPOINT = '/stats/playersvsplayers';
/**
* @Assert\NotBlank()
* @Assert\Type("string")
* @ApiAssert\ApiChoice(MeasureTypeParam::OPTIONS)
*
* @var string
*/
public $measureType;
/**
* @Assert\NotBlank()
* @Assert\Type("string")
* @ApiAssert\ApiChoice(PerModeParam::OPTIONS_ALL)
*
* @var string
*/
public $perMode;
/**
* @Assert\NotNull()
* @Assert\Type("bool")
*
* @var bool
*/
public $plusMinus;
/**
* @Assert\NotNull()
* @Assert\Type("bool")
*
* @var bool
*/
public $paceAdjust;
/**
* @Assert\NotNull()
* @Assert\Type("bool")
*
* @var bool
*/
public $rank;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(LeagueIdParam::OPTIONS_NBA_G_LEAGUE)
*
* @var string
*/
public $leagueId;
/**
* @Assert\NotBlank()
* @Assert\Type("string")
* @ApiAssert\ApiRegex(SeasonParam::FORMAT)
*
* @var string
*/
public $season;
/**
* @Assert\NotBlank()
* @Assert\Type("string")
* @ApiAssert\ApiChoice(SeasonTypeParam::OPTIONS)
*
* @var string
*/
public $seasonType;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = TeamIdParam::MIN, max = TeamIdParam::MAX)
*
* @var int
*/
public $playerTeamId;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN, max = PlayerIdParam::MAX)
*
* @var int
*/
public $playerId1;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $playerId2;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $playerId3;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $playerId4;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $playerId5;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(OutcomeParam::OPTIONS)
*
* @var string
*/
public $outcome;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(LocationParam::OPTIONS)
*
* @var string
*/
public $location;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = MonthParam::MIN_ALL, max = MonthParam::MAX)
*
* @var int
*/
public $month;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(SeasonSegmentParam::OPTIONS)
*
* @var string
*/
public $seasonSegment;
/**
* @Assert\Type("\DateTime")
*
* @var \DateTime
*/
public $dateFrom;
/**
* @Assert\Type("\DateTime")
*
* @var \DateTime
*/
public $dateTo;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = TeamIdParam::MIN_ALL, max = TeamIdParam::MAX)
*
* @var int
*/
public $opponentTeamId;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(ConferenceParam::OPTIONS)
*
* @var string
*/
public $vsConference;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(DivisionParam::OPTIONS_WITH_CONFERENCE)
*
* @var string
*/
public $vsDivision;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(ConferenceParam::OPTIONS)
*
* @var string
*/
public $conference;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(DivisionParam::OPTIONS_WITH_CONFERENCE)
*
* @var string
*/
public $division;
/**
* @Assert\Type("string")
* @ApiAssert\ApiChoice(GameSegmentParam::OPTIONS)
*
* @var string
*/
public $gameSegment;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PeriodParam::MIN_ALL, max = PeriodParam::MAX)
*
* @var int
*/
public $period;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = LastNGamesParam::MIN_ALL, max = LastNGamesParam::MAX)
*
* @var int
*/
public $lastNGames;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = TeamIdParam::MIN, max = TeamIdParam::MAX)
*
* @var int
*/
public $vsTeamId;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN, max = PlayerIdParam::MAX)
*
* @var int
*/
public $vsPlayerId1;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $vsPlayerId2;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $vsPlayerId3;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $vsPlayerId4;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
* @Assert\Range(min = PlayerIdParam::MIN_ALT, max = PlayerIdParam::MAX)
*
* @var int
*/
public $vsPlayerId5;
/**
* {@inheritdoc}
*/
public static function getDefaultValues(): array
{
return array_merge(parent::getDefaultValues(), [
'playerId2' => PlayerIdParam::NONE,
'playerId3' => PlayerIdParam::NONE,
'playerId4' => PlayerIdParam::NONE,
'playerId5' => PlayerIdParam::NONE,
'vsPlayerId2' => PlayerIdParam::NONE,
'vsPlayerId3' => PlayerIdParam::NONE,
'vsPlayerId4' => PlayerIdParam::NONE,
'vsPlayerId5' => PlayerIdParam::NONE,
]);
}
/**
* {@inheritdoc}
*/
public static function getExampleValues(): array
{
return array_merge(parent::getExampleValues(), [
'playerTeamId' => TeamIdParam::GOLDEN_STATE_WARRIORS,
'playerId1' => 201939,
'vsTeamId' => TeamIdParam::CLEVELAND_CAVALIERS,
'vsPlayerId1' => 2544,
]);
}
}
You can’t perform that action at this time.