// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: ooo.bsky.hds.exportAccount
//
// 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::{BosStr, DefaultStr, FromStaticStr};
use jacquard_common::deps::bytes::Bytes;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use serde::{Serialize, Deserialize};

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

/** Request marker for the `ooo.bsky.hds.exportAccount` procedure.

This endpoint has no request parameters or input body; send this marker with `jacquard::Client`.*/

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
pub struct ExportAccount;
/** Response marker for the `ooo.bsky.hds.exportAccount` procedure.

Implements `jacquard_common::xrpc::XrpcResp`; successful bodies decode as `Self::Output<S>`, which is `ExportAccountOutput` for this endpoint.*/
pub struct ExportAccountResponse;
impl jacquard_common::xrpc::XrpcResp for ExportAccountResponse {
    const NSID: &'static str = "ooo.bsky.hds.exportAccount";
    const ENCODING: &'static str = "application/vnd.ipld.car";
    type Output<S: BosStr> = ExportAccountOutput;
    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(ExportAccountOutput {
            body: jacquard_common::deps::bytes::Bytes::copy_from_slice(body),
        })
    }
}

impl jacquard_common::xrpc::XrpcRequest for ExportAccount {
    const NSID: &'static str = "ooo.bsky.hds.exportAccount";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Response = ExportAccountResponse;
}

/** Endpoint marker for the `ooo.bsky.hds.exportAccount` procedure.

Path: `/xrpc/ooo.bsky.hds.exportAccount`. The request payload type is `ExportAccount`; use this marker with lower-level `XrpcEndpoint` APIs when you need endpoint metadata.*/
pub struct ExportAccountRequest;
impl jacquard_common::xrpc::XrpcEndpoint for ExportAccountRequest {
    const PATH: &'static str = "/xrpc/ooo.bsky.hds.exportAccount";
    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure(
        "application/json",
    );
    type Request<S: BosStr> = ExportAccount;
    type Response = ExportAccountResponse;
}