public void ToString_EventGoogleStructuredData_ReturnsExpectedJsonLd() { var feed = new RpdePage(new Uri("https://www.example.com/feed"), 1, "1", @feedItems); output.WriteLine(feed.ToString()); Assert.Equal(this.jsonRpde, feed.ToString()); }
public async Task <RpdePage> GetOrdersRpdePage(string clientId, long?afterChangeNumber) { var page = new RpdePage(this.FeedUrl, afterChangeNumber, await GetRPDEItems(clientId, afterChangeNumber)); // Orders feed pages do not include a License page.License = null; return(page); }
public async Task <RpdePage> GetOrdersRpdePage(string clientId, long?afterTimestamp, string afterId) { if ((!afterTimestamp.HasValue && !string.IsNullOrWhiteSpace(afterId)) || (afterTimestamp.HasValue && string.IsNullOrWhiteSpace(afterId))) { throw new ArgumentNullException("afterTimestamp and afterId must both be supplied, or neither supplied"); } else { var page = new RpdePage(this.FeedUrl, afterTimestamp, afterId, await GetRPDEItems(clientId, afterTimestamp, afterId)); // Orders feed pages do not include a License page.License = null; return(page); } }
/// <summary> /// Returns the JSON-LD representation of an RpdePage. /// </summary> /// <returns> /// A <see cref="string" /> that represents the JSON representation of the RPDE page. /// </returns> public static string SerializeRpdePage(RpdePage obj) => JsonConvert.SerializeObject(obj, RpdePage.SerializerSettings);
/// <summary> /// Returns the JSON-LD representation of an RpdePage, when the item data type is known at compile time. /// </summary> /// <returns> /// A <see cref="string" /> that represents the JSON representation of the RPDE page. /// </returns> public static string SerializeRpdePage <T>(RpdePage <T> obj) where T : Schema.NET.Thing => JsonConvert.SerializeObject(obj, RpdePage.SerializerSettings);