#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct GetFollowingUser<'a> {
#[serde(borrow)]
pub subject_did: jacquard_common::types::string::Did<'a>,
#[serde(borrow)]
pub user_did: jacquard_common::types::string::Did<'a>,
}
pub mod get_following_user_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 UserDid;
type SubjectDid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type UserDid = Unset;
type SubjectDid = Unset;
}
pub struct SetUserDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUserDid<S> {}
impl<S: State> State for SetUserDid<S> {
type UserDid = Set<members::user_did>;
type SubjectDid = S::SubjectDid;
}
pub struct SetSubjectDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubjectDid<S> {}
impl<S: State> State for SetSubjectDid<S> {
type UserDid = S::UserDid;
type SubjectDid = Set<members::subject_did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct user_did(());
pub struct subject_did(());
}
}
pub struct GetFollowingUserBuilder<'a, S: get_following_user_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Did<'a>>,
::core::option::Option<jacquard_common::types::string::Did<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> GetFollowingUser<'a> {
pub fn new() -> GetFollowingUserBuilder<'a, get_following_user_state::Empty> {
GetFollowingUserBuilder::new()
}
}
impl<'a> GetFollowingUserBuilder<'a, get_following_user_state::Empty> {
pub fn new() -> Self {
GetFollowingUserBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> GetFollowingUserBuilder<'a, S>
where
S: get_following_user_state::State,
S::SubjectDid: get_following_user_state::IsUnset,
{
pub fn subject_did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> GetFollowingUserBuilder<'a, get_following_user_state::SetSubjectDid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
GetFollowingUserBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> GetFollowingUserBuilder<'a, S>
where
S: get_following_user_state::State,
S::UserDid: get_following_user_state::IsUnset,
{
pub fn user_did(
mut self,
value: impl Into<jacquard_common::types::string::Did<'a>>,
) -> GetFollowingUserBuilder<'a, get_following_user_state::SetUserDid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
GetFollowingUserBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> GetFollowingUserBuilder<'a, S>
where
S: get_following_user_state::State,
S::UserDid: get_following_user_state::IsSet,
S::SubjectDid: get_following_user_state::IsSet,
{
pub fn build(self) -> GetFollowingUser<'a> {
GetFollowingUser {
subject_did: self.__unsafe_private_named.0.unwrap(),
user_did: self.__unsafe_private_named.1.unwrap(),
}
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct GetFollowingUserOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub follow: std::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
}
pub struct GetFollowingUserResponse;
impl jacquard_common::xrpc::XrpcResp for GetFollowingUserResponse {
const NSID: &'static str = "place.stream.graph.getFollowingUser";
const ENCODING: &'static str = "application/json";
type Output<'de> = GetFollowingUserOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for GetFollowingUser<'a> {
const NSID: &'static str = "place.stream.graph.getFollowingUser";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = GetFollowingUserResponse;
}
pub struct GetFollowingUserRequest;
impl jacquard_common::xrpc::XrpcEndpoint for GetFollowingUserRequest {
const PATH: &'static str = "/xrpc/place.stream.graph.getFollowingUser";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = GetFollowingUser<'de>;
type Response = GetFollowingUserResponse;
}