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/sync/requestCrawl.json (sh.tangled.sync.requestCrawl)

#![allow(clippy::all)]

pub const NSID: &str = "sh.tangled.sync.requestCrawl";

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Input {
    /// specific repository to ensure crawling
    #[serde(
        rename = "ensureRepo",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub ensure_repo: Option<String>,
    /// Hostname of the current service (eg, Knot) that is requesting to be crawled.
    pub hostname: String,
}

/// Request a service to persistently crawl hosted repos. Does not require auth.
///
/// Errors:
/// - `HostBanned`
///
/// The response has no body; use [`crate::xrpc::send_unit`].
pub fn request_crawl(
    http: &reqwest::Client,
    base: &str,
    input: &Input,
) -> reqwest::RequestBuilder {
    let rb = http.post(crate::xrpc::xrpc_url(base, NSID));
    let rb = rb.json(input);
    rb
}