mlb 0.9.0 → 0.11.0

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 (165) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -1
  3. data/LICENSE.txt +1 -1
  4. data/README.md +329 -32
  5. data/lib/mlb/affiliates.rb +28 -0
  6. data/lib/mlb/alumni.rb +30 -0
  7. data/lib/mlb/attendance.rb +28 -0
  8. data/lib/mlb/attendance_record.rb +157 -0
  9. data/lib/mlb/award.rb +126 -0
  10. data/lib/mlb/awards.rb +32 -0
  11. data/lib/mlb/baseball_stat.rb +65 -0
  12. data/lib/mlb/baseball_stats.rb +12 -0
  13. data/lib/mlb/boxscore.rb +81 -0
  14. data/lib/mlb/boxscore_team_stats.rb +210 -0
  15. data/lib/mlb/client.rb +71 -1
  16. data/lib/mlb/coaches.rb +28 -0
  17. data/lib/mlb/code_description_type.rb +45 -0
  18. data/lib/mlb/collection.rb +48 -0
  19. data/lib/mlb/comparable_by_attribute.rb +56 -0
  20. data/lib/mlb/conference.rb +39 -0
  21. data/lib/mlb/conferences.rb +33 -0
  22. data/lib/mlb/connection.rb +130 -7
  23. data/lib/mlb/context_metrics.rb +90 -0
  24. data/lib/mlb/division.rb +26 -6
  25. data/lib/mlb/divisions.rb +24 -18
  26. data/lib/mlb/draft.rb +83 -0
  27. data/lib/mlb/draft_pick.rb +155 -0
  28. data/lib/mlb/error_handler.rb +21 -1
  29. data/lib/mlb/errors/bad_gateway.rb +6 -1
  30. data/lib/mlb/errors/bad_request.rb +1 -0
  31. data/lib/mlb/errors/client_error.rb +1 -0
  32. data/lib/mlb/errors/connection_exception.rb +1 -0
  33. data/lib/mlb/errors/error.rb +1 -0
  34. data/lib/mlb/errors/forbidden.rb +1 -0
  35. data/lib/mlb/errors/gateway_timeout.rb +6 -1
  36. data/lib/mlb/errors/gone.rb +1 -0
  37. data/lib/mlb/errors/http_error.rb +22 -2
  38. data/lib/mlb/errors/internal_server_error.rb +1 -0
  39. data/lib/mlb/errors/network_error.rb +6 -1
  40. data/lib/mlb/errors/not_acceptable.rb +1 -0
  41. data/lib/mlb/errors/not_found.rb +1 -0
  42. data/lib/mlb/errors/payload_too_large.rb +1 -0
  43. data/lib/mlb/errors/retryable.rb +15 -0
  44. data/lib/mlb/errors/server_error.rb +1 -0
  45. data/lib/mlb/errors/service_unavailable.rb +6 -1
  46. data/lib/mlb/errors/too_many_redirects.rb +1 -0
  47. data/lib/mlb/errors/too_many_requests.rb +6 -1
  48. data/lib/mlb/errors/unauthorized.rb +1 -0
  49. data/lib/mlb/errors/unprocessable_entity.rb +1 -0
  50. data/lib/mlb/event_type.rb +61 -0
  51. data/lib/mlb/event_types.rb +12 -0
  52. data/lib/mlb/free_agent.rb +78 -0
  53. data/lib/mlb/free_agents.rb +34 -0
  54. data/lib/mlb/game_changes.rb +87 -0
  55. data/lib/mlb/game_content.rb +251 -0
  56. data/lib/mlb/game_data.rb +155 -0
  57. data/lib/mlb/game_pace.rb +173 -0
  58. data/lib/mlb/game_status.rb +94 -0
  59. data/lib/mlb/game_statuses.rb +12 -0
  60. data/lib/mlb/game_type.rb +98 -0
  61. data/lib/mlb/game_types.rb +12 -0
  62. data/lib/mlb/handedness.rb +30 -9
  63. data/lib/mlb/high_low.rb +121 -0
  64. data/lib/mlb/hit_trajectories.rb +12 -0
  65. data/lib/mlb/hit_trajectory.rb +6 -0
  66. data/lib/mlb/home_run_derby.rb +285 -0
  67. data/lib/mlb/id_description_type.rb +44 -0
  68. data/lib/mlb/inning_score.rb +87 -0
  69. data/lib/mlb/job.rb +58 -0
  70. data/lib/mlb/job_type.rb +39 -0
  71. data/lib/mlb/job_types.rb +12 -0
  72. data/lib/mlb/jobs.rb +87 -0
  73. data/lib/mlb/language.rb +48 -0
  74. data/lib/mlb/languages.rb +12 -0
  75. data/lib/mlb/leader.rb +79 -0
  76. data/lib/mlb/leaders.rb +68 -0
  77. data/lib/mlb/league.rb +97 -14
  78. data/lib/mlb/league_leader_type.rb +21 -0
  79. data/lib/mlb/league_leader_types.rb +12 -0
  80. data/lib/mlb/leagues.rb +24 -18
  81. data/lib/mlb/linescore.rb +342 -0
  82. data/lib/mlb/linescore_teams.rb +89 -0
  83. data/lib/mlb/live_feed.rb +130 -0
  84. data/lib/mlb/logical_event.rb +17 -0
  85. data/lib/mlb/logical_events.rb +12 -0
  86. data/lib/mlb/metric.rb +48 -0
  87. data/lib/mlb/metrics.rb +12 -0
  88. data/lib/mlb/people_changes.rb +34 -0
  89. data/lib/mlb/personnel.rb +28 -0
  90. data/lib/mlb/pitch_code.rb +90 -0
  91. data/lib/mlb/pitch_codes.rb +12 -0
  92. data/lib/mlb/pitch_type.rb +6 -0
  93. data/lib/mlb/pitch_types.rb +12 -0
  94. data/lib/mlb/platform.rb +30 -0
  95. data/lib/mlb/platforms.rb +12 -0
  96. data/lib/mlb/play.rb +300 -0
  97. data/lib/mlb/play_by_play.rb +52 -0
  98. data/lib/mlb/player.rb +186 -0
  99. data/lib/mlb/player_game_stats.rb +350 -0
  100. data/lib/mlb/player_stat.rb +70 -0
  101. data/lib/mlb/players.rb +42 -11
  102. data/lib/mlb/position.rb +68 -0
  103. data/lib/mlb/positions.rb +12 -0
  104. data/lib/mlb/postseason_schedule.rb +41 -0
  105. data/lib/mlb/postseason_series.rb +54 -0
  106. data/lib/mlb/redirect_handler.rb +80 -21
  107. data/lib/mlb/request_builder.rb +33 -2
  108. data/lib/mlb/review_reason.rb +6 -0
  109. data/lib/mlb/review_reasons.rb +12 -0
  110. data/lib/mlb/roster.rb +16 -12
  111. data/lib/mlb/roster_entry.rb +38 -0
  112. data/lib/mlb/roster_type.rb +39 -0
  113. data/lib/mlb/roster_types.rb +12 -0
  114. data/lib/mlb/schedule.rb +33 -0
  115. data/lib/mlb/schedule_date.rb +37 -0
  116. data/lib/mlb/schedule_event_type.rb +25 -0
  117. data/lib/mlb/schedule_event_types.rb +12 -0
  118. data/lib/mlb/scheduled_game.rb +321 -0
  119. data/lib/mlb/season.rb +74 -0
  120. data/lib/mlb/season_date_info.rb +4 -0
  121. data/lib/mlb/seasons.rb +36 -0
  122. data/lib/mlb/single_team_stats.rb +33 -0
  123. data/lib/mlb/situation_code.rb +116 -0
  124. data/lib/mlb/situation_codes.rb +12 -0
  125. data/lib/mlb/skies.rb +12 -0
  126. data/lib/mlb/sky.rb +6 -0
  127. data/lib/mlb/sport.rb +18 -5
  128. data/lib/mlb/sport_players.rb +30 -0
  129. data/lib/mlb/sports.rb +17 -7
  130. data/lib/mlb/standings.rb +47 -0
  131. data/lib/mlb/standings_record.rb +108 -0
  132. data/lib/mlb/standings_type.rb +25 -0
  133. data/lib/mlb/standings_types.rb +12 -0
  134. data/lib/mlb/stat_group.rb +21 -0
  135. data/lib/mlb/stat_groups.rb +12 -0
  136. data/lib/mlb/stat_type.rb +21 -0
  137. data/lib/mlb/stat_types.rb +12 -0
  138. data/lib/mlb/stat_values.rb +158 -0
  139. data/lib/mlb/stats.rb +41 -0
  140. data/lib/mlb/status.rb +17 -0
  141. data/lib/mlb/streaks.rb +184 -0
  142. data/lib/mlb/team.rb +66 -7
  143. data/lib/mlb/team_history.rb +28 -0
  144. data/lib/mlb/team_leader.rb +59 -0
  145. data/lib/mlb/team_leaders.rb +45 -0
  146. data/lib/mlb/team_record.rb +285 -0
  147. data/lib/mlb/team_stat.rb +50 -0
  148. data/lib/mlb/team_stats.rb +52 -0
  149. data/lib/mlb/teams.rb +28 -18
  150. data/lib/mlb/tied_games.rb +32 -0
  151. data/lib/mlb/transaction.rb +128 -0
  152. data/lib/mlb/transactions.rb +11 -6
  153. data/lib/mlb/uniforms.rb +97 -0
  154. data/lib/mlb/utils.rb +45 -0
  155. data/lib/mlb/venue.rb +10 -0
  156. data/lib/mlb/venues.rb +28 -18
  157. data/lib/mlb/version.rb +2 -1
  158. data/lib/mlb/win_probability.rb +64 -0
  159. data/lib/mlb/wind_direction.rb +6 -0
  160. data/lib/mlb/wind_directions.rb +12 -0
  161. data/lib/mlb.rb +64 -0
  162. data/sig/equalizer.rbs +3 -0
  163. data/sig/mlb.rbs +1972 -103
  164. data/sig/shale.rbs +29 -0
  165. metadata +137 -14
data/sig/mlb.rbs CHANGED
@@ -1,186 +1,2055 @@
1
1
  module MLB
2
- CLIENT: Client
3
2
  VERSION: Gem::Version
4
3
 
5
- class Error < StandardError
6
- end
4
+ CLIENT: Client
7
5
 
8
- class ClientError < HTTPError
6
+ # Module to mark errors that are safe to retry
7
+ module Retryable
9
8
  end
10
9
 
11
- class BadGateway < ClientError
12
- end
10
+ # Base class for simple code/description value objects
11
+ class CodeDescriptionType < Shale::Mapper
12
+ include Equalizer
13
13
 
14
- class BadRequest < ClientError
15
- end
14
+ attr_accessor code: String?
15
+ attr_accessor description: String?
16
16
 
17
- class ConnectionException < ClientError
17
+ def to_s: () -> String
18
18
  end
19
19
 
20
- class HTTPError < Error
21
- attr_reader response : Net::HTTPResponse
22
- attr_reader code : String
20
+ # Base class for simple id/description value objects
21
+ class IdDescriptionType < Shale::Mapper
22
+ include Equalizer
23
23
 
24
- def initialize: (response: Net::HTTPResponse) -> void
25
- end
24
+ attr_accessor id: String?
25
+ attr_accessor description: String?
26
26
 
27
- class Forbidden < ClientError
27
+ def to_s: () -> String
28
28
  end
29
29
 
30
- class GatewayTimeout < ClientError
31
- end
30
+ # Provides comparison behavior by attribute
31
+ module ComparableByAttribute
32
+ def <=>: (untyped) -> Integer?
32
33
 
33
- class Gone < ClientError
34
- end
34
+ private
35
35
 
