public async Task <RankedResponse> GetLeaderboardByAct(string actId, int startPositionIndex, int numberOfPlayersToReturn = MaximumPlayersReturnedByRequest, ValorantEndpointRegion region = ValorantEndpointRegion.EU)
        {
            if (string.IsNullOrWhiteSpace(actId))
            {
                throw new ArgumentNullException(nameof(actId));
            }
            if ((startPositionIndex + 1) > numberOfPlayersToReturn)
            {
                throw new StartPositionGreaterThanTotalPlayersReturnedException(startPositionIndex, numberOfPlayersToReturn);
            }

            var url = _riotApiUrlResolver.Resolve(region, $"{RankedUrl}/leaderboards/by-act/{actId}?size={numberOfPlayersToReturn}&startIndex={startPositionIndex}");

            return(await _httpClient.GetAsync <RankedResponse>(url));
        }
 public Uri Resolve(ValorantEndpointRegion region, string endpoint)
 {
     return(BuildUri(region.GetEnumMemberValue(), endpoint, ApiDomain.Valorant.GetEnumMemberValue()));
 }
예제 #3
0
        public async Task <ContentResponse> GetContentOptionallyFilteredByLocale(string locale = "en-GB", ValorantEndpointRegion region = ValorantEndpointRegion.EU)
        {
            var url = _riotApiUrlResolver.Resolve(region, $"{ContentUrl}/contents?locale={locale}");

            return(await _httpClient.GetAsync <ContentResponse>(url));
        }