Ejemplo n.º 1
0
        public Task<string> UpdateHighlightAsync(string accessToken, string highlightId, Highlight updatedHighlight)
        {
            IDictionary<string, string> parameters = GetInitializedParameterCollection();
            parameters.Add(ReadmillConstants.AccessToken, accessToken);
            parameters.Add(HighlightsClient.HighlightId, highlightId);

            WrappedHighlight wrappedUpdate = new WrappedHighlight();
            wrappedUpdate.Highlight = updatedHighlight;

            var highlightUrl = highlightsUriTemplates[HighlightsUriTemplateType.SingleHighlight].BindByName(this.readmillBaseUri, parameters);

            return PutAsync<WrappedHighlight>(wrappedUpdate, highlightUrl);
        }
Ejemplo n.º 2
0
        public Task<string> PostReadingHighlightAsync(string accessToken, string readingId, Highlight highlight)
        {
            IDictionary<string, string> parameters = GetInitializedParameterCollection();
            parameters.Add(ReadmillConstants.AccessToken, accessToken);
            parameters.Add(ReadingsClient.ReadingId, readingId);

            //Wrap in InternalHighlight
            var wrappedHighlight = new WrappedHighlight() { Highlight = highlight};

            var highlightUrl = readingsUriTemplates[ReadingsUriTemplateType.ReadingHighlights].BindByName(this.readmillBaseUri, parameters);
            return PostAsync<WrappedHighlight>(wrappedHighlight, highlightUrl);
        }