36
- class InternalServerError < ServerError
36
+ def comparable_attribute: () -> Symbol
37
+ def compare_values: (untyped, untyped) -> Integer
37
38
  end
38
39
 
39
- class NetworkError < Error
40
- end
40
+ # Utility module
41
+ module Utils
42
+ DEFAULT_SPORT_ID: Integer
41
43
 
42
- class NotAcceptable < ClientError
44
+ def self.current_season: () -> Integer
45
+ def self.extract_id: (untyped) -> untyped
46
+ def self.build_query: (Hash[Symbol, untyped]) -> String
43
47
  end
44
48
 
45
- class NotFound < ClientError
46
- end
49
+ # Base class for simple collections
50
+ class Collection < Shale::Mapper
47
51
 
48
- class PayloadTooLarge < ClientError
49
- end
52
+ self.@endpoint: String
53
+ self.@collection_name: Symbol
50
54
 
51
- class ServerError < HTTPError
55
+ def self.endpoint: () -> String
56
+ def self.collection_name: () -> Symbol
57
+ def self.collection: (endpoint: String, item_type: Class, collection_name: Symbol) -> void
58
+ def self.all: () -> Array[untyped]
52
59
  end
53
60
 
54
- class ServiceUnavailable < ServerError
61
+ # Consolidated stat values class
62
+ class StatValues < Shale::Mapper
63
+ attr_accessor games_played: Integer?
64
+ attr_accessor runs: Integer?
65
+ attr_accessor doubles: Integer?
66
+ attr_accessor triples: Integer?
67
+ attr_accessor home_runs: Integer?
68
+ attr_accessor strike_outs: Integer?
69
+ attr_accessor base_on_balls: Integer?
70
+ attr_accessor hits: Integer?
71
+ attr_accessor avg: String?
72
+ attr_accessor at_bats: Integer?
73
+ attr_accessor obp: String?
74
+ attr_accessor slg: String?
75
+ attr_accessor ops: String?
76
+ attr_accessor stolen_bases: Integer?
77
+ attr_accessor rbi: Integer?
55
78
  end
56
79
 
57
- class TooManyRedirects < Error
58
- end
80
+ # Deprecated aliases for backward compatibility
81
+ PlayerStatValues: singleton(StatValues)
82
+ TeamStatValues: singleton(StatValues)
59
83
 
60
- class TooManyRequests < ClientError
61
- end
84
+ class Client
85
+ extend Forwardable
62
86
 
63
- class Unauthorized < ClientError
64
- end
87
+ DEFAULT_BASE_URL: String
65
88
 
66
- class UnprocessableEntity < ClientError
89
+ attr_accessor base_url: String
90
+
91
+ def open_timeout: () -> Integer
92
+ def read_timeout: () -> Integer
93
+ def write_timeout: () -> Integer
94
+ def proxy_url: () -> String?
95
+ def debug_output: () -> IO
96
+
97
+ def open_timeout=: (Integer) -> Integer
98
+ def read_timeout=: (Integer) -> Integer
99
+ def write_timeout=: (Integer) -> Integer
100
+ def proxy_url=: (String?) -> String?
101
+ def debug_output=: (IO) -> IO
102
+
103
+ def max_redirects: () -> Integer
104
+ def max_redirects=: (Integer) -> Integer
105
+
106
+ def initialize: (
107
+ ?base_url: String,
108
+ ?open_timeout: Integer,
109
+ ?read_timeout: Integer,
110
+ ?write_timeout: Integer,
111
+ ?debug_output: IO,
112
+ ?proxy_url: String?,
113
+ ?max_redirects: Integer
114
+ ) -> void
115
+
116
+ def get: (String, ?headers: Hash[String, String]) -> String?
117
+ def post: (String, ?String?, ?headers: Hash[String, String]) -> String?
118
+ def put: (String, ?String?, ?headers: Hash[String, String]) -> String?
119
+ def delete: (String, ?headers: Hash[String, String]) -> String?
120
+
121
+ private
122
+
123
+ @connection: Connection
124
+ @request_builder: RequestBuilder
125
+ @redirect_handler: RedirectHandler
126
+ @error_handler: ErrorHandler
127
+
128
+ def execute_request: (Symbol, String, headers: Hash[String, String], ?body: String?) -> String?
67
129
  end
68
130
 
69
131
  class Connection
132
+ extend Forwardable
133
+
70
134
  DEFAULT_HOST: String
71
135
  DEFAULT_PORT: Integer
72
136
  DEFAULT_OPEN_TIMEOUT: Integer
73
137
  DEFAULT_READ_TIMEOUT: Integer
74
138
  DEFAULT_WRITE_TIMEOUT: Integer
75
139
  DEFAULT_DEBUG_OUTPUT: IO
76
- NETWORK_ERRORS: Array[(singleton(Errno::ECONNREFUSED) | singleton(Errno::ECONNRESET) | singleton(Net::OpenTimeout) | singleton(Net::ReadTimeout) | singleton(OpenSSL::SSL::SSLError))]
77
-
78
- @proxy_url: URI::Generic | String
140
+ HTTPS_SCHEME: String
141
+ NETWORK_ERRORS: Array[singleton(StandardError)]
79
142
 
80
- extend Forwardable
143
+ attr_accessor open_timeout: Integer
144
+ attr_accessor read_timeout: Integer
145
+ attr_accessor write_timeout: Integer
146
+ attr_accessor debug_output: IO
147
+ attr_reader proxy_url: String?
148
+ attr_reader proxy_uri: URI::HTTP?
81
149
 
82
- attr_accessor open_timeout : Float | Integer
83
- attr_accessor read_timeout : Float | Integer
84
- attr_accessor write_timeout : Float | Integer
85
- attr_accessor debug_output : IO
150
+ def proxy_host: () -> String?
151
+ def proxy_port: () -> Integer?
152
+ def proxy_user: () -> String?
153
+ def proxy_pass: () -> String?
86
154
 
87
- attr_reader proxy_uri: URI::Generic?
88
- attr_reader proxy_host : String?
89
- attr_reader proxy_port : Integer?
90
- attr_reader proxy_user : String?
91
- attr_reader proxy_pass : String?
155
+ def initialize: (
156
+ ?open_timeout: Integer,
157
+ ?read_timeout: Integer,
158
+ ?write_timeout: Integer,
159
+ ?debug_output: IO,
160
+ ?proxy_url: String?
161
+ ) -> void
92
162
 
93
- def initialize: (?open_timeout: Float | Integer, ?read_timeout: Float | Integer, ?write_timeout: Float | Integer, ?proxy_url: URI::Generic? | String?, ?debug_output: IO) -> void
94
- def proxy_url=: (URI::Generic | String proxy_url) -> void
95
163
  def perform: (request: Net::HTTPRequest) -> Net::HTTPResponse
96
164
 
165
+ def proxy_url=: (String) -> void
166
+
97
167
  private
98
- def build_http_client: (?String host, ?Integer port) -> Net::HTTP
99
- def configure_http_client: (Net::HTTP http_client) -> Net::HTTP
168
+
169
+ @proxy_url: String?
170
+ @proxy_uri: URI::HTTP?
171
+
172
+ def build_http_client: (?String, ?Integer) -> Net::HTTP
173
+ def configure_http_client: (Net::HTTP) -> Net::HTTP
100
174
  end
101
175
 
102
176
  class RequestBuilder
103
- HTTP_METHODS: Hash[Symbol, (singleton(Net::HTTP::Get) | singleton(Net::HTTP::Post) | singleton(Net::HTTP::Put) | singleton(Net::HTTP::Delete))]
104
177
  DEFAULT_HEADERS: Hash[String, String]
178
+ HTTP_METHODS: Hash[Symbol, singleton(Net::HTTPRequest)]
105
179
 
106
- def initialize: (?content_type: String, ?user_agent: String) -> void
107
- def build: (http_method: Symbol, uri: URI::Generic, ?body: String?, ?headers: Hash[String, String]) -> (Net::HTTPRequest)
180
+ def build: (http_method: Symbol, uri: URI::Generic, ?body: String?, ?headers: Hash[String, String]) -> Net::HTTPRequest
108
181
 
109
182
  private
110
- def create_request: (http_method: Symbol, uri: URI::Generic, body: String?) -> (Net::HTTPRequest)
183
+
184
+ def create_request: (http_method: Symbol, uri: URI::Generic, body: String?) -> Net::HTTPRequest
111
185
  def add_headers: (request: Net::HTTPRequest, headers: Hash[String, String]) -> void
112
- def escape_query_params: (URI::Generic uri) -> URI::Generic
186
+ def escape_query_params: (URI::Generic) -> URI::Generic
113
187
  end
114
188
 
115
189
  class RedirectHandler
116
190
  DEFAULT_MAX_REDIRECTS: Integer
191
+ PRESERVE_METHOD_CODES: Array[Integer]
192
+ LOCATION_HEADER: String
117
193
 
194
+ attr_accessor max_redirects: Integer
118
195
  attr_reader connection: Connection
119
196
  attr_reader request_builder: RequestBuilder
120
- attr_reader max_redirects: Integer
121
- def initialize: (?connection: Connection, ?request_builder: RequestBuilder, ?max_redirects: Integer) -> void
197
+
198
+ def initialize: (
199
+ ?connection: Connection,
200
+ ?request_builder: RequestBuilder,
201
+ ?max_redirects: Integer
202
+ ) -> void
203
+
122
204
  def handle: (response: Net::HTTPResponse, request: Net::HTTPRequest, base_url: String, ?redirect_count: Integer) -> Net::HTTPResponse
123
205
 
124
206
  private
125
- def build_new_uri: (Net::HTTPResponse response, String base_url) -> URI::Generic
126
- def build_request: (Net::HTTPRequest request, URI::Generic new_uri, Integer response_code) -> Net::HTTPRequest
127
- def send_new_request: (URI::Generic new_uri, Net::HTTPRequest new_request) -> Net::HTTPResponse
207
+
208
+ def build_redirect_uri: (Net::HTTPResponse, String) -> URI::Generic
209
+ def build_redirect_request: (Net::HTTPRequest, URI::Generic, Integer) -> Net::HTTPRequest
128
210
  end
129
211
 
130
212
  class ErrorHandler
131
- ERROR_MAP: Hash[Integer, singleton(BadGateway) | singleton(BadRequest) | singleton(ConnectionException) | singleton(Forbidden) | singleton(GatewayTimeout) | singleton(Gone) | singleton(InternalServerError) | singleton(NotAcceptable) | singleton(NotFound) | singleton(PayloadTooLarge) | singleton(ServiceUnavailable) | singleton(TooManyRequests) | singleton(Unauthorized) | singleton(UnprocessableEntity)]
132
- JSON_CONTENT_TYPE_REGEXP: Regexp
213
+ ERROR_MAP: Hash[Integer, singleton(HTTPError)]
133
214
 
134
- def parse: (response: Net::HTTPResponse) -> untyped
215
+ def handle: (response: Net::HTTPResponse) -> String?
135
216
 
136
217
  private
137
- def error: (Net::HTTPResponse response) -> HTTPError
138
- def error_class: (Net::HTTPResponse response) -> (singleton(BadGateway) | singleton(BadRequest) | singleton(ConnectionException) | singleton(Forbidden) | singleton(GatewayTimeout) | singleton(Gone) | singleton(InternalServerError) | singleton(NotAcceptable) | singleton(NotFound) | singleton(PayloadTooLarge) | singleton(ServiceUnavailable) | singleton(TooManyRequests) | singleton(Unauthorized) | singleton(UnprocessableEntity))
139
- def json?: (Net::HTTPResponse response) -> bool
218
+
219
+ def error: (Net::HTTPResponse) -> HTTPError
220
+ def error_class: (Net::HTTPResponse) -> singleton(HTTPError)
140
221
  end
