#[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};
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct VersionOutput<'a> {
#[serde(borrow)]
pub version: CowStr<'a>,
}
#[jacquard_derive::open_union]
#[derive(
Serialize,
Deserialize,
Debug,
Clone,
PartialEq,
Eq,
thiserror::Error,
miette::Diagnostic,
IntoStatic
)]
#[serde(tag = "error", content = "message")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum VersionError<'a> {}
impl core::fmt::Display for VersionError<'_> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
pub struct Version;
pub struct VersionResponse;
impl jacquard_common::xrpc::XrpcResp for VersionResponse {
const NSID: &'static str = "sh.tangled.knot.version";
const ENCODING: &'static str = "application/json";
type Output<'de> = VersionOutput<'de>;
type Err<'de> = VersionError<'de>;
}
impl jacquard_common::xrpc::XrpcRequest for Version {
const NSID: &'static str = "sh.tangled.knot.version";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = VersionResponse;
}
pub struct VersionRequest;
impl jacquard_common::xrpc::XrpcEndpoint for VersionRequest {
const PATH: &'static str = "/xrpc/sh.tangled.knot.version";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<'de> = Version;
type Response = VersionResponse;
}