query

package
v0.1.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GameQuery

type GameQuery struct {
	// contains filtered or unexported fields
}

GameQuery can be used to query the /games or /game Yahoo Fantasy endpoints.

func Game

func Game() *GameQuery

Game returns a GameQuery for the /game endpoint.

func Games

func Games() *GameQuery

Games returns a GameQuery for the /games endpoint.

func (*GameQuery) Codes

func (g *GameQuery) Codes(codes []string) *GameQuery

Codes adds the "game_codes" parameter with the given codes to the query. Any valid game code can be provided (incl. nba, nhl, nfl, mlb).

func (*GameQuery) Delete added in v0.1.9

func (q *GameQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*GameQuery) GameWeeks added in v0.1.4

func (g *GameQuery) GameWeeks() *GameQuery

GameWeeks adds the "game_weeks" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/game_weeks).

func (*GameQuery) Get

func (q *GameQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*GameQuery) IsAvailable

func (g *GameQuery) IsAvailable() *GameQuery

IsAvailable adds the "is_available" parameter to the query.

func (*GameQuery) Key

func (g *GameQuery) Key(key string) *GameQuery

Key sets the "game_keys" parameter to the the given key. When querying the /game endpoint the key will be appended to the query path (i.e. /game/<key>).

func (*GameQuery) Keys

func (g *GameQuery) Keys(keys []string) *GameQuery

Keys adds the "game_keys" parameter with the given keys to the query.

func (*GameQuery) Leagues

func (g *GameQuery) Leagues() *LeagueQuery

Leagues returns a LeagueQuery for the /leagues subresource.

func (*GameQuery) Players added in v0.1.4

func (g *GameQuery) Players() *PlayerQuery

Players returns a PlayerQuery for the /teams subresource.

func (*GameQuery) PositionTypes added in v0.1.4

func (g *GameQuery) PositionTypes() *GameQuery

PositionTypes adds the "positions_types" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/position_types).

func (*GameQuery) Post added in v0.1.9

func (q *GameQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*GameQuery) Put added in v0.1.9

func (q *GameQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*GameQuery) Reset

func (q *GameQuery) Reset()

func (*GameQuery) RosterPositions added in v0.1.4

func (g *GameQuery) RosterPositions() *GameQuery

RosterPositions adds the "roster_positions" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/roster_positions).

func (*GameQuery) Seasons

func (g *GameQuery) Seasons(seasons []int) *GameQuery

Seasons adds the "seasons" parameter with the given seasons to the query.

func (*GameQuery) StatCategories added in v0.1.4

func (g *GameQuery) StatCategories() *GameQuery

StatCategories adds the "stat_categories" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. game/stat_categories).

func (*GameQuery) Teams

func (g *GameQuery) Teams() *TeamQuery

Teams returns a TeamQuery for the /teams subresource.

func (*GameQuery) ToString

func (q *GameQuery) ToString() string

ToString generates the endpoint string for the query

func (*GameQuery) Types

func (g *GameQuery) Types(types []string) *GameQuery

Types adds the game_types parameter with the given types to the query. Valid game types are full|pickem-team|pickem-group|pickem-team-list.

type LeagueQuery

type LeagueQuery struct {
	// contains filtered or unexported fields
}

LeagueQuery can be used to query the /leagues or /league Yahoo Fantasy endpoints.

func League

func League() *LeagueQuery

League returns a LeagueQuery for the /league endpoint.

func Leagues

func Leagues() *LeagueQuery

Leagues returns a LeagueQuery for the /leagues endpoint.

func (*LeagueQuery) CurrentScoreboard

func (l *LeagueQuery) CurrentScoreboard() *LeagueQuery

CurrentScoreboard adds the "scoreboard" subresource to the request to query the scoreboard for the current week. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/scoreboard).

func (*LeagueQuery) Delete added in v0.1.9

func (q *LeagueQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*LeagueQuery) DraftResults added in v0.1.4

func (l *LeagueQuery) DraftResults() *LeagueQuery

DraftResults adds the "draftresults" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/draftresults).

