From 8e5cbc373edee26528bfec6ff9d29deaa8342009 Mon Sep 17 00:00:00 2001 From: mycognosist Date: Thu, 27 Jan 2022 14:25:19 +0200 Subject: [PATCH] add arg types for friends.hops, friends.isFollowing and friends.isBlocking --- src/api/dto/content.rs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/api/dto/content.rs b/src/api/dto/content.rs index 75663a2..7d8e9d2 100644 --- a/src/api/dto/content.rs +++ b/src/api/dto/content.rs @@ -167,3 +167,25 @@ pub struct SubsetQueryOptions { #[serde(rename = "pageLimit")] pub page_limit: Option, } + +/// Query the follow or block state of two peers. +#[derive(Debug, Serialize, Deserialize)] +pub struct RelationshipQuery { + pub source: String, + pub dest: String, +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct FriendsHops { + /// A maximum hops distance. Nodes beyond this distance are omitted from + /// the output. + pub max: i32, + /// Reverse the perspective when calculating hops distance; from `start` + /// looking "out" (`false`) or from the peer ID(s) looking "in" (`true`). + #[serde(skip_serializing_if = "Option::is_none")] + pub reverse: Option, + /// Feed ID of the "central" node where distance is zero. + /// (Default: sbot.id). + #[serde(skip_serializing_if = "Option::is_none")] + pub start: Option, +}