RiotNet  8.0.0
A C#/.NET client for the Riot Games API.
Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Properties | Events | List of all members
RiotNet.RiotClient Class Reference

A client that interacts with the Riot Games API. More...

Inheritance diagram for RiotNet.RiotClient:
RiotNet.IRiotClient

Public Member Functions

 RiotClient ()
 Creates a new RiotClient instance. More...
 
 RiotClient (IRateLimiter rateLimiter)
 Creates a new RiotClient instance.

Parameters
rateLimiterThe rate limiter to use for proactive rate limiting.
More...
 
 RiotClient (string apiKey)
 Creates a new RiotClient instance. More...
 
 RiotClient (RiotClientSettings settings)
 Creates a new RiotClient instance. More...
 
 RiotClient (string apiKey, string platformId)
 Creates a new RiotClient instance. More...
 
 RiotClient (RiotClientSettings settings, string platformId)
 Creates a new RiotClient instance. More...
 
 RiotClient (RiotClientSettings settings, string platformId, IRateLimiter appRateLimiter)
 Creates a new RiotClient instance. More...
 
async Task< List< Champion > > GetChampionsAsync (bool freeToPlay=false, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets dynamic champion information for all champions. This method uses the Champion API. More...
 
Task< ChampionGetChampionByIdAsync (long id, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets dynamic champion information for the specified champion. This method uses the Champion API. More...
 
Task< ChampionMasteryGetChampionMasteryAsync (string summonerId, long championId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets information about a summoner's mastery of a champion. This method uses the Champion Mastery API. More...
 
Task< List< ChampionMastery > > GetChampionMasteriesAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets information about a summoner's mastery of all champions they have played. This method uses the Champion Mastery API. More...
 
Task< int > GetChampionMasteryScoreAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets a summoner's champion mastery score (the sum of the champion levels of all champions for that summoner). This method uses the Champion Mastery API. More...
 
Task< LeagueListGetLeagueByIdAsync (string leagueId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the full league information for all leagues that the summoners are in, including the leages for the teams they are on. Data is mapped by summoner ID. This method uses the League API. More...
 
Task< List< LeaguePosition > > GetLeaguePositionsBySummonerIdAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Get league positions in all queues for a given summoner ID. This method uses the League API. More...
 
Task< List< LeagueEntry > > GetLeagueEntriesBySummonerIdAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Get league entries in all queues for a given summoner ID. This method uses the League API. More...
 
Task< List< LeagueEntry > > GetLeagueEntriesAsync (string rankedQueueType, string tier, string division, long page=1, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets league entries for all summoners in a particular divison. This method uses the League API. More...
 
Task< LeagueListGetChallengerLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the challenger league. This method uses the League API. More...
 
Task< LeagueListGetGrandmasterLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the grandmaster league. This method uses the League API. More...
 
Task< LeagueListGetMasterLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the master league. This method uses the League API. More...
 
Task< MatchGetMatchAsync (long matchId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the details of a match. This method uses the Match API. More...
 
Task< MatchTimelineGetMatchTimelineAsync (long matchId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the timeline of a match. This method uses the Match API. More...
 
Task< MatchListGetMatchListByAccountIdAsync (string accountId, IEnumerable< long > championIds=null, IEnumerable< QueueType > rankedQueues=null, IEnumerable< Season > seasons=null, DateTime?beginTime=null, DateTime?endTime=null, int?beginIndex=null, int?endIndex=null, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the match list for an account. This method uses the Match API. More...
 
Task< List< long > > GetMatchIdsByTournamentCodeAsync (string tournamentCode, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the list of match IDs for a tournament code. This method uses the Match API. More...
 
Task< MatchGetMatchForTournamentAsync (long matchId, string tournamentCode, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the details of a match. This method uses the Match API. This endpoint is only accessible if you have a tournament API key. More...
 
Task< CurrentGameInfoGetActiveGameBySummonerIdAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets information about the current game a summoner is playing. This method uses the Spectator API. More...
 
Task< FeaturedGamesGetFeaturedGamesAsync (string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the games currently featured in the League of Legends client. This method uses the Spectator API. More...
 
Task< ShardStatusGetShardDataAsync (string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the data for the shard for the specified platform. This method uses the LoL Status API. More...
 
Task< SummonerGetSummonerByAccountIdAsync (string accountId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the summoner information by account ID. This method uses the Summoner API. More...
 
Task< SummonerGetSummonerBySummonerNameAsync (string summonerName, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the summoner information for the specified summoner name. This method uses the Summoner API. More...
 
Task< SummonerGetSummonerBySummonerIdAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the summoner information for the specified summoner ID. This method uses the Summoner API. More...
 
Task< SummonerGetSummonerByPuuidAsync (string summonerPuuid, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets the summoner information for the specified summoner ID. This method uses the Summoner API. More...
 
Task< string > GetThirdPartyCodeAsync (string summonerId, string platformId=null, CancellationToken token=default(CancellationToken))
 Gets a code that a third-party application can use to verify a summoner. More...
 
Task< long > CreateTournamentProviderAsync (string url, string platformId=null, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Registers the current client as a tournament provider. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< long > CreateTournamentProviderAsync (string url, string platformId, CancellationToken token)
 Registers the current client as a tournament provider. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< long > CreateTournamentAsync (long providerId, string name=null, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Creates a tournament. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< long > CreateTournamentAsync (long providerId, string name, CancellationToken token)
 Creates a tournament. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< List< string > > CreateTournamentCodeAsync (long tournamentId, int?count=null, List< string > allowedSummonerIds=null, string mapType=MapType.SUMMONERS_RIFT, string pickType=PickType.TOURNAMENT_DRAFT, string spectatorType=SpectatorType.ALL, int teamSize=5, string metadata=null, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Creates one or more tournament codes. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< List< string > > CreateTournamentCodeAsync (long tournamentId, int?count, List< string > allowedSummonerIds, string mapType, string pickType, string spectatorType, int teamSize, string metadata, CancellationToken token)
 Creates one or more tournament codes. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< List< string > > CreateTournamentCodeAsync (TournamentCode tournamentCode, int?count=null, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task< List< string > > CreateTournamentCodeAsync (TournamentCode tournamentCode, int?count, CancellationToken token)
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task< TournamentCodeGetTournamentCodeAsync (string tournamentCode, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Gets the details of a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task< TournamentCodeGetTournamentCodeAsync (string tournamentCode, CancellationToken token)
 Gets the details of a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task UpdateTournamentCodeAsync (string tournamentCode, List< string > allowedSummonerIds=null, string mapType=MapType.SUMMONERS_RIFT, string pickType=PickType.TOURNAMENT_DRAFT, string spectatorType=SpectatorType.ALL, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task UpdateTournamentCodeAsync (string tournamentCode, List< string > allowedSummonerIds, string mapType, string pickType, string spectatorType, CancellationToken token)
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task UpdateTournamentCodeAsync (TournamentCode tournamentCode, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
Task UpdateTournamentCodeAsync (TournamentCode tournamentCode, CancellationToken token)
 Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API. More...
 
async Task< List< LobbyEvent > > GetTournamentCodeLobbyEventsAsync (string tournamentCode, string regionalProxy=RegionalProxy.Americas, CancellationToken token=default(CancellationToken))
 Gets the events that happened in the lobby of atournament code game. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 
Task< List< LobbyEvent > > GetTournamentCodeLobbyEventsAsync (string tournamentCode, CancellationToken token)
 Gets the events that happened in the lobby of atournament code game. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method. More...
 

Static Public Member Functions

static RiotClient ForPlatform (string platformId)
 Creates a new RiotClient instance for the specified platform ID. More...
 

Protected Types

enum  ResponseAction { ResponseAction.Return, ResponseAction.ReturnDefault, ResponseAction.Retry }
 Specifies the action to take after processing a request. More...
 

Protected Member Functions

virtual HttpClient CreateHttpClient ()
 Creates the underlying HttpClient. Override this method if you want to use a custom HttpMessageHandler for testing purposes. More...
 
Task< T > GetAsync< T > (string resource, string resourceName, string platformId, CancellationToken token, IDictionary< string, object > queryParameters=null)
 Sends a GET request for the specified resource. More...
 
Task< T > PostAsync< T > (string resource, string resourceName, object body, string platformId, CancellationToken token, IDictionary< string, object > queryParameters=null)
 Creates a POST request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request. More...
 
Task< T > PutAsync< T > (string resource, string resourceName, object body, string platformId, CancellationToken token, IDictionary< string, object > queryParameters=null)
 Creates a PUT request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request. More...
 
virtual Task< T > ExecuteAsync< T > (HttpMethod method, string resource, string resourceName, object body, string platformId, CancellationToken token, IDictionary< string, object > queryParameters=null)
 Executes a REST request asynchronously. More...
 
virtual async Task< T > ExecuteAsync< T > (Func< HttpRequestMessage > buildRequest, string methodName, string platformId, CancellationToken token)
 Executes a REST request asynchronously. More...
 
async Task< RiotResponseSendAsync (HttpRequestMessage request, string methodName, string platformId, CancellationToken token)
 Sends a request. More...
 
virtual async Task< ResponseActionDetermineResponseAction (RiotResponse response, int attemptCount, CancellationToken token)
 Determines which action to take for the given response. More...
 
virtual void OnRequestTimedOut (RetryEventArgs e)
 Occurs when a request times out. More...
 
virtual void OnConnectionFailed (RetryEventArgs e)
 Occurs when the client fails to connect to the server while executing a request. More...
 
virtual void OnRateLimitExceeded (RetryEventArgs e)
 Occurs when a request fails because the rate limit has been exceeded (status code 429). More...
 
virtual void OnServerError (RetryEventArgs e)
 Occurs when the server returns an error code of 500 or higher. More...
 
virtual void OnResourceNotFound (ResponseEventArgs e)
 Occurs when a request fails because a resource was not found (status code 404). More...
 
virtual void OnResponseError (ResponseEventArgs e)
 Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response. More...
 
string GetTournamentBaseUrl (bool stub)
 Gets the base URL for tournament requests. More...
 
string GetRegion (string platformId)
 Gets the region for agiven platform ID. More...
 

Static Protected Member Functions

static async Task< string > GetServerErrorMessage (RiotResponse response)
 Gets the error message from the response body if it exists. More...
 
static IEnumerable< RateLimitRuleParseRateLimits (string rateLimitString)
 Parses the rate limits in an X-Rate-Limit header. More...
 

Properties

static JsonSerializerSettings JsonSettings [get]
 Gets the JsonSerializerSettings that are used to deserialize responses from the Riot API. More...
 
static string DefaultPlatformId [get, set]
 Gets or sets the default platform ID to use when creating a new RiotClient. This should equal one of the Models.PlatformId values. More...
 
static IRateLimiter RateLimiter [get, set]
 Gets or sets the rate limiter to use for proactive rate limiting. More...
 
static Func< RiotClientSettingsDefaultSettings [get, set]
 Gets or sets a function that defines the default RiotClientSettings to use when creating a new RiotClient. More...
 
string PlatformId [get]
 Gets the platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. More...
 
RiotClientSettings Settings [get]
 Gets the settings for the RiotClient. More...
 
HttpClient Client [get]
 Gets a reference to the underlying HTTP client. More...
 
- Properties inherited from RiotNet.IRiotClient
string PlatformId [get]
 Gets the platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. More...
 
RiotClientSettings Settings [get]
 Gets the settings for the current IRiotClient. More...
 

Events

RetryEventHandler RequestTimedOut
 Occurs when a request times out. More...
 
RetryEventHandler ConnectionFailed
 Occurs when the client fails to connect to the server, or when an exception occurs while executing a request. More...
 
RetryEventHandler RateLimitExceeded
 Occurs when the client executes a request when the API rate limit has been exceeded (status code 429). More...
 
RetryEventHandler ServerError
 Occurs when the server returns an error code of 500 or higher. More...
 
ResponseEventHandler ResourceNotFound
 Occurs when a request fails because a resource was not found (status code 404). More...
 
ResponseEventHandler ResponseError
 Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response. More...
 
- Events inherited from RiotNet.IRiotClient
RetryEventHandler RequestTimedOut
 Occurs when the a request times out. More...
 
RetryEventHandler ConnectionFailed
 Occurs when the client fails to connect to the server while executing a request. More...
 
RetryEventHandler RateLimitExceeded
 Occurs when the client executes a request when the API rate limit has been exceeded. More...
 
RetryEventHandler ServerError
 Occurs when the server returns an error code of 500 or higher. More...
 
ResponseEventHandler ResourceNotFound
 Occurs when a request fails because a resource was not found. More...
 
ResponseEventHandler ResponseError
 Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response. More...
 

Detailed Description

A client that interacts with the Riot Games API.

Member Enumeration Documentation

enum RiotNet.RiotClient.ResponseAction
strongprotected

Specifies the action to take after processing a request.

Enumerator
Return 

Indicates that the response was received successfully, and its data should be returned.

ReturnDefault 

Indicates that the response was NOT received successfully, and the default value of the type (null in most cases) should be returned.

Retry 

Indicates that the response was NOT received successfully, and the request should be re-sent (unless the maximum number of attempts has been exceeded).

Constructor & Destructor Documentation

RiotNet.RiotClient.RiotClient ( )
inline

Creates a new RiotClient instance.

RiotNet.RiotClient.RiotClient ( IRateLimiter  rateLimiter)
inline

Creates a new RiotClient instance.

Parameters
rateLimiterThe rate limiter to use for proactive rate limiting.

You should pass the same IRateLimiter instance to all RiotClient instances. Do not create multiple IRateLimiter instances. Reactive rate limiting will always be used, even if a proactive rate limiter is not specified.

RiotNet.RiotClient.RiotClient ( string  apiKey)
inline

Creates a new RiotClient instance.

Parameters
apiKeyThe API key to use. NOTE: If you are using a public repository, do NOT check you API key in to the repository. It is recommended to load your API key from a separate file (e.g. key.txt) that is ignored by your repository.
RiotNet.RiotClient.RiotClient ( RiotClientSettings  settings)
inline

Creates a new RiotClient instance.

Parameters
settingsThe settings to use.
RiotNet.RiotClient.RiotClient ( string  apiKey,
string  platformId 
)
inline

Creates a new RiotClient instance.

Parameters
apiKeyThe API key to use. NOTE: If you are using a public repository, do NOT check you API key in to the repository. It is recommended to load your API key from a separate file (e.g. key.txt) that is ignored by your repository.
platformIdThe platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.
RiotNet.RiotClient.RiotClient ( RiotClientSettings  settings,
string  platformId 
)
inline

Creates a new RiotClient instance.

Parameters
settingsThe settings to use.
platformIdThe platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.
RiotNet.RiotClient.RiotClient ( RiotClientSettings  settings,
string  platformId,
IRateLimiter  appRateLimiter 
)
inline

Creates a new RiotClient instance.

Parameters
settingsThe settings to use.
platformIdThe platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.
appRateLimiterThe rate limiter to use for proactive rate limiting.

You should pass the same IRateLimiter instance to all RiotClient instances. Do not create multiple IRateLimiter instances. Reactive rate limiting will always be used, even if a proactive rate limiter is not specified.

Member Function Documentation

virtual HttpClient RiotNet.RiotClient.CreateHttpClient ( )
inlineprotectedvirtual

Creates the underlying HttpClient. Override this method if you want to use a custom HttpMessageHandler for testing purposes.

Returns
An HttpClient.
Task<long> RiotNet.RiotClient.CreateTournamentAsync ( long  providerId,
string  name = null,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Creates a tournament. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
providerIdThe providerId obtained from CreateTournamentProviderAsync.
nameThe optional name of the tournament.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<long> RiotNet.RiotClient.CreateTournamentAsync ( long  providerId,
string  name,
CancellationToken  token 
)
inline

Creates a tournament. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
providerIdThe providerId obtained from CreateTournamentProviderAsync.
nameThe optional name of the tournament.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<string> > RiotNet.RiotClient.CreateTournamentCodeAsync ( long  tournamentId,
int?  count = null,
List< string >  allowedSummonerIds = null,
string  mapType = MapType.SUMMONERS_RIFT,
string  pickType = PickType.TOURNAMENT_DRAFT,
string  spectatorType = SpectatorType.ALL,
int  teamSize = 5,
string  metadata = null,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Creates one or more tournament codes. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
tournamentIdThe tournament ID obtained from CreateTournamentAsync.
countThe number of codes to create (max 1000).
allowedSummonerIdsOptional list of participants in order to validate the players eligible to join the lobby.
mapTypeThe map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed.
pickTypeThe pick type of the game. This should equal one of the PickType values.
spectatorTypeThe spectator type of the game. This should equal one of the SpectatorType values.
teamSizeThe team size of the game. Valid values are 1-5.
metadataOptional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<string> > RiotNet.RiotClient.CreateTournamentCodeAsync ( long  tournamentId,
int?  count,
List< string >  allowedSummonerIds,
string  mapType,
string  pickType,
string  spectatorType,
int  teamSize,
string  metadata,
CancellationToken  token 
)
inline

Creates one or more tournament codes. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
tournamentIdThe tournament ID obtained from CreateTournamentAsync.
countThe number of codes to create (max 1000).
allowedSummonerIdsOptional list of participants in order to validate the players eligible to join the lobby.
mapTypeThe map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed.
pickTypeThe pick type of the game. This should equal one of the PickType values.
spectatorTypeThe spectator type of the game. This should equal one of the SpectatorType values.
teamSizeThe team size of the game. Valid values are 1-5.
metadataOptional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<string> > RiotNet.RiotClient.CreateTournamentCodeAsync ( TournamentCode  tournamentCode,
int?  count = null,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe definition for the tournament code(s) to create.
countThe number of codes to create (max 1000).
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<string> > RiotNet.RiotClient.CreateTournamentCodeAsync ( TournamentCode  tournamentCode,
int?  count,
CancellationToken  token 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe definition for the tournament code(s) to create.
countThe number of codes to create (max 1000).
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<long> RiotNet.RiotClient.CreateTournamentProviderAsync ( string  url,
string  platformId = null,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Registers the current client as a tournament provider. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
urlThe provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol (http URLs must use port 80, https URLs must use port 443).
platformIdThe platform ID of the region in which the provider will be running tournaments. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<long> RiotNet.RiotClient.CreateTournamentProviderAsync ( string  url,
string  platformId,
CancellationToken  token 
)
inline

Registers the current client as a tournament provider. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
urlThe provider's callback URL to which tournament game results in this region should be posted. The URL must be well-formed, use the http or https protocol, and use the default port for the protocol (http URLs must use port 80, https URLs must use port 443).
platformIdThe platform ID of the region in which the provider will be running tournaments. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

virtual async Task<ResponseAction> RiotNet.RiotClient.DetermineResponseAction ( RiotResponse  response,
int  attemptCount,
CancellationToken  token 
)
inlineprotectedvirtual

Determines which action to take for the given response.

Parameters
responseAn HttpResponseMessage.
attemptCountThe number of times the request has been attempted so far.
tokenThe cancellation token to cancel the operation.
Returns
A ResponseAction.
virtual Task<T> RiotNet.RiotClient.ExecuteAsync< T > ( HttpMethod  method,
string  resource,
string  resourceName,
object  body,
string  platformId,
CancellationToken  token,
IDictionary< string, object >  queryParameters = null 
)
inlineprotectedvirtual

Executes a REST request asynchronously.

Template Parameters
TThe type of data to expect in the response.
Parameters
methodThe HTTP method to use.
resourceThe URL of the resource to use.
resourceNameThe resource path without any parameter values. Used for rate limiting purposes.
bodyThe request body. This object will be serialized as a JSON string. Pass null if the request sohuld not have a body.
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
queryParametersQuery string parameters to append to the resource.
Returns
A task that represents the asynchronous operation.
virtual async Task<T> RiotNet.RiotClient.ExecuteAsync< T > ( Func< HttpRequestMessage >  buildRequest,
string  methodName,
string  platformId,
CancellationToken  token 
)
inlineprotectedvirtual

Executes a REST request asynchronously.

Template Parameters
TThe type of data to expect in the response.
Parameters
buildRequestA function that builds the request to execute.
methodNameThe name of the method being executed (for rate limiting purposes).
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task that represents the asynchronous operation.
static RiotClient RiotNet.RiotClient.ForPlatform ( string  platformId)
inlinestatic

Creates a new RiotClient instance for the specified platform ID.

Parameters
platformIdThe platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.
Returns
A RiotClient.
Task<CurrentGameInfo> RiotNet.RiotClient.GetActiveGameBySummonerIdAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets information about the current game a summoner is playing. This method uses the Spectator API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<T> RiotNet.RiotClient.GetAsync< T > ( string  resource,
string  resourceName,
string  platformId,
CancellationToken  token,
IDictionary< string, object >  queryParameters = null 
)
inlineprotected

Sends a GET request for the specified resource.

Parameters
resourceThe resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource.
resourceNameThe resource path without any parameter values. Used for rate limiting purposes.
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
queryParametersQuery string parameters to append to the resource.
Returns
A rest request.
Task<LeagueList> RiotNet.RiotClient.GetChallengerLeagueAsync ( string  rankedQueueType,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the challenger league. This method uses the League API.

Parameters
rankedQueueTypeThe queue type. This should equal one of the RankedQueue values.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Champion> RiotNet.RiotClient.GetChampionByIdAsync ( long  id,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets dynamic champion information for the specified champion. This method uses the Champion API.

Parameters
idThe champion id.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<ChampionMastery> > RiotNet.RiotClient.GetChampionMasteriesAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets information about a summoner's mastery of all champions they have played. This method uses the Champion Mastery API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<ChampionMastery> RiotNet.RiotClient.GetChampionMasteryAsync ( string  summonerId,
long  championId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets information about a summoner's mastery of a champion. This method uses the Champion Mastery API.

Parameters
summonerIdThe summoner ID.
championIdThe champion ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<int> RiotNet.RiotClient.GetChampionMasteryScoreAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets a summoner's champion mastery score (the sum of the champion levels of all champions for that summoner). This method uses the Champion Mastery API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

async Task<List<Champion> > RiotNet.RiotClient.GetChampionsAsync ( bool  freeToPlay = false,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets dynamic champion information for all champions. This method uses the Champion API.

Parameters
freeToPlayTrue to request only free-to-play champion information. Default is false.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<FeaturedGames> RiotNet.RiotClient.GetFeaturedGamesAsync ( string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the games currently featured in the League of Legends client. This method uses the Spectator API.

Parameters
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<LeagueList> RiotNet.RiotClient.GetGrandmasterLeagueAsync ( string  rankedQueueType,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the grandmaster league. This method uses the League API.

Parameters
rankedQueueTypeThe queue type. This should equal one of the RankedQueue values.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<LeagueList> RiotNet.RiotClient.GetLeagueByIdAsync ( string  leagueId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the full league information for all leagues that the summoners are in, including the leages for the teams they are on. Data is mapped by summoner ID. This method uses the League API.

Parameters
leagueIdThe UIID of the league.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<LeagueEntry> > RiotNet.RiotClient.GetLeagueEntriesAsync ( string  rankedQueueType,
string  tier,
string  division,
long  page = 1,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets league entries for all summoners in a particular divison. This method uses the League API.

Parameters
rankedQueueTypeThe queue to search. This should equal one of the RankedQueue values.
tierThe ranked tier. This should equal one of the Tier values.
divisionThe ranked division. This should equal one of the Division values.
pageThe page number to retrieve. The default value is 1 (the first page).
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<LeagueEntry> > RiotNet.RiotClient.GetLeagueEntriesBySummonerIdAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Get league entries in all queues for a given summoner ID. This method uses the League API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<LeaguePosition> > RiotNet.RiotClient.GetLeaguePositionsBySummonerIdAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Get league positions in all queues for a given summoner ID. This method uses the League API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<LeagueList> RiotNet.RiotClient.GetMasterLeagueAsync ( string  rankedQueueType,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the master league. This method uses the League API.

Parameters
rankedQueueTypeThe queue type. This should equal one of the RankedQueue values.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Match> RiotNet.RiotClient.GetMatchAsync ( long  matchId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the details of a match. This method uses the Match API.

Parameters
matchIdThe ID of the match.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Match> RiotNet.RiotClient.GetMatchForTournamentAsync ( long  matchId,
string  tournamentCode,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the details of a match. This method uses the Match API. This endpoint is only accessible if you have a tournament API key.

Parameters
matchIdThe ID of the match.
tournamentCodeThe tournament code.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<List<long> > RiotNet.RiotClient.GetMatchIdsByTournamentCodeAsync ( string  tournamentCode,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the list of match IDs for a tournament code. This method uses the Match API.

Parameters
tournamentCodeThe tournament code.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<MatchList> RiotNet.RiotClient.GetMatchListByAccountIdAsync ( string  accountId,
IEnumerable< long >  championIds = null,
IEnumerable< QueueType rankedQueues = null,
IEnumerable< Season seasons = null,
DateTime?  beginTime = null,
DateTime?  endTime = null,
int?  beginIndex = null,
int?  endIndex = null,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the match list for an account. This method uses the Match API.

Parameters
accountIdThe account ID.
championIdsOnly get games where the summoner played one of these champions.
rankedQueuesOnly get games from these queues. You should only use ranked queues for this (QueueType.TEAM_BUILDER_RANKED_SOLO, QueueType.RANKED_FLEX_SR, QueueType.RANKED_FLEX_TT).
seasonsOnly get games from these seasons.
beginTimeOnly get games played after this time. If beginTime is specified, but not endTime, then these parameters are ignored. If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned.
endTimeOnly get games played before this time. If beginTime is specified, but not endTime, then these parameters are ignored. If endTime is specified, but not beginTime, then beginTime defaults to the start of the account's match history. If both are specified, then endTime should be greater than beginTime. The maximum time range allowed is one week, otherwise a 400 error code is returned.
beginIndexThe begin index to use for fetching games. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned.
endIndexThe end index to use for fetching games. If beginIndex is specified, but not endIndex, then endIndex defaults to beginIndex+100. If endIndex is specified, but not beginIndex, then beginIndex defaults to 0. If both are specified, then endIndex must be greater than beginIndex. The maximum range allowed is 100, otherwise a 400 error code is returned.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<MatchTimeline> RiotNet.RiotClient.GetMatchTimelineAsync ( long  matchId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the timeline of a match. This method uses the Match API.

Parameters
matchIdThe ID of the match.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

string RiotNet.RiotClient.GetRegion ( string  platformId)
inlineprotected

Gets the region for agiven platform ID.

Parameters
platformIdThe platform ID.
Returns
A region.
static async Task<string> RiotNet.RiotClient.GetServerErrorMessage ( RiotResponse  response)
inlinestaticprotected

Gets the error message from the response body if it exists.

Parameters
responseThe response from the server.
Returns
The error messsage, or null if no error message was found.
Task<ShardStatus> RiotNet.RiotClient.GetShardDataAsync ( string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the data for the shard for the specified platform. This method uses the LoL Status API.

Parameters
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Summoner> RiotNet.RiotClient.GetSummonerByAccountIdAsync ( string  accountId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the summoner information by account ID. This method uses the Summoner API.

Parameters
accountIdThe account ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Summoner> RiotNet.RiotClient.GetSummonerByPuuidAsync ( string  summonerPuuid,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the summoner information for the specified summoner ID. This method uses the Summoner API.

Parameters
summonerPuuidThe summoner PUUID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Summoner> RiotNet.RiotClient.GetSummonerBySummonerIdAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the summoner information for the specified summoner ID. This method uses the Summoner API.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<Summoner> RiotNet.RiotClient.GetSummonerBySummonerNameAsync ( string  summonerName,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the summoner information for the specified summoner name. This method uses the Summoner API.

Parameters
summonerNameThe summoner name.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task<string> RiotNet.RiotClient.GetThirdPartyCodeAsync ( string  summonerId,
string  platformId = null,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets a code that a third-party application can use to verify a summoner.

Parameters
summonerIdThe summoner ID.
platformIdThe platform ID of the server to connect to. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

For KR summoners, a 404 will always be returned.

Implements RiotNet.IRiotClient.

string RiotNet.RiotClient.GetTournamentBaseUrl ( bool  stub)
inlineprotected

Gets the base URL for tournament requests.

Parameters
stubIndicates whether to use the tournament-stub API instead of the tournament API.
Returns
The base URL.
Task<TournamentCode> RiotNet.RiotClient.GetTournamentCodeAsync ( string  tournamentCode,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the details of a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
The tournament code details.

Implements RiotNet.IRiotClient.

Task<TournamentCode> RiotNet.RiotClient.GetTournamentCodeAsync ( string  tournamentCode,
CancellationToken  token 
)
inline

Gets the details of a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
tokenThe cancellation token to cancel the operation.
Returns
The tournament code details.

Implements RiotNet.IRiotClient.

async Task<List<LobbyEvent> > RiotNet.RiotClient.GetTournamentCodeLobbyEventsAsync ( string  tournamentCode,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Gets the events that happened in the lobby of atournament code game. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
The tournament code details.

Implements RiotNet.IRiotClient.

Task<List<LobbyEvent> > RiotNet.RiotClient.GetTournamentCodeLobbyEventsAsync ( string  tournamentCode,
CancellationToken  token 
)
inline

Gets the events that happened in the lobby of atournament code game. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. IMPORTANT: if you are using an interim API key, you must set RiotClientSettings.UseTournamentStub to true before calling this method.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
tokenThe cancellation token to cancel the operation.
Returns
The tournament code details.

Implements RiotNet.IRiotClient.

virtual void RiotNet.RiotClient.OnConnectionFailed ( RetryEventArgs  e)
inlineprotectedvirtual

Occurs when the client fails to connect to the server while executing a request.

Parameters
eArguments for the event.
virtual void RiotNet.RiotClient.OnRateLimitExceeded ( RetryEventArgs  e)
inlineprotectedvirtual

Occurs when a request fails because the rate limit has been exceeded (status code 429).

Parameters
eArguments for the event.
virtual void RiotNet.RiotClient.OnRequestTimedOut ( RetryEventArgs  e)
inlineprotectedvirtual

Occurs when a request times out.

Parameters
eArguments for the event.
virtual void RiotNet.RiotClient.OnResourceNotFound ( ResponseEventArgs  e)
inlineprotectedvirtual

Occurs when a request fails because a resource was not found (status code 404).

Parameters
eArguments for the event.
virtual void RiotNet.RiotClient.OnResponseError ( ResponseEventArgs  e)
inlineprotectedvirtual

Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response.

Parameters
eArguments for the event.
virtual void RiotNet.RiotClient.OnServerError ( RetryEventArgs  e)
inlineprotectedvirtual

Occurs when the server returns an error code of 500 or higher.

Parameters
eArguments for the event.
static IEnumerable<RateLimitRule> RiotNet.RiotClient.ParseRateLimits ( string  rateLimitString)
inlinestaticprotected

Parses the rate limits in an X-Rate-Limit header.

Parameters
rateLimitStringThe contents of the rate limit header.
Returns
A list of rate limit rules.
Task<T> RiotNet.RiotClient.PostAsync< T > ( string  resource,
string  resourceName,
object  body,
string  platformId,
CancellationToken  token,
IDictionary< string, object >  queryParameters = null 
)
inlineprotected

Creates a POST request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request.

Parameters
resourceThe resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource.
resourceNameThe resource path without any parameter values. Used for rate limiting purposes.
bodyThe body of the request. This object will be serialized as a JSON string.
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
queryParametersQuery string parameters to append to the resource.
Returns
A rest request.
Task<T> RiotNet.RiotClient.PutAsync< T > ( string  resource,
string  resourceName,
object  body,
string  platformId,
CancellationToken  token,
IDictionary< string, object >  queryParameters = null 
)
inlineprotected

Creates a PUT request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request.

Parameters
resourceThe resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource.
resourceNameThe resource path without any parameter values. Used for rate limiting purposes.
bodyThe body of the request. This object will be serialized as a JSON string.
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used.
tokenThe cancellation token to cancel the operation.
queryParametersQuery string parameters to append to the resource.
Returns
A rest request.
async Task<RiotResponse> RiotNet.RiotClient.SendAsync ( HttpRequestMessage  request,
string  methodName,
string  platformId,
CancellationToken  token 
)
inlineprotected

Sends a request.

Parameters
requestThe request to send.
methodNameThe name of the method being executed (for rate limiting purposes).
platformIdThe platform ID corresponding to the server. This should equal one of the Models.PlatformId values.
tokenThe cancellation token to cancel the operation.
Returns
A task that represents the asynchronous operation.
Task RiotNet.RiotClient.UpdateTournamentCodeAsync ( string  tournamentCode,
List< string >  allowedSummonerIds = null,
string  mapType = MapType.SUMMONERS_RIFT,
string  pickType = PickType.TOURNAMENT_DRAFT,
string  spectatorType = SpectatorType.ALL,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
allowedSummonerIdsOptional list of participants in order to validate the players eligible to join the lobby.
mapTypeThe map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed.
pickTypeThe pick type of the game. This should equal one of the PickType values.
spectatorTypeThe spectator type of the game. This should equal one of the SpectatorType values.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task RiotNet.RiotClient.UpdateTournamentCodeAsync ( string  tournamentCode,
List< string >  allowedSummonerIds,
string  mapType,
string  pickType,
string  spectatorType,
CancellationToken  token 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code obtained from CreateTournamentCodeAsync.
allowedSummonerIdsOptional list of participants in order to validate the players eligible to join the lobby.
mapTypeThe map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed.
pickTypeThe pick type of the game. This should equal one of the PickType values.
spectatorTypeThe spectator type of the game. This should equal one of the SpectatorType values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task RiotNet.RiotClient.UpdateTournamentCodeAsync ( TournamentCode  tournamentCode,
string  regionalProxy = RegionalProxy.Americas,
CancellationToken  token = default(CancellationToken) 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used.
regionalProxyThe name of the regional proxy service. This should equal one of the RegionalProxy values.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Task RiotNet.RiotClient.UpdateTournamentCodeAsync ( TournamentCode  tournamentCode,
CancellationToken  token 
)
inline

Saves changes to a tournament code. This method uses the Tournament API. This endpoint is only accessible if you have a tournament API key. This method does NOT support the tournament stub API.

Parameters
tournamentCodeThe tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used.
tokenThe cancellation token to cancel the operation.
Returns
A task representing the asynchronous operation.

Implements RiotNet.IRiotClient.

Property Documentation

HttpClient RiotNet.RiotClient.Client
getprotected

Gets a reference to the underlying HTTP client.

string RiotNet.RiotClient.DefaultPlatformId
staticgetset

Gets or sets the default platform ID to use when creating a new RiotClient. This should equal one of the Models.PlatformId values.

Func<RiotClientSettings> RiotNet.RiotClient.DefaultSettings
staticgetset

Gets or sets a function that defines the default RiotClientSettings to use when creating a new RiotClient.

JsonSerializerSettings RiotNet.RiotClient.JsonSettings
staticget

Gets the JsonSerializerSettings that are used to deserialize responses from the Riot API.

string RiotNet.RiotClient.PlatformId
get

Gets the platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.

IRateLimiter RiotNet.RiotClient.RateLimiter
staticgetset

Gets or sets the rate limiter to use for proactive rate limiting.

RiotClientSettings RiotNet.RiotClient.Settings
get

Gets the settings for the RiotClient.

Event Documentation

RetryEventHandler RiotNet.RiotClient.ConnectionFailed

Occurs when the client fails to connect to the server, or when an exception occurs while executing a request.

RetryEventHandler RiotNet.RiotClient.RateLimitExceeded

Occurs when the client executes a request when the API rate limit has been exceeded (status code 429).

RetryEventHandler RiotNet.RiotClient.RequestTimedOut

Occurs when a request times out.

ResponseEventHandler RiotNet.RiotClient.ResourceNotFound

Occurs when a request fails because a resource was not found (status code 404).

ResponseEventHandler RiotNet.RiotClient.ResponseError

Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response.

RetryEventHandler RiotNet.RiotClient.ServerError

Occurs when the server returns an error code of 500 or higher.


The documentation for this class was generated from the following files: