Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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));
        }
Exemplo n.º 3
0
        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));
        }
Exemplo n.º 4
0
 public HomeController(HomeResource homeResource)
 {
     this.homeResource = homeResource;
 }
Exemplo n.º 5
0
 public HomeHandler(HomeResource home)
 {
     this.home = home;
 }