diff --git a/mlbstatsapi/models/game/gamedata/attributes.py b/mlbstatsapi/models/game/gamedata/attributes.py index 8d0ea9e..f6ed578 100644 --- a/mlbstatsapi/models/game/gamedata/attributes.py +++ b/mlbstatsapi/models/game/gamedata/attributes.py @@ -200,6 +200,42 @@ class GameReview(MLBBaseModel): home: ReviewInfo +class AbsChallengeInfo(MLBBaseModel): + """ + A class to represent ABS challenge info for each team in this game. + + Attributes + ---------- + used_successful : int + How many successful ABS challenges were used. + used_failed : int + How many failed ABS challenges were used. + remaining : int + How many ABS challenges are remaining. + """ + used_successful: int = Field(alias="usedSuccessful") + used_failed: int = Field(alias="usedFailed") + remaining: int + + +class AbsChallenges(MLBBaseModel): + """ + A class to represent ABS challenge information for this game. + + Attributes + ---------- + has_challenges : bool + If ABS challenges are available. + away : AbsChallengeInfo + Away team ABS challenge info. + home : AbsChallengeInfo + Home team ABS challenge info. + """ + has_challenges: bool = Field(alias="hasChallenges") + away: AbsChallengeInfo + home: AbsChallengeInfo + + class GameFlags(MLBBaseModel): """ A class to represent the flags for this game. diff --git a/mlbstatsapi/models/game/gamedata/gamedata.py b/mlbstatsapi/models/game/gamedata/gamedata.py index 4275336..8a63822 100644 --- a/mlbstatsapi/models/game/gamedata/gamedata.py +++ b/mlbstatsapi/models/game/gamedata/gamedata.py @@ -11,6 +11,7 @@ GameWeather, GameInfo, GameReview, + AbsChallenges, GameFlags, GameProbablePitchers, MoundVisits, @@ -57,8 +58,8 @@ class GameData(MLBBaseModel): Secondary data caster for this game. mound_visits : MoundVisits Mound visits for this game. - abs_challenges : List[dict] - ABS challenges for this game. + abs_challenges : AbsChallenges + ABS challenge information for this game. """ game: GameDataGame datetime: GameDatetime @@ -77,7 +78,7 @@ class GameData(MLBBaseModel): official_scorer: Optional[Person] = Field(default=None, alias="officialScorer") primary_data_caster: Optional[Person] = Field(default=None, alias="primaryDataCaster") secondary_data_caster: Optional[Person] = Field(default=None, alias="secondaryDataCaster") - abs_challenges: Optional[List[dict]] = Field(default=None, alias="absChallenges") + abs_challenges: Optional[AbsChallenges] = Field(default=None, alias="absChallenges") @model_validator(mode='before') @classmethod