#[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::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::collection;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Collection<'a> {
pub acquired_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub common_name: Option<CowStr<'a>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub family: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub genus: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_modified: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_seen: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub log_record_uri: Option<CowStr<'a>>,
pub quantity: i64,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub rarity: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub scientific_name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub source: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub source_details: Option<collection::SourceDetails<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub species: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub specimen_data: Option<collection::SpecimenData<'a>>,
#[serde(borrow)]
pub specimen_id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<CowStr<'a>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct CollectionGetRecordOutput<'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: Collection<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SourceDetails<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub attempts: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub catch_probability: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub game_card_uri: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub location: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct SpecimenData<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub authorship: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
}
impl<'a> Collection<'a> {
pub fn uri(
uri: impl Into<CowStr<'a>>,
) -> Result<RecordUri<'a, CollectionRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct CollectionRecord;
impl XrpcResp for CollectionRecord {
const NSID: &'static str = "net.anisota.beta.game.collection";
const ENCODING: &'static str = "application/json";
type Output<'de> = CollectionGetRecordOutput<'de>;
type Err<'de> = RecordError<'de>;
}
impl From<CollectionGetRecordOutput<'_>> for Collection<'_> {
fn from(output: CollectionGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for Collection<'_> {
const NSID: &'static str = "net.anisota.beta.game.collection";
type Record = CollectionRecord;
}
impl jacquard_common::types::collection::Collection for CollectionRecord {
const NSID: &'static str = "net.anisota.beta.game.collection";
type Record = CollectionRecord;
}
impl<'a> LexiconSchema for Collection<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.collection"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_collection()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.common_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("common_name"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.family {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("family"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.genus {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("genus"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.quantity;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("quantity"),
min: 1i64,
actual: *value,
});
}
}
if let Some(ref value) = self.scientific_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("scientific_name"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.species {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("species"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.specimen_id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("specimen_id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<'a> LexiconSchema for SourceDetails<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.collection"
}
fn def_name() -> &'static str {
"sourceDetails"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_collection()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for SpecimenData<'a> {
fn nsid() -> &'static str {
"net.anisota.beta.game.collection"
}
fn def_name() -> &'static str {
"specimenData"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_collection()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod collection_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 Quantity;
type SpecimenId;
type CreatedAt;
type AcquiredAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Quantity = Unset;
type SpecimenId = Unset;
type CreatedAt = Unset;
type AcquiredAt = Unset;
}
pub struct SetQuantity<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetQuantity<S> {}
impl<S: State> State for SetQuantity<S> {
type Quantity = Set<members::quantity>;
type SpecimenId = S::SpecimenId;
type CreatedAt = S::CreatedAt;
type AcquiredAt = S::AcquiredAt;
}
pub struct SetSpecimenId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSpecimenId<S> {}
impl<S: State> State for SetSpecimenId<S> {
type Quantity = S::Quantity;
type SpecimenId = Set<members::specimen_id>;
type CreatedAt = S::CreatedAt;
type AcquiredAt = S::AcquiredAt;
}
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 Quantity = S::Quantity;
type SpecimenId = S::SpecimenId;
type CreatedAt = Set<members::created_at>;
type AcquiredAt = S::AcquiredAt;
}
pub struct SetAcquiredAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAcquiredAt<S> {}
impl<S: State> State for SetAcquiredAt<S> {
type Quantity = S::Quantity;
type SpecimenId = S::SpecimenId;
type CreatedAt = S::CreatedAt;
type AcquiredAt = Set<members::acquired_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct quantity(());
pub struct specimen_id(());
pub struct created_at(());
pub struct acquired_at(());
}
}
pub struct CollectionBuilder<'a, S: collection_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Datetime>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<i64>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<collection::SourceDetails<'a>>,
Option<CowStr<'a>>,
Option<collection::SpecimenData<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Collection<'a> {
pub fn new() -> CollectionBuilder<'a, collection_state::Empty> {
CollectionBuilder::new()
}
}
impl<'a> CollectionBuilder<'a, collection_state::Empty> {
pub fn new() -> Self {
CollectionBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S> CollectionBuilder<'a, S>
where
S: collection_state::State,
S::AcquiredAt: collection_state::IsUnset,
{
pub fn acquired_at(
mut self,
value: impl Into<Datetime>,
) -> CollectionBuilder<'a, collection_state::SetAcquiredAt<S>> {
self._fields.0 = Option::Some(value.into());
CollectionBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn common_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_common_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> CollectionBuilder<'a, S>
where
S: collection_state::State,
S::CreatedAt: collection_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> CollectionBuilder<'a, collection_state::SetCreatedAt<S>> {
self._fields.2 = Option::Some(value.into());
CollectionBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn family(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_family(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn genus(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_genus(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn last_modified(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_last_modified(mut self, value: Option<Datetime>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn last_seen(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_last_seen(mut self, value: Option<Datetime>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn log_record_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_log_record_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> CollectionBuilder<'a, S>
where
S: collection_state::State,
S::Quantity: collection_state::IsUnset,
{
pub fn quantity(
mut self,
value: impl Into<i64>,
) -> CollectionBuilder<'a, collection_state::SetQuantity<S>> {
self._fields.8 = Option::Some(value.into());
CollectionBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn rarity(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_rarity(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn scientific_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_scientific_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn source(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_source(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn source_details(
mut self,
value: impl Into<Option<collection::SourceDetails<'a>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_source_details(
mut self,
value: Option<collection::SourceDetails<'a>>,
) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn species(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_species(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn specimen_data(
mut self,
value: impl Into<Option<collection::SpecimenData<'a>>>,
) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_specimen_data(
mut self,
value: Option<collection::SpecimenData<'a>>,
) -> Self {
self._fields.14 = value;
self
}
}
impl<'a, S> CollectionBuilder<'a, S>
where
S: collection_state::State,
S::SpecimenId: collection_state::IsUnset,
{
pub fn specimen_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> CollectionBuilder<'a, collection_state::SetSpecimenId<S>> {
self._fields.15 = Option::Some(value.into());
CollectionBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: collection_state::State> CollectionBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.16 = value;
self
}
}
impl<'a, S> CollectionBuilder<'a, S>
where
S: collection_state::State,
S::Quantity: collection_state::IsSet,
S::SpecimenId: collection_state::IsSet,
S::CreatedAt: collection_state::IsSet,
S::AcquiredAt: collection_state::IsSet,
{
pub fn build(self) -> Collection<'a> {
Collection {
acquired_at: self._fields.0.unwrap(),
common_name: self._fields.1,
created_at: self._fields.2.unwrap(),
family: self._fields.3,
genus: self._fields.4,
last_modified: self._fields.5,
last_seen: self._fields.6,
log_record_uri: self._fields.7,
quantity: self._fields.8.unwrap(),
rarity: self._fields.9,
scientific_name: self._fields.10,
source: self._fields.11,
source_details: self._fields.12,
species: self._fields.13,
specimen_data: self._fields.14,
specimen_id: self._fields.15.unwrap(),
status: self._fields.16,
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>,
>,
) -> Collection<'a> {
Collection {
acquired_at: self._fields.0.unwrap(),
common_name: self._fields.1,
created_at: self._fields.2.unwrap(),
family: self._fields.3,
genus: self._fields.4,
last_modified: self._fields.5,
last_seen: self._fields.6,
log_record_uri: self._fields.7,
quantity: self._fields.8.unwrap(),
rarity: self._fields.9,
scientific_name: self._fields.10,
source: self._fields.11,
source_details: self._fields.12,
species: self._fields.13,
specimen_data: self._fields.14,
specimen_id: self._fields.15.unwrap(),
status: self._fields.16,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_net_anisota_beta_game_collection() -> 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.collection"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"Beta version: Record representing a collected specimen in a player's collection",
),
),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("specimenId"),
SmolStr::new_static("quantity"),
SmolStr::new_static("acquiredAt"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("acquiredAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the specimen was first acquired"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("commonName"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Common name of the specimen"),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the record was created"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("family"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Taxonomic family")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("genus"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Taxonomic genus")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastModified"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the record was last modified"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastSeen"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the specimen was last encountered"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("logRecordUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URI of the game.log record that documents the acquisition of this specimen",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("quantity"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rarity"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Rarity level of the specimen"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scientificName"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Scientific name of the specimen"),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("source"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("How the specimen was acquired"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceDetails"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#sourceDetails"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("species"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Taxonomic species")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("specimenData"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#specimenData"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("specimenId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the specimen"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Collection status of this specimen"),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceDetails"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Additional details about how the specimen was acquired",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("attempts"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("catchProbability"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Probability used when catching this specimen (decimal string, e.g. '0.75')",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("gameCardUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URI of the game card that provided this specimen",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("location"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Location where specimen was found or observed",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("specimenData"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Complete specimen information"),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("authorship"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Scientific authorship of the species"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Detailed description of the specimen"),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}