A better Rust ATProto crate
at main 2.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: network.slices.lexicon 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 bon::Builder 18)] 19#[serde(rename_all = "camelCase")] 20pub struct Lexicon<'a> { 21 /// When the lexicon was created 22 pub created_at: jacquard_common::types::string::Datetime, 23 /// The lexicon schema definitions as JSON 24 #[serde(borrow)] 25 #[builder(into)] 26 pub definitions: jacquard_common::CowStr<'a>, 27 /// Human-readable description of the lexicon 28 #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 #[builder(into)] 30 #[serde(borrow)] 31 pub description: Option<jacquard_common::CowStr<'a>>, 32 /// Whether this lexicon should be excluded from sync operations 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[builder(into)] 35 pub excluded_from_sync: Option<bool>, 36 /// Namespaced identifier for the lexicon 37 #[serde(borrow)] 38 #[builder(into)] 39 pub nsid: jacquard_common::CowStr<'a>, 40 /// AT-URI reference to the slice this lexicon belongs to 41 #[serde(borrow)] 42 pub slice: jacquard_common::types::string::AtUri<'a>, 43 /// When the lexicon was last updated 44 #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 #[builder(into)] 46 pub updated_at: Option<jacquard_common::types::string::Datetime>, 47} 48 49/// Typed wrapper for GetRecord response with this collection's record type. 50#[derive( 51 serde::Serialize, 52 serde::Deserialize, 53 Debug, 54 Clone, 55 PartialEq, 56 Eq, 57 jacquard_derive::IntoStatic 58)] 59#[serde(rename_all = "camelCase")] 60pub struct LexiconGetRecordOutput<'a> { 61 #[serde(skip_serializing_if = "std::option::Option::is_none")] 62 #[serde(borrow)] 63 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 64 #[serde(borrow)] 65 pub uri: jacquard_common::types::string::AtUri<'a>, 66 #[serde(borrow)] 67 pub value: Lexicon<'a>, 68} 69 70/// Marker type for deserializing records from this collection. 71pub struct LexiconRecord; 72impl jacquard_common::xrpc::XrpcResp for LexiconRecord { 73 const NSID: &'static str = "network.slices.lexicon"; 74 const ENCODING: &'static str = "application/json"; 75 type Output<'de> = LexiconGetRecordOutput<'de>; 76 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 77} 78 79impl jacquard_common::types::collection::Collection for Lexicon<'_> { 80 const NSID: &'static str = "network.slices.lexicon"; 81 type Record = LexiconRecord; 82} 83 84impl From<LexiconGetRecordOutput<'_>> for Lexicon<'_> { 85 fn from(output: LexiconGetRecordOutput<'_>) -> Self { 86 use jacquard_common::IntoStatic; 87 output.value.into_static() 88 } 89}