A better Rust ATProto crate
at main 2.2 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.ocho.plugin.service 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// The definitions for the plugin. 9#[jacquard_derive::lexicon] 10#[derive( 11 serde::Serialize, 12 serde::Deserialize, 13 Debug, 14 Clone, 15 PartialEq, 16 Eq, 17 jacquard_derive::IntoStatic, 18 bon::Builder 19)] 20#[serde(rename_all = "camelCase")] 21pub struct Service<'a> { 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[builder(into)] 24 #[serde(borrow)] 25 pub db: Option<crate::app_ocho::plugin::Db<'a>>, 26 /// Additional metadata for the plugin, including Expo client and Go configurations. 27 #[serde(borrow)] 28 pub permissions: Vec<jacquard_common::CowStr<'a>>, 29} 30 31/// Typed wrapper for GetRecord response with this collection's record type. 32#[derive( 33 serde::Serialize, 34 serde::Deserialize, 35 Debug, 36 Clone, 37 PartialEq, 38 Eq, 39 jacquard_derive::IntoStatic 40)] 41#[serde(rename_all = "camelCase")] 42pub struct ServiceGetRecordOutput<'a> { 43 #[serde(skip_serializing_if = "std::option::Option::is_none")] 44 #[serde(borrow)] 45 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 46 #[serde(borrow)] 47 pub uri: jacquard_common::types::string::AtUri<'a>, 48 #[serde(borrow)] 49 pub value: Service<'a>, 50} 51 52/// Marker type for deserializing records from this collection. 53pub struct ServiceRecord; 54impl jacquard_common::xrpc::XrpcResp for ServiceRecord { 55 const NSID: &'static str = "app.ocho.plugin.service"; 56 const ENCODING: &'static str = "application/json"; 57 type Output<'de> = ServiceGetRecordOutput<'de>; 58 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 59} 60 61impl jacquard_common::types::collection::Collection for Service<'_> { 62 const NSID: &'static str = "app.ocho.plugin.service"; 63 type Record = ServiceRecord; 64} 65 66impl From<ServiceGetRecordOutput<'_>> for Service<'_> { 67 fn from(output: ServiceGetRecordOutput<'_>) -> Self { 68 use jacquard_common::IntoStatic; 69 output.value.into_static() 70 } 71}