sports-odds-api 1.2.3 → 1.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -0
- data/lib/sports_odds_api/client.rb +28 -1
- data/lib/sports_odds_api/internal/transport/base_client.rb +5 -0
- data/lib/sports_odds_api/internal/util.rb +53 -7
- data/lib/sports_odds_api/models/event.rb +197 -4
- data/lib/sports_odds_api/models/event_get_params.rb +22 -4
- data/lib/sports_odds_api/models/market.rb +206 -0
- data/lib/sports_odds_api/models/market_get_params.rb +150 -0
- data/lib/sports_odds_api/models/player_get_params.rb +3 -3
- data/lib/sports_odds_api/models/team.rb +107 -2
- data/lib/sports_odds_api/models/team_get_params.rb +3 -3
- data/lib/sports_odds_api/models.rb +4 -0
- data/lib/sports_odds_api/resources/account.rb +1 -0
- data/lib/sports_odds_api/resources/events.rb +11 -3
- data/lib/sports_odds_api/resources/leagues.rb +3 -1
- data/lib/sports_odds_api/resources/markets.rb +87 -0
- data/lib/sports_odds_api/resources/players.rb +4 -2
- data/lib/sports_odds_api/resources/sports.rb +1 -0
- data/lib/sports_odds_api/resources/stats.rb +3 -1
- data/lib/sports_odds_api/resources/stream.rb +3 -1
- data/lib/sports_odds_api/resources/teams.rb +4 -2
- data/lib/sports_odds_api/version.rb +1 -1
- data/lib/sports_odds_api.rb +3 -0
- data/rbi/sports_odds_api/client.rbi +12 -0
- data/rbi/sports_odds_api/internal/util.rbi +28 -0
- data/rbi/sports_odds_api/models/event.rbi +387 -3
- data/rbi/sports_odds_api/models/event_get_params.rbi +30 -4
- data/rbi/sports_odds_api/models/market.rbi +326 -0
- data/rbi/sports_odds_api/models/market_get_params.rbi +224 -0
- data/rbi/sports_odds_api/models/player_get_params.rbi +4 -4
- data/rbi/sports_odds_api/models/team.rbi +186 -3
- data/rbi/sports_odds_api/models/team_get_params.rbi +4 -4
- data/rbi/sports_odds_api/models.rbi +4 -0
- data/rbi/sports_odds_api/resources/account.rbi +1 -0
- data/rbi/sports_odds_api/resources/events.rbi +11 -2
- data/rbi/sports_odds_api/resources/leagues.rbi +1 -0
- data/rbi/sports_odds_api/resources/markets.rbi +79 -0
- data/rbi/sports_odds_api/resources/players.rbi +3 -2
- data/rbi/sports_odds_api/resources/sports.rbi +1 -0
- data/rbi/sports_odds_api/resources/stats.rbi +1 -0
- data/rbi/sports_odds_api/resources/stream.rbi +1 -0
- data/rbi/sports_odds_api/resources/teams.rbi +3 -2
- data/sig/sports_odds_api/client.rbs +2 -0
- data/sig/sports_odds_api/internal/util.rbs +14 -0
- data/sig/sports_odds_api/models/event.rbs +246 -3
- data/sig/sports_odds_api/models/event_get_params.rbs +14 -0
- data/sig/sports_odds_api/models/market.rbs +186 -0
- data/sig/sports_odds_api/models/market_get_params.rbs +133 -0
- data/sig/sports_odds_api/models/team.rbs +130 -3
- data/sig/sports_odds_api/models.rbs +4 -0
- data/sig/sports_odds_api/resources/events.rbs +2 -0
- data/sig/sports_odds_api/resources/markets.rbs +27 -0
- metadata +25 -2
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SportsOddsAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SportsOddsAPI::Resources::Markets#get
|
|
6
|
+
class Market < SportsOddsAPI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute active_events
|
|
8
|
+
# The number of unique active events with available odds for this market across
|
|
9
|
+
# all supported league and bookmaker combinations.
|
|
10
|
+
#
|
|
11
|
+
# @return [Float, nil]
|
|
12
|
+
optional :active_events, Float, api_name: :activeEvents
|
|
13
|
+
|
|
14
|
+
# @!attribute bet_type_id
|
|
15
|
+
# The type of bet
|
|
16
|
+
#
|
|
17
|
+
# @return [String, nil]
|
|
18
|
+
optional :bet_type_id, String, api_name: :betTypeID
|
|
19
|
+
|
|
20
|
+
# @!attribute is_main_derivative
|
|
21
|
+
# True if this is a sub-period of a main market
|
|
22
|
+
#
|
|
23
|
+
# @return [Boolean, nil]
|
|
24
|
+
optional :is_main_derivative, SportsOddsAPI::Internal::Type::Boolean, api_name: :isMainDerivative
|
|
25
|
+
|
|
26
|
+
# @!attribute is_main_market
|
|
27
|
+
# True if this is a main market
|
|
28
|
+
#
|
|
29
|
+
# @return [Boolean, nil]
|
|
30
|
+
optional :is_main_market, SportsOddsAPI::Internal::Type::Boolean, api_name: :isMainMarket
|
|
31
|
+
|
|
32
|
+
# @!attribute is_prop
|
|
33
|
+
# True if this is a prop bet
|
|
34
|
+
#
|
|
35
|
+
# @return [Boolean, nil]
|
|
36
|
+
optional :is_prop, SportsOddsAPI::Internal::Type::Boolean, api_name: :isProp
|
|
37
|
+
|
|
38
|
+
# @!attribute is_sub_period
|
|
39
|
+
# True if this market is for a sub-period
|
|
40
|
+
#
|
|
41
|
+
# @return [Boolean, nil]
|
|
42
|
+
optional :is_sub_period, SportsOddsAPI::Internal::Type::Boolean, api_name: :isSubPeriod
|
|
43
|
+
|
|
44
|
+
# @!attribute is_supported
|
|
45
|
+
# True if this market is supported by at least one league/bookmaker.
|
|
46
|
+
#
|
|
47
|
+
# @return [Boolean, nil]
|
|
48
|
+
optional :is_supported, SportsOddsAPI::Internal::Type::Boolean, api_name: :isSupported
|
|
49
|
+
|
|
50
|
+
# @!attribute market_group_id
|
|
51
|
+
# The unique identifier for the group (all sides of the market) this market
|
|
52
|
+
# belongs to
|
|
53
|
+
#
|
|
54
|
+
# @return [String, nil]
|
|
55
|
+
optional :market_group_id, String, api_name: :marketGroupID
|
|
56
|
+
|
|
57
|
+
# @!attribute market_group_name
|
|
58
|
+
# The primary display name for this market's group
|
|
59
|
+
#
|
|
60
|
+
# @return [String, nil]
|
|
61
|
+
optional :market_group_name, String, api_name: :marketGroupName
|
|
62
|
+
|
|
63
|
+
# @!attribute market_group_name_alias
|
|
64
|
+
# An alternative display name for this market's group
|
|
65
|
+
#
|
|
66
|
+
# @return [String, nil]
|
|
67
|
+
optional :market_group_name_alias, String, api_name: :marketGroupNameAlias
|
|
68
|
+
|
|
69
|
+
# @!attribute market_group_name_by_sport
|
|
70
|
+
# Sport-specific market group names when they differ from the primary name
|
|
71
|
+
#
|
|
72
|
+
# @return [Hash{Symbol=>String}, nil]
|
|
73
|
+
optional :market_group_name_by_sport,
|
|
74
|
+
SportsOddsAPI::Internal::Type::HashOf[String],
|
|
75
|
+
api_name: :marketGroupNameBySport
|
|
76
|
+
|
|
77
|
+
# @!attribute odd_id
|
|
78
|
+
# The unique identifier for this market
|
|
79
|
+
#
|
|
80
|
+
# @return [String, nil]
|
|
81
|
+
optional :odd_id, String, api_name: :oddID
|
|
82
|
+
|
|
83
|
+
# @!attribute period_id
|
|
84
|
+
# The period of the event this market applies to
|
|
85
|
+
#
|
|
86
|
+
# @return [String, nil]
|
|
87
|
+
optional :period_id, String, api_name: :periodID
|
|
88
|
+
|
|
89
|
+
# @!attribute player_id
|
|
90
|
+
# Set to a player's unique playerID if it's a player prop
|
|
91
|
+
#
|
|
92
|
+
# @return [String, nil]
|
|
93
|
+
optional :player_id, String, api_name: :playerID
|
|
94
|
+
|
|
95
|
+
# @!attribute prop_type
|
|
96
|
+
# The type of prop bet
|
|
97
|
+
#
|
|
98
|
+
# @return [Symbol, SportsOddsAPI::Models::Market::PropType, nil]
|
|
99
|
+
optional :prop_type, enum: -> { SportsOddsAPI::Market::PropType }, api_name: :propType
|
|
100
|
+
|
|
101
|
+
# @!attribute side_id
|
|
102
|
+
# The side of the bet
|
|
103
|
+
#
|
|
104
|
+
# @return [String, nil]
|
|
105
|
+
optional :side_id, String, api_name: :sideID
|
|
106
|
+
|
|
107
|
+
# @!attribute stat_entity_id
|
|
108
|
+
# The statEntityID represents whose performance on the stat is being evaluated
|
|
109
|
+
#
|
|
110
|
+
# @return [String, nil]
|
|
111
|
+
optional :stat_entity_id, String, api_name: :statEntityID
|
|
112
|
+
|
|
113
|
+
# @!attribute stat_id
|
|
114
|
+
# The statistic which is being evaluated as a part of this market
|
|
115
|
+
#
|
|
116
|
+
# @return [String, nil]
|
|
117
|
+
optional :stat_id, String, api_name: :statID
|
|
118
|
+
|
|
119
|
+
# @!attribute support
|
|
120
|
+
# Nested object showing which leagues and bookmakers support this market.
|
|
121
|
+
#
|
|
122
|
+
# @return [Hash{Symbol=>Hash{Symbol=>SportsOddsAPI::Models::Market::Support}}, nil]
|
|
123
|
+
optional :support,
|
|
124
|
+
-> { SportsOddsAPI::Internal::Type::HashOf[SportsOddsAPI::Internal::Type::HashOf[SportsOddsAPI::Market::Support]] }
|
|
125
|
+
|
|
126
|
+
# @!attribute team_id
|
|
127
|
+
# Set to team's unique teamID if it's a team prop for a tournament type event
|
|
128
|
+
#
|
|
129
|
+
# @return [String, nil]
|
|
130
|
+
optional :team_id, String, api_name: :teamID
|
|
131
|
+
|
|
132
|
+
# @!method initialize(active_events: nil, bet_type_id: nil, is_main_derivative: nil, is_main_market: nil, is_prop: nil, is_sub_period: nil, is_supported: nil, market_group_id: nil, market_group_name: nil, market_group_name_alias: nil, market_group_name_by_sport: nil, odd_id: nil, period_id: nil, player_id: nil, prop_type: nil, side_id: nil, stat_entity_id: nil, stat_id: nil, support: nil, team_id: nil)
|
|
133
|
+
# Some parameter documentations has been truncated, see
|
|
134
|
+
# {SportsOddsAPI::Models::Market} for more details.
|
|
135
|
+
#
|
|
136
|
+
# @param active_events [Float] The number of unique active events with available odds for this market across al
|
|
137
|
+
#
|
|
138
|
+
# @param bet_type_id [String] The type of bet
|
|
139
|
+
#
|
|
140
|
+
# @param is_main_derivative [Boolean] True if this is a sub-period of a main market
|
|
141
|
+
#
|
|
142
|
+
# @param is_main_market [Boolean] True if this is a main market
|
|
143
|
+
#
|
|
144
|
+
# @param is_prop [Boolean] True if this is a prop bet
|
|
145
|
+
#
|
|
146
|
+
# @param is_sub_period [Boolean] True if this market is for a sub-period
|
|
147
|
+
#
|
|
148
|
+
# @param is_supported [Boolean] True if this market is supported by at least one league/bookmaker.
|
|
149
|
+
#
|
|
150
|
+
# @param market_group_id [String] The unique identifier for the group (all sides of the market) this market belong
|
|
151
|
+
#
|
|
152
|
+
# @param market_group_name [String] The primary display name for this market's group
|
|
153
|
+
#
|
|
154
|
+
# @param market_group_name_alias [String] An alternative display name for this market's group
|
|
155
|
+
#
|
|
156
|
+
# @param market_group_name_by_sport [Hash{Symbol=>String}] Sport-specific market group names when they differ from the primary name
|
|
157
|
+
#
|
|
158
|
+
# @param odd_id [String] The unique identifier for this market
|
|
159
|
+
#
|
|
160
|
+
# @param period_id [String] The period of the event this market applies to
|
|
161
|
+
#
|
|
162
|
+
# @param player_id [String] Set to a player's unique playerID if it's a player prop
|
|
163
|
+
#
|
|
164
|
+
# @param prop_type [Symbol, SportsOddsAPI::Models::Market::PropType] The type of prop bet
|
|
165
|
+
#
|
|
166
|
+
# @param side_id [String] The side of the bet
|
|
167
|
+
#
|
|
168
|
+
# @param stat_entity_id [String] The statEntityID represents whose performance on the stat is being evaluated
|
|
169
|
+
#
|
|
170
|
+
# @param stat_id [String] The statistic which is being evaluated as a part of this market
|
|
171
|
+
#
|
|
172
|
+
# @param support [Hash{Symbol=>Hash{Symbol=>SportsOddsAPI::Models::Market::Support}}] Nested object showing which leagues and bookmakers support this market.
|
|
173
|
+
#
|
|
174
|
+
# @param team_id [String] Set to team's unique teamID if it's a team prop for a tournament type event
|
|
175
|
+
|
|
176
|
+
# The type of prop bet
|
|
177
|
+
#
|
|
178
|
+
# @see SportsOddsAPI::Models::Market#prop_type
|
|
179
|
+
module PropType
|
|
180
|
+
extend SportsOddsAPI::Internal::Type::Enum
|
|
181
|
+
|
|
182
|
+
GAME_PROP = :game_prop
|
|
183
|
+
TEAM_PROP = :team_prop
|
|
184
|
+
PLAYER_PROP = :player_prop
|
|
185
|
+
OTHER_PROP = :other_prop
|
|
186
|
+
|
|
187
|
+
# @!method self.values
|
|
188
|
+
# @return [Array<Symbol>]
|
|
189
|
+
end
|
|
190
|
+
|
|
191
|
+
class Support < SportsOddsAPI::Internal::Type::BaseModel
|
|
192
|
+
# @!attribute supported
|
|
193
|
+
# Whether this market is supported for the given league and bookmaker combination.
|
|
194
|
+
#
|
|
195
|
+
# @return [Boolean, nil]
|
|
196
|
+
optional :supported, SportsOddsAPI::Internal::Type::Boolean
|
|
197
|
+
|
|
198
|
+
# @!method initialize(supported: nil)
|
|
199
|
+
# Some parameter documentations has been truncated, see
|
|
200
|
+
# {SportsOddsAPI::Models::Market::Support} for more details.
|
|
201
|
+
#
|
|
202
|
+
# @param supported [Boolean] Whether this market is supported for the given league and bookmaker combination.
|
|
203
|
+
end
|
|
204
|
+
end
|
|
205
|
+
end
|
|
206
|
+
end
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module SportsOddsAPI
|
|
4
|
+
module Models
|
|
5
|
+
# @see SportsOddsAPI::Resources::Markets#get
|
|
6
|
+
class MarketGetParams < SportsOddsAPI::Internal::Type::BaseModel
|
|
7
|
+
extend SportsOddsAPI::Internal::Type::RequestParameters::Converter
|
|
8
|
+
include SportsOddsAPI::Internal::Type::RequestParameters
|
|
9
|
+
|
|
10
|
+
# @!attribute bet_type_id
|
|
11
|
+
# A single betTypeID or comma-separated list of betTypeIDs to filter Markets by
|
|
12
|
+
#
|
|
13
|
+
# @return [String, nil]
|
|
14
|
+
optional :bet_type_id, String
|
|
15
|
+
|
|
16
|
+
# @!attribute bookmaker_id
|
|
17
|
+
# A single bookmakerID or comma-separated list of bookmakerIDs to filter Markets
|
|
18
|
+
# by
|
|
19
|
+
#
|
|
20
|
+
# @return [String, nil]
|
|
21
|
+
optional :bookmaker_id, String
|
|
22
|
+
|
|
23
|
+
# @!attribute cursor
|
|
24
|
+
# The cursor for pagination. Use nextCursor from prior response.
|
|
25
|
+
#
|
|
26
|
+
# @return [String, nil]
|
|
27
|
+
optional :cursor, String
|
|
28
|
+
|
|
29
|
+
# @!attribute is_main_market
|
|
30
|
+
# Filter to only include main markets (main period moneyline, spread, and
|
|
31
|
+
# over/under)
|
|
32
|
+
#
|
|
33
|
+
# @return [Boolean, nil]
|
|
34
|
+
optional :is_main_market, SportsOddsAPI::Internal::Type::Boolean
|
|
35
|
+
|
|
36
|
+
# @!attribute is_prop
|
|
37
|
+
# Filter by whether it is any type of prop bet market
|
|
38
|
+
#
|
|
39
|
+
# @return [Boolean, nil]
|
|
40
|
+
optional :is_prop, SportsOddsAPI::Internal::Type::Boolean
|
|
41
|
+
|
|
42
|
+
# @!attribute is_sub_period
|
|
43
|
+
# Filter by whether it tracks a sub/non-main period
|
|
44
|
+
#
|
|
45
|
+
# @return [Boolean, nil]
|
|
46
|
+
optional :is_sub_period, SportsOddsAPI::Internal::Type::Boolean
|
|
47
|
+
|
|
48
|
+
# @!attribute is_supported
|
|
49
|
+
# Filter whether this market is fully supported by at least 1 bookmaker in at
|
|
50
|
+
# least 1 league. Defaults to true if not specified.
|
|
51
|
+
#
|
|
52
|
+
# @return [Boolean, nil]
|
|
53
|
+
optional :is_supported, SportsOddsAPI::Internal::Type::Boolean
|
|
54
|
+
|
|
55
|
+
# @!attribute league_id
|
|
56
|
+
# A single leagueID or comma-separated list of leagueIDs to filter Markets by
|
|
57
|
+
#
|
|
58
|
+
# @return [String, nil]
|
|
59
|
+
optional :league_id, String
|
|
60
|
+
|
|
61
|
+
# @!attribute limit
|
|
62
|
+
# The maximum number of Markets to return (default: 100, max: 10000)
|
|
63
|
+
#
|
|
64
|
+
# @return [Float, nil]
|
|
65
|
+
optional :limit, Float
|
|
66
|
+
|
|
67
|
+
# @!attribute odd_id
|
|
68
|
+
# A single oddID or comma-separated list of oddIDs. Used to specify specific
|
|
69
|
+
# Markets to return.
|
|
70
|
+
#
|
|
71
|
+
# @return [String, nil]
|
|
72
|
+
optional :odd_id, String
|
|
73
|
+
|
|
74
|
+
# @!attribute period_id
|
|
75
|
+
# A single periodID or comma-separated list of periodIDs to filter Markets by
|
|
76
|
+
#
|
|
77
|
+
# @return [String, nil]
|
|
78
|
+
optional :period_id, String
|
|
79
|
+
|
|
80
|
+
# @!attribute prop_type
|
|
81
|
+
# Filter by prop type (game_prop, team_prop, player_prop, other_prop)
|
|
82
|
+
#
|
|
83
|
+
# @return [String, nil]
|
|
84
|
+
optional :prop_type, String
|
|
85
|
+
|
|
86
|
+
# @!attribute side_id
|
|
87
|
+
# A single sideID or comma-separated list of sideIDs to filter Markets by
|
|
88
|
+
#
|
|
89
|
+
# @return [String, nil]
|
|
90
|
+
optional :side_id, String
|
|
91
|
+
|
|
92
|
+
# @!attribute sport_id
|
|
93
|
+
# A single sportID or comma-separated list of sportIDs to filter Markets by
|
|
94
|
+
#
|
|
95
|
+
# @return [String, nil]
|
|
96
|
+
optional :sport_id, String
|
|
97
|
+
|
|
98
|
+
# @!attribute stat_entity_id
|
|
99
|
+
# A single statEntityID or comma-separated list of statEntityIDs to filter Markets
|
|
100
|
+
# by
|
|
101
|
+
#
|
|
102
|
+
# @return [String, nil]
|
|
103
|
+
optional :stat_entity_id, String
|
|
104
|
+
|
|
105
|
+
# @!attribute stat_id
|
|
106
|
+
# A single statID or comma-separated list of statIDs to filter Markets by
|
|
107
|
+
#
|
|
108
|
+
# @return [String, nil]
|
|
109
|
+
optional :stat_id, String
|
|
110
|
+
|
|
111
|
+
# @!method initialize(bet_type_id: nil, bookmaker_id: nil, cursor: nil, is_main_market: nil, is_prop: nil, is_sub_period: nil, is_supported: nil, league_id: nil, limit: nil, odd_id: nil, period_id: nil, prop_type: nil, side_id: nil, sport_id: nil, stat_entity_id: nil, stat_id: nil, request_options: {})
|
|
112
|
+
# Some parameter documentations has been truncated, see
|
|
113
|
+
# {SportsOddsAPI::Models::MarketGetParams} for more details.
|
|
114
|
+
#
|
|
115
|
+
# @param bet_type_id [String] A single betTypeID or comma-separated list of betTypeIDs to filter Markets by
|
|
116
|
+
#
|
|
117
|
+
# @param bookmaker_id [String] A single bookmakerID or comma-separated list of bookmakerIDs to filter Markets b
|
|
118
|
+
#
|
|
119
|
+
# @param cursor [String] The cursor for pagination. Use nextCursor from prior response.
|
|
120
|
+
#
|
|
121
|
+
# @param is_main_market [Boolean] Filter to only include main markets (main period moneyline, spread, and over/und
|
|
122
|
+
#
|
|
123
|
+
# @param is_prop [Boolean] Filter by whether it is any type of prop bet market
|
|
124
|
+
#
|
|
125
|
+
# @param is_sub_period [Boolean] Filter by whether it tracks a sub/non-main period
|
|
126
|
+
#
|
|
127
|
+
# @param is_supported [Boolean] Filter whether this market is fully supported by at least 1 bookmaker in at leas
|
|
128
|
+
#
|
|
129
|
+
# @param league_id [String] A single leagueID or comma-separated list of leagueIDs to filter Markets by
|
|
130
|
+
#
|
|
131
|
+
# @param limit [Float] The maximum number of Markets to return (default: 100, max: 10000)
|
|
132
|
+
#
|
|
133
|
+
# @param odd_id [String] A single oddID or comma-separated list of oddIDs. Used to specify specific Marke
|
|
134
|
+
#
|
|
135
|
+
# @param period_id [String] A single periodID or comma-separated list of periodIDs to filter Markets by
|
|
136
|
+
#
|
|
137
|
+
# @param prop_type [String] Filter by prop type (game_prop, team_prop, player_prop, other_prop)
|
|
138
|
+
#
|
|
139
|
+
# @param side_id [String] A single sideID or comma-separated list of sideIDs to filter Markets by
|
|
140
|
+
#
|
|
141
|
+
# @param sport_id [String] A single sportID or comma-separated list of sportIDs to filter Markets by
|
|
142
|
+
#
|
|
143
|
+
# @param stat_entity_id [String] A single statEntityID or comma-separated list of statEntityIDs to filter Markets
|
|
144
|
+
#
|
|
145
|
+
# @param stat_id [String] A single statID or comma-separated list of statIDs to filter Markets by
|
|
146
|
+
#
|
|
147
|
+
# @param request_options [SportsOddsAPI::RequestOptions, Hash{Symbol=>Object}]
|
|
148
|
+
end
|
|
149
|
+
end
|
|
150
|
+
end
|
|
@@ -8,8 +8,8 @@ module SportsOddsAPI
|
|
|
8
8
|
include SportsOddsAPI::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute cursor
|
|
11
|
-
# The cursor for the request. Used to get the next group of Players. This
|
|
12
|
-
#
|
|
11
|
+
# The cursor for the request. Used to get the next group of Players. This is an
|
|
12
|
+
# opaque token — pass the nextCursor value from the prior response unchanged.
|
|
13
13
|
#
|
|
14
14
|
# @return [String, nil]
|
|
15
15
|
optional :cursor, String
|
|
@@ -42,7 +42,7 @@ module SportsOddsAPI
|
|
|
42
42
|
# Some parameter documentations has been truncated, see
|
|
43
43
|
# {SportsOddsAPI::Models::PlayerGetParams} for more details.
|
|
44
44
|
#
|
|
45
|
-
# @param cursor [String] The cursor for the request. Used to get the next group of Players. This
|
|
45
|
+
# @param cursor [String] The cursor for the request. Used to get the next group of Players. This is an op
|
|
46
46
|
#
|
|
47
47
|
# @param event_id [String] EventID to get Players data for
|
|
48
48
|
#
|
|
@@ -4,6 +4,11 @@ module SportsOddsAPI
|
|
|
4
4
|
module Models
|
|
5
5
|
# @see SportsOddsAPI::Resources::Teams#get
|
|
6
6
|
class Team < SportsOddsAPI::Internal::Type::BaseModel
|
|
7
|
+
# @!attribute coach
|
|
8
|
+
#
|
|
9
|
+
# @return [SportsOddsAPI::Models::Team::Coach, nil]
|
|
10
|
+
optional :coach, -> { SportsOddsAPI::Team::Coach }
|
|
11
|
+
|
|
7
12
|
# @!attribute colors
|
|
8
13
|
#
|
|
9
14
|
# @return [SportsOddsAPI::Models::Team::Colors, nil]
|
|
@@ -29,6 +34,11 @@ module SportsOddsAPI
|
|
|
29
34
|
# @return [SportsOddsAPI::Models::Team::Names, nil]
|
|
30
35
|
optional :names, -> { SportsOddsAPI::Team::Names }
|
|
31
36
|
|
|
37
|
+
# @!attribute owner
|
|
38
|
+
#
|
|
39
|
+
# @return [SportsOddsAPI::Models::Team::Owner, nil]
|
|
40
|
+
optional :owner, -> { SportsOddsAPI::Team::Owner }
|
|
41
|
+
|
|
32
42
|
# @!attribute sport_id
|
|
33
43
|
#
|
|
34
44
|
# @return [String, nil]
|
|
@@ -44,15 +54,34 @@ module SportsOddsAPI
|
|
|
44
54
|
# @return [String, nil]
|
|
45
55
|
optional :team_id, String, api_name: :teamID
|
|
46
56
|
|
|
47
|
-
# @!
|
|
57
|
+
# @!attribute venue
|
|
58
|
+
#
|
|
59
|
+
# @return [SportsOddsAPI::Models::Team::Venue, nil]
|
|
60
|
+
optional :venue, -> { SportsOddsAPI::Team::Venue }
|
|
61
|
+
|
|
62
|
+
# @!method initialize(coach: nil, colors: nil, league_id: nil, logo: nil, lookups: nil, names: nil, owner: nil, sport_id: nil, standings: nil, team_id: nil, venue: nil)
|
|
63
|
+
# @param coach [SportsOddsAPI::Models::Team::Coach]
|
|
48
64
|
# @param colors [SportsOddsAPI::Models::Team::Colors]
|
|
49
65
|
# @param league_id [String]
|
|
50
66
|
# @param logo [String]
|
|
51
67
|
# @param lookups [SportsOddsAPI::Models::Team::Lookups]
|
|
52
68
|
# @param names [SportsOddsAPI::Models::Team::Names]
|
|
69
|
+
# @param owner [SportsOddsAPI::Models::Team::Owner]
|
|
53
70
|
# @param sport_id [String]
|
|
54
71
|
# @param standings [SportsOddsAPI::Models::Team::Standings]
|
|
55
72
|
# @param team_id [String]
|
|
73
|
+
# @param venue [SportsOddsAPI::Models::Team::Venue]
|
|
74
|
+
|
|
75
|
+
# @see SportsOddsAPI::Models::Team#coach
|
|
76
|
+
class Coach < SportsOddsAPI::Internal::Type::BaseModel
|
|
77
|
+
# @!attribute name
|
|
78
|
+
#
|
|
79
|
+
# @return [String, nil]
|
|
80
|
+
optional :name, String
|
|
81
|
+
|
|
82
|
+
# @!method initialize(name: nil)
|
|
83
|
+
# @param name [String]
|
|
84
|
+
end
|
|
56
85
|
|
|
57
86
|
# @see SportsOddsAPI::Models::Team#colors
|
|
58
87
|
class Colors < SportsOddsAPI::Internal::Type::BaseModel
|
|
@@ -117,8 +146,24 @@ module SportsOddsAPI
|
|
|
117
146
|
# @param short [String]
|
|
118
147
|
end
|
|
119
148
|
|
|
149
|
+
# @see SportsOddsAPI::Models::Team#owner
|
|
150
|
+
class Owner < SportsOddsAPI::Internal::Type::BaseModel
|
|
151
|
+
# @!attribute name
|
|
152
|
+
#
|
|
153
|
+
# @return [String, nil]
|
|
154
|
+
optional :name, String
|
|
155
|
+
|
|
156
|
+
# @!method initialize(name: nil)
|
|
157
|
+
# @param name [String]
|
|
158
|
+
end
|
|
159
|
+
|
|
120
160
|
# @see SportsOddsAPI::Models::Team#standings
|
|
121
161
|
class Standings < SportsOddsAPI::Internal::Type::BaseModel
|
|
162
|
+
# @!attribute last5
|
|
163
|
+
#
|
|
164
|
+
# @return [String, nil]
|
|
165
|
+
optional :last5, String
|
|
166
|
+
|
|
122
167
|
# @!attribute losses
|
|
123
168
|
#
|
|
124
169
|
# @return [Float, nil]
|
|
@@ -139,6 +184,11 @@ module SportsOddsAPI
|
|
|
139
184
|
# @return [String, nil]
|
|
140
185
|
optional :record, String
|
|
141
186
|
|
|
187
|
+
# @!attribute streak
|
|
188
|
+
#
|
|
189
|
+
# @return [Float, nil]
|
|
190
|
+
optional :streak, Float
|
|
191
|
+
|
|
142
192
|
# @!attribute ties
|
|
143
193
|
#
|
|
144
194
|
# @return [Float, nil]
|
|
@@ -149,14 +199,69 @@ module SportsOddsAPI
|
|
|
149
199
|
# @return [Float, nil]
|
|
150
200
|
optional :wins, Float
|
|
151
201
|
|
|
152
|
-
# @!method initialize(losses: nil, played: nil, position: nil, record: nil, ties: nil, wins: nil)
|
|
202
|
+
# @!method initialize(last5: nil, losses: nil, played: nil, position: nil, record: nil, streak: nil, ties: nil, wins: nil)
|
|
203
|
+
# @param last5 [String]
|
|
153
204
|
# @param losses [Float]
|
|
154
205
|
# @param played [Float]
|
|
155
206
|
# @param position [String]
|
|
156
207
|
# @param record [String]
|
|
208
|
+
# @param streak [Float]
|
|
157
209
|
# @param ties [Float]
|
|
158
210
|
# @param wins [Float]
|
|
159
211
|
end
|
|
212
|
+
|
|
213
|
+
# @see SportsOddsAPI::Models::Team#venue
|
|
214
|
+
class Venue < SportsOddsAPI::Internal::Type::BaseModel
|
|
215
|
+
# @!attribute address
|
|
216
|
+
#
|
|
217
|
+
# @return [String, nil]
|
|
218
|
+
optional :address, String
|
|
219
|
+
|
|
220
|
+
# @!attribute capacity
|
|
221
|
+
#
|
|
222
|
+
# @return [Float, nil]
|
|
223
|
+
optional :capacity, Float
|
|
224
|
+
|
|
225
|
+
# @!attribute city
|
|
226
|
+
#
|
|
227
|
+
# @return [String, nil]
|
|
228
|
+
optional :city, String
|
|
229
|
+
|
|
230
|
+
# @!attribute country_code
|
|
231
|
+
#
|
|
232
|
+
# @return [String, nil]
|
|
233
|
+
optional :country_code, String, api_name: :countryCode
|
|
234
|
+
|
|
235
|
+
# @!attribute country_name
|
|
236
|
+
#
|
|
237
|
+
# @return [String, nil]
|
|
238
|
+
optional :country_name, String, api_name: :countryName
|
|
239
|
+
|
|
240
|
+
# @!attribute name
|
|
241
|
+
#
|
|
242
|
+
# @return [String, nil]
|
|
243
|
+
optional :name, String
|
|
244
|
+
|
|
245
|
+
# @!attribute region_code
|
|
246
|
+
#
|
|
247
|
+
# @return [String, nil]
|
|
248
|
+
optional :region_code, String, api_name: :regionCode
|
|
249
|
+
|
|
250
|
+
# @!attribute region_name
|
|
251
|
+
#
|
|
252
|
+
# @return [String, nil]
|
|
253
|
+
optional :region_name, String, api_name: :regionName
|
|
254
|
+
|
|
255
|
+
# @!method initialize(address: nil, capacity: nil, city: nil, country_code: nil, country_name: nil, name: nil, region_code: nil, region_name: nil)
|
|
256
|
+
# @param address [String]
|
|
257
|
+
# @param capacity [Float]
|
|
258
|
+
# @param city [String]
|
|
259
|
+
# @param country_code [String]
|
|
260
|
+
# @param country_name [String]
|
|
261
|
+
# @param name [String]
|
|
262
|
+
# @param region_code [String]
|
|
263
|
+
# @param region_name [String]
|
|
264
|
+
end
|
|
160
265
|
end
|
|
161
266
|
end
|
|
162
267
|
end
|
|
@@ -8,8 +8,8 @@ module SportsOddsAPI
|
|
|
8
8
|
include SportsOddsAPI::Internal::Type::RequestParameters
|
|
9
9
|
|
|
10
10
|
# @!attribute cursor
|
|
11
|
-
# The cursor for the request. Used to get the next group of Teams. This
|
|
12
|
-
# the nextCursor from the prior response.
|
|
11
|
+
# The cursor for the request. Used to get the next group of Teams. This is an
|
|
12
|
+
# opaque token — pass the nextCursor value from the prior response unchanged.
|
|
13
13
|
#
|
|
14
14
|
# @return [String, nil]
|
|
15
15
|
optional :cursor, String
|
|
@@ -42,7 +42,7 @@ module SportsOddsAPI
|
|
|
42
42
|
# Some parameter documentations has been truncated, see
|
|
43
43
|
# {SportsOddsAPI::Models::TeamGetParams} for more details.
|
|
44
44
|
#
|
|
45
|
-
# @param cursor [String] The cursor for the request. Used to get the next group of Teams. This
|
|
45
|
+
# @param cursor [String] The cursor for the request. Used to get the next group of Teams. This is an opaq
|
|
46
46
|
#
|
|
47
47
|
# @param league_id [String] A single leagueID or comma-separated list of leagueIDs to get Teams for
|
|
48
48
|
#
|
|
@@ -54,6 +54,10 @@ module SportsOddsAPI
|
|
|
54
54
|
|
|
55
55
|
LeagueGetParams = SportsOddsAPI::Models::LeagueGetParams
|
|
56
56
|
|
|
57
|
+
Market = SportsOddsAPI::Models::Market
|
|
58
|
+
|
|
59
|
+
MarketGetParams = SportsOddsAPI::Models::MarketGetParams
|
|
60
|
+
|
|
57
61
|
Player = SportsOddsAPI::Models::Player
|
|
58
62
|
|
|
59
63
|
PlayerGetParams = SportsOddsAPI::Models::PlayerGetParams
|
|
@@ -2,19 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
module SportsOddsAPI
|
|
4
4
|
module Resources
|
|
5
|
+
# Get info about Events (includes odds, results, teams, and other metadata)
|
|
5
6
|
class Events
|
|
6
7
|
# Some parameter documentations has been truncated, see
|
|
7
8
|
# {SportsOddsAPI::Models::EventGetParams} for more details.
|
|
8
9
|
#
|
|
9
10
|
# Get a list of Events
|
|
10
11
|
#
|
|
11
|
-
# @overload get(bookmaker_id: nil, cancelled: nil, cursor: nil, ended: nil, event_id: nil, event_ids: nil, finalized: nil, include_alt_lines: nil, include_opposing_odds: nil, league_id: nil, limit: nil, live: nil, odd_id: nil, odds_available: nil, odds_present: nil, player_id: nil, sport_id: nil, started: nil, starts_after: nil, starts_before: nil, team_id: nil, type: nil, request_options: {})
|
|
12
|
+
# @overload get(bookmaker_id: nil, cancelled: nil, cursor: nil, ended: nil, event_id: nil, event_ids: nil, expand_results: nil, finalized: nil, include_alt_lines: nil, include_open_close_odds: nil, include_opposing_odds: nil, league_id: nil, limit: nil, live: nil, odd_id: nil, odds_available: nil, odds_present: nil, player_id: nil, sport_id: nil, started: nil, starts_after: nil, starts_before: nil, team_id: nil, type: nil, request_options: {})
|
|
12
13
|
#
|
|
13
14
|
# @param bookmaker_id [String] A bookmakerID or comma-separated list of bookmakerIDs to include odds for
|
|
14
15
|
#
|
|
15
16
|
# @param cancelled [Boolean] Only include cancelled Events (true), only non-cancelled Events (false) or all E
|
|
16
17
|
#
|
|
17
|
-
# @param cursor [String] The cursor for the request. Used to get the next group of Events. This
|
|
18
|
+
# @param cursor [String] The cursor for the request. Used to get the next group of Events. This is an opa
|
|
18
19
|
#
|
|
19
20
|
# @param ended [Boolean] Only include Events which have have ended (true), only Events which have not end
|
|
20
21
|
#
|
|
@@ -22,10 +23,14 @@ module SportsOddsAPI
|
|
|
22
23
|
#
|
|
23
24
|
# @param event_ids [String] A comma separated list of eventIDs to get Event data for
|
|
24
25
|
#
|
|
26
|
+
# @param expand_results [Boolean] Whether to expand the results object to include all stat values rather than just
|
|
27
|
+
#
|
|
25
28
|
# @param finalized [Boolean] Only include finalized Events (true), exclude unfinalized Events (false) or all
|
|
26
29
|
#
|
|
27
30
|
# @param include_alt_lines [Boolean] Whether to include alternate lines in the odds byBookmaker data
|
|
28
31
|
#
|
|
32
|
+
# @param include_open_close_odds [Boolean] Whether to include open and close odds values (openOdds, closeOdds, openSpread,
|
|
33
|
+
#
|
|
29
34
|
# @param include_opposing_odds [Boolean] Whether to include opposing odds for each included oddID
|
|
30
35
|
#
|
|
31
36
|
# @param league_id [String] A leagueID or comma-separated list of leagueIDs to get Events for
|
|
@@ -61,14 +66,17 @@ module SportsOddsAPI
|
|
|
61
66
|
# @see SportsOddsAPI::Models::EventGetParams
|
|
62
67
|
def get(params = {})
|
|
63
68
|
parsed, options = SportsOddsAPI::EventGetParams.dump_request(params)
|
|
69
|
+
query = SportsOddsAPI::Internal::Util.encode_query_params(parsed)
|
|
64
70
|
@client.request(
|
|
65
71
|
method: :get,
|
|
66
72
|
path: "events/",
|
|
67
|
-
query:
|
|
73
|
+
query: query.transform_keys(
|
|
68
74
|
bookmaker_id: "bookmakerID",
|
|
69
75
|
event_id: "eventID",
|
|
70
76
|
event_ids: "eventIDs",
|
|
77
|
+
expand_results: "expandResults",
|
|
71
78
|
include_alt_lines: "includeAltLines",
|
|
79
|
+
include_open_close_odds: "includeOpenCloseOdds",
|
|
72
80
|
include_opposing_odds: "includeOpposingOdds",
|
|
73
81
|
league_id: "leagueID",
|
|
74
82
|
odd_id: "oddID",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
module SportsOddsAPI
|
|
4
4
|
module Resources
|
|
5
|
+
# Get League-related data
|
|
5
6
|
class Leagues
|
|
6
7
|
# Get a list of Leagues
|
|
7
8
|
#
|
|
@@ -18,10 +19,11 @@ module SportsOddsAPI
|
|
|
18
19
|
# @see SportsOddsAPI::Models::LeagueGetParams
|
|
19
20
|
def get(params = {})
|
|
20
21
|
parsed, options = SportsOddsAPI::LeagueGetParams.dump_request(params)
|
|
22
|
+
query = SportsOddsAPI::Internal::Util.encode_query_params(parsed)
|
|
21
23
|
@client.request(
|
|
22
24
|
method: :get,
|
|
23
25
|
path: "leagues/",
|
|
24
|
-
query:
|
|
26
|
+
query: query.transform_keys(league_id: "leagueID", sport_id: "sportID"),
|
|
25
27
|
unwrap: :data,
|
|
26
28
|
model: SportsOddsAPI::Internal::Type::ArrayOf[SportsOddsAPI::League],
|
|
27
29
|
options: options
|