API Interfaces in RiotBlossom

RiotBlossom serves four major API interfaces. Each of the major interfaces corresponds to an API supported by RiotBlossom:

  • Riot Games --> Riot
  • DataDragon --> DataDragon
  • CommunityDragon --> CommunityDragon
  • Meraki Analytics --> MerakiAnalytics Added in 1.2.0

This is how it corresponds to the codesies:

using BlossomiShymae.RiotBlossom.Api;

IRiotApi riotApi = client.Riot;
IDataDragonApi dataDragonApi = client.DataDragon;
ICommunityDragonApi communityDragonApi = client.CommunityDragon;
IMerakiAnalyticsApi merakiAnalyticsApi = client.MerakiAnalytics;
:bee_mad:

All API interfaces are meant for consumption, not for implementation. This means that you will likely have breaking changes for the implemented interface for each version!

The Riot Games interface

The Riot Games interface (Riot) is denoted by IRiotApi.

The manual driver

It is possible to make a low-level request via the GetAsync method!

Task<T> GetAsync<T>(string route, string path);

This will still take full advantage of the Riot middleware plugin system features (limiting, caching, and retrying if you have them set). Just provide a type for JSON deserialization!

( つ•̀ω•́)つ

var summoner = await client.Riot.GetAsync<SummonerDto>("na1", "/lol/summoner/v4/summoners/by-name/uwuie time");
Oh noes

With great power comes great responsibility. Be sure that any path you use is correct!

Added in 1.2.0

HTTP headers can also be passed. As long as it implements IDictionary<string, string>!

Task<T> GetAsync<T>(string route, string path, IDictionary<string, string> headers);

This should allow the use of any RSO endpoints!

var summoner = await client.Riot.GetAsync<SummonerDto>("na1", "/lol/summoner/v4/summoners/me", new Dictionary<string, string> 
{
    { "Authorization", "Bearer token example"}
});

The Riot Games minor interfaces correspond to endpoints provided by the Riot Games API!

The Account-v1 endpoint

Account is denoted by IAccountApi.

The Champion-v3 endpoint

Champion is denoted by IChampionApi.

The Champion-Mastery-v4 endpoint

ChampionMastery is denoted by IChampionMasteryApi.

The Clash-v1 endpoint

Clash is denoted by IClashApi.

The League-v4 endpoint

League is denoted by ILeagueApi.

The Lol-Challenges-v1 endpoint

LolChallenges is denoted by ILolChallengesApi.

The Lol-Status-v4 endpoint

LolStatus is denoted by ILolStatusApi.

The Lor-Match-v1 endpoint

LorMatch is denoted by ILorMatchApi.

The Lor-Ranked-v1 endpoint

LorRanked is denoted by ILorRankedApi.

The Lor-Status-v1 endpoint

LorStatus is denoted by ILorStatusApi.

The Match-v5 endpoint

Match is denoted by IMatchApi.

The Spectator-v4 endpoint

Spectator is denoted by ISpectatorApi.

The Summoner-v4 endpoint

Summoner is denoted by ISummonerApi.

The Tft-League-v1 endpoint

TftLeague is denoted by ITftLeagueApi.

The Tft-Match-v1 endpoint

TftMatch is denoted by ITftMatchApi.

The Tft-Status-v1 endpoint

TftStatus is denoted by ITftStatusApi.

The Tft-Summoner-v1 endpoint

TftSummoner is denoted by ITftSummonerApi.

The Val-Content-v1 endpoint

ValContent is denoted by IValContentApi.

The Val-Match-v1 endpoint

ValMatch is denoted by IValMatchApi.

The Val-Ranked-v1 endpoint

ValRanked is denoted by IValRankedApi.

The Val-Status-v1 endpoint

ValStatus is denoted by IValStatusApi.

The DataDragon interface

The DataDragon interface (DataDragon) is denoted by IDataDragonApi,

The CommunityDragon interface

The CommunityDragon interface (CommunityDragon) is denoted by ICommunityDragonApi.

The manual driver

Added in 1.2.0

We can make a low-level request via the GetAsync method!

Task<T> GetAsync<T>(string path);

As always, this will take full advantage of the Riot middleware plugin system features (limiting, caching, and retrying if you have them set). Just provide a type for JSON deserialization!

⌒°(ᴖ◡ᴖ)°⌒

var champion = await client.CommunityDragon.GetAsync<Champion>("/latest/plugins/rcp-be-lol-game-data/global/default/v1/champions/887.json");

The MerakiAnalytics interface

The MerakiAnalytics interface (MerakiAnalytics) is denoted by IMerakiAnalyticsApi.