jacquard_api/sh_tangled/git/
ref_update.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.tangled.git.refUpdate
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10    serde::Serialize,
11    serde::Deserialize,
12    Debug,
13    Clone,
14    PartialEq,
15    Eq,
16    jacquard_derive::IntoStatic
17)]
18#[serde(rename_all = "camelCase")]
19pub struct CommitCountBreakdown<'a> {
20    #[serde(skip_serializing_if = "std::option::Option::is_none")]
21    #[serde(borrow)]
22    pub by_email: std::option::Option<
23        Vec<crate::sh_tangled::git::ref_update::IndividualEmailCommitCount<'a>>,
24    >,
25}
26
27#[jacquard_derive::lexicon]
28#[derive(
29    serde::Serialize,
30    serde::Deserialize,
31    Debug,
32    Clone,
33    PartialEq,
34    Eq,
35    jacquard_derive::IntoStatic
36)]
37#[serde(rename_all = "camelCase")]
38pub struct IndividualEmailCommitCount<'a> {
39    pub count: i64,
40    #[serde(borrow)]
41    pub email: jacquard_common::CowStr<'a>,
42}
43
44#[jacquard_derive::lexicon]
45#[derive(
46    serde::Serialize,
47    serde::Deserialize,
48    Debug,
49    Clone,
50    PartialEq,
51    Eq,
52    jacquard_derive::IntoStatic
53)]
54#[serde(rename_all = "camelCase")]
55pub struct IndividualLanguageSize<'a> {
56    #[serde(borrow)]
57    pub lang: jacquard_common::CowStr<'a>,
58    pub size: i64,
59}
60
61#[jacquard_derive::lexicon]
62#[derive(
63    serde::Serialize,
64    serde::Deserialize,
65    Debug,
66    Clone,
67    PartialEq,
68    Eq,
69    jacquard_derive::IntoStatic
70)]
71#[serde(rename_all = "camelCase")]
72pub struct LangBreakdown<'a> {
73    #[serde(skip_serializing_if = "std::option::Option::is_none")]
74    #[serde(borrow)]
75    pub inputs: std::option::Option<
76        Vec<crate::sh_tangled::git::ref_update::IndividualLanguageSize<'a>>,
77    >,
78}
79
80///An update to a git repository, emitted by knots.
81#[jacquard_derive::lexicon]
82#[derive(
83    serde::Serialize,
84    serde::Deserialize,
85    Debug,
86    Clone,
87    PartialEq,
88    Eq,
89    jacquard_derive::IntoStatic
90)]
91#[serde(rename_all = "camelCase")]
92pub struct RefUpdate<'a> {
93    ///did of the user that pushed this ref
94    #[serde(borrow)]
95    pub committer_did: jacquard_common::types::string::Did<'a>,
96    #[serde(borrow)]
97    pub meta: crate::sh_tangled::git::ref_update::Meta<'a>,
98    ///new SHA of this ref
99    #[serde(borrow)]
100    pub new_sha: jacquard_common::CowStr<'a>,
101    ///old SHA of this ref
102    #[serde(borrow)]
103    pub old_sha: jacquard_common::CowStr<'a>,
104    ///Ref being updated
105    #[serde(borrow)]
106    pub r#ref: jacquard_common::CowStr<'a>,
107    ///did of the owner of the repo
108    #[serde(borrow)]
109    pub repo_did: jacquard_common::types::string::Did<'a>,
110    ///name of the repo
111    #[serde(borrow)]
112    pub repo_name: jacquard_common::CowStr<'a>,
113}
114
115impl jacquard_common::types::collection::Collection for RefUpdate<'_> {
116    const NSID: &'static str = "sh.tangled.git.refUpdate";
117}
118
119#[jacquard_derive::lexicon]
120#[derive(
121    serde::Serialize,
122    serde::Deserialize,
123    Debug,
124    Clone,
125    PartialEq,
126    Eq,
127    jacquard_derive::IntoStatic
128)]
129#[serde(rename_all = "camelCase")]
130pub struct Meta<'a> {
131    #[serde(borrow)]
132    pub commit_count: crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>,
133    pub is_default_ref: bool,
134    #[serde(skip_serializing_if = "std::option::Option::is_none")]
135    #[serde(borrow)]
136    pub lang_breakdown: std::option::Option<
137        crate::sh_tangled::git::ref_update::LangBreakdown<'a>,
138    >,
139}