141
222
 
142
- class Client
143
- DEFAULT_BASE_URL: String
144
- extend Forwardable
145
- @connection: Connection
146
- @request_builder: RequestBuilder
147
- @redirect_handler: RedirectHandler
148
- @error_handler: ErrorHandler
223
+ # Error classes
224
+ class Error < StandardError
225
+ end
149
226
 
150
- attr_accessor base_url: String
151
- def initialize: (?base_url: String, ?open_timeout: Integer, ?read_timeout: Integer, ?write_timeout: Integer, ?debug_output: untyped, ?proxy_url: nil, ?max_redirects: Integer) -> void
152
- def get: (String endpoint, ?headers: Hash[String, String]) -> untyped
153
- def post: (String endpoint, ?String? body, ?headers: Hash[String, String]) -> untyped
154
- def put: (String endpoint, ?String? body, ?headers: Hash[String, String]) -> untyped
155
- def delete: (String endpoint, ?headers: Hash[String, String]) -> untyped
227
+ class HTTPError < Error
228
+ attr_reader response: Net::HTTPResponse
229
+ attr_reader code: String
156
230
 
157
- private
158
- def execute_request: (:delete | :get | :post | :put http_method, String endpoint, ?body: String?, ?headers: Hash[String, String]) -> nil
231
+ def initialize: (response: Net::HTTPResponse) -> void
232
+ end
233
+
234
+ class ClientError < HTTPError
235
+ end
236
+
237
+ class ServerError < HTTPError
238
+ end
239
+
240
+ class NetworkError < Error
241
+ include Retryable
242
+ end
243
+
244
+ class TooManyRedirects < Error
245
+ end
246
+
247
+ class BadRequest < ClientError
248
+ end
249
+
250
+ class Unauthorized < ClientError
251
+ end
252
+
253
+ class Forbidden < ClientError
254
+ end
255
+
256
+ class NotFound < ClientError
257
+ end
258
+
259
+ class NotAcceptable < ClientError
260
+ end
261
+
262
+ class ConnectionException < ClientError
263
+ end
264
+
265
+ class Gone < ClientError
266
+ end
267
+
268
+ class PayloadTooLarge < ClientError
269
+ end
270
+
271
+ class UnprocessableEntity < ClientError
272
+ end
273
+
274
+ class TooManyRequests < ClientError
275
+ include Retryable
276
+ end
277
+
278
+ class InternalServerError < ServerError
279
+ end
280
+
281
+ class BadGateway < ServerError
282
+ include Retryable
283
+ end
284
+
285
+ class ServiceUnavailable < ServerError
286
+ include Retryable
287
+ end
288
+
289
+ class GatewayTimeout < ServerError
290
+ include Retryable
159
291
  end
160
292
 
161
- attr_accessor effective_date: String
162
- attr_accessor player_id: String
163
- attr_accessor team_id: String
293
+ # Model classes
294
+ class Handedness < CodeDescriptionType
295
+ LEFT: String
296
+ RIGHT: String
297
+ SWITCH: String
164
298
 
165
- class Team < Struct[untyped]
166
- attr_accessor team_id: String
167
- def self.new: -> void
168
- def self.all: (?season: Integer, ?sort_order: String, ?all_star: false) -> Array[Team]
169
- def roster: -> Array[Player]
299
+ def left?: () -> bool
300
+ def right?: () -> bool
301
+ def switch?: () -> bool
170
302
  end
171
303
 
172
- class Transaction < Struct[untyped]
173
- attr_accessor player_id: String
174
- attr_accessor team_id: String
175
- def self.new: -> void
176
- def self.all: (?season: Integer, ?sort_order: String, ?all_star: false) -> Array[Team]
177
- def team: -> Team
178
- def player: -> Player
304
+ class Position < Shale::Mapper
305
+ include Equalizer
306
+
307
+ TYPE_PITCHER: String
308
+ TYPE_CATCHER: String
309
+ TYPE_INFIELDER: String
310
+ TYPE_OUTFIELDER: String
311
+
312
+ attr_accessor code: String?
313
+ attr_accessor name: String?
314
+ attr_accessor type: String?
315
+ attr_accessor abbreviation: String?
316
+
317
+ def pitcher?: () -> bool
318
+ def catcher?: () -> bool
319
+ def infielder?: () -> bool
320
+ def outfielder?: () -> bool
321
+ end
322
+
323
+ class Status < Shale::Mapper
324
+ include Equalizer
325
+
326
+ attr_accessor code: String?
327
+ attr_accessor description: String?
328
+ end
329
+
330
+ class Sport < Shale::Mapper
331
+ include Comparable
332
+ include ComparableByAttribute
333
+ include Equalizer
334
+
335
+ attr_accessor id: Integer?
336
+ attr_accessor code: String?
337
+ attr_accessor link: String?
338
+ attr_accessor name: String?
339
+ attr_accessor abbreviation: String?
340
+ attr_accessor sort_order: Integer?
341
+ attr_accessor active: bool?
342
+
343
+ def active?: () -> bool?
344
+ def comparable_attribute: () -> Symbol
345
+ end
346
+
347
+ class Venue < Shale::Mapper
348
+ include Equalizer
349
+
350
+ attr_accessor id: Integer?
351
+ attr_accessor name: String?
352
+ attr_accessor link: String?
353
+ attr_accessor active: bool?
354
+ attr_accessor season: Integer?
355
+
356
+ def active?: () -> bool?
357
+ end
358
+
359
+ class SeasonDateInfo < Shale::Mapper
360
+ include Equalizer
361
+
362
+ attr_accessor season_id: String?
363
+ attr_accessor pre_season_start_date: Date?
364
+ attr_accessor pre_season_end_date: Date?
365
+ attr_accessor season_start_date: Date?
366
+ attr_accessor spring_start_date: Date?
367
+ attr_accessor spring_end_date: Date?
368
+ attr_accessor regular_season_start_date: Date?
369
+ attr_accessor last_date_1st_half: Date?
370
+ attr_accessor all_star_date: Date?
371
+ attr_accessor first_date_2nd_half: Date?
372
+ attr_accessor regular_season_end_date: Date?
373
+ attr_accessor post_season_start_date: Date?
374
+ attr_accessor post_season_end_date: Date?
375
+ attr_accessor season_end_date: Date?
376
+ attr_accessor offseason_start_date: Date?
377
+ attr_accessor off_season_end_date: Date?
378
+ attr_accessor season_level_gameday_type: String?
379
+ attr_accessor game_level_gameday_type: String?
380
+ attr_accessor qualifier_plate_appearances: Float?
381
+ attr_accessor qualifier_outs_pitched: Float?
382
+ end
383
+
384
+ class League < Shale::Mapper
385
+ include Comparable
386
+ include ComparableByAttribute
387
+ include Equalizer
388
+
389
+ attr_accessor id: Integer?
390
+ attr_accessor name: String?
391
+ attr_accessor link: String?
392
+ attr_accessor abbreviation: String?
393
+ attr_accessor name_short: String?
394
+ attr_accessor season_state: String?
395
+ attr_accessor has_wildcard: bool?
396
+ attr_accessor has_split_season: bool?
397
+ attr_accessor num_games: Integer?
398
+ attr_accessor has_playoff_points: bool?
399
+ attr_accessor num_teams: Integer?
400
+ attr_accessor num_wildcard_teams: Integer?
401
+ attr_accessor season_date_info: SeasonDateInfo?
402
+ attr_accessor season: Integer?
403
+ attr_accessor org_code: String?
404
+ attr_accessor conferences_in_use: bool?
405
+ attr_accessor divisions_in_use: bool?
406
+ attr_accessor sport: Sport?
407
+ attr_accessor sort_order: Integer?
408
+ attr_accessor active: bool?
409
+
410
+ SEASON_PRESEASON: String
411
+ SEASON_INSEASON: String
412
+ SEASON_POSTSEASON: String
413
+ SEASON_OFFSEASON: String
414
+
415
+ def active?: () -> bool?
416
+ def wildcard?: () -> bool?
417
+ def split_season?: () -> bool?
418
+ def playoff_points?: () -> bool?
419
+ def conferences?: () -> bool?
420
+ def divisions?: () -> bool?
421
+ def preseason?: () -> bool
422
+ def in_season?: () -> bool
423
+ def postseason?: () -> bool
424
+ def offseason?: () -> bool
425
+ def comparable_attribute: () -> Symbol
426
+ end
427
+
428
+ class Division < Shale::Mapper
429
+ include Comparable
430
+ include ComparableByAttribute
431
+ include Equalizer
432
+
433
+ attr_accessor id: Integer?
434
+ attr_accessor name: String?
435
+ attr_accessor season: String?
436
+ attr_accessor name_short: String?
437
+ attr_accessor link: String?
438
+ attr_accessor abbreviation: String?
439
+ attr_accessor league: League?
440
+ attr_accessor sport: Sport?
441
+ attr_accessor has_wildcard: bool?
442
+ attr_accessor sort_order: Integer?
443
+ attr_accessor active: bool?
444
+
445
+ def active?: () -> bool?
446
+ def wildcard?: () -> bool?
447
+ def comparable_attribute: () -> Symbol
448
+ end
449
+
450
+ class Season < Shale::Mapper
451
+ include Comparable
452
+ include ComparableByAttribute
453
+ include Equalizer
454
+
455
+ attr_accessor id: Integer?
456
+ attr_accessor has_wildcard: bool?
457
+ attr_accessor preseason_start_date: Date?
458
+ attr_accessor preseason_end_date: Date?
459
+ attr_accessor season_start_date: Date?
460
+ attr_accessor spring_start_date: Date?
461
+ attr_accessor spring_end_date: Date?
462
+ attr_accessor regular_season_start_date: Date?
463
+ attr_accessor last_date_first_half: Date?
464
+ attr_accessor all_star_date: Date?
465
+ attr_accessor first_date_second_half: Date?
466
+ attr_accessor regular_season_end_date: Date?
467
+ attr_accessor postseason_start_date: Date?
468
+ attr_accessor postseason_end_date: Date?
469
+ attr_accessor season_end_date: Date?
470
+ attr_accessor offseason_start_date: Date?
471
+ attr_accessor offseason_end_date: Date?
472
+ attr_accessor season_level_gameday_type: String?
473
+ attr_accessor game_level_gameday_type: String?
474
+ attr_accessor qualifier_plate_appearances: Float?
475
+ attr_accessor qualifier_outs_pitched: Float?
476
+
477
+ def wildcard?: () -> bool?
478
+ def comparable_attribute: () -> Symbol
479
+ end
480
+
481
+ class Conference < Shale::Mapper
482
+ include Equalizer
483
+
484
+ attr_accessor id: Integer?
485
+ attr_accessor name: String?
486
+ attr_accessor link: String?
487
+ attr_accessor abbreviation: String?
488
+ attr_accessor has_wildcard: bool?
489
+ attr_accessor league: League?
490
+ attr_accessor sport: Sport?
491
+ attr_accessor name_short: String?
492
+
493
+ def wildcard?: () -> bool?
494
+ end
495
+
496
+ class Team < Shale::Mapper
497
+ include Equalizer
498
+
499
+ ALL_STAR_YES: String
500
+ ALL_STAR_NO: String
501
+
502
+ AZ: Integer
503
+ ATH: Integer
504
+ ATL: Integer
505
+ BAL: Integer
506
+ BOS: Integer
507
+ CHC: Integer
508
+ CWS: Integer
509
+ CIN: Integer
510
+ CLE: Integer
511
+ COL: Integer
512
+ DET: Integer
513
+ HOU: Integer
514
+ KC: Integer
515
+ LAA: Integer
516
+ LAD: Integer
517
+ MIA: Integer
518
+ MIL: Integer
519
+ MIN: Integer
520
+ NYM: Integer
521
+ NYY: Integer
522
+ PHI: Integer
523
+ PIT: Integer
524
+ SD: Integer
525
+ SF: Integer
526
+ SEA: Integer
527
+ STL: Integer
528
+ TB: Integer
529
+ TEX: Integer
530
+ TOR: Integer
531
+ WSH: Integer
532
+
533
+ attr_accessor id: Integer?
534
+ attr_accessor spring_league: League?
535
+ attr_accessor all_star_status: String?
536
+ attr_accessor name: String?
537
+ attr_accessor link: String?
538
+ attr_accessor season: Integer?
539
+ attr_accessor venue: Venue?
540
+ attr_accessor spring_venue: Venue?
541
+ attr_accessor team_code: String?
542
+ attr_accessor file_code: String?
543
+ attr_accessor abbreviation: String?
544
+ attr_accessor team_name: String?
545
+ attr_accessor location_name: String?
546
+ attr_accessor first_year_of_play: Integer?
547
+ attr_accessor league: League?
548
+ attr_accessor division: Division?
549
+ attr_accessor sport: Sport?
550
+ attr_accessor short_name: String?
551
+ attr_accessor franchise_name: String?
552
+ attr_accessor club_name: String?
553
+ attr_accessor active: bool?
554
+
555
+ def active?: () -> bool?
556
+ def all_star?: () -> bool
557
+
558
+ def roster: (?season: Integer?) -> Array[RosterEntry]
559
+ end
560
+
561
+ class Player < Shale::Mapper
562
+ include Equalizer
563
+
564
+ attr_accessor id: Integer?
565
+ attr_accessor full_name: String?
566
+ attr_accessor link: String?
567
+ attr_accessor first_name: String?
568
+ attr_accessor last_name: String?
569
+ attr_accessor primary_number: Integer?
570
+ attr_accessor birth_date: Date?
571
+ attr_accessor current_age: Integer?
572
+ attr_accessor birth_city: String?
573
+ attr_accessor birth_state_province: String?
574
+ attr_accessor birth_country: String?
575
+ attr_accessor height: String?
576
+ attr_accessor weight: Integer?
577
+ attr_accessor active: bool?
578
+ attr_accessor current_team: Team?
579
+ attr_accessor primary_position: Position?
580
+ attr_accessor use_name: String?
581
+ attr_accessor middle_name: String?
582
+ attr_accessor boxscore_name: String?
583
+ attr_accessor gender: String?
584
+ attr_accessor is_player: bool?
585
+ attr_accessor is_verified: bool?
586
+ attr_accessor draft_year: Integer?
587
+ attr_accessor mlb_debut_date: Date?
588
+ attr_accessor bat_side: Handedness?
589
+ attr_accessor pitch_hand: Handedness?
590
+
591
+ def verified?: () -> bool?
592
+ def player?: () -> bool?
593
+ def active?: () -> bool?
594
+ end
595
+
596
+ class RosterEntry < Shale::Mapper
597
+ include Equalizer
598
+
599
+ attr_accessor player: Player?
600
+ attr_accessor jersey_number: Integer?
601
+ attr_accessor position: Position?
602
+ attr_accessor status: Status?
603
+ attr_accessor team_id: Integer?
604
+ end
605
+
606
+ class Transaction < Shale::Mapper
607
+ include Equalizer
608
+
609
+ TYPE_TRADE: String
610
+ TYPE_FREE_AGENT: String
611
+ TYPE_ASSIGNMENT: String
612
+ TYPE_SIGNING: String
613
+ TYPE_RELEASE: String
614
+ TYPE_WAIVER: String
615
+
616
+ attr_accessor id: Integer?
617
+ attr_accessor player: Player?
618
+ attr_accessor from_team: Team?
619
+ attr_accessor to_team: Team?
620
+ attr_accessor date: Date?
621
+ attr_accessor effective_date: Date?
622
+ attr_accessor resolution_date: Date?
623
+ attr_accessor type_code: String?
624
+ attr_accessor type_desc: String?
625
+ attr_accessor description: String?
626
+
627
+ def trade?: () -> bool
628
+ def free_agent?: () -> bool
629
+ def assignment?: () -> bool
630
+ def signing?: () -> bool
631
+ def release?: () -> bool
632
+ def waiver?: () -> bool
633
+ end
634
+
635
+ class Award < Shale::Mapper
636
+ include Comparable
637
+ include ComparableByAttribute
638
+ include Equalizer
639
+
640
+ attr_accessor id: String?
641
+ attr_accessor name: String?
642
+ attr_accessor notes: String?
643
+ attr_accessor votes: Integer?
644
+ attr_accessor date: Date?
645
+ attr_accessor season: Integer?
646
+ attr_accessor sport: Sport?
647
+ attr_accessor player: Player?
648
+ attr_accessor league: League?
649
+ attr_accessor sort_order: Integer?
650
+
651
+ def comparable_attribute: () -> Symbol
652
+ def recipients: (?season: Integer?) -> Array[Award]
653
+ end
654
+
655
+ class BaseballStat < Shale::Mapper
656
+ include Equalizer
657
+
658
+ attr_accessor name: String?
659
+ attr_accessor lookup_param: String?
660
+ attr_accessor is_counting: bool?
661
+ attr_accessor label: String?
662
+ attr_accessor stat_groups: Array[untyped]
663
+
664
+ def counting?: () -> bool?
665
+ end
666
+
667
+ # Collection classes
668
+ # Using untyped for flexibility with Integer or objects responding to :id
669
+ class BaseballStats < Collection
670
+ attr_accessor stats: Array[BaseballStat]
671
+
672
+ def self.all: () -> Array[BaseballStat]
179
673
  end
