public async Task <ApiResponse <List <Clan> > > GetClansResponseAsync(string[] clanTags, ClanFilter clanFilter = null) { Ensure.ArgumentNotNullOrEmptyEnumerable(clanTags, nameof(clanTags)); var apiResponse = await _restApiClient.GetApiResponseAsync <List <Clan> >(UrlPathBuilder.GetClanUrl(clanTags), clanFilter?.ToQueryParams()); return(apiResponse); }
public async Task <ApiResponse <List <Clan> > > GetPopularPlayersResponseAsync(ClanFilter clanFilter = null) { var apiResponse = await _restApiClient.GetApiResponseAsync <List <Clan> >(UrlPathBuilder.PopularClansUrl, clanFilter?.ToQueryParams()); return(apiResponse); }
public async Task <ApiResponse <Clan> > GetClanResponseAsync(string clanTag, ClanFilter clanFilter = null) { Ensure.ArgumentNotNullOrEmptyString(clanTag, nameof(clanTag)); var apiResponse = await _restApiClient.GetApiResponseAsync <Clan>(UrlPathBuilder.GetClanUrl(clanTag), clanFilter?.ToQueryParams()); 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); }