diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2024-01-13 20:05:44 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2024-01-13 20:05:44 +0100 |
commit | 1c4839d7449fd85734bb1335a303fc377cab1a04 (patch) | |
tree | 850ce6c052624ec157443e0b1625e12c8ca5787c /src | |
parent | d9fa0a00889e40baf5289a65e17d47727b7c506e (diff) | |
download | rust-zotapi-1c4839d7449fd85734bb1335a303fc377cab1a04.tar.gz rust-zotapi-1c4839d7449fd85734bb1335a303fc377cab1a04.tar.bz2 rust-zotapi-1c4839d7449fd85734bb1335a303fc377cab1a04.zip |
Add some more fields to the StreamItem struct.
Diffstat (limited to 'src')
-rw-r--r-- | src/stream/streamitem.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/stream/streamitem.rs b/src/stream/streamitem.rs index 514cae3..d30be9e 100644 --- a/src/stream/streamitem.rs +++ b/src/stream/streamitem.rs @@ -11,6 +11,8 @@ use super::datetime::DateTime; use super::verb::Verb; use serde::Deserialize; +use url::Url; +use uuid::Uuid; #[derive(Debug, Deserialize, PartialEq)] pub enum StreamItemType { @@ -33,6 +35,12 @@ pub struct StreamItem { pub item_type: StreamItemType, pub encoding: StreamItemEncoding, + pub uuid: Uuid, + pub message_id: Url, + pub message_top: Url, + pub message_parent: Url, + pub permalink: Url, + /* * Date and time fields for when the item was * created, last edited or commented, as well as @@ -142,6 +150,11 @@ mod test { assert_eq!(StreamItemType::Activity, item.item_type); assert_eq!(StreamItemEncoding::Zot, item.encoding); + assert_eq!("2c102ec3-676b-4d84-b2b4-9141467a254f", item.uuid.to_string()); + assert_eq!("https://example.com/item/2c102ec3-676b-4d84-b2b4-9141467a254f", item.message_id.to_string()); + assert_eq!("https://example.com/item/2c102ec3-676b-4d84-b2b4-9141467a254f", item.message_top.to_string()); + assert_eq!("https://example.com/item/2c102ec3-676b-4d84-b2b4-9141467a254f", item.message_parent.to_string()); + assert_eq!("https://example.com/item/2c102ec3-676b-4d84-b2b4-9141467a254f", item.permalink.to_string()); assert_eq!(Verb::Post, item.verb); assert_eq!("The item title", &item.title); assert_eq!("The summary of the post", &item.summary); |