// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: app.ocho.auth.whoami
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
use jacquard_derive::{IntoStatic, lexicon};
use serde::{Serialize, Deserialize};
/// The session data

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct WhoamiOutput<'a> {
    ///The user's DID
    #[serde(borrow)]
    pub did: CowStr<'a>,
    ///The user's ID
    #[serde(borrow)]
    pub handle: CowStr<'a>,
}

/// XRPC request marker type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
pub struct Whoami;
/// Response type for app.ocho.auth.whoami
pub struct WhoamiResponse;
impl jacquard_common::xrpc::XrpcResp for WhoamiResponse {
    const NSID: &'static str = "app.ocho.auth.whoami";
    const ENCODING: &'static str = "application/json";
    type Output<'de> = WhoamiOutput<'de>;
    type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}

impl jacquard_common::xrpc::XrpcRequest for Whoami {
    const NSID: &'static str = "app.ocho.auth.whoami";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = WhoamiResponse;
}

/// Endpoint type for app.ocho.auth.whoami
pub struct WhoamiRequest;
impl jacquard_common::xrpc::XrpcEndpoint for WhoamiRequest {
    const PATH: &'static str = "/xrpc/app.ocho.auth.whoami";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<'de> = Whoami;
    type Response = WhoamiResponse;
}