func (*LeagueQuery) Get

func (q *LeagueQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*LeagueQuery) Key

func (l *LeagueQuery) Key(key string) *LeagueQuery

Key sets the league_keys parameter to the the given key. When querying the /league endpoint the key will be appended to the query path (i.e. /league/<key>).

func (*LeagueQuery) Keys

func (l *LeagueQuery) Keys(keys []string) *LeagueQuery

Keys adds the league_keys parameter with the given keys to the query.

func (*LeagueQuery) Players

func (l *LeagueQuery) Players() *PlayerQuery

Players returns a PlayerQuery for the /players subresource.

func (*LeagueQuery) PlayersWithDefaults added in v0.1.4

func (l *LeagueQuery) PlayersWithDefaults() *PlayerQuery

PlayersWithDefaults adds the "players" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/players).

func (*LeagueQuery) Post added in v0.1.9

func (q *LeagueQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*LeagueQuery) Put added in v0.1.9

func (q *LeagueQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*LeagueQuery) Reset

func (q *LeagueQuery) Reset()

func (*LeagueQuery) Scoreboard

func (l *LeagueQuery) Scoreboard(week int) *LeagueQuery

Scoreboard adds the "scoreboard" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/scoreboard). week is expected by Yahoo to be a positive integer.

func (*LeagueQuery) Settings

func (l *LeagueQuery) Settings() *LeagueQuery

Settings adds the "settings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/settings).

func (*LeagueQuery) Standings

func (l *LeagueQuery) Standings() *LeagueQuery

Standings adds the "standings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/standings).

func (*LeagueQuery) Teams

func (l *LeagueQuery) Teams() *TeamQuery

Teams returns a TeamQuery for the /teams subresource.

func (*LeagueQuery) TeamsWithDefaults added in v0.1.4

func (l *LeagueQuery) TeamsWithDefaults() *TeamQuery

TeamsWithDefaults adds the "teams" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/teams).

func (*LeagueQuery) ToString

func (q *LeagueQuery) ToString() string

ToString generates the endpoint string for the query

func (*LeagueQuery) Transactions added in v0.1.4

func (l *LeagueQuery) Transactions() *TransactionQuery

Transactions returns a TransactionQuery for the /transactions subresource.

func (*LeagueQuery) TransactionsWithDefaults added in v0.1.4

func (l *LeagueQuery) TransactionsWithDefaults() *TransactionQuery

TransactionsWithDefaults adds the "teams" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. league/transactions).

type PlayerQuery

type PlayerQuery struct {
	// contains filtered or unexported fields
}

PlayerQuery can be used to query the /players or /player Yahoo Fantasy endpoints.

func Player

func Player() *PlayerQuery

Player returns a PlayerQuery for the /player endpoint.

func Players

func Players() *PlayerQuery

Players returns a PlayerQuery for the /players endpoint.

func (*PlayerQuery) Count

func (p *PlayerQuery) Count(count int) *PlayerQuery

Count adds the "count" parameter with the provided count to the query. count is expected by Yahoo to be a positive integer.

func (*PlayerQuery) Delete added in v0.1.9

func (q *PlayerQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*PlayerQuery) DraftAnalysis added in v0.1.4

func (p *PlayerQuery) DraftAnalysis() *PlayerQuery

DraftAnalysis adds the "draft_analysis" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/draft_analysis).

func (*PlayerQuery) Get

func (q *PlayerQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*PlayerQuery) Key

func (p *PlayerQuery) Key(key string) *PlayerQuery

Key sets the "player_keys" parameter to the the given key. When querying the /game endpoint the key will be appended to the query path (i.e. /player/<key>).

func (*PlayerQuery) Keys

func (p *PlayerQuery) Keys(keys []string) *PlayerQuery

Keys adds the "player_keys" parameter with the given keys to the query.

func (*PlayerQuery) Ownership added in v0.1.4

func (p *PlayerQuery) Ownership() *PlayerQuery

Ownership adds the "ownership" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/ownership).

