public async Task <ApiResponse <PlayerDetail> > GetPlayerResponseAsync(string playerTag)
        {
            Ensure.ArgumentNotNullOrEmptyString(playerTag, nameof(playerTag));

            var apiResponse = await _restApiClient.GetApiResponseAsync <PlayerDetail>(UrlPathBuilder.GetPlayerUrl(playerTag));

            return(apiResponse);
        }
        public async Task <ApiResponse <List <Episode> > > GetEpisodesResponseAsync(int podcastId)
        {
            Ensure.GreaterThanZero(podcastId, nameof(podcastId));

            ApiResponse <List <Episode> > apiResponse = await _restApiClient.GetApiResponseAsync <List <Episode> >(UrlPathBuilder.GetEpisodesUrl(podcastId));

            return(apiResponse);
        }
        public async Task <ApiResponse <Statistic> > GetPodcastStatisticResponseAsync(int podcastId)
        {
            Ensure.GreaterThanZero(podcastId, nameof(podcastId));

            ApiResponse <Statistic> apiResponse = await _restApiClient.GetApiResponseAsync <Statistic>(UrlPathBuilder.GetPodcastStatisticUrl(podcastId));

            return(apiResponse);
        }
        public async Task <IApiResponse <Player> > GetPlayerResponseAsync(string playerTag, PlayerFilter playerFilter = null)
        {
            Ensure.ArgumentNotNullOrEmptyString(playerTag, nameof(playerTag));

            IApiResponse <Player> apiResponse = await _restApiClient.GetApiResponseAsync <Player>(UrlPathBuilder.GetPlayerUrl(playerTag),
                                                                                                  playerFilter?.ToQueryParams(), null, new CamelCaseNamingStrategy());

            return(apiResponse);
        }
Beispiel #5
0
        public async Task <ApiResponse <LocationList> > GetLocationsResponseAsync(LocationFilter locationFilter = null)
        {
            if (locationFilter?.After != null && locationFilter.Before != null)
            {
                throw new InvalidOperationException("Only after or before can be specified for a request, not both.");
            }

            var apiResponse = await _restApiClient.GetApiResponseAsync <LocationList>(UrlPathBuilder.LocationUrl, locationFilter?.ToQueryParams());

            return(apiResponse);
        }
Beispiel #6
0
        public async Task <IApiResponse <List <ClanSummary> > > SearchClanResponseAsync(ClanSummaryFilter clanSummaryFilter = null)
        {
            IApiResponse <List <ClanSummary> > apiResponse = await _restApiClient.GetApiResponseAsync <List <ClanSummary> >(UrlPathBuilder.ClanSearchUrl,
                                                                                                                            clanSummaryFilter?.ToQueryParams(), null,
                                                                                                                            new CamelCaseNamingStrategy());

            return(apiResponse);
        }
Beispiel #7
0
        public async Task <ApiResponse <Embed> > GetPlayerEmbedResponseAsync(int podcastId, int episodeId)
        {
            Ensure.GreaterThanZero(podcastId, nameof(podcastId));
            Ensure.GreaterThanZero(episodeId, nameof(episodeId));

            ApiResponse <Embed> apiResponse = await _restApiClient.GetApiResponseAsync <Embed>(UrlPathBuilder.GetPlayerEmbedUrl(podcastId, episodeId));

            return(apiResponse);
        }
        public async Task <ApiResponse <ClanSearchResult> > SearchClanResponseAsync(ClanFilter clanApiFilter)
        {
            Ensure.ArgumentNotNull(clanApiFilter, nameof(clanApiFilter));
            Ensure.AtleastOneCriteriaMustBeDefined(clanApiFilter, nameof(clanApiFilter));

            if (clanApiFilter.Name != null && clanApiFilter.Name.Length < 3)
            {
                throw new ArgumentException("Name needs to be at least three characters long.", nameof(ClanFilter.Name));
            }

            if (clanApiFilter.After.HasValue && clanApiFilter.Before.HasValue)
            {
                throw new InvalidOperationException("Only after or before can be specified for a request, not both.");
            }

            var apiResponse = await _restApiClient.GetApiResponseAsync <ClanSearchResult>(UrlPathBuilder.ClanUrl, clanApiFilter.ToQueryParams());

            return(apiResponse);
        }
Beispiel #9
0
        public async Task <ApiResponse <TournamentSearchResult> > SearchTournamentResponseAsync(TournamentFilter tournamentFilter)
        {
            Ensure.ArgumentNotNull(tournamentFilter, nameof(tournamentFilter));
            Ensure.AtleastOneCriteriaMustBeDefined(tournamentFilter, nameof(tournamentFilter));

            if (tournamentFilter?.Name != null && tournamentFilter.Name.Length < 3)
            {
                throw new ArgumentException("Name needs to be at least three characters long.", nameof(TournamentFilter.Name));
            }

            if (tournamentFilter?.After != null && tournamentFilter.Before != null)
            {
                throw new InvalidOperationException("Only after or before can be specified for a request, not both.");
            }

            var apiResponse = await _restApiClient.GetApiResponseAsync <TournamentSearchResult>(UrlPathBuilder.TournamentUrl, tournamentFilter.ToQueryParams());

            return(apiResponse);
        }
        public async Task <ApiResponse <CardList> > GetCardsResponseAsync()
        {
            var apiResponse = await _restApiClient.GetApiResponseAsync <CardList>(UrlPathBuilder.CardUrl);

            return(apiResponse);
        }
        public async Task <ApiResponse <List <Tournament> > > SearchTournamentResponseAsync(TournamentSearchFilter tournamentSearchFilter = null)
        {
            var apiResponse = await _restApiClient.GetApiResponseAsync <List <Tournament> >(UrlPathBuilder.TournamentSearchUrl, tournamentSearchFilter?.ToQueryParams());

            return(apiResponse);
        }
        public async Task <ApiResponse <List <ClanSummary> > > SearchClanResponseAsync(ClanSummaryFilter clanSummaryFilter = null)
        {
            var apiResponse = await _restApiClient.GetApiResponseAsync <List <ClanSummary> >(UrlPathBuilder.ClanSearchUrl, clanSummaryFilter?.ToQueryParams());

            return(apiResponse);
        }
Beispiel #13
0
 public async Task <ApiResponse> GetVersionResponse()
 {
     return(await _restApiClient.GetApiResponseAsync(UrlPathBuilder.Version));
 }
        public async Task <ApiResponse <List <Podcast> > > GetPodcastsResponseAsync()
        {
            ApiResponse <List <Podcast> > apiResponse = await _restApiClient.GetApiResponseAsync <List <Podcast> >(UrlPathBuilder.PodcastUrl);

            return(apiResponse);
        }
Beispiel #15
0
 public Task <IApiResponse <Constants> > GetConstantsResponseAsync()
 {
     return(_restApiClient.GetApiResponseAsync <Constants>(UrlPathBuilder.ConstantsUrl));
 }
Beispiel #16
0
 public Task <IApiResponse <Ver> > GetVersionResponseAsync()
 {
     return(_restApiClient.GetApiResponseAsync <Ver>(UrlPathBuilder.VersionUrl));
 }