#![allow(clippy::all)]
pub const NSID: &str = "sh.tangled.ci.triggerPipeline";
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Input {
pub repo: String,
pub trigger: serde_json::Value,
#[serde(skip_serializing_if = "Option::is_none", default)]
pub workflows: Option<Vec<String>>,
}
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Output {
pub pipeline: String,
}
pub fn trigger_pipeline(
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
}