A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.rocksky.shout.defs 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8pub mod create_shout; 9pub mod get_album_shouts; 10pub mod get_artist_shouts; 11pub mod get_profile_shouts; 12pub mod get_shout_replies; 13pub mod get_track_shouts; 14pub mod remove_shout; 15pub mod reply_shout; 16pub mod report_shout; 17 18/// A declaration of a shout. 19#[jacquard_derive::lexicon] 20#[derive( 21 serde::Serialize, 22 serde::Deserialize, 23 Debug, 24 Clone, 25 PartialEq, 26 Eq, 27 jacquard_derive::IntoStatic, 28 bon::Builder 29)] 30#[serde(rename_all = "camelCase")] 31pub struct Shout<'a> { 32 /// The date when the shout was created. 33 pub created_at: jacquard_common::types::string::Datetime, 34 /// The message of the shout. 35 #[serde(borrow)] 36 #[builder(into)] 37 pub message: jacquard_common::CowStr<'a>, 38 #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 #[builder(into)] 40 #[serde(borrow)] 41 pub parent: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 42 #[serde(borrow)] 43 pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, 44} 45 46/// Typed wrapper for GetRecord response with this collection's record type. 47#[derive( 48 serde::Serialize, 49 serde::Deserialize, 50 Debug, 51 Clone, 52 PartialEq, 53 Eq, 54 jacquard_derive::IntoStatic 55)] 56#[serde(rename_all = "camelCase")] 57pub struct ShoutGetRecordOutput<'a> { 58 #[serde(skip_serializing_if = "std::option::Option::is_none")] 59 #[serde(borrow)] 60 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 61 #[serde(borrow)] 62 pub uri: jacquard_common::types::string::AtUri<'a>, 63 #[serde(borrow)] 64 pub value: Shout<'a>, 65} 66 67/// Marker type for deserializing records from this collection. 68pub struct ShoutRecord; 69impl jacquard_common::xrpc::XrpcResp for ShoutRecord { 70 const NSID: &'static str = "app.rocksky.shout"; 71 const ENCODING: &'static str = "application/json"; 72 type Output<'de> = ShoutGetRecordOutput<'de>; 73 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 74} 75 76impl jacquard_common::types::collection::Collection for Shout<'_> { 77 const NSID: &'static str = "app.rocksky.shout"; 78 type Record = ShoutRecord; 79} 80 81impl From<ShoutGetRecordOutput<'_>> for Shout<'_> { 82 fn from(output: ShoutGetRecordOutput<'_>) -> Self { 83 use jacquard_common::IntoStatic; 84 output.value.into_static() 85 } 86} 87 88#[jacquard_derive::lexicon] 89#[derive( 90 serde::Serialize, 91 serde::Deserialize, 92 Debug, 93 Clone, 94 PartialEq, 95 Eq, 96 jacquard_derive::IntoStatic, 97 Default 98)] 99#[serde(rename_all = "camelCase")] 100pub struct Author<'a> { 101 /// The URL of the author's avatar image. 102 #[serde(skip_serializing_if = "std::option::Option::is_none")] 103 #[serde(borrow)] 104 pub avatar: std::option::Option<jacquard_common::types::string::Uri<'a>>, 105 /// The decentralized identifier (DID) of the author. 106 #[serde(skip_serializing_if = "std::option::Option::is_none")] 107 #[serde(borrow)] 108 pub did: std::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 109 /// The display name of the author. 110 #[serde(skip_serializing_if = "std::option::Option::is_none")] 111 #[serde(borrow)] 112 pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 113 /// The handle of the author. 114 #[serde(skip_serializing_if = "std::option::Option::is_none")] 115 #[serde(borrow)] 116 pub handle: std::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 117 /// The unique identifier of the author. 118 #[serde(skip_serializing_if = "std::option::Option::is_none")] 119 #[serde(borrow)] 120 pub id: std::option::Option<jacquard_common::CowStr<'a>>, 121} 122 123#[jacquard_derive::lexicon] 124#[derive( 125 serde::Serialize, 126 serde::Deserialize, 127 Debug, 128 Clone, 129 PartialEq, 130 Eq, 131 jacquard_derive::IntoStatic, 132 Default 133)] 134#[serde(rename_all = "camelCase")] 135pub struct ShoutView<'a> { 136 /// The author of the shout. 137 #[serde(skip_serializing_if = "std::option::Option::is_none")] 138 #[serde(borrow)] 139 pub author: std::option::Option<crate::app_rocksky::shout::Author<'a>>, 140 /// The date and time when the shout was created. 141 #[serde(skip_serializing_if = "std::option::Option::is_none")] 142 pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 143 /// The unique identifier of the shout. 144 #[serde(skip_serializing_if = "std::option::Option::is_none")] 145 #[serde(borrow)] 146 pub id: std::option::Option<jacquard_common::CowStr<'a>>, 147 /// The content of the shout. 148 #[serde(skip_serializing_if = "std::option::Option::is_none")] 149 #[serde(borrow)] 150 pub message: std::option::Option<jacquard_common::CowStr<'a>>, 151 /// The ID of the parent shout if this is a reply, otherwise null. 152 #[serde(skip_serializing_if = "std::option::Option::is_none")] 153 #[serde(borrow)] 154 pub parent: std::option::Option<jacquard_common::CowStr<'a>>, 155}