A better Rust ATProto crate
at main 3.3 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.feed.generator 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Record declaring of the existence of a feed generator, and containing metadata about it. The record can exist in any repository. 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 Generator<'a> { 22 /// Declaration that a feed accepts feedback interactions from a client through app.bsky.feed.sendInteractions 23 #[serde(skip_serializing_if = "std::option::Option::is_none")] 24 #[builder(into)] 25 pub accepts_interactions: Option<bool>, 26 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 #[builder(into)] 28 #[serde(borrow)] 29 pub avatar: Option<jacquard_common::types::blob::Blob<'a>>, 30 #[serde(skip_serializing_if = "std::option::Option::is_none")] 31 #[builder(into)] 32 #[serde(borrow)] 33 pub content_mode: Option<jacquard_common::CowStr<'a>>, 34 pub created_at: jacquard_common::types::string::Datetime, 35 #[serde(skip_serializing_if = "std::option::Option::is_none")] 36 #[builder(into)] 37 #[serde(borrow)] 38 pub description: Option<jacquard_common::CowStr<'a>>, 39 #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 #[builder(into)] 41 #[serde(borrow)] 42 pub description_facets: Option<Vec<crate::app_bsky::richtext::facet::Facet<'a>>>, 43 #[serde(borrow)] 44 pub did: jacquard_common::types::string::Did<'a>, 45 #[serde(borrow)] 46 #[builder(into)] 47 pub display_name: jacquard_common::CowStr<'a>, 48 /// Self-label values 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 #[builder(into)] 51 #[serde(borrow)] 52 pub labels: Option<crate::com_atproto::label::SelfLabels<'a>>, 53} 54 55/// Typed wrapper for GetRecord response with this collection's record type. 56#[derive( 57 serde::Serialize, 58 serde::Deserialize, 59 Debug, 60 Clone, 61 PartialEq, 62 Eq, 63 jacquard_derive::IntoStatic 64)] 65#[serde(rename_all = "camelCase")] 66pub struct GeneratorGetRecordOutput<'a> { 67 #[serde(skip_serializing_if = "std::option::Option::is_none")] 68 #[serde(borrow)] 69 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 70 #[serde(borrow)] 71 pub uri: jacquard_common::types::string::AtUri<'a>, 72 #[serde(borrow)] 73 pub value: Generator<'a>, 74} 75 76/// Marker type for deserializing records from this collection. 77pub struct GeneratorRecord; 78impl jacquard_common::xrpc::XrpcResp for GeneratorRecord { 79 const NSID: &'static str = "app.bsky.feed.generator"; 80 const ENCODING: &'static str = "application/json"; 81 type Output<'de> = GeneratorGetRecordOutput<'de>; 82 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 83} 84 85impl jacquard_common::types::collection::Collection for Generator<'_> { 86 const NSID: &'static str = "app.bsky.feed.generator"; 87 type Record = GeneratorRecord; 88} 89 90impl From<GeneratorGetRecordOutput<'_>> for Generator<'_> { 91 fn from(output: GeneratorGetRecordOutput<'_>) -> Self { 92 use jacquard_common::IntoStatic; 93 output.value.into_static() 94 } 95}