180
674
 
181
- class Player < Struct[untyped]
182
- attr_accessor player_id: String
183
- def self.new: -> void
184
- def team: -> Team
675
+ class Awards < Shale::Mapper
676
+ attr_accessor awards: Array[Award]
677
+
678
+ def self.all: () -> Array[Award]
679
+ def self.find: (untyped) -> Award?
680
+ end
681
+
682
+ class Conferences < Shale::Mapper
683
+ attr_accessor conferences: Array[Conference]
684
+
685
+ def self.all: () -> Array[Conference]
686
+ def self.find: (untyped) -> Conference?
687
+ end
688
+
689
+ class Divisions < Shale::Mapper
690
+ attr_accessor divisions: Array[Division]
691
+
692
+ def self.all: (?sport: untyped) -> Array[Division]
693
+ def self.find: (untyped, ?sport: untyped) -> Division?
694
+ end
695
+
696
+ class Leagues < Shale::Mapper
697
+ attr_accessor leagues: Array[League]
698
+
699
+ def self.all: (?sport: untyped) -> Array[League]
700
+ def self.find: (untyped, ?sport: untyped) -> League?
701
+ end
702
+
703
+ class Players < Shale::Mapper
704
+ attr_accessor players: Array[Player]
705
+
706
+ def self.all: (?season: Integer?, ?sport: untyped) -> Array[Player]
707
+ def self.find: (untyped) -> Player?
708
+ def self.find_all: (*untyped) -> Array[Player]
709
+ end
710
+
711
+ class Roster < Shale::Mapper
712
+ attr_accessor roster: Array[RosterEntry]
713
+
714
+ def self.find: (team: untyped, ?season: Integer?, ?sport: untyped) -> Array[RosterEntry]
715
+ end
716
+
717
+ class Seasons < Shale::Mapper
718
+ attr_accessor seasons: Array[Season]
719
+
720
+ def self.all: (?sport: untyped) -> Array[Season]
721
+ def self.find: (untyped, ?sport: untyped) -> Season?
722
+ end
723
+
724
+ class Sports < Shale::Mapper
725
+ attr_accessor sports: Array[Sport]
726
+
727
+ def self.all: () -> Array[Sport]
728
+ def self.find: (untyped) -> Sport?
729
+ end
730
+
731
+ class Teams < Shale::Mapper
732
+ attr_accessor teams: Array[Team]
733
+
734
+ def self.all: (?season: Integer?, ?sport: untyped) -> Array[Team]
735
+ def self.find: (untyped, ?season: Integer?, ?sport: untyped) -> Team?
736
+ end
737
+
738
+ class Transactions < Shale::Mapper
739
+ attr_accessor transactions: Array[Transaction]
740
+
741
+ def self.between: (?start_date: Date, ?end_date: Date) -> Array[Transaction]
742
+ end
743
+
744
+ class Venues < Shale::Mapper
745
+ attr_accessor venues: Array[Venue]
746
+
747
+ def self.all: (?season: Integer?, ?sport: untyped) -> Array[Venue]
748
+ def self.find: (untyped, ?season: Integer?, ?sport: untyped) -> Venue?
749
+ end
750
+
751
+ # New model classes
752
+ class EventType < Shale::Mapper
753
+ include Equalizer
754
+
755
+ attr_accessor code: String?
756
+ attr_accessor description: String?
757
+ attr_accessor plate_appearance: bool?
758
+ attr_accessor hit: bool?
759
+ attr_accessor base_running_event: bool?
760
+
761
+ def plate_appearance?: () -> bool?
762
+ def hit?: () -> bool?
763
+ def base_running_event?: () -> bool?
764
+ end
765
+
766
+ class EventTypes < Collection
767
+ attr_accessor event_types: Array[EventType]
768
+
769
+ def self.all: () -> Array[EventType]
770
+ end
771
+
772
+ class GameStatus < Shale::Mapper
773
+ include Equalizer
774
+
775
+ FINAL: String
776
+ LIVE: String
777
+ PREVIEW: String
778
+
779
+ attr_accessor abstract_game_state: String?
780
+ attr_accessor coded_game_state: String?
781
+ attr_accessor detailed_state: String?
782
+ attr_accessor status_code: String?
783
+ attr_accessor abstract_game_code: String?
784
+ attr_accessor reason: String?
785
+
786
+ def final?: () -> bool
787
+ def live?: () -> bool
788
+ def preview?: () -> bool
789
+ end
790
+
791
+ class GameStatuses < Collection
792
+ attr_accessor game_statuses: Array[GameStatus]
793
+
794
+ def self.all: () -> Array[GameStatus]
795
+ end
796
+
797
+ class GameType < IdDescriptionType
798
+ TYPE_REGULAR: String
799
+ TYPE_SPRING: String
800
+ TYPE_EXHIBITION: String
801
+ TYPE_ALL_STAR: String
802
+ TYPE_WILD_CARD: String
803
+ TYPE_DIVISION: String
804
+ TYPE_LCS: String
805
+ TYPE_WORLD_SERIES: String
806
+ POSTSEASON_TYPES: Array[String]
807
+
808
+ def regular_season?: () -> bool
809
+ def spring_training?: () -> bool
810
+ def exhibition?: () -> bool
811
+ def all_star?: () -> bool
812
+ def wild_card?: () -> bool
813
+ def division_series?: () -> bool
814
+ def lcs?: () -> bool
815
+ def world_series?: () -> bool
816
+ def postseason?: () -> bool
817
+ end
818
+
819
+ class GameTypes < Collection
820
+ attr_accessor game_types: Array[GameType]
821
+
822
+ def self.all: () -> Array[GameType]
823
+ end
824
+
825
+ class HitTrajectory < CodeDescriptionType
826
+ end
827
+
828
+ class HitTrajectories < Collection
829
+ attr_accessor hit_trajectories: Array[HitTrajectory]
830
+
831
+ def self.all: () -> Array[HitTrajectory]
832
+ end
833
+
834
+ class JobType < Shale::Mapper
835
+ include Equalizer
836
+
837
+ attr_accessor code: String?
838
+ attr_accessor job: String?
839
+ attr_accessor sort_order: Integer?
840
+ end
841
+
842
+ class JobTypes < Collection
843
+ attr_accessor job_types: Array[JobType]
844
+
845
+ def self.all: () -> Array[JobType]
846
+ end
847
+
848
+ class Language < Shale::Mapper
849
+ include Equalizer
850
+
851
+ attr_accessor language_id: Integer?
852
+ attr_accessor language_code: String?
853
+ attr_accessor name: String?
854
+ attr_accessor locale: String?
855
+ end
856
+
857
+ class Languages < Collection
858
+ attr_accessor languages: Array[Language]
859
+
860
+ def self.all: () -> Array[Language]
861
+ end
862
+
863
+ class LeagueLeaderType < Shale::Mapper
864
+ include Equalizer
865
+
866
+ attr_accessor display_name: String?
867
+ end
868
+
869
+ class LeagueLeaderTypes < Collection
870
+ attr_accessor league_leader_types: Array[LeagueLeaderType]
871
+
872
+ def self.all: () -> Array[LeagueLeaderType]
873
+ end
874
+
875
+ class LogicalEvent < Shale::Mapper
876
+ include Equalizer
877
+
878
+ attr_accessor code: String?
879
+ end
880
+
881
+ class LogicalEvents < Collection
882
+ attr_accessor logical_events: Array[LogicalEvent]
883
+
884
+ def self.all: () -> Array[LogicalEvent]
885
+ end
886
+
887
+ class Metric < Shale::Mapper
888
+ include Equalizer
889
+
890
+ attr_accessor name: String?
891
+ attr_accessor metric_id: Integer?
892
+ attr_accessor group: String?
893
+ attr_accessor unit: String?
894
+ end
895
+
896
+ class Metrics < Collection
897
+ attr_accessor metrics: Array[Metric]
898
+
899
+ def self.all: () -> Array[Metric]
900
+ end
901
+
902
+ class PitchCode < Shale::Mapper
903
+ include Equalizer
904
+
905
+ attr_accessor code: String?
906
+ attr_accessor description: String?
907
+ attr_accessor swing_status: bool?
908
+ attr_accessor strike_status: bool?
909
+ attr_accessor ball_status: bool?
910
+ attr_accessor sort_order: Integer?
911
+
912
+ def swing?: () -> bool?
913
+ def strike?: () -> bool?
914
+ def ball?: () -> bool?
915
+ end
916
+
917
+ class PitchCodes < Collection
918
+ attr_accessor pitch_codes: Array[PitchCode]
919
+
920
+ def self.all: () -> Array[PitchCode]
921
+ end
922
+
923
+ class PitchType < CodeDescriptionType
924
+ end
925
+
926
+ class PitchTypes < Collection
927
+ attr_accessor pitch_types: Array[PitchType]
928
+
929
+ def self.all: () -> Array[PitchType]
930
+ end
931
+
932
+ class Platform < Shale::Mapper
933
+ include Equalizer
934
+
935
+ attr_accessor platform_code: String?
936
+ attr_accessor platform_description: String?
937
+ end
938
+
939
+ class Platforms < Collection
940
+ attr_accessor platforms: Array[Platform]
941
+
942
+ def self.all: () -> Array[Platform]
943
+ end
944
+
945
+ class Positions < Collection
946
+ attr_accessor positions: Array[Position]
947
+
948
+ def self.all: () -> Array[Position]
949
+ end
950
+
951
+ class ReviewReason < CodeDescriptionType
952
+ end
953
+
954
+ class ReviewReasons < Collection
955
+ attr_accessor review_reasons: Array[ReviewReason]
956
+
957
+ def self.all: () -> Array[ReviewReason]
958
+ end
959
+
960
+ class RosterType < Shale::Mapper
961
+ include Equalizer
962
+
963
+ attr_accessor description: String?
964
+ attr_accessor lookup_name: String?
965
+ attr_accessor parameter: String?
966
+ end
967
+
968
+ class RosterTypes < Collection
969
+ attr_accessor roster_types: Array[RosterType]
970
+
971
+ def self.all: () -> Array[RosterType]
972
+ end
973
+
974
+ class ScheduleEventType < Shale::Mapper
975
+ include Equalizer
976
+
977
+ attr_accessor code: String?
978
+ attr_accessor name: String?
979
+ end
980
+
981
+ class ScheduleEventTypes < Collection
982
+ attr_accessor schedule_event_types: Array[ScheduleEventType]
983
+
984
+ def self.all: () -> Array[ScheduleEventType]
985
+ end
986
+
987
+ class SituationCode < Shale::Mapper
988
+ include Equalizer
989
+
990
+ attr_accessor code: String?
991
+ attr_accessor sort_order: Integer?
992
+ attr_accessor navigation_menu: String?
993
+ attr_accessor description: String?
994
+ attr_accessor team: bool?
995
+ attr_accessor batting: bool?
996
+ attr_accessor fielding: bool?
997
+ attr_accessor pitching: bool?
998
+
999
+ def team?: () -> bool?
1000
+ def batting?: () -> bool?
1001
+ def fielding?: () -> bool?
1002
+ def pitching?: () -> bool?
1003
+ end
1004
+
1005
+ class SituationCodes < Collection
1006
+ attr_accessor situation_codes: Array[SituationCode]
1007
+
1008
+ def self.all: () -> Array[SituationCode]
1009
+ end
1010
+
1011
+ class Sky < CodeDescriptionType
1012
+ end
1013
+
1014
+ class Skies < Collection
1015
+ attr_accessor skies: Array[Sky]
1016
+
1017
+ def self.all: () -> Array[Sky]
1018
+ end
1019
+
1020
+ class StandingsType < Shale::Mapper
1021
+ include Equalizer
1022
+
1023
+ attr_accessor name: String?
1024
+ attr_accessor description: String?
1025
+ end
1026
+
1027
+ class StandingsTypes < Collection
1028
+ attr_accessor standings_types: Array[StandingsType]
1029
+
1030
+ def self.all: () -> Array[StandingsType]
1031
+ end
1032
+
1033
+ class StatGroup < Shale::Mapper
1034
+ include Equalizer
1035
+
1036
+ attr_accessor display_name: String?
1037
+ end
1038
+
1039
+ class StatGroups < Collection
1040
+ attr_accessor stat_groups: Array[StatGroup]
1041
+
1042
+ def self.all: () -> Array[StatGroup]
1043
+ end
1044
+
1045
+ class StatType < Shale::Mapper
1046
+ include Equalizer
1047
+
1048
+ attr_accessor display_name: String?
1049
+ end
1050
+
1051
+ class StatTypes < Collection
1052
+ attr_accessor stat_types: Array[StatType]
1053
+
1054
+ def self.all: () -> Array[StatType]
1055
+ end
1056
+
1057
+ class WindDirection < CodeDescriptionType
1058
+ end
1059
+
1060
+ class WindDirections < Collection
1061
+ attr_accessor wind_directions: Array[WindDirection]
1062
+
1063
+ def self.all: () -> Array[WindDirection]
1064
+ end
1065
+
1066
+ # Boxscore classes
1067
+ class BoxscoreBattingStats < Shale::Mapper
1068
+ attr_accessor runs: Integer?
1069
+ attr_accessor hits: Integer?
1070
+ attr_accessor doubles: Integer?
1071
+ attr_accessor triples: Integer?
1072
+ attr_accessor home_runs: Integer?
1073
+ attr_accessor strike_outs: Integer?
1074
+ attr_accessor base_on_balls: Integer?
1075
+ attr_accessor at_bats: Integer?
1076
+ attr_accessor avg: String?
1077
+ attr_accessor rbi: Integer?
1078
+ attr_accessor left_on_base: Integer?
1079
+ end
1080
+
1081
+ class BoxscorePitchingStats < Shale::Mapper
1082
+ attr_accessor runs: Integer?
1083
+ attr_accessor earned_runs: Integer?
1084
+ attr_accessor hits: Integer?
1085
+ attr_accessor home_runs: Integer?
1086
+ attr_accessor strike_outs: Integer?
1087
+ attr_accessor base_on_balls: Integer?
1088
+ attr_accessor innings_pitched: String?
1089
+ attr_accessor era: String?
1090
+ end
1091
+
1092
+ class BoxscoreTeamStats < Shale::Mapper
1093
+ attr_accessor batting: BoxscoreBattingStats?
1094
+ attr_accessor pitching: BoxscorePitchingStats?
1095
+ end
1096
+
1097
+ class BoxscoreTeam < Shale::Mapper
1098
+ attr_accessor team: Team?
1099
+ attr_accessor team_stats: BoxscoreTeamStats?
1100
+ end
1101
+
1102
+ class BoxscoreTeams < Shale::Mapper
1103
+ attr_accessor home: BoxscoreTeam?
1104
+ attr_accessor away: BoxscoreTeam?
1105
+ end
1106
+
1107
+ class Boxscore < Shale::Mapper
1108
+ attr_accessor teams: BoxscoreTeams?
1109
+
1110
+ def self.find: (game: untyped) -> Boxscore
1111
+ end
1112
+
1113
+ # Linescore classes
1114
+ class InningHalfScore < Shale::Mapper
1115
+ attr_accessor runs: Integer?
1116
+ attr_accessor hits: Integer?
1117
+ attr_accessor errors: Integer?
1118
+ attr_accessor left_on_base: Integer?
1119
+ end
1120
+
1121
+ class InningScore < Shale::Mapper
1122
+ attr_accessor num: Integer?
1123
+ attr_accessor ordinal_num: String?
1124
+ attr_accessor home: InningHalfScore?
1125
+ attr_accessor away: InningHalfScore?
1126
+ end
1127
+
1128
+ class LinescoreTeam < Shale::Mapper
1129
+ attr_accessor runs: Integer?
1130
+ attr_accessor hits: Integer?
1131
+ attr_accessor errors: Integer?
1132
+ attr_accessor left_on_base: Integer?
1133
+ attr_accessor is_winner: bool?
1134
+
1135
+ def winner?: () -> bool?
1136
+ end
1137
+
1138
+ class LinescoreTeams < Shale::Mapper
1139
+ attr_accessor home: LinescoreTeam?
1140
+ attr_accessor away: LinescoreTeam?
1141
+ end
1142
+
1143
+ class Linescore < Shale::Mapper
1144
+ INNING_TOP: String
1145
+ INNING_MIDDLE: String
1146
+ INNING_BOTTOM: String
1147
+
1148
+ attr_accessor current_inning: Integer?
1149
+ attr_accessor current_inning_ordinal: String?
1150
+ attr_accessor inning_state: String?
1151
+ attr_accessor inning_half: String?
1152
+ attr_accessor is_top_inning: bool?
1153
+ attr_accessor scheduled_innings: Integer?
1154
+ attr_accessor innings: Array[InningScore]
1155
+ attr_accessor teams: LinescoreTeams?
1156
+
1157
+ def top_inning?: () -> bool?
1158
+ def top?: () -> bool
1159
+ def middle?: () -> bool
1160
+ def bottom?: () -> bool
1161
+ def first?: () -> bool
1162
+ def second?: () -> bool
1163
+ def third?: () -> bool
1164
+ def fourth?: () -> bool
1165
+ def fifth?: () -> bool
1166
+ def sixth?: () -> bool
1167
+ def seventh?: () -> bool
1168
+ def eighth?: () -> bool
1169
+ def ninth?: () -> bool
1170
+ def tenth?: () -> bool
1171
+ def eleventh?: () -> bool
1172
+ def twelfth?: () -> bool
1173
+ def thirteenth?: () -> bool
1174
+ def fourteenth?: () -> bool
1175
+ def fifteenth?: () -> bool
1176
+ def sixteenth?: () -> bool
1177
+ def seventeenth?: () -> bool
1178
+ def eighteenth?: () -> bool
1179
+ def nineteenth?: () -> bool
1180
+ def twentieth?: () -> bool
1181
+ def twenty_first?: () -> bool
1182
+ def twenty_second?: () -> bool
1183
+ def twenty_third?: () -> bool
1184
+ def twenty_fourth?: () -> bool
1185
+ def twenty_fifth?: () -> bool
1186
+ def twenty_sixth?: () -> bool
1187
+
1188
+ def self.find: (game: untyped) -> Linescore
1189
+ end
1190
+
1191
+ # Free Agent classes
1192
+ class FreeAgent < Shale::Mapper
1193
+ include Equalizer
1194
+
1195
+ attr_accessor player: Player?
1196
+ attr_accessor original_team: Team?
1197
+ attr_accessor new_team: Team?
1198
+ attr_accessor notes: String?
1199
+ attr_accessor date_signed: Date?
1200
+ attr_accessor date_declared: Date?
1201
+ attr_accessor position: Position?
1202
+ end
1203
+
1204
+ class FreeAgents < Shale::Mapper
1205
+ attr_accessor free_agents: Array[FreeAgent]
1206
+
1207
+ def self.all: (?season: Integer?) -> Array[FreeAgent]
1208
+ end
1209
+
1210
+ # Attendance classes
1211
+ class AttendanceRecord < Shale::Mapper
1212
+ include Equalizer
1213
+
1214
+ attr_accessor year: String?
1215
+ attr_accessor team: Team?
1216
+ attr_accessor openings_total: Integer?
1217
+ attr_accessor openings_total_home: Integer?
1218
+ attr_accessor openings_total_away: Integer?
1219
+ attr_accessor games_total: Integer?
1220
+ attr_accessor games_home_total: Integer?
1221
+ attr_accessor games_away_total: Integer?
1222
+ attr_accessor attendance_total: Integer?
1223
+ attr_accessor attendance_total_home: Integer?
1224
+ attr_accessor attendance_total_away: Integer?
1225
+ attr_accessor attendance_average_home: Integer?
1226
+ attr_accessor attendance_average_away: Integer?
1227
+ attr_accessor attendance_average_ytd: Integer?
1228
+ attr_accessor attendance_high: Integer?
1229
+ attr_accessor attendance_low: Integer?
1230
+ end
1231
+
1232
+ class Attendance < Shale::Mapper
1233
+ attr_accessor records: Array[AttendanceRecord]
1234
+
1235
+ def self.find: (team: untyped, ?season: Integer?) -> Array[AttendanceRecord]
1236
+ end
1237
+
1238
+ # Job classes
1239
+ class Job < Shale::Mapper
1240
+ include Equalizer
1241
+
1242
+ attr_accessor person: Player?
1243
+ attr_accessor jersey_number: String?
1244
+ attr_accessor job: String?
1245
+ attr_accessor job_id: String?
1246
+ attr_accessor title: String?
1247
+ end
1248
+
1249
+ class Jobs < Shale::Mapper
1250
+ attr_accessor roster: Array[Job]
1251
+
1252
+ def self.umpires: (?season: Integer?) -> Array[Job]
1253
+ def self.datacasters: (?season: Integer?) -> Array[Job]
1254
+ def self.official_scorers: (?season: Integer?) -> Array[Job]
1255
+ def self.umpire_games: (umpire: untyped, ?season: Integer?) -> Array[Job]
1256
+
1257
+ private
1258
+
1259
+ def self.fetch_jobs: (String, season: Integer?) -> Array[Job]
1260
+ end
1261
+
1262
+ # Affiliates class
1263
+ class Affiliates < Shale::Mapper
1264
+ attr_accessor teams: Array[Team]
1265
+
1266
+ def self.find: (team: untyped, ?season: Integer?) -> Array[Team]
1267
+ end
1268
+
1269
+ # Personnel class
1270
+ class Personnel < Shale::Mapper
1271
+ attr_accessor roster: Array[Job]
1272
+
1273
+ def self.find: (team: untyped, ?season: Integer?) -> Array[Job]
1274
+ end
1275
+
1276
+ # HighLow classes
1277
+ class HighLowResult < Shale::Mapper
1278
+ include Equalizer
1279
+
1280
+ attr_accessor season: String?
1281
+ attr_accessor team: Team?
1282
+ attr_accessor opponent: Team?
1283
+ attr_accessor date: String?
1284
+ attr_accessor is_home: bool?
1285
+ attr_accessor rank: Integer?
1286
+
1287
+ def home?: () -> bool?
1288
+ end
1289
+
1290
+ class HighLowGroup < Shale::Mapper
1291
+ attr_accessor splits: Array[HighLowResult]
1292
+ end
1293
+
1294
+ class HighLow < Shale::Mapper
1295
+ attr_accessor high_low_results: Array[HighLowGroup]
1296
+
1297
+ def self.find: (org_type: String, ?season: Integer?) -> Array[HighLowResult]
1298
+ end
1299
+
1300
+ # Draft classes
1301
+ class DraftSchool < Shale::Mapper
1302
+ attr_accessor name: String?
1303
+ attr_accessor school_class: String?
1304
+ attr_accessor city: String?
1305
+ attr_accessor state: String?
1306
+ attr_accessor country: String?
1307
+ end
1308
+
1309
+ class DraftPick < Shale::Mapper
1310
+ include Equalizer
1311
+
1312
+ attr_accessor pick_round: String?
1313
+ attr_accessor pick_number: Integer?
1314
+ attr_accessor round_pick_number: Integer?
1315
+ attr_accessor rank: Integer?
1316
+ attr_accessor pick_value: String?
1317
+ attr_accessor signing_bonus: String?
1318
+ attr_accessor person: Player?
1319
+ attr_accessor team: Team?
1320
+ attr_accessor school: DraftSchool?
1321
+ attr_accessor blurb: String?
1322
+ end
1323
+
1324
+ class DraftRound < Shale::Mapper
1325
+ attr_accessor round: String?
1326
+ attr_accessor picks: Array[DraftPick]
1327
+ end
1328
+
1329
+ class DraftYear < Shale::Mapper
1330
+ attr_accessor draft_year: Integer?
1331
+ attr_accessor rounds: Array[DraftRound]
1332
+ end
1333
+
1334
+ class Draft < Shale::Mapper
1335
+ attr_accessor drafts: DraftYear?
1336
+
1337
+ def self.picks: (?year: Integer?) -> Array[DraftPick]
1338
+ end
1339
+
1340
+ # Leaders classes
1341
+ class Leader < Shale::Mapper
1342
+ include Equalizer
1343
+
1344
+ attr_accessor rank: Integer?
1345
+ attr_accessor value: String?
1346
+ attr_accessor person: Player?
1347
+ attr_accessor team: Team?
1348
+ attr_accessor league: League?
1349
+ attr_accessor sport: Sport?
1350
+ attr_accessor season: String?
1351
+ end
1352
+
1353
+ class LeaderCategory < Shale::Mapper
1354
+ attr_accessor leader_category: String?
1355
+ attr_accessor season: String?
1356
+ attr_accessor leaders: Array[Leader]
1357
+ end
1358
+
1359
+ class Leaders < Shale::Mapper
1360
+ attr_accessor league_leaders: Array[LeaderCategory]
1361
+
1362
+ def self.find: (category: String, ?season: Integer?, ?limit: Integer) -> Array[Leader]
1363
+ end
1364
+
1365
+ # GamePace classes
1366
+ class GamePaceStats < Shale::Mapper
1367
+ attr_accessor hits_per_9inn: Float?
1368
+ attr_accessor runs_per_9inn: Float?
1369
+ attr_accessor pitches_per_9inn: Float?
1370
+ attr_accessor hits_per_game: Float?
1371
+ attr_accessor runs_per_game: Float?
1372
+ attr_accessor pitches_per_game: Float?
1373
+ attr_accessor total_games: Integer?
1374
+ attr_accessor total_innings_played: Float?
1375
+ attr_accessor total_hits: Integer?
1376
+ attr_accessor total_runs: Integer?
1377
+ attr_accessor total_pitches: Integer?
1378
+ attr_accessor time_per_game: String?
1379
+ attr_accessor time_per_pitch: String?
1380
+ attr_accessor season: String?
1381
+ attr_accessor sport: Sport?
1382
+ end
1383
+
1384
+ class GamePace < Shale::Mapper
1385
+ attr_accessor sports: Array[GamePaceStats]
1386
+
1387
+ def self.find: (?season: Integer?) -> GamePaceStats?
1388
+ end
1389
+
1390
+ # Coaches class
1391
+ class Coaches < Shale::Mapper
1392
+ attr_accessor roster: Array[Job]
1393
+
1394
+ def self.find: (team: untyped, ?season: Integer?) -> Array[Job]
1395
+ end
1396
+
1397
+ # PostseasonSchedule class
1398
+ class PostseasonSchedule < Shale::Mapper
1399
+ attr_accessor total_games: Integer?
1400
+ attr_accessor dates: Array[ScheduleDate]
1401
+
1402
+ def self.games: (?season: Integer?) -> Array[ScheduledGame]
1403
+ end
1404
+
1405
+ # TiedGames class
1406
+ class TiedGames < Shale::Mapper
1407
+ attr_accessor dates: Array[ScheduleDate]
1408
+
1409
+ def self.all: (?season: Integer?) -> Array[ScheduledGame]
1410
+ end
1411
+
1412
+ # TeamHistory class
1413
+ class TeamHistory < Shale::Mapper
1414
+ attr_accessor teams: Array[Team]
1415
+
1416
+ def self.find: (team: untyped) -> Array[Team]
1417
+ end
1418
+
1419
+ # Alumni class
1420
+ class Alumni < Shale::Mapper
1421
+ attr_accessor people: Array[Player]
1422
+
1423
+ def self.find: (team: untyped, ?season: Integer?) -> Array[Player]
1424
+ end
1425
+
1426
+ # TeamLeader classes
1427
+ class TeamLeader < Shale::Mapper
1428
+ include Equalizer
1429
+
1430
+ attr_accessor rank: Integer?
1431
+ attr_accessor value: String?
1432
+ attr_accessor person: Player?
1433
+ attr_accessor team: Team?
1434
+ attr_accessor season: String?
1435
+ end
1436
+
1437
+ class TeamLeaderCategory < Shale::Mapper
1438
+ attr_accessor leader_category: String?
1439
+ attr_accessor season: String?
1440
+ attr_accessor leaders: Array[TeamLeader]
1441
+ end
1442
+
1443
+ class TeamLeaders < Shale::Mapper
1444
+ attr_accessor team_leaders: Array[TeamLeaderCategory]
1445
+
1446
+ def self.find: (team: untyped, category: String, ?season: Integer?) -> Array[TeamLeader]
1447
+ end
1448
+
1449
+ # TeamStat classes
1450
+
1451
+ class TeamStat < Shale::Mapper
1452
+ include Equalizer
1453
+
1454
+ attr_accessor season: String?
1455
+ attr_accessor stat: StatValues?
1456
+ attr_accessor team: Team?
1457
+ attr_accessor rank: Integer?
1458
+ end
1459
+
1460
+ class TeamStatGroup < Shale::Mapper
1461
+ attr_accessor splits: Array[TeamStat]
1462
+ end
1463
+
1464
+ class TeamStats < Shale::Mapper
1465
+ attr_accessor stats: Array[TeamStatGroup]
1466
+
1467
+ def self.find: (?season: Integer?, ?group: String, ?stats: String) -> Array[TeamStat]
1468
+ end
1469
+
1470
+ # SingleTeamStats class
1471
+ class SingleTeamStats < Shale::Mapper
1472
+ attr_accessor stats: Array[TeamStatGroup]
1473
+
1474
+ def self.find: (team: untyped, ?season: Integer?, ?group: String, ?stats: String) -> Array[TeamStat]
1475
+ end
1476
+
1477
+ # PlayerStat classes
1478
+
1479
+ class PlayerStat < Shale::Mapper
1480
+ include Equalizer
1481
+
1482
+ attr_accessor season: String?
1483
+ attr_accessor stat: StatValues?
1484
+ attr_accessor player: Player?
1485
+ attr_accessor team: Team?
1486
+ attr_accessor rank: Integer?
1487
+ attr_accessor position: Position?
1488
+ end
1489
+
1490
+ class PlayerStatGroup < Shale::Mapper
1491
+ attr_accessor splits: Array[PlayerStat]
1492
+ end
1493
+
1494
+ class Stats < Shale::Mapper
1495
+ attr_accessor stats: Array[PlayerStatGroup]
1496
+
1497
+ def self.find: (?season: Integer?, ?group: String, ?stats: String, ?sport: untyped) -> Array[PlayerStat]
1498
+ end
1499
+
1500
+ # Schedule classes
1501
+ class ScheduledGameTeam < Shale::Mapper
1502
+ include Equalizer
1503
+
1504
+ attr_accessor team: Team?
1505
+ attr_accessor score: Integer?
1506
+ attr_accessor is_winner: bool?
1507
+
1508
+ def winner?: () -> bool?
1509
+ end
1510
+
1511
+ class ScheduledGameTeams < Shale::Mapper
1512
+ attr_accessor away: ScheduledGameTeam?
1513
+ attr_accessor home: ScheduledGameTeam?
1514
+ end
1515
+
1516
+ class ScheduledGame < Shale::Mapper
1517
+ include Equalizer
1518
+
1519
+ DAY: String
1520
+ NIGHT: String
1521
+ DOUBLE_HEADER_VALUES: Array[String]
1522
+ GAME_TYPE_REGULAR: String
1523
+ GAME_TYPE_SPRING: String
1524
+ GAME_TYPE_EXHIBITION: String
1525
+ GAME_TYPE_ALL_STAR: String
1526
+ POSTSEASON_GAME_TYPES: Array[String]
1527
+
1528
+ attr_accessor game_pk: Integer?
1529
+ attr_accessor link: String?
1530
+ attr_accessor game_type: String?
1531
+ attr_accessor season: String?
1532
+ attr_accessor game_date: String?
1533
+ attr_accessor official_date: Date?
1534
+ attr_accessor status: GameStatus?
1535
+ attr_accessor teams: ScheduledGameTeams?
1536
+ attr_accessor venue: Venue?
1537
+ attr_accessor is_tie: bool?
1538
+ attr_accessor game_number: Integer?
1539
+ attr_accessor double_header: String?
1540
+ attr_accessor day_night: String?
1541
+ attr_accessor scheduled_innings: Integer?
1542
+ attr_accessor series_description: String?
1543
+ attr_accessor games_in_series: Integer?
1544
+ attr_accessor series_game_number: Integer?
1545
+
1546
+ def tie?: () -> bool?
1547
+ def day?: () -> bool
1548
+ def night?: () -> bool
1549
+ def double_header?: () -> bool
1550
+ def regular_season?: () -> bool
1551
+ def spring_training?: () -> bool
1552
+ def exhibition?: () -> bool
1553
+ def all_star?: () -> bool
1554
+ def postseason?: () -> bool
1555
+ end
1556
+
1557
+ class ScheduleDate < Shale::Mapper
1558
+ attr_accessor date: Date?
1559
+ attr_accessor total_games: Integer?
1560
+ attr_accessor games: Array[ScheduledGame]
1561
+ end
1562
+
1563
+ class Schedule < Shale::Mapper
1564
+ attr_accessor total_games: Integer?
1565
+ attr_accessor dates: Array[ScheduleDate]
1566
+
1567
+ def self.games: (?date: Date, ?sport: untyped, ?team: untyped) -> Array[ScheduledGame]
1568
+ end
1569
+
1570
+ # Standings classes
1571
+ class LeagueRecord < Shale::Mapper
1572
+ attr_accessor wins: Integer?
1573
+ attr_accessor losses: Integer?
1574
+ attr_accessor ties: Integer?
1575
+ attr_accessor pct: String?
1576
+ end
1577
+
1578
+ class Streak < Shale::Mapper
1579
+ WINS: String
1580
+ LOSSES: String
1581
+
1582
+ attr_accessor streak_code: String?
1583
+ attr_accessor streak_type: String?
1584
+ attr_accessor streak_number: Integer?
1585
+
1586
+ def winning?: () -> bool
1587
+ def losing?: () -> bool
1588
+ end
1589
+
1590
+ class TeamRecord < Shale::Mapper
1591
+ include Equalizer
1592
+
1593
+ attr_accessor team: Team?
1594
+ attr_accessor season: String?
1595
+ attr_accessor streak: Streak?
1596
+ attr_accessor division_rank: String?
1597
+ attr_accessor league_rank: String?
1598
+ attr_accessor wildcard_rank: String?
1599
+ attr_accessor games_played: Integer?
1600
+ attr_accessor games_back: String?
1601
+ attr_accessor wildcard_games_back: String?
1602
+ attr_accessor league_record: LeagueRecord?
1603
+ attr_accessor wins: Integer?
1604
+ attr_accessor losses: Integer?
1605
+ attr_accessor runs_scored: Integer?
1606
+ attr_accessor runs_allowed: Integer?
1607
+ attr_accessor run_differential: Integer?
1608
+ attr_accessor winning_percentage: String?
1609
+ attr_accessor division_champ: bool?
1610
+ attr_accessor division_leader: bool?
1611
+ attr_accessor clinched: bool?
1612
+
1613
+ def division_champ?: () -> bool?
1614
+ def division_leader?: () -> bool?
1615
+ def clinched?: () -> bool?
1616
+ end
1617
+
1618
+ class StandingsRecord < Shale::Mapper
1619
+ STANDINGS_REGULAR_SEASON: String
1620
+ STANDINGS_WILD_CARD: String
1621
+ STANDINGS_DIVISION_LEADERS: String
1622
+ STANDINGS_WILD_CARD_WITH_LEADERS: String
1623
+ STANDINGS_FIRST_HALF: String
1624
+ STANDINGS_SECOND_HALF: String
1625
+ STANDINGS_SPRING_TRAINING: String
1626
+ STANDINGS_POSTSEASON: String
1627
+
1628
+ attr_accessor standings_type: String?
1629
+ attr_accessor league: League?
1630
+ attr_accessor division: Division?
1631
+ attr_accessor sport: Sport?
1632
+ attr_accessor last_updated: String?
1633
+ attr_accessor team_records: Array[TeamRecord]
1634
+
1635
+ def regular_season?: () -> bool
1636
+ def wild_card?: () -> bool
1637
+ def spring_training?: () -> bool
1638
+ def postseason?: () -> bool
1639
+ end
1640
+
1641
+ class Standings < Shale::Mapper
1642
+ DEFAULT_LEAGUE_IDS: Array[Integer]
1643
+
1644
+ attr_accessor records: Array[StandingsRecord]
1645
+
1646
+ def self.all: (?season: Integer?, ?league_ids: Array[Integer]) -> Array[StandingsRecord]
1647
+ def self.find: (division: untyped, ?season: Integer?, ?league_ids: Array[Integer]) -> StandingsRecord?
1648
+ end
1649
+
1650
+ # PostseasonSeries classes
1651
+ class SeriesInfo < Shale::Mapper
1652
+ attr_accessor id: String?
1653
+ attr_accessor sort_number: Integer?
1654
+ attr_accessor game_type: String?
1655
+ end
1656
+
1657
+ class PostseasonSeriesEntry < Shale::Mapper
1658
+ include Equalizer
1659
+
1660
+ attr_accessor series: SeriesInfo?
1661
+ attr_accessor total_games: Integer?
1662
+ attr_accessor games: Array[ScheduledGame]
1663
+ end
1664
+
1665
+ class PostseasonSeries < Shale::Mapper
1666
+ attr_accessor series: Array[PostseasonSeriesEntry]
1667
+
1668
+ def self.all: (?season: Integer?, ?sport: untyped) -> Array[PostseasonSeriesEntry]
1669
+ end
1670
+
1671
+ # SportPlayers class
1672
+ class SportPlayers < Shale::Mapper
1673
+ attr_accessor people: Array[Player]
1674
+
1675
+ def self.all: (?season: Integer?, ?sport: untyped) -> Array[Player]
1676
+ end
1677
+
1678
+ # PeopleChanges class
1679
+ class PeopleChanges < Shale::Mapper
1680
+ attr_accessor people: Array[Player]
1681
+
1682
+ def self.since: (date: Date) -> Array[Player]
1683
+ end
1684
+
1685
+ # GameChanges classes
1686
+ class ChangedGame < Shale::Mapper
1687
+ include Equalizer
1688
+
1689
+ attr_accessor game_pk: Integer?
1690
+ end
1691
+
1692
+ class ChangedGameDate < Shale::Mapper
1693
+ attr_accessor date: String?
1694
+ attr_accessor games: Array[ChangedGame]
1695
+ end
1696
+
1697
+ class GameChanges < Shale::Mapper
1698
+ attr_accessor dates: Array[ChangedGameDate]
1699
+
1700
+ def self.since: (updated_since: untyped, ?sport_id: Integer?, ?season: Integer?, ?game_type: String?) -> Array[ChangedGame]
1701
+ end
1702
+
1703
+ # ContextMetrics classes
1704
+ class SacFlyProbability < Shale::Mapper
1705
+ include Equalizer
1706
+
1707
+ attr_accessor probability: Float?
1708
+ end
1709
+
1710
+ class ContextMetrics < Shale::Mapper
1711
+ attr_accessor home_win_probability: Float?
1712
+ attr_accessor away_win_probability: Float?
1713
+ attr_accessor left_field_sac_fly_probability: SacFlyProbability?
1714
+ attr_accessor center_field_sac_fly_probability: SacFlyProbability?
1715
+ attr_accessor right_field_sac_fly_probability: SacFlyProbability?
1716
+
1717
+ def self.find: (game: untyped) -> ContextMetrics
1718
+ end
1719
+
1720
+ # Play-by-play classes
1721
+ class PlayResult < Shale::Mapper
1722
+ attr_accessor type: String?
1723
+ attr_accessor event: String?
1724
+ attr_accessor event_type: String?
1725
+ attr_accessor description: String?
1726
+ attr_accessor rbi: Integer?
1727
+ attr_accessor away_score: Integer?
1728
+ attr_accessor home_score: Integer?
1729
+ attr_accessor is_out: bool?
1730
+
1731
+ def out?: () -> bool?
1732
+ end
1733
+
1734
+ class PlayAbout < Shale::Mapper
1735
+ attr_accessor at_bat_index: Integer?
1736
+ attr_accessor half_inning: String?
1737
+ attr_accessor is_top_inning: bool?
1738
+ attr_accessor inning: Integer?
1739
+ attr_accessor is_complete: bool?
1740
+ attr_accessor is_scoring_play: bool?
1741
+
1742
+ def top_inning?: () -> bool?
1743
+ def complete?: () -> bool?
1744
+ def scoring_play?: () -> bool?
1745
+ end
1746
+
1747
+ class PlayCount < Shale::Mapper
1748
+ attr_accessor balls: Integer?
1749
+ attr_accessor strikes: Integer?
1750
+ attr_accessor outs: Integer?
1751
+ end
1752
+
1753
+ class PlayMatchup < Shale::Mapper
1754
+ attr_accessor batter: Player?
1755
+ attr_accessor bat_side: Handedness?
1756
+ attr_accessor pitcher: Player?
1757
+ attr_accessor pitch_hand: Handedness?
1758
+ end
1759
+
1760
+ class Play < Shale::Mapper
1761
+ attr_accessor result: PlayResult?
1762
+ attr_accessor about: PlayAbout?
1763
+ attr_accessor count: PlayCount?
1764
+ attr_accessor matchup: PlayMatchup?
1765
+ end
1766
+
1767
+ class PlayByPlay < Shale::Mapper
1768
+ attr_accessor all_plays: Array[Play]
1769
+ attr_accessor current_play: Play?
1770
+ attr_accessor scoring_plays: Array[Integer]
1771
+
1772
+ def self.find: (game: untyped) -> PlayByPlay
1773
+ end
1774
+
1775
+ # WinProbability classes
1776
+ class WinProbabilityEntry < Shale::Mapper
1777
+ include Equalizer
1778
+
1779
+ attr_accessor at_bat_index: Integer?
1780
+ attr_accessor home_team_win_probability: Float?
1781
+ attr_accessor away_team_win_probability: Float?
1782
+ end
1783
+
1784
+ class WinProbability < Shale::Mapper
1785
+ attr_accessor entries: Array[WinProbabilityEntry]
1786
+
1787
+ def self.find: (game: untyped) -> Array[WinProbabilityEntry]
1788
+ end
1789
+
1790
+ # LiveFeed classes
1791
+ class GameDateTime < Shale::Mapper
1792
+ DAY: String
1793
+ NIGHT: String
1794
+ AM: String
1795
+ PM: String
1796
+
1797
+ attr_accessor date_time: String?
1798
+ attr_accessor original_date: String?
1799
+ attr_accessor day_night: String?
1800
+ attr_accessor time: String?
1801
+ attr_accessor am_pm: String?
1802
+
1803
+ def day?: () -> bool
1804
+ def night?: () -> bool
1805
+ def am?: () -> bool
1806
+ def pm?: () -> bool
1807
+ end
1808
+
1809
+ class GameTeams < Shale::Mapper
1810
+ attr_accessor away: Team?
1811
+ attr_accessor home: Team?
1812
+ end
1813
+
1814
+ class GameData < Shale::Mapper
1815
+ attr_accessor datetime: GameDateTime?
1816
+ attr_accessor teams: GameTeams?
1817
+ attr_accessor venue: Venue?
1818
+ end
1819
+
1820
+ class LivePlays < Shale::Mapper
1821
+ attr_accessor all_plays: Array[Play]
1822
+ attr_accessor current_play: Play?
1823
+ attr_accessor scoring_plays: Array[Integer]
1824
+ end
1825
+
1826
+ class LiveData < Shale::Mapper
1827
+ attr_accessor plays: LivePlays?
1828
+ attr_accessor linescore: Linescore?
1829
+ attr_accessor boxscore: Boxscore?
1830
+ end
1831
+
1832
+ class LiveFeed < Shale::Mapper
1833
+ attr_accessor game_pk: Integer?
1834
+ attr_accessor link: String?
1835
+ attr_accessor game_data: GameData?
1836
+ attr_accessor live_data: LiveData?
1837
+
1838
+ def self.find: (game: untyped) -> LiveFeed
1839
+ end
1840
+
1841
+ # GameContent classes
1842
+ class MediaPlayback < Shale::Mapper
1843
+ attr_accessor name: String?
1844
+ attr_accessor url: String?
1845
+ end
1846
+
1847
+ class MediaCut < Shale::Mapper
1848
+ attr_accessor aspect_ratio: String?
1849
+ attr_accessor width: Integer?
1850
+ attr_accessor height: Integer?
1851
+ attr_accessor src: String?
1852
+ end
1853
+
1854
+ class MediaImage < Shale::Mapper
1855
+ attr_accessor title: String?
1856
+ attr_accessor cuts: Array[MediaCut]
1857
+ end
1858
+
1859
+ class Highlight < Shale::Mapper
1860
+ include Equalizer
1861
+
1862
+ attr_accessor id: String?
1863
+ attr_accessor type: String?
1864
+ attr_accessor headline: String?
1865
+ attr_accessor description: String?
1866
+ attr_accessor duration: String?
1867
+ attr_accessor playbacks: Array[MediaPlayback]
1868
+ attr_accessor image: MediaImage?
1869
+ end
1870
+
1871
+ class HighlightsSection < Shale::Mapper
1872
+ attr_accessor highlights: Array[Highlight]
1873
+ end
1874
+
1875
+ class GameContentMedia < Shale::Mapper
1876
+ attr_accessor free_game: bool?
1877
+ attr_accessor enhanced_game: bool?
1878
+ end
1879
+
1880
+ class GameContent < Shale::Mapper
1881
+ attr_accessor link: String?
1882
+ attr_accessor media: GameContentMedia?
1883
+ attr_accessor highlights: HighlightsSection?
1884
+
1885
+ def self.find: (game: untyped) -> GameContent
1886
+ end
1887
+
1888
+ # HomeRunDerby classes
1889
+ class DerbyHomeRun < Shale::Mapper
1890
+ attr_accessor total_distance: Integer?
1891
+ attr_accessor launch_speed: Float?
1892
+ attr_accessor launch_angle: Float?
1893
+ attr_accessor is_bonus_time: bool?
1894
+
1895
+ def bonus_time?: () -> bool?
1896
+ end
1897
+
1898
+ class DerbyBatter < Shale::Mapper
1899
+ include Equalizer
1900
+
1901
+ attr_accessor id: Integer?
1902
+ attr_accessor full_name: String?
1903
+ attr_accessor link: String?
1904
+ attr_accessor seed: Integer?
1905
+ attr_accessor home_runs: Integer?
1906
+ attr_accessor is_winner: bool?
1907
+ attr_accessor is_bonus: bool?
1908
+ attr_accessor hits: Array[DerbyHomeRun]
1909
+
1910
+ def winner?: () -> bool?
1911
+ def bonus?: () -> bool?
1912
+ end
1913
+
1914
+ class DerbyMatchup < Shale::Mapper
1915
+ attr_accessor matchup_id: Integer?
1916
+ attr_accessor top_seed: DerbyBatter?
1917
+ attr_accessor bottom_seed: DerbyBatter?
1918
+ end
1919
+
1920
+ class DerbyRound < Shale::Mapper
1921
+ attr_accessor round: Integer?
1922
+ attr_accessor num_batters: Integer?
1923
+ attr_accessor matchups: Array[DerbyMatchup]
1924
+ end
1925
+
1926
+ class DerbyInfo < Shale::Mapper
1927
+ attr_accessor id: Integer?
1928
+ attr_accessor name: String?
1929
+ end
1930
+
1931
+ class HomeRunDerby < Shale::Mapper
1932
+ attr_accessor info: DerbyInfo?
1933
+ attr_accessor rounds: Array[DerbyRound]
1934
+
1935
+ def self.find: (game: untyped) -> HomeRunDerby
1936
+ end
1937
+
1938
+ class UniformColor < Shale::Mapper
1939
+ attr_accessor name: String?
1940
+ attr_accessor hex: String?
1941
+ end
1942
+
1943
+ class UniformAsset < Shale::Mapper
1944
+ attr_accessor cap: String?
1945
+ attr_accessor jersey: String?
1946
+ end
1947
+
1948
+ class UniformInfo < Shale::Mapper
1949
+ include Equalizer
1950
+
1951
+ attr_accessor team_id: Integer?
1952
+ attr_accessor uniform_type: String?
1953
+ attr_accessor jersey_color: UniformColor?
1954
+ attr_accessor cap_color: UniformColor?
1955
+ attr_accessor assets: UniformAsset?
1956
+ end
1957
+
1958
+ class GameUniforms < Shale::Mapper
1959
+ attr_accessor away: UniformInfo?
1960
+ attr_accessor home: UniformInfo?
1961
+
1962
+ def self.find: (game: untyped) -> GameUniforms
1963
+ end
1964
+
1965
+ class TeamUniforms < Shale::Mapper
1966
+ attr_accessor uniforms: Array[UniformInfo]
1967
+
1968
+ def self.find: (team: untyped, ?season: Integer?) -> Array[UniformInfo]
1969
+ end
1970
+
1971
+ class PlayerStreak < Shale::Mapper
1972
+ include Equalizer
1973
+
1974
+ STREAK_HITTING: String
1975
+ STREAK_ON_BASE: String
1976
+
1977
+ attr_accessor player_id: Integer?
1978
+ attr_accessor player_name: String?
1979
+ attr_accessor streak_type: String?
1980
+ attr_accessor current_streak: Integer?
1981
+ attr_accessor current_streak_stat: String?
1982
+ attr_accessor team: Team?
1983
+
1984
+ def hitting_streak?: () -> bool
1985
+ def on_base_streak?: () -> bool
1986
+ end
1987
+
1988
+ class StreakCategory < Shale::Mapper
1989
+ CATEGORY_HITTING: String
1990
+ CATEGORY_ON_BASE: String
1991
+
1992
+ attr_accessor category_type: String?
1993
+ attr_accessor streaks: Array[PlayerStreak]
1994
+
1995
+ def hitting_streak?: () -> bool
1996
+ def on_base_streak?: () -> bool
1997
+ end
1998
+
1999
+ class Streaks < Shale::Mapper
2000
+ attr_accessor streak_stats: Array[StreakCategory]
2001
+
2002
+ def self.hitting: (?season: Integer?, ?limit: Integer) -> Array[PlayerStreak]
2003
+ def self.on_base: (?season: Integer?, ?limit: Integer) -> Array[PlayerStreak]
2004
+ def self.find: (streak_type: String, ?season: Integer?, ?limit: Integer) -> Array[PlayerStreak]
2005
+ end
2006
+
2007
+ class PlayerGameBattingStats < Shale::Mapper
2008
+ attr_accessor games_played: Integer?
2009
+ attr_accessor at_bats: Integer?
2010
+ attr_accessor runs: Integer?
2011
+ attr_accessor hits: Integer?
2012
+ attr_accessor doubles: Integer?
2013
+ attr_accessor triples: Integer?
2014
+ attr_accessor home_runs: Integer?
2015
+ attr_accessor rbi: Integer?
2016
+ attr_accessor stolen_bases: Integer?
2017
+ attr_accessor base_on_balls: Integer?
2018
+ attr_accessor strike_outs: Integer?
2019
+ end
2020
+
2021
+ class PlayerGamePitchingStats < Shale::Mapper
2022
+ attr_accessor games_played: Integer?
2023
+ attr_accessor games_started: Integer?
2024
+ attr_accessor wins: Integer?
2025
+ attr_accessor losses: Integer?
2026
+ attr_accessor saves: Integer?
2027
+ attr_accessor innings_pitched: String?
2028
+ attr_accessor hits: Integer?
2029
+ attr_accessor runs: Integer?
2030
+ attr_accessor earned_runs: Integer?
2031
+ attr_accessor home_runs: Integer?
2032
+ attr_accessor base_on_balls: Integer?
2033
+ attr_accessor strike_outs: Integer?
2034
+ attr_accessor number_of_pitches: Integer?
2035
+ end
2036
+
2037
+ class PlayerGameStatSplit < Shale::Mapper
2038
+ attr_accessor stat: untyped
2039
+ attr_accessor team: Team?
2040
+ attr_accessor player: Player?
2041
+ end
2042
+
2043
+ class PlayerGameStatGroup < Shale::Mapper
2044
+ attr_accessor group: String?
2045
+ attr_accessor splits: Array[PlayerGameStatSplit]
2046
+ end
2047
+
2048
+ class PlayerGameStats < Shale::Mapper
2049
+ attr_accessor stats: Array[PlayerGameStatGroup]
2050
+
2051
+ def self.find: (player: untyped, game: untyped) -> PlayerGameStats
2052
+ def batting: () -> PlayerGameBattingStats?
2053
+ def pitching: () -> PlayerGamePitchingStats?
185
2054
  end
186
2055
  end