#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::net_anisota::beta::game::progress;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Progress<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_uri: Option<CowStr<'a>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub current_stamina: Option<CowStr<'a>>,
pub level: i64,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub metadata: Option<progress::Metadata<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub previous_level: Option<i64>,
#[serde(borrow)]
pub progress_percentage: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub related_log_uris: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub session_id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub session_uri: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub stats: Option<progress::Stats<'a>>,
pub total_xp: i64,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub trigger_source: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub xp_gained_since_last_save: Option<i64>,
pub xp_to_next_level: i64,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProgressGetRecordOutput<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cid: Option<Cid<'a>>,
#[serde(borrow)]
pub uri: AtUri<'a>,
#[serde(borrow)]
pub value: Progress<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Metadata<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub client_version: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub platform: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct Stats<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub daily_rewards_claimed: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub items_collected: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_post_read_date: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub posts_read_today: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub posts_read_total: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub posts_viewed: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub shuffles_performed: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub specimens_collected: Option<i64>,
}
impl<'a> Progress<'a> {
pub fn uri(
uri: impl Into<CowStr<'a>>,
) -> Result<RecordUri<'a, ProgressRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct ProgressRecord;
impl XrpcResp for ProgressRecord {
const NSID: &'static str = "net.anisota.beta.game.progress";
const ENCODING: &'static str = "application/json";
type Output<'de> = ProgressGetRecordOutput<'de>;
type Err<'de> = RecordError<'de>;
}
impl From<ProgressGetRecordOutput<'_>> for Progress<'_> {
fn from(output: ProgressGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl Collection for Progress<'_> {
const NSID: &'static str = "net.anisota.beta.game.progress";
type Record = ProgressRecord;
}
impl Collection for ProgressRecord {
const NSID: &'static str = "net.anisota.beta.game.progress";
type Record = ProgressRecord;
}
impl<'a> LexiconSchema for Progress<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.progress"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_progress()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.level;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.previous_level {
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("previous_level"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.total_xp;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("total_xp"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.xp_gained_since_last_save {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp_gained_since_last_save"),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.xp_to_next_level;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp_to_next_level"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for Metadata<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.progress"
}
fn def_name() -> &'static str {
"metadata"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_progress()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for Stats<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.progress"
}
fn def_name() -> &'static str {
"stats"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_progress()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.daily_rewards_claimed {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("daily_rewards_claimed"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.items_collected {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("items_collected"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.posts_read_today {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("posts_read_today"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.posts_read_total {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("posts_read_total"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.posts_viewed {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("posts_viewed"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.shuffles_performed {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("shuffles_performed"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.specimens_collected {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("specimens_collected"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
pub mod progress_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type TotalXp;
type XpToNextLevel;
type Level;
type CreatedAt;
type ProgressPercentage;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type TotalXp = Unset;
type XpToNextLevel = Unset;
type Level = Unset;
type CreatedAt = Unset;
type ProgressPercentage = Unset;
}
pub struct SetTotalXp<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTotalXp<S> {}
impl<S: State> State for SetTotalXp<S> {
type TotalXp = Set<members::total_xp>;
type XpToNextLevel = S::XpToNextLevel;
type Level = S::Level;
type CreatedAt = S::CreatedAt;
type ProgressPercentage = S::ProgressPercentage;
}
pub struct SetXpToNextLevel<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetXpToNextLevel<S> {}
impl<S: State> State for SetXpToNextLevel<S> {
type TotalXp = S::TotalXp;
type XpToNextLevel = Set<members::xp_to_next_level>;
type Level = S::Level;
type CreatedAt = S::CreatedAt;
type ProgressPercentage = S::ProgressPercentage;
}
pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLevel<S> {}
impl<S: State> State for SetLevel<S> {
type TotalXp = S::TotalXp;
type XpToNextLevel = S::XpToNextLevel;
type Level = Set<members::level>;
type CreatedAt = S::CreatedAt;
type ProgressPercentage = S::ProgressPercentage;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type TotalXp = S::TotalXp;
type XpToNextLevel = S::XpToNextLevel;
type Level = S::Level;
type CreatedAt = Set<members::created_at>;
type ProgressPercentage = S::ProgressPercentage;
}
pub struct SetProgressPercentage<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetProgressPercentage<S> {}
impl<S: State> State for SetProgressPercentage<S> {
type TotalXp = S::TotalXp;
type XpToNextLevel = S::XpToNextLevel;
type Level = S::Level;
type CreatedAt = S::CreatedAt;
type ProgressPercentage = Set<members::progress_percentage>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct total_xp(());
pub struct xp_to_next_level(());
pub struct level(());
pub struct created_at(());
pub struct progress_percentage(());
}
}
pub struct ProgressBuilder<'a, S: progress_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<i64>,
Option<progress::Metadata<'a>>,
Option<i64>,
Option<CowStr<'a>>,
Option<Vec<CowStr<'a>>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<progress::Stats<'a>>,
Option<i64>,
Option<CowStr<'a>>,
Option<i64>,
Option<i64>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Progress<'a> {
pub fn new() -> ProgressBuilder<'a, progress_state::Empty> {
ProgressBuilder::new()
}
}
impl<'a> ProgressBuilder<'a, progress_state::Empty> {
pub fn new() -> Self {
ProgressBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn card_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_card_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::CreatedAt: progress_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ProgressBuilder<'a, progress_state::SetCreatedAt<S>> {
self._fields.1 = Option::Some(value.into());
ProgressBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn current_stamina(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_current_stamina(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::Level: progress_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<i64>,
) -> ProgressBuilder<'a, progress_state::SetLevel<S>> {
self._fields.3 = Option::Some(value.into());
ProgressBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn metadata(mut self, value: impl Into<Option<progress::Metadata<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_metadata(mut self, value: Option<progress::Metadata<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn previous_level(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_previous_level(mut self, value: Option<i64>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::ProgressPercentage: progress_state::IsUnset,
{
pub fn progress_percentage(
mut self,
value: impl Into<CowStr<'a>>,
) -> ProgressBuilder<'a, progress_state::SetProgressPercentage<S>> {
self._fields.6 = Option::Some(value.into());
ProgressBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn related_log_uris(
mut self,
value: impl Into<Option<Vec<CowStr<'a>>>>,
) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_related_log_uris(mut self, value: Option<Vec<CowStr<'a>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn session_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_session_id(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn session_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_session_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn stats(mut self, value: impl Into<Option<progress::Stats<'a>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_stats(mut self, value: Option<progress::Stats<'a>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::TotalXp: progress_state::IsUnset,
{
pub fn total_xp(
mut self,
value: impl Into<i64>,
) -> ProgressBuilder<'a, progress_state::SetTotalXp<S>> {
self._fields.11 = Option::Some(value.into());
ProgressBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn trigger_source(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_trigger_source(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: progress_state::State> ProgressBuilder<'a, S> {
pub fn xp_gained_since_last_save(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_xp_gained_since_last_save(mut self, value: Option<i64>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::XpToNextLevel: progress_state::IsUnset,
{
pub fn xp_to_next_level(
mut self,
value: impl Into<i64>,
) -> ProgressBuilder<'a, progress_state::SetXpToNextLevel<S>> {
self._fields.14 = Option::Some(value.into());
ProgressBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ProgressBuilder<'a, S>
where
S: progress_state::State,
S::TotalXp: progress_state::IsSet,
S::XpToNextLevel: progress_state::IsSet,
S::Level: progress_state::IsSet,
S::CreatedAt: progress_state::IsSet,
S::ProgressPercentage: progress_state::IsSet,
{
pub fn build(self) -> Progress<'a> {
Progress {
card_uri: self._fields.0,
created_at: self._fields.1.unwrap(),
current_stamina: self._fields.2,
level: self._fields.3.unwrap(),
metadata: self._fields.4,
previous_level: self._fields.5,
progress_percentage: self._fields.6.unwrap(),
related_log_uris: self._fields.7,
session_id: self._fields.8,
session_uri: self._fields.9,
stats: self._fields.10,
total_xp: self._fields.11.unwrap(),
trigger_source: self._fields.12,
xp_gained_since_last_save: self._fields.13,
xp_to_next_level: self._fields.14.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Progress<'a> {
Progress {
card_uri: self._fields.0,
created_at: self._fields.1.unwrap(),
current_stamina: self._fields.2,
level: self._fields.3.unwrap(),
metadata: self._fields.4,
previous_level: self._fields.5,
progress_percentage: self._fields.6.unwrap(),
related_log_uris: self._fields.7,
session_id: self._fields.8,
session_uri: self._fields.9,
stats: self._fields.10,
total_xp: self._fields.11.unwrap(),
trigger_source: self._fields.12,
xp_gained_since_last_save: self._fields.13,
xp_to_next_level: self._fields.14.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_net_anisota_beta_game_progress() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("net.anisota.beta.game.progress"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"Record representing a player's level progression and game statistics",
),
),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("level"),
SmolStr::new_static("totalXP"),
SmolStr::new_static("progressPercentage"),
SmolStr::new_static("xpToNextLevel"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cardUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URI of the card that was advanced when triggerSource is card_advance",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the progress record was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("currentStamina"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Current stamina level when this progress was recorded (decimal string, e.g. '85.5')",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("metadata"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#metadata"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("previousLevel"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("progressPercentage"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Progress percentage to the next level (decimal string, e.g. '75.5')",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("relatedLogUris"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"URIs of related game log records that contributed to this progress",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sessionId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Session ID when this progress was recorded (for linking with log records)",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sessionUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URI of the session record when this progress was recorded",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("stats"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#stats"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalXP"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("triggerSource"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"What action triggered this progress save",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xpGainedSinceLastSave"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xpToNextLevel"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("metadata"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Additional metadata about this progress update",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("clientVersion"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Version of the client when this progress was recorded",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platform"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Platform where the level up occurred (web, mobile, etc.)",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("stats"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Game-specific statistics and metrics"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("dailyRewardsClaimed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("itemsCollected"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastPostReadDate"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Date when posts read today was last updated (for daily reset tracking)",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postsReadToday"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postsReadTotal"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postsViewed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("shufflesPerformed"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("specimensCollected"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}