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/git/refUpdate.json (sh.tangled.git.refUpdate)

#![allow(clippy::all)]

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct CommitCountBreakdown {
    #[serde(rename = "byEmail", skip_serializing_if = "Option::is_none", default)]
    pub by_email: Option<Vec<crate::lexicon::sh::tangled::git::ref_update::IndividualEmailCommitCount>>,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct IndividualEmailCommitCount {
    pub count: i64,
    pub email: String,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct IndividualLanguageSize {
    pub lang: String,
    pub size: i64,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct LangBreakdown {
    #[serde(skip_serializing_if = "Option::is_none", default)]
    pub inputs: Option<Vec<crate::lexicon::sh::tangled::git::ref_update::IndividualLanguageSize>>,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

pub const NSID: &str = "sh.tangled.git.refUpdate";

/// An event record representing git-push operation to git repository, emitted by knots.
#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Record {
    /// Record type discriminator (`$type`); set to [`NSID`] when writing.
    #[serde(
        rename = "$type",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub r#type: Option<String>,
    /// files changed between commits
    #[serde(
        rename = "changedFiles",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub changed_files: Option<Vec<String>>,
    /// did of the user that pushed this ref
    #[serde(rename = "committerDid")]
    pub committer_did: String,
    pub meta: crate::lexicon::sh::tangled::git::ref_update::Meta,
    /// new SHA of this ref
    #[serde(rename = "newSha")]
    pub new_sha: String,
    /// old SHA of this ref
    #[serde(rename = "oldSha")]
    pub old_sha: String,
    /// did of the owner of the repo
    #[serde(
        rename = "ownerDid",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub owner_did: Option<String>,
    /// push options passed on git-push
    #[serde(
        rename = "pushOptions",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub push_options: Option<Vec<String>>,
    /// Ref being updated
    pub r#ref: String,
    /// DID of the repo itself
    pub repo: String,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}

#[derive(Debug, Clone, Default, serde::Serialize, serde::Deserialize)]
pub struct Meta {
    #[serde(rename = "commitCount")]
    pub commit_count:
        crate::lexicon::sh::tangled::git::ref_update::CommitCountBreakdown,
    #[serde(rename = "isDefaultRef")]
    pub is_default_ref: bool,
    #[serde(
        rename = "langBreakdown",
        skip_serializing_if = "Option::is_none",
        default
    )]
    pub lang_breakdown:
        Option<crate::lexicon::sh::tangled::git::ref_update::LangBreakdown>,
    /// Unknown fields, preserved across read-modify-write round-trips.
    #[serde(flatten)]
    pub extra: serde_json::Map<String, serde_json::Value>,
}