RiotNet
8.0.0
A C#/.NET client for the Riot Games API.
|
A client that interacts with the Riot Games API. More...
Public Member Functions | |||
RiotClient () | |||
Creates a new RiotClient instance. More... | |||
RiotClient (IRateLimiter rateLimiter) | |||
Creates a new RiotClient instance.
| |||
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< Champion > | GetChampionByIdAsync (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< ChampionMastery > | GetChampionMasteryAsync (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< LeagueList > | GetLeagueByIdAsync (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< LeagueList > | GetChallengerLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the challenger league. This method uses the League API. More... | |||
Task< LeagueList > | GetGrandmasterLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the grandmaster league. This method uses the League API. More... | |||
Task< LeagueList > | GetMasterLeagueAsync (string rankedQueueType, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the master league. This method uses the League API. More... | |||
Task< Match > | GetMatchAsync (long matchId, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the details of a match. This method uses the Match API. More... | |||
Task< MatchTimeline > | GetMatchTimelineAsync (long matchId, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the timeline of a match. This method uses the Match API. More... | |||
Task< MatchList > | 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)) | ||
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< Match > | GetMatchForTournamentAsync (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< CurrentGameInfo > | GetActiveGameBySummonerIdAsync (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< FeaturedGames > | GetFeaturedGamesAsync (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< ShardStatus > | GetShardDataAsync (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< Summoner > | GetSummonerByAccountIdAsync (string accountId, string platformId=null, CancellationToken token=default(CancellationToken)) | ||
Gets the summoner information by account ID. This method uses the Summoner API. More... | |||
Task< Summoner > | GetSummonerBySummonerNameAsync (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< Summoner > | GetSummonerBySummonerIdAsync (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< Summoner > | GetSummonerByPuuidAsync (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< TournamentCode > | GetTournamentCodeAsync (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< TournamentCode > | GetTournamentCodeAsync (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< RiotResponse > | SendAsync (HttpRequestMessage request, string methodName, string platformId, CancellationToken token) |
Sends a request. More... | |
virtual async Task< ResponseAction > | DetermineResponseAction (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< RateLimitRule > | ParseRateLimits (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< RiotClientSettings > | DefaultSettings [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... | |
A client that interacts with the Riot Games API.
|
strongprotected |
Specifies the action to take after processing a request.
|
inline |
Creates a new RiotClient instance.
|
inline |
Creates a new RiotClient instance.
rateLimiter | The 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.
|
inline |
Creates a new RiotClient instance.
apiKey | The 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. |
|
inline |
Creates a new RiotClient instance.
settings | The settings to use. |
|
inline |
Creates a new RiotClient instance.
apiKey | The 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. |
platformId | The platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. |
|
inline |
Creates a new RiotClient instance.
settings | The settings to use. |
platformId | The platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. |
|
inline |
Creates a new RiotClient instance.
settings | The settings to use. |
platformId | The platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. |
appRateLimiter | The 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.
|
inlineprotectedvirtual |
Creates the underlying HttpClient. Override this method if you want to use a custom HttpMessageHandler for testing purposes.
|
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.
providerId | The providerId obtained from CreateTournamentProviderAsync. |
name | The optional name of the tournament. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
providerId | The providerId obtained from CreateTournamentProviderAsync. |
name | The optional name of the tournament. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentId | The tournament ID obtained from CreateTournamentAsync. |
count | The number of codes to create (max 1000). |
allowedSummonerIds | Optional list of participants in order to validate the players eligible to join the lobby. |
mapType | The map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed. |
pickType | The pick type of the game. This should equal one of the PickType values. |
spectatorType | The spectator type of the game. This should equal one of the SpectatorType values. |
teamSize | The team size of the game. Valid values are 1-5. |
metadata | Optional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentId | The tournament ID obtained from CreateTournamentAsync. |
count | The number of codes to create (max 1000). |
allowedSummonerIds | Optional list of participants in order to validate the players eligible to join the lobby. |
mapType | The map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed. |
pickType | The pick type of the game. This should equal one of the PickType values. |
spectatorType | The spectator type of the game. This should equal one of the SpectatorType values. |
teamSize | The team size of the game. Valid values are 1-5. |
metadata | Optional string that may contain any data in any format, if specified at all. Used to denote any custom information about the game. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The definition for the tournament code(s) to create. |
count | The number of codes to create (max 1000). |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The definition for the tournament code(s) to create. |
count | The number of codes to create (max 1000). |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
url | The 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). |
platformId | The 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. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
url | The 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). |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inlineprotectedvirtual |
Determines which action to take for the given response.
response | An HttpResponseMessage. |
attemptCount | The number of times the request has been attempted so far. |
token | The cancellation token to cancel the operation. |
|
inlineprotectedvirtual |
Executes a REST request asynchronously.
T | The type of data to expect in the response. |
method | The HTTP method to use. |
resource | The URL of the resource to use. |
resourceName | The resource path without any parameter values. Used for rate limiting purposes. |
body | The request body. This object will be serialized as a JSON string. Pass null if the request sohuld not have a body. |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used. |
token | The cancellation token to cancel the operation. |
queryParameters | Query string parameters to append to the resource. |
|
inlineprotectedvirtual |
Executes a REST request asynchronously.
T | The type of data to expect in the response. |
buildRequest | A function that builds the request to execute. |
methodName | The name of the method being executed (for rate limiting purposes). |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used. |
token | The cancellation token to cancel the operation. |
|
inlinestatic |
Creates a new RiotClient instance for the specified platform ID.
platformId | The platform ID of the default server to connect to. This should equal one of the Models.PlatformId values. |
|
inline |
Gets information about the current game a summoner is playing. This method uses the Spectator API.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inlineprotected |
Sends a GET request for the specified resource.
resource | The resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource. |
resourceName | The resource path without any parameter values. Used for rate limiting purposes. |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used. |
token | The cancellation token to cancel the operation. |
queryParameters | Query string parameters to append to the resource. |
|
inline |
Gets the challenger league. This method uses the League API.
rankedQueueType | The queue type. This should equal one of the RankedQueue values. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets dynamic champion information for the specified champion. This method uses the Champion API.
id | The champion id. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets information about a summoner's mastery of all champions they have played. This method uses the Champion Mastery API.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets information about a summoner's mastery of a champion. This method uses the Champion Mastery API.
summonerId | The summoner ID. |
championId | The champion ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets dynamic champion information for all champions. This method uses the Champion API.
freeToPlay | True to request only free-to-play champion information. Default is false. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the games currently featured in the League of Legends client. This method uses the Spectator API.
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the grandmaster league. This method uses the League API.
rankedQueueType | The queue type. This should equal one of the RankedQueue values. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
leagueId | The UIID of the league. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets league entries for all summoners in a particular divison. This method uses the League API.
rankedQueueType | The queue to search. This should equal one of the RankedQueue values. |
tier | The ranked tier. This should equal one of the Tier values. |
division | The ranked division. This should equal one of the Division values. |
page | The page number to retrieve. The default value is 1 (the first page). |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Get league entries in all queues for a given summoner ID. This method uses the League API.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Get league positions in all queues for a given summoner ID. This method uses the League API.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the master league. This method uses the League API.
rankedQueueType | The queue type. This should equal one of the RankedQueue values. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the details of a match. This method uses the Match API.
matchId | The ID of the match. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
matchId | The ID of the match. |
tournamentCode | The tournament code. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the list of match IDs for a tournament code. This method uses the Match API.
tournamentCode | The tournament code. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the match list for an account. This method uses the Match API.
accountId | The account ID. |
championIds | Only get games where the summoner played one of these champions. |
rankedQueues | Only 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). |
seasons | Only get games from these seasons. |
beginTime | Only 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. |
endTime | Only 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. |
beginIndex | The 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. |
endIndex | The 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. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the timeline of a match. This method uses the Match API.
matchId | The ID of the match. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inlineprotected |
Gets the region for agiven platform ID.
platformId | The platform ID. |
|
inlinestaticprotected |
Gets the error message from the response body if it exists.
response | The response from the server. |
|
inline |
Gets the data for the shard for the specified platform. This method uses the LoL Status API.
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the summoner information by account ID. This method uses the Summoner API.
accountId | The account ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the summoner information for the specified summoner ID. This method uses the Summoner API.
summonerPuuid | The summoner PUUID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the summoner information for the specified summoner ID. This method uses the Summoner API.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets the summoner information for the specified summoner name. This method uses the Summoner API.
summonerName | The summoner name. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inline |
Gets a code that a third-party application can use to verify a summoner.
summonerId | The summoner ID. |
platformId | The 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. |
token | The cancellation token to cancel the operation. |
For KR summoners, a 404 will always be returned.
Implements RiotNet.IRiotClient.
|
inlineprotected |
Gets the base URL for tournament requests.
stub | Indicates whether to use the tournament-stub API instead of the tournament API. |
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
inlineprotectedvirtual |
Occurs when the client fails to connect to the server while executing a request.
e | Arguments for the event. |
|
inlineprotectedvirtual |
Occurs when a request fails because the rate limit has been exceeded (status code 429).
e | Arguments for the event. |
|
inlineprotectedvirtual |
Occurs when a request times out.
e | Arguments for the event. |
|
inlineprotectedvirtual |
Occurs when a request fails because a resource was not found (status code 404).
e | Arguments for the event. |
|
inlineprotectedvirtual |
Occurs when a response returns an error code that does not fit into any other category, or an exception occurs during the response.
e | Arguments for the event. |
|
inlineprotectedvirtual |
Occurs when the server returns an error code of 500 or higher.
e | Arguments for the event. |
|
inlinestaticprotected |
Parses the rate limits in an X-Rate-Limit header.
rateLimitString | The contents of the rate limit header. |
|
inlineprotected |
Creates a POST request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request.
resource | The resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource. |
resourceName | The resource path without any parameter values. Used for rate limiting purposes. |
body | The body of the request. This object will be serialized as a JSON string. |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used. |
token | The cancellation token to cancel the operation. |
queryParameters | Query string parameters to append to the resource. |
|
inlineprotected |
Creates a PUT request for the specified resource. The region, platformId, and api_key parameters are automatically added to the request.
resource | The resource path, relative to the base URL. Note: this method will automatically add the api_key parameter to the resource. |
resourceName | The resource path without any parameter values. Used for rate limiting purposes. |
body | The body of the request. This object will be serialized as a JSON string. |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. If unspecified, the PlatformId property will be used. |
token | The cancellation token to cancel the operation. |
queryParameters | Query string parameters to append to the resource. |
|
inlineprotected |
Sends a request.
request | The request to send. |
methodName | The name of the method being executed (for rate limiting purposes). |
platformId | The platform ID corresponding to the server. This should equal one of the Models.PlatformId values. |
token | The cancellation token to cancel the operation. |
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
allowedSummonerIds | Optional list of participants in order to validate the players eligible to join the lobby. |
mapType | The map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed. |
pickType | The pick type of the game. This should equal one of the PickType values. |
spectatorType | The spectator type of the game. This should equal one of the SpectatorType values. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code obtained from CreateTournamentCodeAsync. |
allowedSummonerIds | Optional list of participants in order to validate the players eligible to join the lobby. |
mapType | The map type of the game. This should equal one of the MapType values. Note that MapType.CRYSTAL_SCAR is not allowed. |
pickType | The pick type of the game. This should equal one of the PickType values. |
spectatorType | The spectator type of the game. This should equal one of the SpectatorType values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used. |
regionalProxy | The name of the regional proxy service. This should equal one of the RegionalProxy values. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
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.
tournamentCode | The tournament code to update. Only the Code, Participants, MapType, PickType, and SpectatorType properties are used. |
token | The cancellation token to cancel the operation. |
Implements RiotNet.IRiotClient.
|
getprotected |
Gets a reference to the underlying HTTP client.
|
staticgetset |
Gets or sets the default platform ID to use when creating a new RiotClient. This should equal one of the Models.PlatformId values.
|
staticgetset |
Gets or sets a function that defines the default RiotClientSettings to use when creating a new RiotClient.
|
staticget |
Gets the JsonSerializerSettings that are used to deserialize responses from the Riot API.
|
get |
Gets the platform ID of the default server to connect to. This should equal one of the Models.PlatformId values.
|
staticgetset |
Gets or sets the rate limiter to use for proactive rate limiting.
|
get |
Gets the settings for the RiotClient.
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.