func (*PlayerQuery) PercentOwned added in v0.1.4

func (p *PlayerQuery) PercentOwned() *PlayerQuery

PercentOwned adds the "percent_owned" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/percent_owned).

func (*PlayerQuery) Position

func (p *PlayerQuery) Position(pos string) *PlayerQuery

Position adds the "position" parameter with the provided position to the query. Valid player positions can be provided as input (e.x. "QB", "PG")

func (*PlayerQuery) Post added in v0.1.9

func (q *PlayerQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*PlayerQuery) Put added in v0.1.9

func (q *PlayerQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*PlayerQuery) Reset

func (q *PlayerQuery) Reset()

func (*PlayerQuery) Search

func (p *PlayerQuery) Search(name string) *PlayerQuery

Search adds the "search" parameter with the provided name to the query.

func (*PlayerQuery) Sort

func (p *PlayerQuery) Sort(sort string) *PlayerQuery

Sort adds the "sort" parameter with the provided sort criteria to the query. Valid inputs are: {stat_id} NAME (last, first) OR (overall rank) AR (actual rank) PTS (fantasy points)

func (*PlayerQuery) SortDate

func (p *PlayerQuery) SortDate(date string) *PlayerQuery

SortDate adds the "sort_date" parameter with the provided date to the query. date should be formatted as YYYY-MM-DD.

func (*PlayerQuery) SortSeason

func (p *PlayerQuery) SortSeason(season int) *PlayerQuery

SortSeason adds the "sort_season" parameter with the provided season to the query.

func (*PlayerQuery) SortType

func (p *PlayerQuery) SortType(sortType string) *PlayerQuery

SortType adds the "sort_type" parameter with the provided type to the query. Valid types are: season date (baseball, basketball, and hockey only) week (football only) lastweek (baseball, basketball, and hockey only) lastmonth

func (*PlayerQuery) SortWeek

func (p *PlayerQuery) SortWeek(week int) *PlayerQuery

SortWeek adds the "sort_week" parameter with the provided week to the query. Yahoo only supports this parameter for football. week is expected by Yahoo to be a positive integer.

func (*PlayerQuery) Start

func (p *PlayerQuery) Start(start int) *PlayerQuery

Start adds the "start" parameter with the provided start to the query. start is expected by Yahoo to be a positive integer.

func (*PlayerQuery) Stats

func (p *PlayerQuery) Stats() *StatsQuery

Stats returns a StatsQuery for the /stats subresource.

func (*PlayerQuery) StatsWithDefaults added in v0.1.4

func (p *PlayerQuery) StatsWithDefaults() *PlayerQuery

StatsWithDefaults adds the "stats" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. player/stats).

func (*PlayerQuery) Status

func (p *PlayerQuery) Status(status string) *PlayerQuery

Status adds the "status" parameter with the provided status to the query. Valid statuses are: A (all available players) FA (free agents only) W (waivers only) T (all taken players) K (keepers only)

func (*PlayerQuery) ToString

func (q *PlayerQuery) ToString() string

ToString generates the endpoint string for the query

type StatsQuery

type StatsQuery struct {
	// contains filtered or unexported fields
}

StatsQuery can be used to query the /stats endpoint.

func Stats

func Stats() *StatsQuery

Stats returns a StatsQuery for the /stats subresource endpoint.

func (*StatsQuery) CurrentSeason

func (s *StatsQuery) CurrentSeason() *StatsQuery

CurrentSeason adds the "type=season" parameter to the query.

func (*StatsQuery) CurrentSeasonAverage

func (s *StatsQuery) CurrentSeasonAverage() *StatsQuery

CurrentSeasonAverage adds the "type=average_season" parameter to the query.

func (*StatsQuery) Day

func (s *StatsQuery) Day(date string) *StatsQuery

Day adds the "type=date" parameter and "date" parameter with the provided date to the query. date is expected to be formatted as YYYY-MM-DD.

func (*StatsQuery) Delete added in v0.1.9

func (q *StatsQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*StatsQuery) Get

func (q *StatsQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*StatsQuery) LastMonth

