Beispiel #1
0
 /// <summary>
 /// Add/Drops Players
 /// </summary>
 /// <returns></returns>
 public async Task AddAndDropPlayerAsync(
     AuthModel auth,
     string leagueKey,
     MultiPlayerTransaction transaction
     )
 {
     await Utils.PostCollection(
         client,
         ApiEndpoints.TransactionsLeagueEndPoint(leagueKey),
         auth,
         transaction
         );
 }
 /// <summary>
 /// Get Player Resource with Draft Analysis Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/player/{playerKey}/draft_analysis
 /// </summary>
 /// <param name="playerKey">Player Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Player Resource</returns>
 public async Task <Player> GetDraftAnalysis(string playerKey, string AccessToken)
 {
     return(await Utils.GetResource <Player>(ApiEndpoints.PlayerEndPoint(playerKey, EndpointSubResources.DraftAnalysis), AccessToken, "game"));
 }
 /// <summary>
 /// Get Player Resource with Percent Owned Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/player/{playerKey}/precent_owned
 /// </summary>
 /// <param name="playerKey">Player Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Player Resource</returns>
 public async Task <Player> GetPercentOwned(string playerKey, string AccessToken)
 {
     return(await Utils.GetResource <Player>(ApiEndpoints.PlayerEndPoint(playerKey, EndpointSubResources.PercentOwned), AccessToken, "game"));
 }
 /// <summary>
 /// Get Player Resource with Ownership Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/player/{playerKey}/ownership
 /// </summary>
 /// <param name="playerKey">Player Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Player Resource</returns>
 public async Task <Player> GetOwnership(string[] playerKeys, string leagueKeys, string AccessToken)
 {
     return(await Utils.GetResource <Player>(ApiEndpoints.PlayerOwnershipEndPoint(playerKeys, leagueKeys), AccessToken, "game"));
 }
 /// <summary>
 /// Get League Resource with DraftResults Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/league/{leagueKey}/draft_results
 /// </summary>
 /// <param name="leagueKey">LeagueKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>League Resource</returns>
 public async Task <League> GetDraftResults(string leagueKey, string AccessToken)
 {
     return(await Utils.GetResource <League>(ApiEndpoints.LeagueEndPoint(leagueKey, EndpointSubResources.DraftResults), AccessToken, "league"));
 }
Beispiel #6
0
 /// <summary>
 /// Get User Resource with Game/Teams Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/users;use_login=1/games{gameKeys}/leagues
 /// </summary>
 /// <param name="gameKeys">Game Keys to get Team Resource for</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <param name="subresources">SubResources to include with League Resource</param>
 /// <returns>User Resource</returns>
 public async Task <User> GetUserGamesTeamsEndPoint(string AccessToken, string[] gameKeys = null, EndpointSubResourcesCollection subresources = null)
 {
     return(await Utils.GetResource <User>(ApiEndpoints.UserGamesTeamsEndPoint(gameKeys, subresources), AccessToken, "user"));
 }
Beispiel #7
0
 /// <summary>
 /// Get Roster Resource with Player Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/team/{teamKey}/roster/players
 /// </summary>
 /// <param name="teamKey">Team Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <param name="week">Optional Week to get Roster at particular time</param>
 /// <param name="date">Optional Date to get Roster at particular time</param>
 /// <returns>Player Resource</returns>
 public async Task <Roster> GetPlayers(string teamKey, int?week, DateTime?date, string AccessToken)
 {
     return(await Utils.GetResource <Roster>(ApiEndpoints.RosterEndPoint(teamKey, week, date), AccessToken, "roster"));
 }
Beispiel #8
0
 /// <summary>
 /// Gets Teams Collection based on supplied game Keys for logged in user
 /// Attaches Requested SubResources
 /// </summary>
 /// <param name="gameKeys">Game Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with Team Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Team Collection (List of Team Resources)</returns>
 public async Task <List <Game> > GetUserGamesTeams(string AccessToken, string[] gameKeys = null, EndpointSubResourcesCollection subresources = null)
 {
     return(await Utils.GetCollection <Game>(ApiEndpoints.TeamsUserGamesEndPoint(gameKeys, subresources), AccessToken, "game"));
 }
