tangled-api 0.1.0

Lexicon-generated XRPC client for Tangled and AT Protocol APIs
Documentation
// @generated by `cargo xtask codegen` — do not edit.
// source: lexicons/repo/archive.json (sh.tangled.repo.archive)

#![allow(clippy::all)]

pub const NSID: &str = "sh.tangled.repo.archive";

#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct Params {
    /// Archive format
    #[serde(skip_serializing_if = "Option::is_none")]
    pub format: Option<String>,
    /// Prefix for files in the archive
    #[serde(skip_serializing_if = "Option::is_none")]
    pub prefix: Option<String>,
    /// Git reference (branch, tag, or commit SHA)
    pub r#ref: String,
    /// Repository identifier in format 'did:plc:.../repoName'
    pub repo: String,
}

///
/// Errors:
/// - `RepoNotFound`: Repository not found or access denied
/// - `RefNotFound`: Git reference not found
/// - `InvalidRequest`: Invalid request parameters
/// - `ArchiveError`: Failed to create archive
///
/// The response body is binary; use [`crate::xrpc::send_bytes`].
pub fn archive(
    http: &reqwest::Client,
    base: &str,
    params: &Params,
) -> reqwest::RequestBuilder {
    let rb = http.get(crate::xrpc::xrpc_url(base, NSID));
    let rb = crate::xrpc::push_query(rb, params);
    rb
}