public async Task <NavigationResultSet> NavigationLinks() { var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _navigationLinks); var json = await _wikiaHttpClient.Get(requestUrl); return(JsonHelper.Deserialize <NavigationResultSet>(json)); }
public async Task <WikiDataContainer> WikiVariables() { var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _wikiVariablesUrl); var json = await _wikiaHttpClient.Get(requestUrl); return(JsonHelper.Deserialize <WikiDataContainer>(json)); }
public async Task <ActivityResponseResult> Activity(ActivityRequestParameters requestParameters, ActivityEndpoint endpoint) { if (requestParameters == null) { throw new ArgumentNullException(nameof(requestParameters)); } var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, Endpoints[endpoint]); var parameters = GetParameters(requestParameters); var json = await _wikiaHttpClient.Get(requestUrl, parameters); return(JsonHelper.Deserialize <ActivityResponseResult>(json)); }
public async Task <LocalWikiSearchResultSet> SearchList(SearchListRequestParameter requestParameters) { if (requestParameters == null) { throw new ArgumentNullException(nameof(requestParameters)); } var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _searchList); var parameters = GetSearchListParameters(requestParameters); var json = await _wikiaHttpClient.Get(requestUrl, parameters); return(JsonHelper.Deserialize <LocalWikiSearchResultSet>(json)); }
public async Task <SearchSuggestionsPhrases> SuggestedPhrases(string query) { if (string.IsNullOrWhiteSpace(query)) { throw new ArgumentException("Search suggestion query required.", nameof(query)); } var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _searchSuggestionsList); var parameters = new Dictionary <string, string> { ["query"] = query }; var json = await _wikiaHttpClient.Get(requestUrl, parameters); return(JsonHelper.Deserialize <SearchSuggestionsPhrases>(json)); }
public async Task <RelatedPages> Articles(RelatedArticlesRequestParameters requestParameters) { if (requestParameters == null) { throw new ArgumentNullException(nameof(requestParameters)); } if (requestParameters.Ids == null || !requestParameters.Ids.Any()) { throw new ArgumentException("Article Id(s) required.", nameof(requestParameters.Ids)); } var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _relatedPages); var parameters = GetArticlesParameters(requestParameters); var json = await _wikiaHttpClient.Get(requestUrl, parameters); return(JsonHelper.Deserialize <RelatedPages>(json)); }
public async Task <UserResultSet> Details(UserRequestParameters requestParameters) { if (requestParameters == null) { throw new ArgumentNullException(nameof(requestParameters)); } if (requestParameters.Ids == null || !requestParameters.Ids.Any()) { throw new ArgumentException("User Ids are required.", nameof(requestParameters.Ids)); } if (requestParameters.Ids.Count > 100) { throw new ArgumentException("Maximum size of id list is 100", nameof(requestParameters.Ids)); } var requestUrl = UrlHelper.GenerateApiUrl(_wikiApiUrl, _user); var parameters = GetDetailsParameters(requestParameters); var json = await _wikiaHttpClient.Get(requestUrl, parameters); return(JsonHelper.Deserialize <UserResultSet>(json)); }
private async Task <string> WebClient(string requestUrl, IDictionary <string, string> parameters) { return(await _wikiaHttpClient.Get(requestUrl, parameters)); }