Beispiel #9
0
 /// <summary>
 /// Gets Games Collection based on supplied Keys
 /// Attaches Requested SubResources
 /// Applies Filters if included
 /// </summary>
 /// <param name="gameKey">Game Key to return Resources for </param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Games Collection (List of Game Resources)</returns>
 public async Task <List <Game> > GetGames(string gameKey, string AccessToken)
 {
     return(await Utils.GetCollection <Game>(ApiEndpoints.GameEndPoint(gameKey), AccessToken, "game"));
 }
 /// <summary>
 /// Get Transaction Resource with Player Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/transaction/{transactionKey}/players
 /// </summary>
 /// <param name="transactionKey">Transaction Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Transaction Resource</returns>
 public async Task <Transaction> GetPlayers(string transactionKey, string AccessToken)
 {
     return(await Utils.GetResource <Transaction>(ApiEndpoints.TransactionEndpoint(transactionKey, EndpointSubResources.Players), AccessToken, "transaction"));
 }
Beispiel #11
0
 /// <summary>
 /// Get Game Resource with Roster Positions Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/game/{gameKey}/roster_positions
 /// </summary>
 /// <param name="gameKey">GameKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Game Resource</returns>
 public async Task <Game> GetRosterPositions(string gameKey, string AccessToken)
 {
     return(await Utils.GetResource <Game>(ApiEndpoints.GameEndPoint(gameKey, EndpointSubResources.RosterPositions), AccessToken, "game"));
 }
Beispiel #12
0
 /// <summary>
 /// Get Game Resource with Stat Categories Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/game/{gameKey}/stat_categories
 /// </summary>
 /// <param name="gameKey">GameKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Game Resource</returns>
 public async Task <Game> GetStatCategories(string gameKey, string AccessToken)
 {
     return(await Utils.GetResource <Game>(ApiEndpoints.GameEndPoint(gameKey, EndpointSubResources.StatCategories), AccessToken, "game"));
 }
Beispiel #13
0
 /// <summary>
 /// Get Game Resource with Players Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/game/{gameKey}/players
 /// </summary>
 /// <param name="gameKey">GameKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Game Resource</returns>
 public async Task <Game> GetPlayers(string gameKey, string[] playerKeys, string AccessToken)
 {
     return(await Utils.GetResource <Game>(ApiEndpoints.GamePlayersEndPoint(gameKey, playerKeys), AccessToken, "game"));
 }
Beispiel #14
0
 /// <summary>
 /// Get Game Resource with Leagues Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/game/{gameKey}/leagues
 /// </summary>
 /// <param name="gameKey">GameKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Game Resource</returns>
 public async Task <Game> GetLeagues(string gameKey, string[] leagueKeys, string AccessToken)
 {
     return(await Utils.GetResource <Game>(ApiEndpoints.GameLeaguesEndPoint(gameKey, leagueKeys), AccessToken, "game"));
 }
Beispiel #15
0
 /// <summary>
 /// Get Game Resource with Meta Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/game/{gameKey}/metadata
 /// </summary>
 /// <param name="gameKey">GameKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Game Resource</returns>
 public async Task <Game> GetMeta(string gameKey, string AccessToken)
 {
     return(await Utils.GetResource <Game>(ApiEndpoints.GameEndPoint(gameKey, EndpointSubResources.MetaData), AccessToken, "game"));
 }
Beispiel #16
0
 /// <summary>
 /// Gets Games Collection based on supplied Keys for logged in user
 /// Attaches Requested SubResources
 /// Applies Filters if included
 /// </summary>
 /// <param name="gameKeys">Game Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with Game Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <param name="filters">Custom Filter Object on Game</param>
 /// <returns>Games Collection (List of Game Resources)</returns>
 public async Task <List <Game> > GetGamesUsers(string AccessToken, string[] gameKeys = null, EndpointSubResourcesCollection subresources = null, GameCollectionFilters filters = null)
 {
     return(await Utils.GetCollection <Game>(ApiEndpoints.GamesUserEndPoint(gameKeys, subresources, filters), AccessToken, "game"));
 }