func (s *StatsQuery) LastMonth() *StatsQuery

LastMonth adds the "type=lastmonth" parameter to the query.

func (*StatsQuery) LastMonthAverage added in v0.1.7

func (s *StatsQuery) LastMonthAverage() *StatsQuery

LastMonthAverage adds the "type=average_lastmonth" parameter to the query.

func (*StatsQuery) LastWeek

func (s *StatsQuery) LastWeek() *StatsQuery

LastWeek adds the "type=lastweek" parameter to the query.

func (*StatsQuery) LastWeekAverage added in v0.1.7

func (s *StatsQuery) LastWeekAverage() *StatsQuery

LastWeekAverage adds the "type=average_lastweek" parameter to the query.

func (*StatsQuery) Post added in v0.1.9

func (q *StatsQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*StatsQuery) Put added in v0.1.9

func (q *StatsQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*StatsQuery) Reset

func (q *StatsQuery) Reset()

func (*StatsQuery) Season

func (s *StatsQuery) Season(season int) *StatsQuery

Season adds the "type=season" parameter and "season" parameter with the provided season to the query.

func (*StatsQuery) SeasonAverage

func (s *StatsQuery) SeasonAverage(season int) *StatsQuery

SeasonAverage adds the "type=average_season" parameter and "season" parameter with the provided season to the query.

func (*StatsQuery) ToString

func (q *StatsQuery) ToString() string

ToString generates the endpoint string for the query

func (*StatsQuery) Today

func (s *StatsQuery) Today() *StatsQuery

Today adds the "type=date" parameter to the query.

type TeamQuery

type TeamQuery struct {
	// contains filtered or unexported fields
}

TeamQuery can be used to query the /teams or /team Yahoo Fantasy resource.

func Team

func Team() *TeamQuery

Team returns a TeamQuery for the /team endpoint.

func Teams

func Teams() *TeamQuery

Teams returns a TeamQuery for the /teams endpoint.

func (*TeamQuery) AllMatchups

func (t *TeamQuery) AllMatchups() *TeamQuery

AllMatchups adds the "matchups" subresource to the request to request for all matchups. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/matchups).

func (*TeamQuery) Delete added in v0.1.9

func (q *TeamQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamQuery) DraftResults added in v0.1.4

func (t *TeamQuery) DraftResults() *TeamQuery

DraftResults adds the "draftresults" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/draftresults).

func (*TeamQuery) Get

func (q *TeamQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*TeamQuery) Key

func (t *TeamQuery) Key(key string) *TeamQuery

Key sets the "team_keys" parameter to the the given key. When querying the /team endpoint the key will be appended to the query path (i.e. /team/<key>).

func (*TeamQuery) Keys

func (t *TeamQuery) Keys(keys []string) *TeamQuery

Keys adds the "team_keys" parameter with the given keys to the query.

func (*TeamQuery) Matchups

func (t *TeamQuery) Matchups(weeks []int) *TeamQuery

Matchups adds the "matchups" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/matchups). weeks is expected by Yahoo to contain positive integers.

func (*TeamQuery) Post added in v0.1.9

func (q *TeamQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamQuery) Put added in v0.1.9

func (q *TeamQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamQuery) Reset

func (q *TeamQuery) Reset()

func (*TeamQuery) Roster

func (t *TeamQuery) Roster() *TeamQuery

Roster adds the "roster" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/roster).

func (*TeamQuery) RosterDay

func (t *TeamQuery) RosterDay(date string) *TeamRosterQuery

RosterDay returns a TeamRosterQuery for the /roster subresource with the "date" parameter set to the provided date. date is expected to be formatted as YYYY-MM-DD.

func (*TeamQuery) RosterWeek

func (t *TeamQuery) RosterWeek(week int) *TeamRosterQuery

RosterWeek returns a TeamRosterQuery for the /roster subresource with the "week" parameter set to the provided week. week is expected by Yahoo to be a positive integer.

func (*TeamQuery) Standings added in v0.1.4

