private void InitializeEndpoints(IStaticEndpointProvider staticEndpointProvider) { this.Champion = staticEndpointProvider.GetEndpoint <IStaticChampionEndpoint>(); this.Item = staticEndpointProvider.GetEndpoint <IStaticItemEndpoint>(); this.Language = staticEndpointProvider.GetEndpoint <IStaticLanguageEndpoint>(); this.Map = staticEndpointProvider.GetEndpoint <IStaticMapEndpoint>(); this.Mastery = staticEndpointProvider.GetEndpoint <IStaticMasteryEndpoint>(); this.ProfileIcon = staticEndpointProvider.GetEndpoint <IStaticProfileIconEndpoint>(); this.Realm = staticEndpointProvider.GetEndpoint <IStaticRealmEndpoint>(); this.Rune = staticEndpointProvider.GetEndpoint <IStaticRuneEndpoint>(); this.SummonerSpell = staticEndpointProvider.GetEndpoint <IStaticSummonerSpellEndpoint>(); this.Version = staticEndpointProvider.GetEndpoint <IStaticVersionEndpoint>(); }
private void InitializeEndpoints(IStaticEndpointProvider staticEndpointProvider) { Champions = staticEndpointProvider.GetEndpoint <IStaticChampionEndpoint>(); Items = staticEndpointProvider.GetEndpoint <IStaticItemEndpoint>(); Languages = staticEndpointProvider.GetEndpoint <IStaticLanguageEndpoint>(); Maps = staticEndpointProvider.GetEndpoint <IStaticMapEndpoint>(); Masteries = staticEndpointProvider.GetEndpoint <IStaticMasteryEndpoint>(); ProfileIcons = staticEndpointProvider.GetEndpoint <IStaticProfileIconEndpoint>(); Realms = staticEndpointProvider.GetEndpoint <IStaticRealmEndpoint>(); ReforgedRunes = staticEndpointProvider.GetEndpoint <IStaticReforgedRuneEndpoint>(); Runes = staticEndpointProvider.GetEndpoint <IStaticRuneEndpoint>(); SummonerSpells = staticEndpointProvider.GetEndpoint <IStaticSummonerSpellEndpoint>(); Versions = staticEndpointProvider.GetEndpoint <IStaticVersionEndpoint>(); TarballLinks = staticEndpointProvider.GetEndpoint <IStaticTarballLinkEndPoint>(); }
/// <summary> /// Dependency injection constructor /// </summary> /// <param name="rateLimitedRequester">Rate limited requester for all endpoints except the static endpoint.</param> /// <param name="staticEndpointProvider">The static endpoint provider.</param> /// <param name="cache">The cache.</param> /// <exception cref="ArgumentNullException"> /// rateLimitedRequester /// or /// staticEndpointProvider /// </exception> public RiotApi(IRateLimitedRequester rateLimitedRequester, IStaticEndpointProvider staticEndpointProvider, ICache cache = null) { if (rateLimitedRequester == null) { throw new ArgumentNullException(nameof(rateLimitedRequester)); } if (staticEndpointProvider == null) { throw new ArgumentNullException(nameof(staticEndpointProvider)); } _cache = cache ?? new PassThroughCache(); Summoner = new SummonerEndpoint(rateLimitedRequester, _cache); Champion = new ChampionEndpoint(rateLimitedRequester); League = new LeagueEndpoint(rateLimitedRequester); Match = new MatchEndpoint(rateLimitedRequester, _cache); Spectator = new SpectatorEndpoint(rateLimitedRequester); ChampionMastery = new ChampionMasteryEndpoint(rateLimitedRequester); ThirdParty = new ThirdPartyEndpoint(rateLimitedRequester); StaticData = new StaticDataEndpoints(staticEndpointProvider); }
/// <summary> /// Default dependency injection constructor /// </summary> /// <param name="staticEndpointProvider">provider that provides configured static-endpoints</param> public DataDragonEndpoints(IStaticEndpointProvider staticEndpointProvider) { InitializeEndpoints(staticEndpointProvider); }
public RiotService(IStaticEndpointProvider staticEndpointProvider) { ApiInstance = RiotApi.GetDevelopmentInstance("RGAPI-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"); StaticEndpointProvider = staticEndpointProvider; }