Skip to main content

tangled_api/lexicon/sh/tangled/git/temp/
get_commit.rs

1// @generated by `cargo xtask codegen` — do not edit.
2// source: lexicons/git/temp/getCommit.json (sh.tangled.git.temp.getCommit)
3
4#![allow(clippy::all)]
5
6pub const NSID: &str = "sh.tangled.git.temp.getCommit";
7
8#[derive(Debug, Clone, Default, serde::Serialize)]
9pub struct Params {
10    /// reference name to resolve
11    pub r#ref: String,
12    /// DID of the repository
13    pub repo: String,
14}
15
16pub type Output = crate::lexicon::sh::tangled::git::temp::defs::Commit;
17
18/// resolve commit from given ref
19///
20/// Errors:
21/// - `RepoNotFound`: Repository not found or access denied
22/// - `CommitNotFound`: Commit not found
23/// - `InvalidRequest`: Invalid request parameters
24pub fn get_commit(
25    http: &reqwest::Client,
26    base: &str,
27    params: &Params,
28) -> reqwest::RequestBuilder {
29    let rb = http.get(crate::xrpc::xrpc_url(base, NSID));
30    let rb = rb.header(reqwest::header::ACCEPT, "application/json");
31    let rb = crate::xrpc::push_query(rb, params);
32    rb
33}