A better Rust ATProto crate
at oauth 6.9 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.embed.record 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(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 10#[serde(rename_all = "camelCase")] 11pub struct Record<'a> { 12 #[serde(borrow)] 13 pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, 14} 15 16impl jacquard_common::IntoStatic for Record<'_> { 17 type Output = Record<'static>; 18 fn into_static(self) -> Self::Output { 19 Record { 20 record: self.record.into_static(), 21 extra_data: self.extra_data.into_static(), 22 } 23 } 24} 25 26#[jacquard_derive::lexicon] 27#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 28#[serde(rename_all = "camelCase")] 29pub struct View<'a> { 30 #[serde(borrow)] 31 pub record: ViewRecordRecord<'a>, 32} 33 34#[jacquard_derive::open_union] 35#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 36#[serde(tag = "$type")] 37#[serde(bound(deserialize = "'de: 'a"))] 38pub enum ViewRecordRecord<'a> { 39 #[serde(rename = "app.bsky.feed.defs#generatorView")] 40 DefsGeneratorView(Box<crate::app_bsky::feed::GeneratorView<'a>>), 41 #[serde(rename = "app.bsky.graph.defs#listView")] 42 DefsListView(Box<crate::app_bsky::graph::ListView<'a>>), 43 #[serde(rename = "app.bsky.labeler.defs#labelerView")] 44 DefsLabelerView(Box<crate::app_bsky::labeler::LabelerView<'a>>), 45 #[serde(rename = "app.bsky.graph.defs#starterPackViewBasic")] 46 DefsStarterPackViewBasic(Box<crate::app_bsky::graph::StarterPackViewBasic<'a>>), 47} 48 49impl jacquard_common::IntoStatic for ViewRecordRecord<'_> { 50 type Output = ViewRecordRecord<'static>; 51 fn into_static(self) -> Self::Output { 52 match self { 53 ViewRecordRecord::DefsGeneratorView(v) => { 54 ViewRecordRecord::DefsGeneratorView(v.into_static()) 55 } 56 ViewRecordRecord::DefsListView(v) => { 57 ViewRecordRecord::DefsListView(v.into_static()) 58 } 59 ViewRecordRecord::DefsLabelerView(v) => { 60 ViewRecordRecord::DefsLabelerView(v.into_static()) 61 } 62 ViewRecordRecord::DefsStarterPackViewBasic(v) => { 63 ViewRecordRecord::DefsStarterPackViewBasic(v.into_static()) 64 } 65 ViewRecordRecord::Unknown(v) => ViewRecordRecord::Unknown(v.into_static()), 66 } 67 } 68} 69 70impl jacquard_common::IntoStatic for View<'_> { 71 type Output = View<'static>; 72 fn into_static(self) -> Self::Output { 73 View { 74 record: self.record.into_static(), 75 extra_data: self.extra_data.into_static(), 76 } 77 } 78} 79 80#[jacquard_derive::lexicon] 81#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 82#[serde(rename_all = "camelCase")] 83pub struct ViewBlocked<'a> { 84 #[serde(borrow)] 85 pub author: crate::app_bsky::feed::BlockedAuthor<'a>, 86 pub blocked: bool, 87 #[serde(borrow)] 88 pub uri: jacquard_common::types::string::AtUri<'a>, 89} 90 91impl jacquard_common::IntoStatic for ViewBlocked<'_> { 92 type Output = ViewBlocked<'static>; 93 fn into_static(self) -> Self::Output { 94 ViewBlocked { 95 author: self.author.into_static(), 96 blocked: self.blocked.into_static(), 97 uri: self.uri.into_static(), 98 extra_data: self.extra_data.into_static(), 99 } 100 } 101} 102 103#[jacquard_derive::lexicon] 104#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 105#[serde(rename_all = "camelCase")] 106pub struct ViewDetached<'a> { 107 pub detached: bool, 108 #[serde(borrow)] 109 pub uri: jacquard_common::types::string::AtUri<'a>, 110} 111 112impl jacquard_common::IntoStatic for ViewDetached<'_> { 113 type Output = ViewDetached<'static>; 114 fn into_static(self) -> Self::Output { 115 ViewDetached { 116 detached: self.detached.into_static(), 117 uri: self.uri.into_static(), 118 extra_data: self.extra_data.into_static(), 119 } 120 } 121} 122 123#[jacquard_derive::lexicon] 124#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 125#[serde(rename_all = "camelCase")] 126pub struct ViewNotFound<'a> { 127 pub not_found: bool, 128 #[serde(borrow)] 129 pub uri: jacquard_common::types::string::AtUri<'a>, 130} 131 132impl jacquard_common::IntoStatic for ViewNotFound<'_> { 133 type Output = ViewNotFound<'static>; 134 fn into_static(self) -> Self::Output { 135 ViewNotFound { 136 not_found: self.not_found.into_static(), 137 uri: self.uri.into_static(), 138 extra_data: self.extra_data.into_static(), 139 } 140 } 141} 142 143#[jacquard_derive::lexicon] 144#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 145#[serde(rename_all = "camelCase")] 146pub struct ViewRecord<'a> { 147 #[serde(borrow)] 148 pub author: crate::app_bsky::actor::ProfileViewBasic<'a>, 149 #[serde(borrow)] 150 pub cid: jacquard_common::types::string::Cid<'a>, 151 #[serde(skip_serializing_if = "std::option::Option::is_none")] 152 #[serde(borrow)] 153 pub embeds: std::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 154 pub indexed_at: jacquard_common::types::string::Datetime, 155 #[serde(skip_serializing_if = "std::option::Option::is_none")] 156 #[serde(borrow)] 157 pub labels: std::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 158 #[serde(skip_serializing_if = "std::option::Option::is_none")] 159 pub like_count: std::option::Option<i64>, 160 #[serde(skip_serializing_if = "std::option::Option::is_none")] 161 pub quote_count: std::option::Option<i64>, 162 #[serde(skip_serializing_if = "std::option::Option::is_none")] 163 pub reply_count: std::option::Option<i64>, 164 #[serde(skip_serializing_if = "std::option::Option::is_none")] 165 pub repost_count: std::option::Option<i64>, 166 #[serde(borrow)] 167 pub uri: jacquard_common::types::string::AtUri<'a>, 168 ///The record data itself. 169 #[serde(borrow)] 170 pub value: jacquard_common::types::value::Data<'a>, 171} 172 173impl jacquard_common::IntoStatic for ViewRecord<'_> { 174 type Output = ViewRecord<'static>; 175 fn into_static(self) -> Self::Output { 176 ViewRecord { 177 author: self.author.into_static(), 178 cid: self.cid.into_static(), 179 embeds: self.embeds.into_static(), 180 indexed_at: self.indexed_at.into_static(), 181 labels: self.labels.into_static(), 182 like_count: self.like_count.into_static(), 183 quote_count: self.quote_count.into_static(), 184 reply_count: self.reply_count.into_static(), 185 repost_count: self.repost_count.into_static(), 186 uri: self.uri.into_static(), 187 value: self.value.into_static(), 188 extra_data: self.extra_data.into_static(), 189 } 190 } 191}