A better Rust ATProto crate
at main 4.9 kB view raw
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 Default 18)] 19#[serde(rename_all = "camelCase")] 20pub struct CommitCountBreakdown<'a> { 21 #[serde(skip_serializing_if = "std::option::Option::is_none")] 22 #[serde(borrow)] 23 pub by_email: std::option::Option< 24 Vec<crate::sh_tangled::git::ref_update::IndividualEmailCommitCount<'a>>, 25 >, 26} 27 28#[jacquard_derive::lexicon] 29#[derive( 30 serde::Serialize, 31 serde::Deserialize, 32 Debug, 33 Clone, 34 PartialEq, 35 Eq, 36 jacquard_derive::IntoStatic, 37 bon::Builder 38)] 39#[serde(rename_all = "camelCase")] 40pub struct IndividualEmailCommitCount<'a> { 41 pub count: i64, 42 #[serde(borrow)] 43 #[builder(into)] 44 pub email: jacquard_common::CowStr<'a>, 45} 46 47#[jacquard_derive::lexicon] 48#[derive( 49 serde::Serialize, 50 serde::Deserialize, 51 Debug, 52 Clone, 53 PartialEq, 54 Eq, 55 jacquard_derive::IntoStatic, 56 bon::Builder 57)] 58#[serde(rename_all = "camelCase")] 59pub struct IndividualLanguageSize<'a> { 60 #[serde(borrow)] 61 #[builder(into)] 62 pub lang: jacquard_common::CowStr<'a>, 63 pub size: i64, 64} 65 66#[jacquard_derive::lexicon] 67#[derive( 68 serde::Serialize, 69 serde::Deserialize, 70 Debug, 71 Clone, 72 PartialEq, 73 Eq, 74 jacquard_derive::IntoStatic, 75 Default 76)] 77#[serde(rename_all = "camelCase")] 78pub struct LangBreakdown<'a> { 79 #[serde(skip_serializing_if = "std::option::Option::is_none")] 80 #[serde(borrow)] 81 pub inputs: std::option::Option< 82 Vec<crate::sh_tangled::git::ref_update::IndividualLanguageSize<'a>>, 83 >, 84} 85 86/// An update to a git repository, emitted by knots. 87#[jacquard_derive::lexicon] 88#[derive( 89 serde::Serialize, 90 serde::Deserialize, 91 Debug, 92 Clone, 93 PartialEq, 94 Eq, 95 jacquard_derive::IntoStatic, 96 bon::Builder 97)] 98#[serde(rename_all = "camelCase")] 99pub struct RefUpdate<'a> { 100 /// did of the user that pushed this ref 101 #[serde(borrow)] 102 pub committer_did: jacquard_common::types::string::Did<'a>, 103 #[serde(borrow)] 104 pub meta: crate::sh_tangled::git::ref_update::Meta<'a>, 105 /// new SHA of this ref 106 #[serde(borrow)] 107 #[builder(into)] 108 pub new_sha: jacquard_common::CowStr<'a>, 109 /// old SHA of this ref 110 #[serde(borrow)] 111 #[builder(into)] 112 pub old_sha: jacquard_common::CowStr<'a>, 113 /// Ref being updated 114 #[serde(borrow)] 115 #[builder(into)] 116 pub r#ref: jacquard_common::CowStr<'a>, 117 /// did of the owner of the repo 118 #[serde(borrow)] 119 pub repo_did: jacquard_common::types::string::Did<'a>, 120 /// name of the repo 121 #[serde(borrow)] 122 #[builder(into)] 123 pub repo_name: jacquard_common::CowStr<'a>, 124} 125 126/// Typed wrapper for GetRecord response with this collection's record type. 127#[derive( 128 serde::Serialize, 129 serde::Deserialize, 130 Debug, 131 Clone, 132 PartialEq, 133 Eq, 134 jacquard_derive::IntoStatic 135)] 136#[serde(rename_all = "camelCase")] 137pub struct RefUpdateGetRecordOutput<'a> { 138 #[serde(skip_serializing_if = "std::option::Option::is_none")] 139 #[serde(borrow)] 140 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 141 #[serde(borrow)] 142 pub uri: jacquard_common::types::string::AtUri<'a>, 143 #[serde(borrow)] 144 pub value: RefUpdate<'a>, 145} 146 147/// Marker type for deserializing records from this collection. 148pub struct RefUpdateRecord; 149impl jacquard_common::xrpc::XrpcResp for RefUpdateRecord { 150 const NSID: &'static str = "sh.tangled.git.refUpdate"; 151 const ENCODING: &'static str = "application/json"; 152 type Output<'de> = RefUpdateGetRecordOutput<'de>; 153 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 154} 155 156impl jacquard_common::types::collection::Collection for RefUpdate<'_> { 157 const NSID: &'static str = "sh.tangled.git.refUpdate"; 158 type Record = RefUpdateRecord; 159} 160 161impl From<RefUpdateGetRecordOutput<'_>> for RefUpdate<'_> { 162 fn from(output: RefUpdateGetRecordOutput<'_>) -> Self { 163 use jacquard_common::IntoStatic; 164 output.value.into_static() 165 } 166} 167 168#[jacquard_derive::lexicon] 169#[derive( 170 serde::Serialize, 171 serde::Deserialize, 172 Debug, 173 Clone, 174 PartialEq, 175 Eq, 176 jacquard_derive::IntoStatic, 177 bon::Builder 178)] 179#[serde(rename_all = "camelCase")] 180pub struct Meta<'a> { 181 #[serde(borrow)] 182 pub commit_count: crate::sh_tangled::git::ref_update::CommitCountBreakdown<'a>, 183 pub is_default_ref: bool, 184 #[serde(skip_serializing_if = "std::option::Option::is_none")] 185 #[builder(into)] 186 #[serde(borrow)] 187 pub lang_breakdown: Option<crate::sh_tangled::git::ref_update::LangBreakdown<'a>>, 188}