cbbd 1.1.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. cbbd/__init__.py +64 -0
  2. cbbd/api/__init__.py +10 -0
  3. cbbd/api/conferences_api.py +176 -0
  4. cbbd/api/games_api.py +806 -0
  5. cbbd/api/plays_api.py +761 -0
  6. cbbd/api/stats_api.py +423 -0
  7. cbbd/api/teams_api.py +195 -0
  8. cbbd/api/venues_api.py +176 -0
  9. cbbd/api_client.py +767 -0
  10. cbbd/api_response.py +25 -0
  11. cbbd/configuration.py +443 -0
  12. cbbd/exceptions.py +167 -0
  13. cbbd/models/__init__.py +42 -0
  14. cbbd/models/conference_info.py +80 -0
  15. cbbd/models/game_box_score_players.py +147 -0
  16. cbbd/models/game_box_score_players_players_inner.py +238 -0
  17. cbbd/models/game_box_score_team.py +148 -0
  18. cbbd/models/game_box_score_team_stats.py +170 -0
  19. cbbd/models/game_box_score_team_stats_points.py +112 -0
  20. cbbd/models/game_info.py +212 -0
  21. cbbd/models/game_media_info.py +133 -0
  22. cbbd/models/game_media_info_broadcasts_inner.py +74 -0
  23. cbbd/models/game_status.py +44 -0
  24. cbbd/models/play_info.py +193 -0
  25. cbbd/models/play_info_participants_inner.py +74 -0
  26. cbbd/models/play_type_info.py +74 -0
  27. cbbd/models/player_season_stats.py +231 -0
  28. cbbd/models/season_type.py +42 -0
  29. cbbd/models/team_info.py +160 -0
  30. cbbd/models/team_season_stats.py +112 -0
  31. cbbd/models/team_season_unit_stats.py +163 -0
  32. cbbd/models/team_season_unit_stats_field_goals.py +91 -0
  33. cbbd/models/team_season_unit_stats_fouls.py +91 -0
  34. cbbd/models/team_season_unit_stats_four_factors.py +98 -0
  35. cbbd/models/team_season_unit_stats_points.py +98 -0
  36. cbbd/models/team_season_unit_stats_rebounds.py +91 -0
  37. cbbd/models/team_season_unit_stats_turnovers.py +84 -0
  38. cbbd/models/venue_info.py +102 -0
  39. cbbd/py.typed +0 -0
  40. cbbd/rest.py +330 -0
  41. cbbd-1.1.0a1.dist-info/METADATA +24 -0
  42. cbbd-1.1.0a1.dist-info/RECORD +44 -0
  43. cbbd-1.1.0a1.dist-info/WHEEL +5 -0
  44. cbbd-1.1.0a1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,170 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ College Basketball Data API
