A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: app.rocksky.scrobble.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_scrobble; 9pub mod get_scrobble; 10pub mod get_scrobbles; 11 12/// A declaration of a scrobble. 13#[jacquard_derive::lexicon] 14#[derive( 15 serde::Serialize, 16 serde::Deserialize, 17 Debug, 18 Clone, 19 PartialEq, 20 Eq, 21 jacquard_derive::IntoStatic, 22 bon::Builder 23)] 24#[serde(rename_all = "camelCase")] 25pub struct Scrobble<'a> { 26 /// The album of the song. 27 #[serde(borrow)] 28 #[builder(into)] 29 pub album: jacquard_common::CowStr<'a>, 30 /// The album art of the song. 31 #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 #[builder(into)] 33 #[serde(borrow)] 34 pub album_art: Option<jacquard_common::types::blob::Blob<'a>>, 35 /// The album artist of the song. 36 #[serde(borrow)] 37 #[builder(into)] 38 pub album_artist: jacquard_common::CowStr<'a>, 39 /// The Apple Music link of the song. 40 #[serde(skip_serializing_if = "std::option::Option::is_none")] 41 #[builder(into)] 42 #[serde(borrow)] 43 pub apple_music_link: Option<jacquard_common::types::string::Uri<'a>>, 44 /// The artist of the song. 45 #[serde(borrow)] 46 #[builder(into)] 47 pub artist: jacquard_common::CowStr<'a>, 48 /// The composer of the song. 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 #[builder(into)] 51 #[serde(borrow)] 52 pub composer: Option<jacquard_common::CowStr<'a>>, 53 /// The copyright message of the song. 54 #[serde(skip_serializing_if = "std::option::Option::is_none")] 55 #[builder(into)] 56 #[serde(borrow)] 57 pub copyright_message: Option<jacquard_common::CowStr<'a>>, 58 /// The date when the song was created. 59 pub created_at: jacquard_common::types::string::Datetime, 60 /// The disc number of the song in the album. 61 #[serde(skip_serializing_if = "std::option::Option::is_none")] 62 #[builder(into)] 63 pub disc_number: Option<i64>, 64 /// The duration of the song in seconds. 65 pub duration: i64, 66 /// The genre of the song. 67 #[serde(skip_serializing_if = "std::option::Option::is_none")] 68 #[builder(into)] 69 #[serde(borrow)] 70 pub genre: Option<jacquard_common::CowStr<'a>>, 71 /// The label of the song. 72 #[serde(skip_serializing_if = "std::option::Option::is_none")] 73 #[builder(into)] 74 #[serde(borrow)] 75 pub label: Option<jacquard_common::CowStr<'a>>, 76 /// The lyrics of the song. 77 #[serde(skip_serializing_if = "std::option::Option::is_none")] 78 #[builder(into)] 79 #[serde(borrow)] 80 pub lyrics: Option<jacquard_common::CowStr<'a>>, 81 /// The MusicBrainz ID of the song. 82 #[serde(skip_serializing_if = "std::option::Option::is_none")] 83 #[builder(into)] 84 #[serde(borrow)] 85 pub mbid: Option<jacquard_common::CowStr<'a>>, 86 /// The release date of the song. 87 #[serde(skip_serializing_if = "std::option::Option::is_none")] 88 #[builder(into)] 89 pub release_date: Option<jacquard_common::types::string::Datetime>, 90 /// The Spotify link of the song. 91 #[serde(skip_serializing_if = "std::option::Option::is_none")] 92 #[builder(into)] 93 #[serde(borrow)] 94 pub spotify_link: Option<jacquard_common::types::string::Uri<'a>>, 95 /// The tags of the song. 96 #[serde(skip_serializing_if = "std::option::Option::is_none")] 97 #[builder(into)] 98 #[serde(borrow)] 99 pub tags: Option<Vec<jacquard_common::CowStr<'a>>>, 100 /// The Tidal link of the song. 101 #[serde(skip_serializing_if = "std::option::Option::is_none")] 102 #[builder(into)] 103 #[serde(borrow)] 104 pub tidal_link: Option<jacquard_common::types::string::Uri<'a>>, 105 /// The title of the song. 106 #[serde(borrow)] 107 #[builder(into)] 108 pub title: jacquard_common::CowStr<'a>, 109 /// The track number of the song in the album. 110 #[serde(skip_serializing_if = "std::option::Option::is_none")] 111 #[builder(into)] 112 pub track_number: Option<i64>, 113 /// Informations about the song 114 #[serde(skip_serializing_if = "std::option::Option::is_none")] 115 #[builder(into)] 116 #[serde(borrow)] 117 pub wiki: Option<jacquard_common::CowStr<'a>>, 118 /// The year the song was released. 119 #[serde(skip_serializing_if = "std::option::Option::is_none")] 120 #[builder(into)] 121 pub year: Option<i64>, 122 /// The YouTube link of the song. 123 #[serde(skip_serializing_if = "std::option::Option::is_none")] 124 #[builder(into)] 125 #[serde(borrow)] 126 pub youtube_link: Option<jacquard_common::types::string::Uri<'a>>, 127} 128 129/// Typed wrapper for GetRecord response with this collection's record type. 130#[derive( 131 serde::Serialize, 132 serde::Deserialize, 133 Debug, 134 Clone, 135 PartialEq, 136 Eq, 137 jacquard_derive::IntoStatic 138)] 139#[serde(rename_all = "camelCase")] 140pub struct ScrobbleGetRecordOutput<'a> { 141 #[serde(skip_serializing_if = "std::option::Option::is_none")] 142 #[serde(borrow)] 143 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 144 #[serde(borrow)] 145 pub uri: jacquard_common::types::string::AtUri<'a>, 146 #[serde(borrow)] 147 pub value: Scrobble<'a>, 148} 149 150/// Marker type for deserializing records from this collection. 151pub struct ScrobbleRecord; 152impl jacquard_common::xrpc::XrpcResp for ScrobbleRecord { 153 const NSID: &'static str = "app.rocksky.scrobble"; 154 const ENCODING: &'static str = "application/json"; 155 type Output<'de> = ScrobbleGetRecordOutput<'de>; 156 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 157} 158 159impl jacquard_common::types::collection::Collection for Scrobble<'_> { 160 const NSID: &'static str = "app.rocksky.scrobble"; 161 type Record = ScrobbleRecord; 162} 163 164impl From<ScrobbleGetRecordOutput<'_>> for Scrobble<'_> { 165 fn from(output: ScrobbleGetRecordOutput<'_>) -> Self { 166 use jacquard_common::IntoStatic; 167 output.value.into_static() 168 } 169} 170 171#[jacquard_derive::lexicon] 172#[derive( 173 serde::Serialize, 174 serde::Deserialize, 175 Debug, 176 Clone, 177 PartialEq, 178 Eq, 179 jacquard_derive::IntoStatic, 180 Default 181)] 182#[serde(rename_all = "camelCase")] 183pub struct ScrobbleViewBasic<'a> { 184 /// The album of the song. 185 #[serde(skip_serializing_if = "std::option::Option::is_none")] 186 #[serde(borrow)] 187 pub album: std::option::Option<jacquard_common::CowStr<'a>>, 188 /// The URI of the album. 189 #[serde(skip_serializing_if = "std::option::Option::is_none")] 190 #[serde(borrow)] 191 pub album_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 192 /// The artist of the song. 193 #[serde(skip_serializing_if = "std::option::Option::is_none")] 194 #[serde(borrow)] 195 pub artist: std::option::Option<jacquard_common::CowStr<'a>>, 196 /// The URI of the artist. 197 #[serde(skip_serializing_if = "std::option::Option::is_none")] 198 #[serde(borrow)] 199 pub artist_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 200 /// The album art URL of the song. 201 #[serde(skip_serializing_if = "std::option::Option::is_none")] 202 #[serde(borrow)] 203 pub cover: std::option::Option<jacquard_common::types::string::Uri<'a>>, 204 /// The timestamp when the scrobble was created. 205 #[serde(skip_serializing_if = "std::option::Option::is_none")] 206 pub date: std::option::Option<jacquard_common::types::string::Datetime>, 207 /// The unique identifier of the scrobble. 208 #[serde(skip_serializing_if = "std::option::Option::is_none")] 209 #[serde(borrow)] 210 pub id: std::option::Option<jacquard_common::CowStr<'a>>, 211 /// The SHA256 hash of the scrobble data. 212 #[serde(skip_serializing_if = "std::option::Option::is_none")] 213 #[serde(borrow)] 214 pub sha256: std::option::Option<jacquard_common::CowStr<'a>>, 215 /// The title of the scrobble. 216 #[serde(skip_serializing_if = "std::option::Option::is_none")] 217 #[serde(borrow)] 218 pub title: std::option::Option<jacquard_common::CowStr<'a>>, 219 /// The URI of the scrobble. 220 #[serde(skip_serializing_if = "std::option::Option::is_none")] 221 #[serde(borrow)] 222 pub uri: std::option::Option<jacquard_common::types::string::Uri<'a>>, 223 /// The handle of the user who created the scrobble. 224 #[serde(skip_serializing_if = "std::option::Option::is_none")] 225 #[serde(borrow)] 226 pub user: std::option::Option<jacquard_common::CowStr<'a>>, 227} 228 229#[jacquard_derive::lexicon] 230#[derive( 231 serde::Serialize, 232 serde::Deserialize, 233 Debug, 234 Clone, 235 PartialEq, 236 Eq, 237 jacquard_derive::IntoStatic, 238 Default 239)] 240#[serde(rename_all = "camelCase")] 241pub struct ScrobbleViewDetailed<'a> { 242 /// The album of the song. 243 #[serde(skip_serializing_if = "std::option::Option::is_none")] 244 #[serde(borrow)] 245 pub album: std::option::Option<jacquard_common::CowStr<'a>>, 246 /// The URI of the album. 247 #[serde(skip_serializing_if = "std::option::Option::is_none")] 248 #[serde(borrow)] 249 pub album_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 250 /// The artist of the song. 251 #[serde(skip_serializing_if = "std::option::Option::is_none")] 252 #[serde(borrow)] 253 pub artist: std::option::Option<jacquard_common::CowStr<'a>>, 254 /// The URI of the artist. 255 #[serde(skip_serializing_if = "std::option::Option::is_none")] 256 #[serde(borrow)] 257 pub artist_uri: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 258 /// The album art URL of the song. 259 #[serde(skip_serializing_if = "std::option::Option::is_none")] 260 #[serde(borrow)] 261 pub cover: std::option::Option<jacquard_common::types::string::Uri<'a>>, 262 /// The timestamp when the scrobble was created. 263 #[serde(skip_serializing_if = "std::option::Option::is_none")] 264 pub date: std::option::Option<jacquard_common::types::string::Datetime>, 265 /// The unique identifier of the scrobble. 266 #[serde(skip_serializing_if = "std::option::Option::is_none")] 267 #[serde(borrow)] 268 pub id: std::option::Option<jacquard_common::CowStr<'a>>, 269 /// The number of listeners 270 #[serde(skip_serializing_if = "std::option::Option::is_none")] 271 pub listeners: std::option::Option<i64>, 272 /// The number of scrobbles for this song 273 #[serde(skip_serializing_if = "std::option::Option::is_none")] 274 pub scrobbles: std::option::Option<i64>, 275 /// The SHA256 hash of the scrobble data. 276 #[serde(skip_serializing_if = "std::option::Option::is_none")] 277 #[serde(borrow)] 278 pub sha256: std::option::Option<jacquard_common::CowStr<'a>>, 279 /// The title of the scrobble. 280 #[serde(skip_serializing_if = "std::option::Option::is_none")] 281 #[serde(borrow)] 282 pub title: std::option::Option<jacquard_common::CowStr<'a>>, 283 /// The URI of the scrobble. 284 #[serde(skip_serializing_if = "std::option::Option::is_none")] 285 #[serde(borrow)] 286 pub uri: std::option::Option<jacquard_common::types::string::Uri<'a>>, 287 /// The handle of the user who created the scrobble. 288 #[serde(skip_serializing_if = "std::option::Option::is_none")] 289 #[serde(borrow)] 290 pub user: std::option::Option<jacquard_common::CowStr<'a>>, 291}