A better Rust ATProto crate
at main 3.1 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.feed.postgate 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8/// Disables embedding of this post. 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 Default 19)] 20#[serde(rename_all = "camelCase")] 21pub struct DisableRule<'a> {} 22/// Record defining interaction rules for a post. The record key (rkey) of the postgate record must match the record key of the post, and that record must be in the same repository. 23#[jacquard_derive::lexicon] 24#[derive( 25 serde::Serialize, 26 serde::Deserialize, 27 Debug, 28 Clone, 29 PartialEq, 30 Eq, 31 jacquard_derive::IntoStatic, 32 bon::Builder 33)] 34#[serde(rename_all = "camelCase")] 35pub struct Postgate<'a> { 36 pub created_at: jacquard_common::types::string::Datetime, 37 /// List of AT-URIs embedding this post that the author has detached from. 38 #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 #[builder(into)] 40 #[serde(borrow)] 41 pub detached_embedding_uris: Option<Vec<jacquard_common::types::string::AtUri<'a>>>, 42 /// List of rules defining who can embed this post. If value is an empty array or is undefined, no particular rules apply and anyone can embed. 43 #[serde(skip_serializing_if = "std::option::Option::is_none")] 44 #[builder(into)] 45 #[serde(borrow)] 46 pub embedding_rules: Option<Vec<crate::app_bsky::feed::postgate::DisableRule<'a>>>, 47 /// Reference (AT-URI) to the post record. 48 #[serde(borrow)] 49 pub post: jacquard_common::types::string::AtUri<'a>, 50} 51 52/// Typed wrapper for GetRecord response with this collection's record type. 53#[derive( 54 serde::Serialize, 55 serde::Deserialize, 56 Debug, 57 Clone, 58 PartialEq, 59 Eq, 60 jacquard_derive::IntoStatic 61)] 62#[serde(rename_all = "camelCase")] 63pub struct PostgateGetRecordOutput<'a> { 64 #[serde(skip_serializing_if = "std::option::Option::is_none")] 65 #[serde(borrow)] 66 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 67 #[serde(borrow)] 68 pub uri: jacquard_common::types::string::AtUri<'a>, 69 #[serde(borrow)] 70 pub value: Postgate<'a>, 71} 72 73/// Marker type for deserializing records from this collection. 74pub struct PostgateRecord; 75impl jacquard_common::xrpc::XrpcResp for PostgateRecord { 76 const NSID: &'static str = "app.bsky.feed.postgate"; 77 const ENCODING: &'static str = "application/json"; 78 type Output<'de> = PostgateGetRecordOutput<'de>; 79 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 80} 81 82impl jacquard_common::types::collection::Collection for Postgate<'_> { 83 const NSID: &'static str = "app.bsky.feed.postgate"; 84 type Record = PostgateRecord; 85} 86 87impl From<PostgateGetRecordOutput<'_>> for Postgate<'_> { 88 fn from(output: PostgateGetRecordOutput<'_>) -> Self { 89 use jacquard_common::IntoStatic; 90 output.value.into_static() 91 } 92}