#[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};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "com.suibari.atsumeat.sticker",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Sticker<S: BosStr = DefaultStr> {
pub image: Data<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub image_type: Option<StickerImageType<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<S>,
pub model: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<S>,
pub obtained_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub obtained_from: Option<Did<S>>,
pub original_owner: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub shape: Option<StickerShape<S>>,
pub signature: S,
pub signed_payload: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub subject_did: Option<Did<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tags: Option<Vec<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 StickerImageType<S: BosStr = DefaultStr> {
Avatar,
Custom,
Other(S),
}
impl<S: BosStr> StickerImageType<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Avatar => "avatar",
Self::Custom => "custom",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"avatar" => Self::Avatar,
"custom" => Self::Custom,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for StickerImageType<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for StickerImageType<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for StickerImageType<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 StickerImageType<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 StickerImageType<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for StickerImageType<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = StickerImageType<S::Output>;
fn into_static(self) -> Self::Output {
match self {
StickerImageType::Avatar => StickerImageType::Avatar,
StickerImageType::Custom => StickerImageType::Custom,
StickerImageType::Other(v) => StickerImageType::Other(v.into_static()),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StickerShape<S: BosStr = DefaultStr> {
Circle,
Square,
Rectangle,
Star,
Heart,
Diamond,
Butterfly,
Transparent,
Other(S),
}
impl<S: BosStr> StickerShape<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Circle => "circle",
Self::Square => "square",
Self::Rectangle => "rectangle",
Self::Star => "star",
Self::Heart => "heart",
Self::Diamond => "diamond",
Self::Butterfly => "butterfly",
Self::Transparent => "transparent",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"circle" => Self::Circle,
"square" => Self::Square,
"rectangle" => Self::Rectangle,
"star" => Self::Star,
"heart" => Self::Heart,
"diamond" => Self::Diamond,
"butterfly" => Self::Butterfly,
"transparent" => Self::Transparent,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for StickerShape<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for StickerShape<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for StickerShape<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 StickerShape<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 StickerShape<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for StickerShape<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = StickerShape<S::Output>;
fn into_static(self) -> Self::Output {
match self {
StickerShape::Circle => StickerShape::Circle,
StickerShape::Square => StickerShape::Square,
StickerShape::Rectangle => StickerShape::Rectangle,
StickerShape::Star => StickerShape::Star,
StickerShape::Heart => StickerShape::Heart,
StickerShape::Diamond => StickerShape::Diamond,
StickerShape::Butterfly => StickerShape::Butterfly,
StickerShape::Transparent => StickerShape::Transparent,
StickerShape::Other(v) => StickerShape::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StickerGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Sticker<S>,
}
impl<S: BosStr> Sticker<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, StickerRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct StickerRecord;
impl XrpcResp for StickerRecord {
const NSID: &'static str = "com.suibari.atsumeat.sticker";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = StickerGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<StickerGetRecordOutput<S>> for Sticker<S> {
fn from(output: StickerGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Sticker<S> {
const NSID: &'static str = "com.suibari.atsumeat.sticker";
type Record = StickerRecord;
}
impl Collection for StickerRecord {
const NSID: &'static str = "com.suibari.atsumeat.sticker";
type Record = StickerRecord;
}
impl<S: BosStr> LexiconSchema for Sticker<S> {
fn nsid() -> &'static str {
"com.suibari.atsumeat.sticker"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_com_suibari_atsumeat_sticker()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.image_type {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 64usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("image_type"),
max: 64usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.message {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 6400usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("message"),
max: 6400usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.message {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 640usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("message"),
max: 640usize,
actual: count,
});
}
}
}
{
let value = &self.model;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 64usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("model"),
max: 64usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref 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()),
});
}
}
if let Some(ref 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.shape {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 64usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("shape"),
max: 64usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.signature;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2048usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("signature"),
max: 2048usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.signed_payload;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("signed_payload"),
max: 10000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.tags {
#[allow(unused_comparisons)]
if value.len() > 8usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("tags"),
max: 8usize,
actual: value.len(),
});
}
}
Ok(())
}
}
pub mod sticker_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 SignedPayload;
type Image;
type Signature;
type Model;
type ObtainedAt;
type OriginalOwner;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type SignedPayload = Unset;
type Image = Unset;
type Signature = Unset;
type Model = Unset;
type ObtainedAt = Unset;
type OriginalOwner = Unset;
}
pub struct SetSignedPayload<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSignedPayload<St> {}
impl<St: State> State for SetSignedPayload<St> {
type SignedPayload = Set<members::signed_payload>;
type Image = St::Image;
type Signature = St::Signature;
type Model = St::Model;
type ObtainedAt = St::ObtainedAt;
type OriginalOwner = St::OriginalOwner;
}
pub struct SetImage<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetImage<St> {}
impl<St: State> State for SetImage<St> {
type SignedPayload = St::SignedPayload;
type Image = Set<members::image>;
type Signature = St::Signature;
type Model = St::Model;
type ObtainedAt = St::ObtainedAt;
type OriginalOwner = St::OriginalOwner;
}
pub struct SetSignature<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSignature<St> {}
impl<St: State> State for SetSignature<St> {
type SignedPayload = St::SignedPayload;
type Image = St::Image;
type Signature = Set<members::signature>;
type Model = St::Model;
type ObtainedAt = St::ObtainedAt;
type OriginalOwner = St::OriginalOwner;
}
pub struct SetModel<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetModel<St> {}
impl<St: State> State for SetModel<St> {
type SignedPayload = St::SignedPayload;
type Image = St::Image;
type Signature = St::Signature;
type Model = Set<members::model>;
type ObtainedAt = St::ObtainedAt;
type OriginalOwner = St::OriginalOwner;
}
pub struct SetObtainedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetObtainedAt<St> {}
impl<St: State> State for SetObtainedAt<St> {
type SignedPayload = St::SignedPayload;
type Image = St::Image;
type Signature = St::Signature;
type Model = St::Model;
type ObtainedAt = Set<members::obtained_at>;
type OriginalOwner = St::OriginalOwner;
}
pub struct SetOriginalOwner<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetOriginalOwner<St> {}
impl<St: State> State for SetOriginalOwner<St> {
type SignedPayload = St::SignedPayload;
type Image = St::Image;
type Signature = St::Signature;
type Model = St::Model;
type ObtainedAt = St::ObtainedAt;
type OriginalOwner = Set<members::original_owner>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct signed_payload(());
pub struct image(());
pub struct signature(());
pub struct model(());
pub struct obtained_at(());
pub struct original_owner(());
}
}
pub struct StickerBuilder<S: BosStr, St: sticker_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Data<S>>,
Option<StickerImageType<S>>,
Option<S>,
Option<S>,
Option<S>,
Option<Datetime>,
Option<Did<S>>,
Option<Did<S>>,
Option<StickerShape<S>>,
Option<S>,
Option<S>,
Option<Did<S>>,
Option<Vec<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Sticker<S> {
pub fn new() -> StickerBuilder<S, sticker_state::Empty> {
StickerBuilder::new()
}
}
impl<S: BosStr> StickerBuilder<S, sticker_state::Empty> {
pub fn new() -> Self {
StickerBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::Image: sticker_state::IsUnset,
{
pub fn image(
mut self,
value: impl Into<Data<S>>,
) -> StickerBuilder<S, sticker_state::SetImage<St>> {
self._fields.0 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn image_type(mut self, value: impl Into<Option<StickerImageType<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_image_type(mut self, value: Option<StickerImageType<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn message(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_message(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::Model: sticker_state::IsUnset,
{
pub fn model(
mut self,
value: impl Into<S>,
) -> StickerBuilder<S, sticker_state::SetModel<St>> {
self._fields.3 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_name(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::ObtainedAt: sticker_state::IsUnset,
{
pub fn obtained_at(
mut self,
value: impl Into<Datetime>,
) -> StickerBuilder<S, sticker_state::SetObtainedAt<St>> {
self._fields.5 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn obtained_from(mut self, value: impl Into<Option<Did<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_obtained_from(mut self, value: Option<Did<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::OriginalOwner: sticker_state::IsUnset,
{
pub fn original_owner(
mut self,
value: impl Into<Did<S>>,
) -> StickerBuilder<S, sticker_state::SetOriginalOwner<St>> {
self._fields.7 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn shape(mut self, value: impl Into<Option<StickerShape<S>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_shape(mut self, value: Option<StickerShape<S>>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::Signature: sticker_state::IsUnset,
{
pub fn signature(
mut self,
value: impl Into<S>,
) -> StickerBuilder<S, sticker_state::SetSignature<St>> {
self._fields.9 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::SignedPayload: sticker_state::IsUnset,
{
pub fn signed_payload(
mut self,
value: impl Into<S>,
) -> StickerBuilder<S, sticker_state::SetSignedPayload<St>> {
self._fields.10 = Option::Some(value.into());
StickerBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn subject_did(mut self, value: impl Into<Option<Did<S>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_subject_did(mut self, value: Option<Did<S>>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: sticker_state::State> StickerBuilder<S, St> {
pub fn tags(mut self, value: impl Into<Option<Vec<S>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_tags(mut self, value: Option<Vec<S>>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St> StickerBuilder<S, St>
where
St: sticker_state::State,
St::SignedPayload: sticker_state::IsSet,
St::Image: sticker_state::IsSet,
St::Signature: sticker_state::IsSet,
St::Model: sticker_state::IsSet,
St::ObtainedAt: sticker_state::IsSet,
St::OriginalOwner: sticker_state::IsSet,
{
pub fn build(self) -> Sticker<S> {
Sticker {
image: self._fields.0.unwrap(),
image_type: self._fields.1,
message: self._fields.2,
model: self._fields.3.unwrap(),
name: self._fields.4,
obtained_at: self._fields.5.unwrap(),
obtained_from: self._fields.6,
original_owner: self._fields.7.unwrap(),
shape: self._fields.8,
signature: self._fields.9.unwrap(),
signed_payload: self._fields.10.unwrap(),
subject_did: self._fields.11,
tags: self._fields.12,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Sticker<S> {
Sticker {
image: self._fields.0.unwrap(),
image_type: self._fields.1,
message: self._fields.2,
model: self._fields.3.unwrap(),
name: self._fields.4,
obtained_at: self._fields.5.unwrap(),
obtained_from: self._fields.6,
original_owner: self._fields.7.unwrap(),
shape: self._fields.8,
signature: self._fields.9.unwrap(),
signed_payload: self._fields.10.unwrap(),
subject_did: self._fields.11,
tags: self._fields.12,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_com_suibari_atsumeat_sticker() -> 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("com.suibari.atsumeat.sticker"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(CowStr::new_static("Definition of a sticker")),
key: Some(CowStr::new_static("tid")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("image"),
SmolStr::new_static("originalOwner"),
SmolStr::new_static("model"),
SmolStr::new_static("obtainedAt"),
SmolStr::new_static("signature"),
SmolStr::new_static("signedPayload")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("image"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("imageType"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Type of the image source."),
),
max_length: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("message"),
LexObjectProperty::String(LexString {
max_length: Some(6400usize),
max_graphemes: Some(640usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("model"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Identifier for the sticker model. 'default' for avatar stickers, 'cid:<cid>' for custom stickers.",
),
),
max_length: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("obtainedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The timestamp when this sticker was obtained.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("obtainedFrom"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The DID of the user from whom this sticker was obtained (for provenance).",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("originalOwner"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The DID of the original creator/minter of this sticker.",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("shape"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The shape of the sticker canvas."),
),
max_length: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signature"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Cryptographic signature from the server verifying the sticker's authenticity/provenance.",
),
),
max_length: Some(2048usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signedPayload"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The original JSON payload that was signed by the server.",
),
),
max_length: Some(10000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("subjectDid"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The DID of the user depicted in the sticker, if applicable (e.g. for avatar stickers).",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
max_length: Some(8usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}
}