public async Task <IApiResponse <PagedTournaments> > 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."); } IApiResponse <PagedTournaments> apiResponse = await RestApiClient.GetApiResponseAsync <PagedTournaments>(UrlPathBuilder.TournamentUrl, tournamentFilter.ToQueryParams()); return(apiResponse); }
public async Task <ApiResponse <List <Tournament> > > GetPopularTournamentsResponseAsync(TournamentFilter tournamentFilter = null) { var apiResponse = await _restApiClient.GetApiResponseAsync <List <Tournament> >(UrlPathBuilder.PopularTournamentUrl, tournamentFilter?.ToQueryParams()); return(apiResponse); }