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/com/atproto/identity/resolveHandle.json (com.atproto.identity.resolveHandle)

#![allow(clippy::all)]

pub const NSID: &str = "com.atproto.identity.resolveHandle";

#[derive(Debug, Clone, Default, serde::Serialize)]
pub struct Params {
    /// The handle to resolve.
    pub handle: String,
}

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Output {
    pub did: String,
}

/// Resolves an atproto handle (hostname) to a DID. Does not necessarily bi-directionally verify against the the DID document.
///
/// Errors:
/// - `HandleNotFound`: The resolution process confirmed that the handle does not resolve to any DID.
pub fn resolve_handle(
    http: &reqwest::Client,
    base: &str,
    params: &Params,
) -> reqwest::RequestBuilder {
    let rb = http.get(crate::xrpc::xrpc_url(base, NSID));
    let rb = rb.header(reqwest::header::ACCEPT, "application/json");
    let rb = crate::xrpc::push_query(rb, params);
    rb
}