#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{Did, AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
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::world_ptah::temp::world;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "world.ptah.temp.world",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct World<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub canonical_status: Option<WorldCanonicalStatus<S>>,
pub created_at: Datetime,
pub creator_did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub governance_mode: Option<WorldGovernanceMode<S>>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub rendering_hints: Option<world::RenderingHints<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub source_reference: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub source_type: Option<WorldSourceType<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorldCanonicalStatus<S: BosStr = DefaultStr> {
CanonicalStatusOfficial,
CanonicalStatusCommunity,
CanonicalStatusApocryphal,
Other(S),
}
impl<S: BosStr> WorldCanonicalStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::CanonicalStatusOfficial => {
"world.ptah.temp.defs#canonicalStatusOfficial"
}
Self::CanonicalStatusCommunity => {
"world.ptah.temp.defs#canonicalStatusCommunity"
}
Self::CanonicalStatusApocryphal => {
"world.ptah.temp.defs#canonicalStatusApocryphal"
}
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"world.ptah.temp.defs#canonicalStatusOfficial" => {
Self::CanonicalStatusOfficial
}
"world.ptah.temp.defs#canonicalStatusCommunity" => {
Self::CanonicalStatusCommunity
}
"world.ptah.temp.defs#canonicalStatusApocryphal" => {
Self::CanonicalStatusApocryphal
}
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WorldCanonicalStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WorldCanonicalStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WorldCanonicalStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for WorldCanonicalStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for WorldCanonicalStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WorldCanonicalStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WorldCanonicalStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WorldCanonicalStatus::CanonicalStatusOfficial => {
WorldCanonicalStatus::CanonicalStatusOfficial
}
WorldCanonicalStatus::CanonicalStatusCommunity => {
WorldCanonicalStatus::CanonicalStatusCommunity
}
WorldCanonicalStatus::CanonicalStatusApocryphal => {
WorldCanonicalStatus::CanonicalStatusApocryphal
}
WorldCanonicalStatus::Other(v) => {
WorldCanonicalStatus::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorldGovernanceMode<S: BosStr = DefaultStr> {
Sandbox,
Governed,
Constitutional,
Other(S),
}
impl<S: BosStr> WorldGovernanceMode<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Sandbox => "sandbox",
Self::Governed => "governed",
Self::Constitutional => "constitutional",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"sandbox" => Self::Sandbox,
"governed" => Self::Governed,
"constitutional" => Self::Constitutional,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WorldGovernanceMode<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WorldGovernanceMode<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WorldGovernanceMode<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for WorldGovernanceMode<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for WorldGovernanceMode<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WorldGovernanceMode<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WorldGovernanceMode<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WorldGovernanceMode::Sandbox => WorldGovernanceMode::Sandbox,
WorldGovernanceMode::Governed => WorldGovernanceMode::Governed,
WorldGovernanceMode::Constitutional => WorldGovernanceMode::Constitutional,
WorldGovernanceMode::Other(v) => WorldGovernanceMode::Other(v.into_static()),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WorldSourceType<S: BosStr = DefaultStr> {
SourceTypeOriginalIp,
SourceTypePublicDomain,
SourceTypeCollaborativeCommons,
Other(S),
}
impl<S: BosStr> WorldSourceType<S> {
pub fn as_str(&self) -> &str {
match self {
Self::SourceTypeOriginalIp => "world.ptah.temp.defs#sourceTypeOriginalIP",
Self::SourceTypePublicDomain => "world.ptah.temp.defs#sourceTypePublicDomain",
Self::SourceTypeCollaborativeCommons => {
"world.ptah.temp.defs#sourceTypeCollaborativeCommons"
}
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"world.ptah.temp.defs#sourceTypeOriginalIP" => Self::SourceTypeOriginalIp,
"world.ptah.temp.defs#sourceTypePublicDomain" => Self::SourceTypePublicDomain,
"world.ptah.temp.defs#sourceTypeCollaborativeCommons" => {
Self::SourceTypeCollaborativeCommons
}
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WorldSourceType<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WorldSourceType<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WorldSourceType<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for WorldSourceType<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for WorldSourceType<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WorldSourceType<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WorldSourceType<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WorldSourceType::SourceTypeOriginalIp => {
WorldSourceType::SourceTypeOriginalIp
}
WorldSourceType::SourceTypePublicDomain => {
WorldSourceType::SourceTypePublicDomain
}
WorldSourceType::SourceTypeCollaborativeCommons => {
WorldSourceType::SourceTypeCollaborativeCommons
}
WorldSourceType::Other(v) => WorldSourceType::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WorldGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: World<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct RenderingHints<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub aesthetic: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub era: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub genre: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tone: Option<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> World<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, WorldRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct WorldRecord;
impl XrpcResp for WorldRecord {
const NSID: &'static str = "world.ptah.temp.world";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = WorldGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<WorldGetRecordOutput<S>> for World<S> {
fn from(output: WorldGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for World<S> {
const NSID: &'static str = "world.ptah.temp.world";
type Record = WorldRecord;
}
impl Collection for WorldRecord {
const NSID: &'static str = "world.ptah.temp.world";
type Record = WorldRecord;
}
impl<S: BosStr> LexiconSchema for World<S> {
fn nsid() -> &'static str {
"world.ptah.temp.world"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_world_ptah_temp_world()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10240usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 10240usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 1024usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 1024usize,
actual: count,
});
}
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("name"),
max: 64usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.source_reference {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10240usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("source_reference"),
max: 10240usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.source_reference {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 1024usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("source_reference"),
max: 1024usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for RenderingHints<S> {
fn nsid() -> &'static str {
"world.ptah.temp.world"
}
fn def_name() -> &'static str {
"renderingHints"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_world_ptah_temp_world()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.aesthetic {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("aesthetic"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.aesthetic {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("aesthetic"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.era {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("era"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.era {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("era"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.genre {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("genre"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.genre {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("genre"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.tone {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("tone"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.tone {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("tone"),
max: 256usize,
actual: count,
});
}
}
}
Ok(())
}
}
pub mod world_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 CreatedAt;
type CreatorDid;
type Name;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type CreatorDid = Unset;
type Name = Unset;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type CreatedAt = Set<members::created_at>;
type CreatorDid = St::CreatorDid;
type Name = St::Name;
}
pub struct SetCreatorDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatorDid<St> {}
impl<St: State> State for SetCreatorDid<St> {
type CreatedAt = St::CreatedAt;
type CreatorDid = Set<members::creator_did>;
type Name = St::Name;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type CreatedAt = St::CreatedAt;
type CreatorDid = St::CreatorDid;
type Name = Set<members::name>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct creator_did(());
pub struct name(());
}
}
pub struct WorldBuilder<S: BosStr, St: world_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<WorldCanonicalStatus<S>>,
Option<Datetime>,
Option<Did<S>>,
Option<S>,
Option<WorldGovernanceMode<S>>,
Option<S>,
Option<world::RenderingHints<S>>,
Option<S>,
Option<WorldSourceType<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> World<S> {
pub fn new() -> WorldBuilder<S, world_state::Empty> {
WorldBuilder::new()
}
}
impl<S: BosStr> WorldBuilder<S, world_state::Empty> {
pub fn new() -> Self {
WorldBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn canonical_status(
mut self,
value: impl Into<Option<WorldCanonicalStatus<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_canonical_status(
mut self,
value: Option<WorldCanonicalStatus<S>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> WorldBuilder<S, St>
where
St: world_state::State,
St::CreatedAt: world_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> WorldBuilder<S, world_state::SetCreatedAt<St>> {
self._fields.1 = Option::Some(value.into());
WorldBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WorldBuilder<S, St>
where
St: world_state::State,
St::CreatorDid: world_state::IsUnset,
{
pub fn creator_did(
mut self,
value: impl Into<Did<S>>,
) -> WorldBuilder<S, world_state::SetCreatorDid<St>> {
self._fields.2 = Option::Some(value.into());
WorldBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn governance_mode(
mut self,
value: impl Into<Option<WorldGovernanceMode<S>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_governance_mode(
mut self,
value: Option<WorldGovernanceMode<S>>,
) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> WorldBuilder<S, St>
where
St: world_state::State,
St::Name: world_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> WorldBuilder<S, world_state::SetName<St>> {
self._fields.5 = Option::Some(value.into());
WorldBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn rendering_hints(
mut self,
value: impl Into<Option<world::RenderingHints<S>>>,
) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_rendering_hints(
mut self,
value: Option<world::RenderingHints<S>>,
) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn source_reference(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_source_reference(mut self, value: Option<S>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: world_state::State> WorldBuilder<S, St> {
pub fn source_type(mut self, value: impl Into<Option<WorldSourceType<S>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_source_type(mut self, value: Option<WorldSourceType<S>>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> WorldBuilder<S, St>
where
St: world_state::State,
St::CreatedAt: world_state::IsSet,
St::CreatorDid: world_state::IsSet,
St::Name: world_state::IsSet,
{
pub fn build(self) -> World<S> {
World {
canonical_status: self._fields.0,
created_at: self._fields.1.unwrap(),
creator_did: self._fields.2.unwrap(),
description: self._fields.3,
governance_mode: self._fields.4,
name: self._fields.5.unwrap(),
rendering_hints: self._fields.6,
source_reference: self._fields.7,
source_type: self._fields.8,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> World<S> {
World {
canonical_status: self._fields.0,
created_at: self._fields.1.unwrap(),
creator_did: self._fields.2.unwrap(),
description: self._fields.3,
governance_mode: self._fields.4,
name: self._fields.5.unwrap(),
rendering_hints: self._fields.6,
source_reference: self._fields.7,
source_type: self._fields.8,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_world_ptah_temp_world() -> 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("world.ptah.temp.world"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"The deed. Establishes that a world exists, who created it, and what its basic properties are. Ptah conceives the world in his heart — this record is that conception made permanent.",
),
),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("name"),
SmolStr::new_static("creatorDID"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("canonicalStatus"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Whether this world is open for contribution, controlled by the originator, or governed by community consensus.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Timestamp of world creation."),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("creatorDID"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The permanent identity of whoever seeded this world. This never changes.",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"What kind of world this is, in plain language.",
),
),
max_length: Some(10240usize),
max_graphemes: Some(1024usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("governanceMode"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The constitutional posture of the world. Signals how contributions and canon are governed before anyone contributes.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("What the world is called."),
),
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("renderingHints"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#renderingHints"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceReference"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"If sourceType is publicDomain, the specific source material this world is derived from.",
),
),
max_length: Some(10240usize),
max_graphemes: Some(1024usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceType"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The intellectual property origin of this world.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("renderingHints"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Visual and tonal metadata for rendering layers. The world has to feel like something before anything has happened in it yet.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("aesthetic"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Visual texture, materials, atmosphere."),
),
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("era"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The temporal setting or period."),
),
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("genre"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The narrative genre."),
),
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tone"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The emotional register of the world."),
),
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}