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/ci/cancelPipeline.json (sh.tangled.ci.cancelPipeline)

#![allow(clippy::all)]

pub const NSID: &str = "sh.tangled.ci.cancelPipeline";

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Input {
    /// pipeline TID
    pub pipeline: String,
    /// git repository DID
    pub repo: String,
    /// Workflow names to filter. When not provided, entire pipeline will be canceled.
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub workflows: Option<Vec<String>>,
}

/// Cancel running pipeline or specific workflows
///
/// The response has no body; use [`crate::xrpc::send_unit`].
pub fn cancel_pipeline(
    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
}