jacquard-api 0.12.0-beta.2

Generated AT Protocol API bindings for Jacquard
Documentation
// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: ooo.bsky.authfetch.exportRepo
//
// 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::deps::bytes::Bytes;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::value::Data;
use jacquard_common::{BosStr, DefaultStr, FromStaticStr};
use jacquard_derive::IntoStatic;
use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ExportRepoOutput {
    pub body: Bytes,
}

/// XRPC request marker type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
pub struct ExportRepo;
/// Response type for ooo.bsky.authfetch.exportRepo
pub struct ExportRepoResponse;
impl jacquard_common::xrpc::XrpcResp for ExportRepoResponse {
    const NSID: &'static str = "ooo.bsky.authfetch.exportRepo";
    const ENCODING: &'static str = "application/vnd.ipld.car";
    type Output<S: BosStr> = ExportRepoOutput;
    type Err = jacquard_common::xrpc::GenericError;
    fn encode_output<S: BosStr>(
        output: &Self::Output<S>,
    ) -> Result<Vec<u8>, jacquard_common::xrpc::EncodeError>
    where
        Self::Output<S>: Serialize,
    {
        Ok(output.body.to_vec())
    }
    fn decode_output<'de, S>(
        body: &'de [u8],
    ) -> Result<Self::Output<S>, jacquard_common::error::DecodeError>
    where
        S: BosStr + Deserialize<'de>,
        Self::Output<S>: Deserialize<'de>,
    {
        Ok(ExportRepoOutput {
            body: jacquard_common::deps::bytes::Bytes::copy_from_slice(body),
        })
    }
}

impl jacquard_common::xrpc::XrpcRequest for ExportRepo {
    const NSID: &'static str = "ooo.bsky.authfetch.exportRepo";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Response = ExportRepoResponse;
}

/// Endpoint type for ooo.bsky.authfetch.exportRepo
pub struct ExportRepoRequest;
impl jacquard_common::xrpc::XrpcEndpoint for ExportRepoRequest {
    const PATH: &'static str = "/xrpc/ooo.bsky.authfetch.exportRepo";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
    type Request<S: BosStr> = ExportRepo;
    type Response = ExportRepoResponse;
}