func (t *TeamQuery) Standings() *TeamQuery

Standings adds the "standings" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/standings).

func (*TeamQuery) Stats

func (t *TeamQuery) Stats() *StatsQuery

Stats returns a StatsQuery for the /stats subresource.

func (*TeamQuery) StatsWithDefaults added in v0.1.4

func (t *TeamQuery) StatsWithDefaults() *TeamQuery

StatsWithDefaults adds the "stats" subresource to the request. If combined with other subresources, they are all combined into the "out" parameter, otherwise it is added to the request path (i.e. team/stats).

func (*TeamQuery) ToString

func (q *TeamQuery) ToString() string

ToString generates the endpoint string for the query

type TeamRosterQuery

type TeamRosterQuery struct {
	// contains filtered or unexported fields
}

TeamRosterQuery can be used to query the /roster subresource of Game resource.

func (*TeamRosterQuery) Delete added in v0.1.9

func (q *TeamRosterQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamRosterQuery) Get

func (q *TeamRosterQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*TeamRosterQuery) Post added in v0.1.9

func (q *TeamRosterQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamRosterQuery) Put added in v0.1.9

func (q *TeamRosterQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TeamRosterQuery) Reset

func (q *TeamRosterQuery) Reset()

func (*TeamRosterQuery) ToString

func (q *TeamRosterQuery) ToString() string

ToString generates the endpoint string for the query

type TransactionQuery

type TransactionQuery struct {
	// contains filtered or unexported fields
}

TransactionQuery can be used to query the /transactions or /transaction Yahoo Fantasy endpoints.

func Transaction

func Transaction() *TransactionQuery

Transaction returns a TransactionQuery for the /transaction endpoint.

func Transactions

func Transactions() *TransactionQuery

Transactions returns a TransactionQuery for the /transactions endpoint.

func (*TransactionQuery) AcceptTrade added in v0.1.9

func (t *TransactionQuery) AcceptTrade(transactionKey, note string) *TransactionQuery

AcceptTrade set the payload of the query to perform an accept trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) Add added in v0.1.9

func (t *TransactionQuery) Add(teamKey, playerKey string) *TransactionQuery

Add sets the payload of the query to an "add" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.

func (*TransactionQuery) AddDrop added in v0.1.9

func (t *TransactionQuery) AddDrop(teamKey, addPlayerKey, dropPlayerKey string) *TransactionQuery

AddDrop sets the payload of the query to an "add/drop" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.

func (*TransactionQuery) AllowTrade added in v0.1.9

func (t *TransactionQuery) AllowTrade(transactionKey string) *TransactionQuery

AllowTrade set the payload of the query to perform an allow trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) CancelTrade added in v0.1.9

func (t *TransactionQuery) CancelTrade(transactionKey string) *TransactionQuery

CancelTrade set the payload of the query to perform a cancel trade action. Use the Delete method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) CancelWaiverClaim added in v0.1.9

func (t *TransactionQuery) CancelWaiverClaim(transactionKey string) *TransactionQuery

CancelWaiverClaim set the payload of the query to perform a cancel waiver claim action. Use the Delete method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) Count

func (t *TransactionQuery) Count(count int) *TransactionQuery

Count adds the "count" parameter with the given count to the query. count is expected by Yahoo to be a positive integer.

func (*TransactionQuery) Delete added in v0.1.9

func (q *TransactionQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TransactionQuery) DisallowTrade added in v0.1.9

func (t *TransactionQuery) DisallowTrade(transactionKey string) *TransactionQuery

DisallowTrade set the payload of the query to perform a disallow trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) Drop added in v0.1.9

func (t *TransactionQuery) Drop(teamKey, playerKey string) *TransactionQuery

Drop sets the payload of the query to a "drop" transaction. Use the Post method to send the payload. This payload works with the /transactions endpoint.

func (*TransactionQuery) Get

func (q *TransactionQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*TransactionQuery) Key

Key sets the "transaction_keys" parameter to the the given key. When querying the /transaction endpoint the key will be appended to the query path (i.e. /transaction/<key>).

