#![allow(clippy::all)]
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct ConflictInfo {
pub filename: String,
pub reason: String,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
pub const NSID: &str = "sh.tangled.repo.mergeCheck";
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Input {
pub branch: String,
pub did: String,
pub name: String,
pub patch: String,
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Output {
#[serde(skip_serializing_if = "Option::is_none", default)]
pub conflicts: Option<
Vec<crate::lexicon::sh::tangled::repo::merge_check::ConflictInfo>,
>,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub error: Option<String>,
pub is_conflicted: bool,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub message: Option<String>,
}
pub fn merge_check(
http: &reqwest::Client,
base: &str,
input: &Input,
) -> reqwest::RequestBuilder {
let rb = http.post(crate::xrpc::xrpc_url(base, NSID));
let rb = rb.header(reqwest::header::ACCEPT, "application/json");
let rb = rb.json(input);
rb
}