5
+
6
+ This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
7
+
8
+ The version of the OpenAPI document: 1.1.0
9
+ Contact: admin@collegefootballdata.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import Optional, Union
23
+ from pydantic import BaseModel, Field, StrictFloat, StrictInt
24
+ from cbbd.models.game_box_score_team_stats_points import GameBoxScoreTeamStatsPoints
25
+ from cbbd.models.team_season_unit_stats_field_goals import TeamSeasonUnitStatsFieldGoals
26
+ from cbbd.models.team_season_unit_stats_fouls import TeamSeasonUnitStatsFouls
27
+ from cbbd.models.team_season_unit_stats_four_factors import TeamSeasonUnitStatsFourFactors
28
+ from cbbd.models.team_season_unit_stats_rebounds import TeamSeasonUnitStatsRebounds
29
+ from cbbd.models.team_season_unit_stats_turnovers import TeamSeasonUnitStatsTurnovers
30
+
31
+ class GameBoxScoreTeamStats(BaseModel):
32
+ """
33
+ GameBoxScoreTeamStats
34
+ """
35
+ field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="fieldGoals")
36
+ two_point_field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="twoPointFieldGoals")
37
+ three_point_field_goals: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="threePointFieldGoals")
38
+ free_throws: TeamSeasonUnitStatsFieldGoals = Field(default=..., alias="freeThrows")
39
+ rebounds: TeamSeasonUnitStatsRebounds = Field(...)
40
+ turnovers: TeamSeasonUnitStatsTurnovers = Field(...)
41
+ fouls: TeamSeasonUnitStatsFouls = Field(...)
42
+ points: GameBoxScoreTeamStatsPoints = Field(...)
43
+ four_factors: TeamSeasonUnitStatsFourFactors = Field(default=..., alias="fourFactors")
44
+ assists: Optional[Union[StrictFloat, StrictInt]] = Field(...)
45
+ blocks: Optional[Union[StrictFloat, StrictInt]] = Field(...)
46
+ steals: Optional[Union[StrictFloat, StrictInt]] = Field(...)
47
+ possessions: Optional[Union[StrictFloat, StrictInt]] = Field(...)
48
+ rating: Optional[Union[StrictFloat, StrictInt]] = Field(...)
49
+ true_shooting: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="trueShooting")
50
+ game_score: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="gameScore")
51
+ __properties = ["fieldGoals", "twoPointFieldGoals", "threePointFieldGoals", "freeThrows", "rebounds", "turnovers", "fouls", "points", "fourFactors", "assists", "blocks", "steals", "possessions", "rating", "trueShooting", "gameScore"]
52
+
53
+ class Config:
54
+ """Pydantic configuration"""
55
+ allow_population_by_field_name = True
56
+ validate_assignment = True
57
+
58
+ def to_str(self) -> str:
59
+ """Returns the string representation of the model using alias"""
60
+ return pprint.pformat(self.dict(by_alias=True))
61
+
62
+ def to_json(self) -> str:
63
+ """Returns the JSON representation of the model using alias"""
64
+ return json.dumps(self.to_dict())
65
+
66
+ @classmethod
67
+ def from_json(cls, json_str: str) -> GameBoxScoreTeamStats:
68
+ """Create an instance of GameBoxScoreTeamStats from a JSON string"""
69
+ return cls.from_dict(json.loads(json_str))
70
+
71
+ def to_dict(self):
72
+ """Returns the dictionary representation of the model using alias"""
73
+ _dict = self.dict(by_alias=True,
74
+ exclude={
75
+ },
76
+ exclude_none=True)
77
+ # override the default output from pydantic by calling `to_dict()` of field_goals
78
+ if self.field_goals:
79
+ _dict['fieldGoals'] = self.field_goals.to_dict()
80
+ # override the default output from pydantic by calling `to_dict()` of two_point_field_goals
81
+ if self.two_point_field_goals:
82
+ _dict['twoPointFieldGoals'] = self.two_point_field_goals.to_dict()
83
+ # override the default output from pydantic by calling `to_dict()` of three_point_field_goals
84
+ if self.three_point_field_goals:
85
+ _dict['threePointFieldGoals'] = self.three_point_field_goals.to_dict()
86
+ # override the default output from pydantic by calling `to_dict()` of free_throws
87
+ if self.free_throws:
88
+ _dict['freeThrows'] = self.free_throws.to_dict()
89
+ # override the default output from pydantic by calling `to_dict()` of rebounds
90
+ if self.rebounds:
91
+ _dict['rebounds'] = self.rebounds.to_dict()
92
+ # override the default output from pydantic by calling `to_dict()` of turnovers
93
+ if self.turnovers:
94
+ _dict['turnovers'] = self.turnovers.to_dict()
95
+ # override the default output from pydantic by calling `to_dict()` of fouls
96
+ if self.fouls:
97
+ _dict['fouls'] = self.fouls.to_dict()
98
+ # override the default output from pydantic by calling `to_dict()` of points
99
+ if self.points:
100
+ _dict['points'] = self.points.to_dict()
101
+ # override the default output from pydantic by calling `to_dict()` of four_factors
102
+ if self.four_factors:
103
+ _dict['fourFactors'] = self.four_factors.to_dict()
104
+ # set to None if assists (nullable) is None
105
+ # and __fields_set__ contains the field
106
+ if self.assists is None and "assists" in self.__fields_set__:
107
+ _dict['assists'] = None
108
+
109
+ # set to None if blocks (nullable) is None
110
+ # and __fields_set__ contains the field
111
+ if self.blocks is None and "blocks" in self.__fields_set__:
112
+ _dict['blocks'] = None
113
+
114
+ # set to None if steals (nullable) is None
115
+ # and __fields_set__ contains the field
116
+ if self.steals is None and "steals" in self.__fields_set__:
117
+ _dict['steals'] = None
118
+
119
+ # set to None if possessions (nullable) is None
120
+ # and __fields_set__ contains the field
121
+ if self.possessions is None and "possessions" in self.__fields_set__:
122
+ _dict['possessions'] = None
123
+
124
+ # set to None if rating (nullable) is None
125
+ # and __fields_set__ contains the field
126
+ if self.rating is None and "rating" in self.__fields_set__:
127
+ _dict['rating'] = None
128
+
129
+ # set to None if true_shooting (nullable) is None
130
+ # and __fields_set__ contains the field
131
+ if self.true_shooting is None and "true_shooting" in self.__fields_set__:
132
+ _dict['trueShooting'] = None
133
+
134
+ # set to None if game_score (nullable) is None
135
+ # and __fields_set__ contains the field
136
+ if self.game_score is None and "game_score" in self.__fields_set__:
137
+ _dict['gameScore'] = None
138
+
139
+ return _dict
140
+
141
+ @classmethod
142
+ def from_dict(cls, obj: dict) -> GameBoxScoreTeamStats:
143
+ """Create an instance of GameBoxScoreTeamStats from a dict"""
144
+ if obj is None:
145
+ return None
146
+
147
+ if not isinstance(obj, dict):
148
+ return GameBoxScoreTeamStats.parse_obj(obj)
149
+
150
+ _obj = GameBoxScoreTeamStats.parse_obj({
151
+ "field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("fieldGoals")) if obj.get("fieldGoals") is not None else None,
152
+ "two_point_field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("twoPointFieldGoals")) if obj.get("twoPointFieldGoals") is not None else None,
153
+ "three_point_field_goals": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("threePointFieldGoals")) if obj.get("threePointFieldGoals") is not None else None,
154
+ "free_throws": TeamSeasonUnitStatsFieldGoals.from_dict(obj.get("freeThrows")) if obj.get("freeThrows") is not None else None,
155
+ "rebounds": TeamSeasonUnitStatsRebounds.from_dict(obj.get("rebounds")) if obj.get("rebounds") is not None else None,
156
+ "turnovers": TeamSeasonUnitStatsTurnovers.from_dict(obj.get("turnovers")) if obj.get("turnovers") is not None else None,
157
+ "fouls": TeamSeasonUnitStatsFouls.from_dict(obj.get("fouls")) if obj.get("fouls") is not None else None,
158
+ "points": GameBoxScoreTeamStatsPoints.from_dict(obj.get("points")) if obj.get("points") is not None else None,
159
+ "four_factors": TeamSeasonUnitStatsFourFactors.from_dict(obj.get("fourFactors")) if obj.get("fourFactors") is not None else None,
160
+ "assists": obj.get("assists"),
161
+ "blocks": obj.get("blocks"),
162
+ "steals": obj.get("steals"),
163
+ "possessions": obj.get("possessions"),
164
+ "rating": obj.get("rating"),
165
+ "true_shooting": obj.get("trueShooting"),
166
+ "game_score": obj.get("gameScore")
167
+ })
168
+ return _obj
169
+
170
+
@@ -0,0 +1,112 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ College Basketball Data API
5
+
6
+ This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
7
+
8
+ The version of the OpenAPI document: 1.1.0
9
+ Contact: admin@collegefootballdata.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+
22
+ from typing import List, Optional, Union
23
+ from pydantic import BaseModel, Field, StrictFloat, StrictInt, conlist
24
+
25
+ class GameBoxScoreTeamStatsPoints(BaseModel):
26
+ """
27
+ GameBoxScoreTeamStatsPoints
28
+ """
29
+ fast_break: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="fastBreak")
30
+ off_turnovers: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="offTurnovers")
31
+ in_paint: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="inPaint")
32
+ by_period: Optional[conlist(Union[StrictFloat, StrictInt])] = Field(default=..., alias="byPeriod")
33
+ largest_lead: Optional[Union[StrictFloat, StrictInt]] = Field(default=..., alias="largestLead")
34
+ total: Optional[Union[StrictFloat, StrictInt]] = Field(...)
35
+ __properties = ["fastBreak", "offTurnovers", "inPaint", "byPeriod", "largestLead", "total"]
36
+
37
+ class Config:
38
+ """Pydantic configuration"""
39
+ allow_population_by_field_name = True
40
+ validate_assignment = True
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.dict(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> GameBoxScoreTeamStatsPoints:
52
+ """Create an instance of GameBoxScoreTeamStatsPoints from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self):
56
+ """Returns the dictionary representation of the model using alias"""
57
+ _dict = self.dict(by_alias=True,
58
+ exclude={
59
+ },
60
+ exclude_none=True)
61
+ # set to None if fast_break (nullable) is None
62
+ # and __fields_set__ contains the field
63
+ if self.fast_break is None and "fast_break" in self.__fields_set__:
64
+ _dict['fastBreak'] = None
65
+
66
+ # set to None if off_turnovers (nullable) is None
67
+ # and __fields_set__ contains the field
68
+ if self.off_turnovers is None and "off_turnovers" in self.__fields_set__:
69
+ _dict['offTurnovers'] = None
70
+
71
+ # set to None if in_paint (nullable) is None
72
+ # and __fields_set__ contains the field
73
+ if self.in_paint is None and "in_paint" in self.__fields_set__:
74
+ _dict['inPaint'] = None
75
+
76
+ # set to None if by_period (nullable) is None
77
+ # and __fields_set__ contains the field
78
+ if self.by_period is None and "by_period" in self.__fields_set__:
79
+ _dict['byPeriod'] = None
80
+
81
+ # set to None if largest_lead (nullable) is None
82
+ # and __fields_set__ contains the field
83
+ if self.largest_lead is None and "largest_lead" in self.__fields_set__:
84
+ _dict['largestLead'] = None
85
+
86
+ # set to None if total (nullable) is None
87
+ # and __fields_set__ contains the field
88
+ if self.total is None and "total" in self.__fields_set__:
89
+ _dict['total'] = None
90
+
91
+ return _dict
92
+
93
+ @classmethod
94
+ def from_dict(cls, obj: dict) -> GameBoxScoreTeamStatsPoints:
95
+ """Create an instance of GameBoxScoreTeamStatsPoints from a dict"""
96
+ if obj is None:
97
+ return None
98
+
99
+ if not isinstance(obj, dict):
100
+ return GameBoxScoreTeamStatsPoints.parse_obj(obj)
101
+
102
+ _obj = GameBoxScoreTeamStatsPoints.parse_obj({
103
+ "fast_break": obj.get("fastBreak"),
104
+ "off_turnovers": obj.get("offTurnovers"),
105
+ "in_paint": obj.get("inPaint"),
106
+ "by_period": obj.get("byPeriod"),
107
+ "largest_lead": obj.get("largestLead"),
108
+ "total": obj.get("total")
109
+ })
110
+ return _obj
111
+
112
+
@@ -0,0 +1,212 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ College Basketball Data API
5
+
6
+ This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
7
+
8
+ The version of the OpenAPI document: 1.1.0
9
+ Contact: admin@collegefootballdata.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from typing import List, Optional
23
+ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist
24
+ from cbbd.models.game_status import GameStatus
25
+ from cbbd.models.season_type import SeasonType
26
+
27
+ class GameInfo(BaseModel):
28
+ """
29
+ GameInfo
30
+ """
31
+ id: StrictInt = Field(...)
32
+ source_id: StrictStr = Field(default=..., alias="sourceId")
33
+ season_label: StrictStr = Field(default=..., alias="seasonLabel")
34
+ season: StrictInt = Field(...)
35
+ season_type: SeasonType = Field(default=..., alias="seasonType")
36
+ start_date: datetime = Field(default=..., alias="startDate")
37
+ start_time_tbd: StrictBool = Field(default=..., alias="startTimeTbd")
38
+ neutral_site: StrictBool = Field(default=..., alias="neutralSite")
39
+ conference_game: StrictBool = Field(default=..., alias="conferenceGame")
40
+ game_type: Optional[StrictStr] = Field(default=..., alias="gameType")
41
+ status: GameStatus = Field(...)
42
+ attendance: Optional[StrictInt] = Field(...)
43
+ home_team_id: StrictInt = Field(default=..., alias="homeTeamId")
44
+ home_team: StrictStr = Field(default=..., alias="homeTeam")
45
+ home_conference_id: Optional[StrictInt] = Field(default=..., alias="homeConferenceId")
46
+ home_conference: Optional[StrictStr] = Field(default=..., alias="homeConference")
47
+ home_points: Optional[StrictInt] = Field(default=..., alias="homePoints")
48
+ home_period_points: Optional[conlist(StrictInt)] = Field(default=..., alias="homePeriodPoints")
49
+ home_winner: Optional[StrictBool] = Field(default=..., alias="homeWinner")
50
+ away_team_id: StrictInt = Field(default=..., alias="awayTeamId")
51
+ away_team: StrictStr = Field(default=..., alias="awayTeam")
52
+ away_conference_id: Optional[StrictInt] = Field(default=..., alias="awayConferenceId")
53
+ away_conference: Optional[StrictStr] = Field(default=..., alias="awayConference")
54
+ away_points: Optional[StrictInt] = Field(default=..., alias="awayPoints")
55
+ away_period_points: Optional[conlist(StrictInt)] = Field(default=..., alias="awayPeriodPoints")
56
+ away_winner: Optional[StrictBool] = Field(default=..., alias="awayWinner")
57
+ venue_id: Optional[StrictInt] = Field(default=..., alias="venueId")
58
+ venue: Optional[StrictStr] = Field(...)
59
+ city: Optional[StrictStr] = Field(...)
60
+ state: Optional[StrictStr] = Field(...)
61
+ __properties = ["id", "sourceId", "seasonLabel", "season", "seasonType", "startDate", "startTimeTbd", "neutralSite", "conferenceGame", "gameType", "status", "attendance", "homeTeamId", "homeTeam", "homeConferenceId", "homeConference", "homePoints", "homePeriodPoints", "homeWinner", "awayTeamId", "awayTeam", "awayConferenceId", "awayConference", "awayPoints", "awayPeriodPoints", "awayWinner", "venueId", "venue", "city", "state"]
62
+
63
+ class Config:
64
+ """Pydantic configuration"""
65
+ allow_population_by_field_name = True
66
+ validate_assignment = True
67
+
68
+ def to_str(self) -> str:
69
+ """Returns the string representation of the model using alias"""
70
+ return pprint.pformat(self.dict(by_alias=True))
71
+
72
+ def to_json(self) -> str:
73
+ """Returns the JSON representation of the model using alias"""
74
+ return json.dumps(self.to_dict())
75
+
76
+ @classmethod
77
+ def from_json(cls, json_str: str) -> GameInfo:
78
+ """Create an instance of GameInfo from a JSON string"""
79
+ return cls.from_dict(json.loads(json_str))
80
+
81
+ def to_dict(self):
82
+ """Returns the dictionary representation of the model using alias"""
83
+ _dict = self.dict(by_alias=True,
84
+ exclude={
85
+ },
86
+ exclude_none=True)
87
+ # set to None if game_type (nullable) is None
88
+ # and __fields_set__ contains the field
89
+ if self.game_type is None and "game_type" in self.__fields_set__:
90
+ _dict['gameType'] = None
91
+
92
+ # set to None if attendance (nullable) is None
93
+ # and __fields_set__ contains the field
94
+ if self.attendance is None and "attendance" in self.__fields_set__:
95
+ _dict['attendance'] = None
96
+
97
+ # set to None if home_conference_id (nullable) is None
98
+ # and __fields_set__ contains the field
99
+ if self.home_conference_id is None and "home_conference_id" in self.__fields_set__:
100
+ _dict['homeConferenceId'] = None
101
+
102
+ # set to None if home_conference (nullable) is None
103
+ # and __fields_set__ contains the field
104
+ if self.home_conference is None and "home_conference" in self.__fields_set__:
105
+ _dict['homeConference'] = None
106
+
107
+ # set to None if home_points (nullable) is None
108
+ # and __fields_set__ contains the field
109
+ if self.home_points is None and "home_points" in self.__fields_set__:
110
+ _dict['homePoints'] = None
111
+
112
+ # set to None if home_period_points (nullable) is None
113
+ # and __fields_set__ contains the field
114
+ if self.home_period_points is None and "home_period_points" in self.__fields_set__:
115
+ _dict['homePeriodPoints'] = None
116
+
117
+ # set to None if home_winner (nullable) is None
118
+ # and __fields_set__ contains the field
119
+ if self.home_winner is None and "home_winner" in self.__fields_set__:
120
+ _dict['homeWinner'] = None
121
+
122
+ # set to None if away_conference_id (nullable) is None
123
+ # and __fields_set__ contains the field
124
+ if self.away_conference_id is None and "away_conference_id" in self.__fields_set__:
125
+ _dict['awayConferenceId'] = None
126
+
127
+ # set to None if away_conference (nullable) is None
128
+ # and __fields_set__ contains the field
129
+ if self.away_conference is None and "away_conference" in self.__fields_set__:
130
+ _dict['awayConference'] = None
131
+
132
+ # set to None if away_points (nullable) is None
133
+ # and __fields_set__ contains the field
134
+ if self.away_points is None and "away_points" in self.__fields_set__:
135
+ _dict['awayPoints'] = None
136
+
137
+ # set to None if away_period_points (nullable) is None
138
+ # and __fields_set__ contains the field
139
+ if self.away_period_points is None and "away_period_points" in self.__fields_set__:
140
+ _dict['awayPeriodPoints'] = None
141
+
142
+ # set to None if away_winner (nullable) is None
143
+ # and __fields_set__ contains the field
144
+ if self.away_winner is None and "away_winner" in self.__fields_set__:
145
+ _dict['awayWinner'] = None
146
+
147
+ # set to None if venue_id (nullable) is None
148
+ # and __fields_set__ contains the field
149
+ if self.venue_id is None and "venue_id" in self.__fields_set__:
150
+ _dict['venueId'] = None
151
+
152
+ # set to None if venue (nullable) is None
153
+ # and __fields_set__ contains the field
154
+ if self.venue is None and "venue" in self.__fields_set__:
155
+ _dict['venue'] = None
156
+
157
+ # set to None if city (nullable) is None
158
+ # and __fields_set__ contains the field
159
+ if self.city is None and "city" in self.__fields_set__:
160
+ _dict['city'] = None
161
+
162
+ # set to None if state (nullable) is None
163
+ # and __fields_set__ contains the field
164
+ if self.state is None and "state" in self.__fields_set__:
165
+ _dict['state'] = None
166
+
167
+ return _dict
168
+
169
+ @classmethod
170
+ def from_dict(cls, obj: dict) -> GameInfo:
171
+ """Create an instance of GameInfo from a dict"""
172
+ if obj is None:
173
+ return None
174
+
175
+ if not isinstance(obj, dict):
176
+ return GameInfo.parse_obj(obj)
177
+
178
+ _obj = GameInfo.parse_obj({
179
+ "id": obj.get("id"),
180
+ "source_id": obj.get("sourceId"),
181
+ "season_label": obj.get("seasonLabel"),
182
+ "season": obj.get("season"),
183
+ "season_type": obj.get("seasonType"),
184
+ "start_date": obj.get("startDate"),
185
+ "start_time_tbd": obj.get("startTimeTbd"),
186
+ "neutral_site": obj.get("neutralSite"),
187
+ "conference_game": obj.get("conferenceGame"),
188
+ "game_type": obj.get("gameType"),
189
+ "status": obj.get("status"),
190
+ "attendance": obj.get("attendance"),
191
+ "home_team_id": obj.get("homeTeamId"),
192
+ "home_team": obj.get("homeTeam"),
193
+ "home_conference_id": obj.get("homeConferenceId"),
194
+ "home_conference": obj.get("homeConference"),
195
+ "home_points": obj.get("homePoints"),
196
+ "home_period_points": obj.get("homePeriodPoints"),
197
+ "home_winner": obj.get("homeWinner"),
198
+ "away_team_id": obj.get("awayTeamId"),
199
+ "away_team": obj.get("awayTeam"),
200
+ "away_conference_id": obj.get("awayConferenceId"),
201
+ "away_conference": obj.get("awayConference"),
202
+ "away_points": obj.get("awayPoints"),
203
+ "away_period_points": obj.get("awayPeriodPoints"),
204
+ "away_winner": obj.get("awayWinner"),
205
+ "venue_id": obj.get("venueId"),
206
+ "venue": obj.get("venue"),
207
+ "city": obj.get("city"),
208
+ "state": obj.get("state")
209
+ })
210
+ return _obj
211
+
212
+
@@ -0,0 +1,133 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ College Basketball Data API
5
+
6
+ This API is in limited Beta for Patreon subscribers. It may have bugs and is subject to changes. API keys can be acquired from the CollegeFootballData.com website.
7
+
8
+ The version of the OpenAPI document: 1.1.0
9
+ Contact: admin@collegefootballdata.com
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ from __future__ import annotations
17
+ import pprint
18
+ import re # noqa: F401
19
+ import json
20
+
21
+ from datetime import datetime
22
+ from typing import List, Optional
23
+ from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist
24
+ from cbbd.models.game_media_info_broadcasts_inner import GameMediaInfoBroadcastsInner
25
+ from cbbd.models.season_type import SeasonType
26
+
27
+ class GameMediaInfo(BaseModel):
28
+ """
29
+ GameMediaInfo
30
+ """
31
+ game_id: StrictInt = Field(default=..., alias="gameId")
32
+ season: StrictInt = Field(...)
33
+ season_label: StrictStr = Field(default=..., alias="seasonLabel")
34
+ season_type: SeasonType = Field(default=..., alias="seasonType")
35
+ start_date: datetime = Field(default=..., alias="startDate")
36
+ start_time_tbd: StrictBool = Field(default=..., alias="startTimeTbd")
37
+ home_team_id: StrictInt = Field(default=..., alias="homeTeamId")
38
+ home_team: StrictStr = Field(default=..., alias="homeTeam")
39
+ home_conference: Optional[StrictStr] = Field(default=..., alias="homeConference")
40
+ away_team_id: StrictInt = Field(default=..., alias="awayTeamId")
41
+ away_team: StrictStr = Field(default=..., alias="awayTeam")
42
+ away_conference: Optional[StrictStr] = Field(default=..., alias="awayConference")
43
+ neutral_site: StrictBool = Field(default=..., alias="neutralSite")
44
+ conference_game: StrictBool = Field(default=..., alias="conferenceGame")
45
+ game_type: Optional[StrictStr] = Field(default=..., alias="gameType")
46
+ notes: Optional[StrictStr] = Field(...)
47
+ broadcasts: conlist(GameMediaInfoBroadcastsInner) = Field(...)
48
+ __properties = ["gameId", "season", "seasonLabel", "seasonType", "startDate", "startTimeTbd", "homeTeamId", "homeTeam", "homeConference", "awayTeamId", "awayTeam", "awayConference", "neutralSite", "conferenceGame", "gameType", "notes", "broadcasts"]
49
+
50
+ class Config:
51
+ """Pydantic configuration"""
52
+ allow_population_by_field_name = True
53
+ validate_assignment = True
54
+
55
+ def to_str(self) -> str:
56
+ """Returns the string representation of the model using alias"""
57
+ return pprint.pformat(self.dict(by_alias=True))
58
+
59
+ def to_json(self) -> str:
60
+ """Returns the JSON representation of the model using alias"""
61
+ return json.dumps(self.to_dict())
62
+
63
+ @classmethod
64
+ def from_json(cls, json_str: str) -> GameMediaInfo:
65
+ """Create an instance of GameMediaInfo from a JSON string"""
66
+ return cls.from_dict(json.loads(json_str))
67
+
68
+ def to_dict(self):
69
+ """Returns the dictionary representation of the model using alias"""
70
+ _dict = self.dict(by_alias=True,
71
+ exclude={
72
+ },
73
+ exclude_none=True)
74
+ # override the default output from pydantic by calling `to_dict()` of each item in broadcasts (list)
75
+ _items = []
76
+ if self.broadcasts:
77
+ for _item in self.broadcasts:
78
+ if _item:
79
+ _items.append(_item.to_dict())
80
+ _dict['broadcasts'] = _items
81
+ # set to None if home_conference (nullable) is None
82
+ # and __fields_set__ contains the field
83
+ if self.home_conference is None and "home_conference" in self.__fields_set__:
84
+ _dict['homeConference'] = None
85
+
86
+ # set to None if away_conference (nullable) is None
87
+ # and __fields_set__ contains the field
88
+ if self.away_conference is None and "away_conference" in self.__fields_set__:
89
+ _dict['awayConference'] = None
90
+
91
+ # set to None if game_type (nullable) is None
92
+ # and __fields_set__ contains the field
93
+ if self.game_type is None and "game_type" in self.__fields_set__:
94
+ _dict['gameType'] = None
95
+
96
+ # set to None if notes (nullable) is None
97
+ # and __fields_set__ contains the field
98
+ if self.notes is None and "notes" in self.__fields_set__:
99
+ _dict['notes'] = None
100
+
101
+ return _dict
102
+
103
+ @classmethod
104
+ def from_dict(cls, obj: dict) -> GameMediaInfo:
105
+ """Create an instance of GameMediaInfo from a dict"""
106
+ if obj is None:
107
+ return None
108
+
109
+ if not isinstance(obj, dict):
110
+ return GameMediaInfo.parse_obj(obj)
111
+
112
+ _obj = GameMediaInfo.parse_obj({
113
+ "game_id": obj.get("gameId"),
114
+ "season": obj.get("season"),
115
+ "season_label": obj.get("seasonLabel"),
116
+ "season_type": obj.get("seasonType"),
117
+ "start_date": obj.get("startDate"),
118
+ "start_time_tbd": obj.get("startTimeTbd"),
119
+ "home_team_id": obj.get("homeTeamId"),
120
+ "home_team": obj.get("homeTeam"),
121
+ "home_conference": obj.get("homeConference"),
122
+ "away_team_id": obj.get("awayTeamId"),
123
+ "away_team": obj.get("awayTeam"),
124
+ "away_conference": obj.get("awayConference"),
125
+ "neutral_site": obj.get("neutralSite"),
126
+ "conference_game": obj.get("conferenceGame"),
127
+ "game_type": obj.get("gameType"),
128
+ "notes": obj.get("notes"),
129
+ "broadcasts": [GameMediaInfoBroadcastsInner.from_dict(_item) for _item in obj.get("broadcasts")] if obj.get("broadcasts") is not None else None
130
+ })
131
+ return _obj
132
+
133
+