-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathreq_soccerseason_fixtures.go
46 lines (39 loc) · 1.09 KB
/
req_soccerseason_fixtures.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package footballdata
import (
"fmt"
"time"
)
// DEPRECATED.
//
type SoccerSeasonFixturesRequest struct{ request }
// DEPRECATED.
//
// Matchday modifies the request to specify a match day.
func (r SoccerSeasonFixturesRequest) Matchday(matchday uint16) SoccerSeasonFixturesRequest {
r.urlValues.Set("matchday", fmt.Sprintf("%d", matchday))
return r
}
// DEPRECATED.
//
// TimeFrame modifies the request to specify a specific time frame.
func (r SoccerSeasonFixturesRequest) TimeFrame(timeframe time.Duration) SoccerSeasonFixturesRequest {
r.urlValues.Set("timeFrame", durationToTimeFrame(timeframe))
return r
}
// DEPRECATED.
//
// Do executes the request.
func (r SoccerSeasonFixturesRequest) Do() (s FixtureList, err error) {
d, _, err := r.doJson("GET")
if err != nil {
return
}
err = d.Decode(&s)
return
}
// DEPRECATED.
//
// FixturesOfSoccerSeason prepares a request to fetch the fixtures of a soccer season.
func (c *Client) FixturesOfSoccerSeason(soccerSeasonId uint64) SoccerSeasonFixturesRequest {
return SoccerSeasonFixturesRequest{c.req("soccerseasons/%d/fixtures", soccerSeasonId)}
}