A better Rust ATProto crate
at main 3.4 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.tangled.repo.pull 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8pub mod comment; 9pub mod status; 10 11#[jacquard_derive::lexicon] 12#[derive( 13 serde::Serialize, 14 serde::Deserialize, 15 Debug, 16 Clone, 17 PartialEq, 18 Eq, 19 jacquard_derive::IntoStatic, 20 bon::Builder 21)] 22#[serde(rename_all = "camelCase")] 23pub struct Pull<'a> { 24 #[serde(skip_serializing_if = "std::option::Option::is_none")] 25 #[builder(into)] 26 #[serde(borrow)] 27 pub body: Option<jacquard_common::CowStr<'a>>, 28 pub created_at: jacquard_common::types::string::Datetime, 29 #[serde(borrow)] 30 #[builder(into)] 31 pub patch: jacquard_common::CowStr<'a>, 32 #[serde(skip_serializing_if = "std::option::Option::is_none")] 33 #[builder(into)] 34 #[serde(borrow)] 35 pub source: Option<crate::sh_tangled::repo::pull::Source<'a>>, 36 #[serde(borrow)] 37 pub target: crate::sh_tangled::repo::pull::Target<'a>, 38 #[serde(borrow)] 39 #[builder(into)] 40 pub title: jacquard_common::CowStr<'a>, 41} 42 43/// Typed wrapper for GetRecord response with this collection's record type. 44#[derive( 45 serde::Serialize, 46 serde::Deserialize, 47 Debug, 48 Clone, 49 PartialEq, 50 Eq, 51 jacquard_derive::IntoStatic 52)] 53#[serde(rename_all = "camelCase")] 54pub struct PullGetRecordOutput<'a> { 55 #[serde(skip_serializing_if = "std::option::Option::is_none")] 56 #[serde(borrow)] 57 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 58 #[serde(borrow)] 59 pub uri: jacquard_common::types::string::AtUri<'a>, 60 #[serde(borrow)] 61 pub value: Pull<'a>, 62} 63 64/// Marker type for deserializing records from this collection. 65pub struct PullRecord; 66impl jacquard_common::xrpc::XrpcResp for PullRecord { 67 const NSID: &'static str = "sh.tangled.repo.pull"; 68 const ENCODING: &'static str = "application/json"; 69 type Output<'de> = PullGetRecordOutput<'de>; 70 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 71} 72 73impl jacquard_common::types::collection::Collection for Pull<'_> { 74 const NSID: &'static str = "sh.tangled.repo.pull"; 75 type Record = PullRecord; 76} 77 78impl From<PullGetRecordOutput<'_>> for Pull<'_> { 79 fn from(output: PullGetRecordOutput<'_>) -> Self { 80 use jacquard_common::IntoStatic; 81 output.value.into_static() 82 } 83} 84 85#[jacquard_derive::lexicon] 86#[derive( 87 serde::Serialize, 88 serde::Deserialize, 89 Debug, 90 Clone, 91 PartialEq, 92 Eq, 93 jacquard_derive::IntoStatic, 94 Default 95)] 96#[serde(rename_all = "camelCase")] 97pub struct Source<'a> { 98 #[serde(borrow)] 99 pub branch: jacquard_common::CowStr<'a>, 100 #[serde(skip_serializing_if = "std::option::Option::is_none")] 101 #[serde(borrow)] 102 pub repo: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 103 #[serde(borrow)] 104 pub sha: jacquard_common::CowStr<'a>, 105} 106 107#[jacquard_derive::lexicon] 108#[derive( 109 serde::Serialize, 110 serde::Deserialize, 111 Debug, 112 Clone, 113 PartialEq, 114 Eq, 115 jacquard_derive::IntoStatic, 116 bon::Builder 117)] 118#[serde(rename_all = "camelCase")] 119pub struct Target<'a> { 120 #[serde(borrow)] 121 #[builder(into)] 122 pub branch: jacquard_common::CowStr<'a>, 123 #[serde(borrow)] 124 pub repo: jacquard_common::types::string::AtUri<'a>, 125}