A better Rust ATProto crate
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: net.anisota.beta.game.progress 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8///Record representing a player's level progression and game statistics 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)] 19#[serde(rename_all = "camelCase")] 20pub struct Progress<'a> { 21 ///URI of the card that was advanced when triggerSource is card_advance 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 #[serde(borrow)] 24 pub card_uri: std::option::Option<jacquard_common::CowStr<'a>>, 25 ///When the progress record was created 26 pub created_at: jacquard_common::types::string::Datetime, 27 ///Current stamina level when this progress was recorded (decimal string, e.g. '85.5') 28 #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 #[serde(borrow)] 30 pub current_stamina: std::option::Option<jacquard_common::CowStr<'a>>, 31 ///Current player level 32 pub level: i64, 33 #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 #[serde(borrow)] 35 pub metadata: std::option::Option< 36 crate::net_anisota::beta::game::progress::Metadata<'a>, 37 >, 38 ///Previous level before this update (for tracking level progression) 39 #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 pub previous_level: std::option::Option<i64>, 41 ///Progress percentage to the next level (decimal string, e.g. '75.5') 42 #[serde(borrow)] 43 pub progress_percentage: jacquard_common::CowStr<'a>, 44 ///URIs of related game log records that contributed to this progress 45 #[serde(skip_serializing_if = "std::option::Option::is_none")] 46 #[serde(borrow)] 47 pub related_log_uris: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 48 ///Session ID when this progress was recorded (for linking with log records) 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 #[serde(borrow)] 51 pub session_id: std::option::Option<jacquard_common::CowStr<'a>>, 52 ///URI of the session record when this progress was recorded 53 #[serde(skip_serializing_if = "std::option::Option::is_none")] 54 #[serde(borrow)] 55 pub session_uri: std::option::Option<jacquard_common::CowStr<'a>>, 56 #[serde(skip_serializing_if = "std::option::Option::is_none")] 57 #[serde(borrow)] 58 pub stats: std::option::Option<crate::net_anisota::beta::game::progress::Stats<'a>>, 59 ///Total experience points accumulated 60 pub total_xp: i64, 61 ///What action triggered this progress save 62 #[serde(skip_serializing_if = "std::option::Option::is_none")] 63 #[serde(borrow)] 64 pub trigger_source: std::option::Option<jacquard_common::CowStr<'a>>, 65 ///Experience points gained since the last progress save 66 #[serde(skip_serializing_if = "std::option::Option::is_none")] 67 pub xp_gained_since_last_save: std::option::Option<i64>, 68 ///Experience points needed to reach the next level 69 pub xp_to_next_level: i64, 70} 71 72/// Typed wrapper for GetRecord response with this collection's record type. 73#[derive( 74 serde::Serialize, 75 serde::Deserialize, 76 Debug, 77 Clone, 78 PartialEq, 79 Eq, 80 jacquard_derive::IntoStatic 81)] 82#[serde(rename_all = "camelCase")] 83pub struct ProgressGetRecordOutput<'a> { 84 #[serde(skip_serializing_if = "std::option::Option::is_none")] 85 #[serde(borrow)] 86 pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 87 #[serde(borrow)] 88 pub uri: jacquard_common::types::string::AtUri<'a>, 89 #[serde(borrow)] 90 pub value: Progress<'a>, 91} 92 93/// Marker type for deserializing records from this collection. 94pub struct ProgressRecord; 95impl jacquard_common::xrpc::XrpcResp for ProgressRecord { 96 const NSID: &'static str = "net.anisota.beta.game.progress"; 97 const ENCODING: &'static str = "application/json"; 98 type Output<'de> = ProgressGetRecordOutput<'de>; 99 type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 100} 101 102impl jacquard_common::types::collection::Collection for Progress<'_> { 103 const NSID: &'static str = "net.anisota.beta.game.progress"; 104 type Record = ProgressRecord; 105} 106 107impl From<ProgressGetRecordOutput<'_>> for Progress<'_> { 108 fn from(output: ProgressGetRecordOutput<'_>) -> Self { 109 use jacquard_common::IntoStatic; 110 output.value.into_static() 111 } 112} 113 114///Additional metadata about this progress update 115#[jacquard_derive::lexicon] 116#[derive( 117 serde::Serialize, 118 serde::Deserialize, 119 Debug, 120 Clone, 121 PartialEq, 122 Eq, 123 jacquard_derive::IntoStatic 124)] 125#[serde(rename_all = "camelCase")] 126pub struct Metadata<'a> { 127 ///Version of the client when this progress was recorded 128 #[serde(skip_serializing_if = "std::option::Option::is_none")] 129 #[serde(borrow)] 130 pub client_version: std::option::Option<jacquard_common::CowStr<'a>>, 131 ///Platform where the level up occurred (web, mobile, etc.) 132 #[serde(skip_serializing_if = "std::option::Option::is_none")] 133 #[serde(borrow)] 134 pub platform: std::option::Option<jacquard_common::CowStr<'a>>, 135} 136 137///Game-specific statistics and metrics 138#[jacquard_derive::lexicon] 139#[derive( 140 serde::Serialize, 141 serde::Deserialize, 142 Debug, 143 Clone, 144 PartialEq, 145 Eq, 146 jacquard_derive::IntoStatic 147)] 148#[serde(rename_all = "camelCase")] 149pub struct Stats<'a> { 150 ///Total daily rewards claimed 151 #[serde(skip_serializing_if = "std::option::Option::is_none")] 152 pub daily_rewards_claimed: std::option::Option<i64>, 153 ///Total items collected 154 #[serde(skip_serializing_if = "std::option::Option::is_none")] 155 pub items_collected: std::option::Option<i64>, 156 ///Date when posts read today was last updated (for daily reset tracking) 157 #[serde(skip_serializing_if = "std::option::Option::is_none")] 158 pub last_post_read_date: std::option::Option< 159 jacquard_common::types::string::Datetime, 160 >, 161 ///Posts read today (resets daily) 162 #[serde(skip_serializing_if = "std::option::Option::is_none")] 163 pub posts_read_today: std::option::Option<i64>, 164 ///Total posts read (all time, cumulative) 165 #[serde(skip_serializing_if = "std::option::Option::is_none")] 166 pub posts_read_total: std::option::Option<i64>, 167 ///Total posts viewed 168 #[serde(skip_serializing_if = "std::option::Option::is_none")] 169 pub posts_viewed: std::option::Option<i64>, 170 ///Total shuffles performed 171 #[serde(skip_serializing_if = "std::option::Option::is_none")] 172 pub shuffles_performed: std::option::Option<i64>, 173 ///Total specimens collected 174 #[serde(skip_serializing_if = "std::option::Option::is_none")] 175 pub specimens_collected: std::option::Option<i64>, 176}