public async Task <TimelinesResource> GetTimelinesAsync(CancellationToken cancellationToken) { HomeResource home = await GetHomeAsync(cancellationToken); string timelinesUrl = home == null ? null : home.Links.Url(Relations.Timelines); if (timelinesUrl != null) { return(await SendAsync <TimelinesResource>(timelinesUrl, HttpMethod.Get, null, cancellationToken)); } return(null); }
public async Task <TagCombinationListResource> PostTagCombinationsAsync(TagCombinationListResource tagCombinationList, CancellationToken cancellationToken) { HomeResource home = await GetHomeAsync(cancellationToken); string tagCombinationListUrl = home == null ? null : home.Links.Url(Relations.TagCombinationList); if (tagCombinationListUrl == null) { return(null); } return(await SendAsync <TagCombinationListResource>(tagCombinationListUrl, HttpMethod.Post, tagCombinationList, cancellationToken)); }
public async Task <TimelineResource> PublishTimeline(TimelineResource timeline, CancellationToken cancellationToken) { HomeResource home = await GetHomeAsync(cancellationToken); string timelinesUrl = home == null ? null : home.Links.Url(Relations.Timelines); if (timelinesUrl == null) { throw new InvalidOperationException("Cannot publish timeline. Timelines url not found."); } return(await SendAsync <TimelineResource>(timelinesUrl, HttpMethod.Post, timeline, cancellationToken)); }
public HomeController(HomeResource homeResource) { this.homeResource = homeResource; }
public HomeHandler(HomeResource home) { this.home = home; }