#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::types::ident::AtIdentifier;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
use crate::app_rocksky::actor::NeighbourViewBasic;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GetActorNeighbours<'a> {
#[serde(borrow)]
pub did: AtIdentifier<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct GetActorNeighboursOutput<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub neighbours: Option<Vec<NeighbourViewBasic<'a>>>,
}
pub struct GetActorNeighboursResponse;
impl jacquard_common::xrpc::XrpcResp for GetActorNeighboursResponse {
const NSID: &'static str = "app.rocksky.actor.getActorNeighbours";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetActorNeighboursOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorNeighbours<'a> {
const NSID: &'static str = "app.rocksky.actor.getActorNeighbours";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetActorNeighboursResponse;
}
pub struct GetActorNeighboursRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetActorNeighboursRequest {
const PATH: &'static str = "/xrpc/app.rocksky.actor.getActorNeighbours";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetActorNeighbours<'de>;
type Response = GetActorNeighboursResponse;
}
pub mod get_actor_neighbours_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct GetActorNeighboursBuilder<'a, S: get_actor_neighbours_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtIdentifier<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> GetActorNeighbours<'a> {
pub fn new() -> GetActorNeighboursBuilder<'a, get_actor_neighbours_state::Empty> {
GetActorNeighboursBuilder::new()
}
}
impl<'a> GetActorNeighboursBuilder<'a, get_actor_neighbours_state::Empty> {
pub fn new() -> Self {
GetActorNeighboursBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetActorNeighboursBuilder<'a, S>
where
S: get_actor_neighbours_state::State,
S::Did: get_actor_neighbours_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<AtIdentifier<'a>>,
) -> GetActorNeighboursBuilder<'a, get_actor_neighbours_state::SetDid<S>> {
self._fields.0 = Option::Some(value.into());
GetActorNeighboursBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> GetActorNeighboursBuilder<'a, S>
where
S: get_actor_neighbours_state::State,
S::Did: get_actor_neighbours_state::IsSet,
{
pub fn build(self) -> GetActorNeighbours<'a> {
GetActorNeighbours {
did: self._fields.0.unwrap(),
}
}
}