Beispiel #17
0
 /// <summary>
 /// Gets Teams Collection based on supplied Keys
 /// Attaches Requested SubResources
 /// </summary>
 /// <param name="teamKeys">Teams Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with Team Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Team Collection (List of Team Resources)</returns>
 public async Task <List <Team> > GetTeams(string[] teamKeys, EndpointSubResourcesCollection subresources, string AccessToken)
 {
     return(await Utils.GetCollection <Team>(ApiEndpoints.TeamsEndPoint(teamKeys, subresources), AccessToken, "team"));
 }
Beispiel #18
0
 /// <summary>
 /// Get Team Resource with Matchups Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/team/{teamKey}/matchups
 /// </summary>
 /// <param name="teamKey">Team Key to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <returns>Team Resource</returns>
 public async Task <Team> GetMatchups(string teamKey, string AccessToken)
 {
     return(await Utils.GetResource <Team>(ApiEndpoints.TeamEndPoint(teamKey, EndpointSubResources.Matchups), AccessToken, "game"));
 }
Beispiel #19
0
 /// <summary>
 /// Gets Leagues Collection based on supplied Keys
 /// Attaches Requested SubResources
 /// </summary>
 /// <param name="leagueKeys">League Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with League Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Leagues Collection (List of League Resources)</returns>
 public async Task <List <League> > GetLeagues(string AccessToken, string[] leagueKeys = null, EndpointSubResourcesCollection subresources = null)
 {
     return(await Utils.GetCollection <League>(ApiEndpoints.LeaguesEndPoint(leagueKeys, subresources), AccessToken, "game"));
 }
 /// <summary>
 /// Get League Resource with Scoreboard Subresource
 /// https://fantasysports.yahooapis.com/fantasy/v2/league/{leagueKey}/scoreboard
 /// </summary>
 /// <param name="leagueKey">LeagueKey to Query</param>
 /// <param name="AccessToken">Access Token from Auth Api</param>
 /// <param name="weeks">Weeks to get the scoreboards for</param>
 /// <returns>League Resource</returns>
 public async Task <League> GetScoreboard(string leagueKey, string AccessToken, int?[] weeks = null)
 {
     return(await Utils.GetResource <League>(ApiEndpoints.LeagueEndPoint(leagueKey, EndpointSubResources.Scoreboard, weeks), AccessToken, "league"));
 }
Beispiel #21
0
 /// <summary>
 /// Gets Transactions Collection based on supplied league Keys
 /// Attaches Requested SubResources
 /// </summary>
 /// <param name="leagueKeys">League Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with Transaction Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Transaction Collection (List of Transaction Resources)</returns>
 public async Task <List <Transaction> > GetTransactionsLeagues(string[] leagueKeys, EndpointSubResourcesCollection subresources, string AccessToken)
 {
     return(await Utils.GetCollection <Transaction>(ApiEndpoints.TransactionsLeagueEndPoint(leagueKeys, subresources), AccessToken, "transaction"));
 }
Beispiel #22
0
 /// <summary>
 /// Gets Players Collection based on supplied Keys
 /// Attaches Requested SubResources
 /// </summary>
 /// <param name="playerKeys">Players Keys to return Resources for </param>
 /// <param name="subresources">SubResources to include with Player Resource</param>
 /// <param name="AccessToken">Token for request</param>
 /// <returns>Players Collection (List of Player Resources)</returns>
 public async Task <List <Player> > GetPlayers(string[] playerKeys, EndpointSubResourcesCollection subresources, string AccessToken)
 {
     return(await Utils.GetCollection <Player>(ApiEndpoints.PlayersEndPoint(playerKeys, subresources), AccessToken, "player"));
 }