A better Rust ATProto crate
at oauth 6.5 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.bsky.notification.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 declaration; 9pub mod get_preferences; 10pub mod get_unread_count; 11pub mod list_activity_subscriptions; 12pub mod list_notifications; 13pub mod put_activity_subscription; 14pub mod put_preferences; 15pub mod put_preferences_v2; 16pub mod register_push; 17pub mod unregister_push; 18pub mod update_seen; 19 20#[jacquard_derive::lexicon] 21#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 22#[serde(rename_all = "camelCase")] 23pub struct ActivitySubscription<'a> { 24 pub post: bool, 25 pub reply: bool, 26} 27 28impl jacquard_common::IntoStatic for ActivitySubscription<'_> { 29 type Output = ActivitySubscription<'static>; 30 fn into_static(self) -> Self::Output { 31 ActivitySubscription { 32 post: self.post.into_static(), 33 reply: self.reply.into_static(), 34 extra_data: self.extra_data.into_static(), 35 } 36 } 37} 38 39#[jacquard_derive::lexicon] 40#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 41#[serde(rename_all = "camelCase")] 42pub struct ChatPreference<'a> { 43 #[serde(borrow)] 44 pub include: jacquard_common::CowStr<'a>, 45 pub push: bool, 46} 47 48impl jacquard_common::IntoStatic for ChatPreference<'_> { 49 type Output = ChatPreference<'static>; 50 fn into_static(self) -> Self::Output { 51 ChatPreference { 52 include: self.include.into_static(), 53 push: self.push.into_static(), 54 extra_data: self.extra_data.into_static(), 55 } 56 } 57} 58 59#[jacquard_derive::lexicon] 60#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 61#[serde(rename_all = "camelCase")] 62pub struct FilterablePreference<'a> { 63 #[serde(borrow)] 64 pub include: jacquard_common::CowStr<'a>, 65 pub list: bool, 66 pub push: bool, 67} 68 69impl jacquard_common::IntoStatic for FilterablePreference<'_> { 70 type Output = FilterablePreference<'static>; 71 fn into_static(self) -> Self::Output { 72 FilterablePreference { 73 include: self.include.into_static(), 74 list: self.list.into_static(), 75 push: self.push.into_static(), 76 extra_data: self.extra_data.into_static(), 77 } 78 } 79} 80 81#[jacquard_derive::lexicon] 82#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 83#[serde(rename_all = "camelCase")] 84pub struct Preference<'a> { 85 pub list: bool, 86 pub push: bool, 87} 88 89impl jacquard_common::IntoStatic for Preference<'_> { 90 type Output = Preference<'static>; 91 fn into_static(self) -> Self::Output { 92 Preference { 93 list: self.list.into_static(), 94 push: self.push.into_static(), 95 extra_data: self.extra_data.into_static(), 96 } 97 } 98} 99 100#[jacquard_derive::lexicon] 101#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 102#[serde(rename_all = "camelCase")] 103pub struct Preferences<'a> { 104 #[serde(borrow)] 105 pub chat: crate::app_bsky::notification::ChatPreference<'a>, 106 #[serde(borrow)] 107 pub follow: crate::app_bsky::notification::FilterablePreference<'a>, 108 #[serde(borrow)] 109 pub like: crate::app_bsky::notification::FilterablePreference<'a>, 110 #[serde(borrow)] 111 pub like_via_repost: crate::app_bsky::notification::FilterablePreference<'a>, 112 #[serde(borrow)] 113 pub mention: crate::app_bsky::notification::FilterablePreference<'a>, 114 #[serde(borrow)] 115 pub quote: crate::app_bsky::notification::FilterablePreference<'a>, 116 #[serde(borrow)] 117 pub reply: crate::app_bsky::notification::FilterablePreference<'a>, 118 #[serde(borrow)] 119 pub repost: crate::app_bsky::notification::FilterablePreference<'a>, 120 #[serde(borrow)] 121 pub repost_via_repost: crate::app_bsky::notification::FilterablePreference<'a>, 122 #[serde(borrow)] 123 pub starterpack_joined: crate::app_bsky::notification::Preference<'a>, 124 #[serde(borrow)] 125 pub subscribed_post: crate::app_bsky::notification::Preference<'a>, 126 #[serde(borrow)] 127 pub unverified: crate::app_bsky::notification::Preference<'a>, 128 #[serde(borrow)] 129 pub verified: crate::app_bsky::notification::Preference<'a>, 130} 131 132impl jacquard_common::IntoStatic for Preferences<'_> { 133 type Output = Preferences<'static>; 134 fn into_static(self) -> Self::Output { 135 Preferences { 136 chat: self.chat.into_static(), 137 follow: self.follow.into_static(), 138 like: self.like.into_static(), 139 like_via_repost: self.like_via_repost.into_static(), 140 mention: self.mention.into_static(), 141 quote: self.quote.into_static(), 142 reply: self.reply.into_static(), 143 repost: self.repost.into_static(), 144 repost_via_repost: self.repost_via_repost.into_static(), 145 starterpack_joined: self.starterpack_joined.into_static(), 146 subscribed_post: self.subscribed_post.into_static(), 147 unverified: self.unverified.into_static(), 148 verified: self.verified.into_static(), 149 extra_data: self.extra_data.into_static(), 150 } 151 } 152} 153 154#[jacquard_derive::lexicon] 155#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 156#[serde(rename_all = "camelCase")] 157pub struct RecordDeleted<'a> {} 158impl jacquard_common::IntoStatic for RecordDeleted<'_> { 159 type Output = RecordDeleted<'static>; 160 fn into_static(self) -> Self::Output { 161 RecordDeleted { 162 extra_data: self.extra_data.into_static(), 163 } 164 } 165} 166 167///Object used to store activity subscription data in stash. 168#[jacquard_derive::lexicon] 169#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] 170#[serde(rename_all = "camelCase")] 171pub struct SubjectActivitySubscription<'a> { 172 #[serde(borrow)] 173 pub activity_subscription: crate::app_bsky::notification::ActivitySubscription<'a>, 174 #[serde(borrow)] 175 pub subject: jacquard_common::types::string::Did<'a>, 176} 177 178impl jacquard_common::IntoStatic for SubjectActivitySubscription<'_> { 179 type Output = SubjectActivitySubscription<'static>; 180 fn into_static(self) -> Self::Output { 181 SubjectActivitySubscription { 182 activity_subscription: self.activity_subscription.into_static(), 183 subject: self.subject.into_static(), 184 extra_data: self.extra_data.into_static(), 185 } 186 } 187}