// @generated by jacquard-lexicon. DO NOT EDIT. // // Lexicon: sh.tangled.repo.diff // // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, bon::Builder, jacquard_derive::IntoStatic )] #[builder(start_fn = new)] #[serde(rename_all = "camelCase")] pub struct Diff<'a> { #[serde(borrow)] #[builder(into)] pub r#ref: jacquard_common::CowStr<'a>, #[serde(borrow)] #[builder(into)] pub repo: jacquard_common::CowStr<'a>, } #[jacquard_derive::lexicon] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic )] #[serde(rename_all = "camelCase")] pub struct DiffOutput<'a> {} #[jacquard_derive::open_union] #[derive( serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, thiserror::Error, miette::Diagnostic, jacquard_derive::IntoStatic )] #[serde(tag = "error", content = "message")] #[serde(bound(deserialize = "'de: 'a"))] pub enum DiffError<'a> { /// Repository not found or access denied #[serde(rename = "RepoNotFound")] RepoNotFound(std::option::Option), /// Git reference not found #[serde(rename = "RefNotFound")] RefNotFound(std::option::Option), /// Invalid request parameters #[serde(rename = "InvalidRequest")] InvalidRequest(std::option::Option), } impl std::fmt::Display for DiffError<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { Self::RepoNotFound(msg) => { write!(f, "RepoNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::RefNotFound(msg) => { write!(f, "RefNotFound")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::InvalidRequest(msg) => { write!(f, "InvalidRequest")?; if let Some(msg) = msg { write!(f, ": {}", msg)?; } Ok(()) } Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), } } } ///Response type for ///sh.tangled.repo.diff pub struct DiffResponse; impl jacquard_common::xrpc::XrpcResp for DiffResponse { const NSID: &'static str = "sh.tangled.repo.diff"; const ENCODING: &'static str = "*/*"; type Output<'de> = DiffOutput<'de>; type Err<'de> = DiffError<'de>; } impl<'a> jacquard_common::xrpc::XrpcRequest for Diff<'a> { const NSID: &'static str = "sh.tangled.repo.diff"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Response = DiffResponse; } ///Endpoint type for ///sh.tangled.repo.diff pub struct DiffRequest; impl jacquard_common::xrpc::XrpcEndpoint for DiffRequest { const PATH: &'static str = "/xrpc/sh.tangled.repo.diff"; const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; type Request<'de> = Diff<'de>; type Response = DiffResponse; }