BaseResponse <Badge> IBadges.GetRecentlyAwardedBadges(BadgeFilters filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Badges, "recipients") .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Badge> >().ValidateApiResponse(); return(response); }
BaseResponse <Badge> IBadges.GetAllTaggedBadges(BadgeFilters filters, string inName) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Badges, "tags") .WithFilter(filters, inName) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Badge> >().ValidateApiResponse(); return(response); }
BaseResponse <Post> IPosts.GetAllPosts(PostFilter filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Posts) .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Post> >().ValidateApiResponse(); return(response); }
BaseResponse <Badge> IBadges.GetNonTaggedBadges(List <string> ids, BadgeFilters filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Badges, "name") .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Badge> >().ValidateApiResponse(); return(response); }
BaseResponse <Question> IAnswers.GetQuestionByAnswerIds(List <string> ids, AnswerFilters filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Answers) .WithFilter(filters) .WithIds(ids) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Question> >().ValidateApiResponse(); return(response); }
BaseResponse <Answer> IAnswers.GetAllAnswers(AnswerFilters filters) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Answers) .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Answer> >().ValidateApiResponse(); return(response); }
BaseResponse <Question> IQuestions.GetFeaturedQuestions(QuestionFilters filters) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Questions, "featured") .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Question> >().ValidateApiResponse(); return(response); }
BaseResponse <Comment> IQuestions.GetCommentsByQuestionIds(List <string> ids, QuestionFilters filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Questions) .WithFilter(filters) .WithIds(ids) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Comment> >().ValidateApiResponse(); return(response); }
BaseResponse <Post> IPosts.GetSuggestedEdits(List <string> ids, SuggestedEditFilter filters) { var url = ApiUrlBuilder.Initialize(_apiKey) .ForClient(ClientType.Posts) .WithFilter(filters) .WithIds(ids, "suggested-edits") .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Post> >().ValidateApiResponse(); return(response); }
BaseResponse <SuggestedEdits> ISuggestedEdits.GetAllSuggestedEdits(SuggestedEditFilter filters) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Suggested_Edits) .WithFilter(filters) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <SuggestedEdits> >().ValidateApiResponse(); return(response); }
BaseResponse <Badge> IBadges.GetAllBadges(BadgeFilters filters, string inName) { MakeSure.ArgumentNotNullOrEmptyString(inName, nameof(inName)); var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Badges) .WithFilter(filters, inName) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Badge> >().ValidateApiResponse(); return(response); }
BaseResponse <Tags> ITags.GetRelatedTags(List <string> tags) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Tags) .WithIds(tags, "related") .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Tags> >().ValidateApiResponse(); return(response); }
BaseResponse <Question> ITags.GetFrequentlyAskedQuestions(List <string> tags) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Tags) .WithIds(tags, "faq") .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Question> >().ValidateApiResponse(); return(response); }
BaseResponse <TagSynonym> ITags.GetAllTagSynonyms(TagFilter filter) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Tags, "synonyms") .WithFilter(filter) .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <TagSynonym> >().ValidateApiResponse(); return(response); }
BaseResponse <TagScore> ITags.GetTopAskers(string tag, string period) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Tags) .WithTagAndPeriod(tag, $"top-askers/{period}") .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <TagScore> >().ValidateApiResponse(); return(response); }
BaseResponse <Tags> ITags.GetTagsByNames(List <string> tags, TagFilter filter) { var url = ApiUrlBuilder .Initialize(_apiKey) .ForClient(ClientType.Tags) .WithFilter(filter) .WithIds(tags, "info") .GetApiUrl(); var response = _httpClient.GetAsync(url).Result.ReadAsJsonAsync <Data <Tags> >().ValidateApiResponse(); return(response); }