A better Rust ATProto crate
at main 2.0 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.tangled.repo.issue.state 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8pub mod closed; 9pub mod open; 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 State<'a> { 24 #[serde(borrow)] 25 pub issue: jacquard_common::types::string::AtUri<'a>, 26 /// state of the issue 27 #[serde(borrow)] 28 #[builder(into)] 29 pub state: jacquard_common::CowStr<'a>, 30} 31 32/// Typed wrapper for GetRecord response with this collection's record type. 33#[derive( 34 serde::Serialize, 35 serde::Deserialize, 36 Debug, 37 Clone, 38 PartialEq, 39 Eq, 40 jacquard_derive::IntoStatic 41)] 42#[serde(rename_all = "camelCase")] 43pub struct StateGetRecordOutput<'a> { 44 #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 #[serde(borrow)] 46 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 47 #[serde(borrow)] 48 pub uri: jacquard_common::types::string::AtUri<'a>, 49 #[serde(borrow)] 50 pub value: State<'a>, 51} 52 53/// Marker type for deserializing records from this collection. 54pub struct StateRecord; 55impl jacquard_common::xrpc::XrpcResp for StateRecord { 56 const NSID: &'static str = "sh.tangled.repo.issue.state"; 57 const ENCODING: &'static str = "application/json"; 58 type Output<'de> = StateGetRecordOutput<'de>; 59 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 60} 61 62impl jacquard_common::types::collection::Collection for State<'_> { 63 const NSID: &'static str = "sh.tangled.repo.issue.state"; 64 type Record = StateRecord; 65} 66 67impl From<StateGetRecordOutput<'_>> for State<'_> { 68 fn from(output: StateGetRecordOutput<'_>) -> Self { 69 use jacquard_common::IntoStatic; 70 output.value.into_static() 71 } 72}