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/merge.json (sh.tangled.repo.merge)

#![allow(clippy::all)]

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

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Input {
    /// Author email for the merge commit
    #[serde(
        rename = "authorEmail",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub author_email: Option<String>,
    /// Author name for the merge commit
    #[serde(
        rename = "authorName",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub author_name: Option<String>,
    /// Target branch to merge into
    pub branch: String,
    /// Additional commit message body
    #[serde(
        rename = "commitBody",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub commit_body: Option<String>,
    /// Merge commit message
    #[serde(
        rename = "commitMessage",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub commit_message: Option<String>,
    /// DID of the repository owner
    pub did: String,
    /// Name of the repository
    pub name: String,
    /// Patch content to merge
    pub patch: String,
}

/// Merge a patch into a repository branch
///
/// The response has no body; use [`crate::xrpc::send_unit`].
pub fn merge(
    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
}