func (*TransactionQuery) Keys

func (t *TransactionQuery) Keys(keys []string) *TransactionQuery

Keys adds the "transaction_keys" parameter with the given keys to the query.

func (*TransactionQuery) Post added in v0.1.9

func (q *TransactionQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TransactionQuery) Put added in v0.1.9

func (q *TransactionQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*TransactionQuery) RejectTrade added in v0.1.9

func (t *TransactionQuery) RejectTrade(transactionKey, note string) *TransactionQuery

RejectTrade set the payload of the query to perform a reject trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) Reset

func (q *TransactionQuery) Reset()

func (*TransactionQuery) TeamKey

func (t *TransactionQuery) TeamKey(key string) *TransactionQuery

TeamKey adds the "team_key" parameter with the provided key to the query.

func (*TransactionQuery) ToString

func (q *TransactionQuery) ToString() string

ToString generates the endpoint string for the query

func (*TransactionQuery) Types

func (t *TransactionQuery) Types(types []string) *TransactionQuery

Types sets the "transaction_types" parameter with the given types to the query. Valid types are add,drop,commish,trade.

func (*TransactionQuery) UpdateWaiverClaim added in v0.1.9

func (t *TransactionQuery) UpdateWaiverClaim(transactionKey string, priority, faab int) *TransactionQuery

UpdateWaiverClaim set the payload of the query to perform a waiver claim update on priority and FAAB. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) UpdateWaiverClaimFAAB added in v0.1.9

func (t *TransactionQuery) UpdateWaiverClaimFAAB(transactionKey string, faab int) *TransactionQuery

UpdateWaiverClaimFAAB set the payload of the query to perform a waiver claim update on FAAB. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) UpdateWaiverClaimPriority added in v0.1.9

func (t *TransactionQuery) UpdateWaiverClaimPriority(transactionKey string, priority int) *TransactionQuery

UpdateWaiverClaimPriority set the payload of the query to perform a waiver claim update on priority. Use the Put method to send this payload. This payload works with the /transaction endpoint.

func (*TransactionQuery) VoteAgainstTrade added in v0.1.9

func (t *TransactionQuery) VoteAgainstTrade(transactionKey, voterTeamKey string) *TransactionQuery

VoteAgainstTrade set the payload of the query to perform a vote against trade action. Use the Put method to send this payload. This payload works with the /transaction endpoint.

type UserQuery

type UserQuery struct {
	// contains filtered or unexported fields
}

UserQuery can be used to query the /users Yahoo Fantasy endpoint.

func Users

func Users() *UserQuery

Users returns a UserQuery for the /users endpoint.

func (*UserQuery) Delete added in v0.1.9

func (q *UserQuery) Delete(client *http.Client) (*schema.FantasyContent, error)

Delete sends a "DELETE" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*UserQuery) Games

func (u *UserQuery) Games() *GameQuery

Games returns a GameQuery for the /games subresource.

func (*UserQuery) Get

func (q *UserQuery) Get(client *http.Client) (*schema.FantasyContent, error)

Get sends a "GET" request to the Yahoo Fantasy endpoint that the query would generate using the provided client.

func (*UserQuery) Leagues

func (u *UserQuery) Leagues() *LeagueQuery

Leagues returns a GameQuery for the /leagues subresource.

func (*UserQuery) Post added in v0.1.9

func (q *UserQuery) Post(client *http.Client) (*schema.FantasyContent, error)

Post sends a "POST" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*UserQuery) Put added in v0.1.9

func (q *UserQuery) Put(client *http.Client) (*schema.FantasyContent, error)

Put sends a "PUT" request to the Yahoo Fantasy endpoint that the query would generate using the provided client along with the payload.

func (*UserQuery) Reset

func (q *UserQuery) Reset()

func (*UserQuery) Teams

func (u *UserQuery) Teams() *TeamQuery

Teams returns a TeamQuery for the /teams subresource.

func (*UserQuery) ToString

func (q *UserQuery) ToString() string

ToString generates the endpoint string for the query

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL