2016-06-12 22:39:00 +00:00
|
|
|
package footballdata
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type SoccerSeasonsRequest struct{ request }
|
|
|
|
|
2016-06-25 10:15:58 +00:00
|
|
|
// Season Modifies the request to specify a season.
|
2016-06-12 22:39:00 +00:00
|
|
|
func (r SoccerSeasonsRequest) Season(num uint32) SoccerSeasonsRequest {
|
2016-06-25 10:15:58 +00:00
|
|
|
r.urlValues.Set("season", fmt.Sprintf("%d", num))
|
2016-06-12 22:39:00 +00:00
|
|
|
return r
|
|
|
|
}
|
|
|
|
|
2016-06-25 10:15:58 +00:00
|
|
|
// Do Executes the request.
|
2016-06-12 22:39:00 +00:00
|
|
|
func (r SoccerSeasonsRequest) Do() (s SoccerSeasonList, err error) {
|
|
|
|
d, _, err := r.doJson("GET")
|
|
|
|
if err != nil {
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
err = d.Decode(&s)
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
2016-06-25 10:15:58 +00:00
|
|
|
// SoccerSeasons Prepares a request to fetch the complete list of soccer seasons.
|
|
|
|
func (c *client) SoccerSeasons() SoccerSeasonsRequest {
|
2016-06-12 22:39:00 +00:00
|
|
|
return SoccerSeasonsRequest{c.req("soccerseasons")}
|
|
|
|
}
|