pub mod entry;
pub mod profile;
pub mod profile_localization;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::blob::BlobRef;
use jacquard_common::types::string::{Nsid, RecordKey, Rkey, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::community_lexicon::app;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AccountIndicator<S: BosStr = DefaultStr> {
pub collection: Nsid<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rkey: Option<RecordKey<Rkey<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct AspectRatio<S: BosStr = DefaultStr> {
pub height: i64,
pub width: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Discontinued;
impl core::fmt::Display for Discontinued {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "discontinued")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Image<S: BosStr = DefaultStr> {
pub alt: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub aspect_ratio: Option<app::AspectRatio<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub image: Option<BlobRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub purpose: Option<ImagePurpose<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<UriValue<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 ImagePurpose<S: BosStr = DefaultStr> {
PurposeIcon,
PurposeLogo,
PurposeHero,
PurposeScreenshot,
PurposeBanner,
PurposeSocialCard,
PurposeAppStore,
PurposeAd,
Other(S),
}
impl<S: BosStr> ImagePurpose<S> {
pub fn as_str(&self) -> &str {
match self {
Self::PurposeIcon => "community.lexicon.app.defs#purposeIcon",
Self::PurposeLogo => "community.lexicon.app.defs#purposeLogo",
Self::PurposeHero => "community.lexicon.app.defs#purposeHero",
Self::PurposeScreenshot => "community.lexicon.app.defs#purposeScreenshot",
Self::PurposeBanner => "community.lexicon.app.defs#purposeBanner",
Self::PurposeSocialCard => "community.lexicon.app.defs#purposeSocialCard",
Self::PurposeAppStore => "community.lexicon.app.defs#purposeAppStore",
Self::PurposeAd => "community.lexicon.app.defs#purposeAd",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"community.lexicon.app.defs#purposeIcon" => Self::PurposeIcon,
"community.lexicon.app.defs#purposeLogo" => Self::PurposeLogo,
"community.lexicon.app.defs#purposeHero" => Self::PurposeHero,
"community.lexicon.app.defs#purposeScreenshot" => Self::PurposeScreenshot,
"community.lexicon.app.defs#purposeBanner" => Self::PurposeBanner,
"community.lexicon.app.defs#purposeSocialCard" => Self::PurposeSocialCard,
"community.lexicon.app.defs#purposeAppStore" => Self::PurposeAppStore,
"community.lexicon.app.defs#purposeAd" => Self::PurposeAd,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ImagePurpose<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ImagePurpose<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ImagePurpose<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 ImagePurpose<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 ImagePurpose<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ImagePurpose<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ImagePurpose<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ImagePurpose::PurposeIcon => ImagePurpose::PurposeIcon,
ImagePurpose::PurposeLogo => ImagePurpose::PurposeLogo,
ImagePurpose::PurposeHero => ImagePurpose::PurposeHero,
ImagePurpose::PurposeScreenshot => ImagePurpose::PurposeScreenshot,
ImagePurpose::PurposeBanner => ImagePurpose::PurposeBanner,
ImagePurpose::PurposeSocialCard => ImagePurpose::PurposeSocialCard,
ImagePurpose::PurposeAppStore => ImagePurpose::PurposeAppStore,
ImagePurpose::PurposeAd => ImagePurpose::PurposeAd,
ImagePurpose::Other(v) => ImagePurpose::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct LexiconInterop<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub consumes: Option<Vec<Nsid<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub produces: Option<Vec<Nsid<S>>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Link<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub label: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub role: Option<app::LinkRole<S>>,
pub uri: UriValue<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 LinkRole<S: BosStr = DefaultStr> {
CommunityLexiconAppDefsLinkRoleWebsite,
CommunityLexiconAppDefsLinkRoleWebManifest,
CommunityLexiconAppDefsLinkRolePrivacyPolicy,
CommunityLexiconAppDefsLinkRoleTermsOfService,
CommunityLexiconAppDefsLinkRoleSupport,
CommunityLexiconAppDefsLinkRoleSourceCode,
CommunityLexiconAppDefsLinkRoleDocs,
CommunityLexiconAppDefsLinkRoleChangelog,
CommunityLexiconAppDefsLinkRoleStatus,
CommunityLexiconAppDefsLinkRoleAppStore,
CommunityLexiconAppDefsLinkRolePlayStore,
CommunityLexiconAppDefsLinkRoleFDroid,
Other(S),
}
impl<S: BosStr> LinkRole<S> {
pub fn as_str(&self) -> &str {
match self {
Self::CommunityLexiconAppDefsLinkRoleWebsite => {
"community.lexicon.app.defs#linkRoleWebsite"
}
Self::CommunityLexiconAppDefsLinkRoleWebManifest => {
"community.lexicon.app.defs#linkRoleWebManifest"
}
Self::CommunityLexiconAppDefsLinkRolePrivacyPolicy => {
"community.lexicon.app.defs#linkRolePrivacyPolicy"
}
Self::CommunityLexiconAppDefsLinkRoleTermsOfService => {
"community.lexicon.app.defs#linkRoleTermsOfService"
}
Self::CommunityLexiconAppDefsLinkRoleSupport => {
"community.lexicon.app.defs#linkRoleSupport"
}
Self::CommunityLexiconAppDefsLinkRoleSourceCode => {
"community.lexicon.app.defs#linkRoleSourceCode"
}
Self::CommunityLexiconAppDefsLinkRoleDocs => "community.lexicon.app.defs#linkRoleDocs",
Self::CommunityLexiconAppDefsLinkRoleChangelog => {
"community.lexicon.app.defs#linkRoleChangelog"
}
Self::CommunityLexiconAppDefsLinkRoleStatus => {
"community.lexicon.app.defs#linkRoleStatus"
}
Self::CommunityLexiconAppDefsLinkRoleAppStore => {
"community.lexicon.app.defs#linkRoleAppStore"
}
Self::CommunityLexiconAppDefsLinkRolePlayStore => {
"community.lexicon.app.defs#linkRolePlayStore"
}
Self::CommunityLexiconAppDefsLinkRoleFDroid => {
"community.lexicon.app.defs#linkRoleFDroid"
}
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"community.lexicon.app.defs#linkRoleWebsite" => {
Self::CommunityLexiconAppDefsLinkRoleWebsite
}
"community.lexicon.app.defs#linkRoleWebManifest" => {
Self::CommunityLexiconAppDefsLinkRoleWebManifest
}
"community.lexicon.app.defs#linkRolePrivacyPolicy" => {
Self::CommunityLexiconAppDefsLinkRolePrivacyPolicy
}
"community.lexicon.app.defs#linkRoleTermsOfService" => {
Self::CommunityLexiconAppDefsLinkRoleTermsOfService
}
"community.lexicon.app.defs#linkRoleSupport" => {
Self::CommunityLexiconAppDefsLinkRoleSupport
}
"community.lexicon.app.defs#linkRoleSourceCode" => {
Self::CommunityLexiconAppDefsLinkRoleSourceCode
}
"community.lexicon.app.defs#linkRoleDocs" => Self::CommunityLexiconAppDefsLinkRoleDocs,
"community.lexicon.app.defs#linkRoleChangelog" => {
Self::CommunityLexiconAppDefsLinkRoleChangelog
}
"community.lexicon.app.defs#linkRoleStatus" => {
Self::CommunityLexiconAppDefsLinkRoleStatus
}
"community.lexicon.app.defs#linkRoleAppStore" => {
Self::CommunityLexiconAppDefsLinkRoleAppStore
}
"community.lexicon.app.defs#linkRolePlayStore" => {
Self::CommunityLexiconAppDefsLinkRolePlayStore
}
"community.lexicon.app.defs#linkRoleFDroid" => {
Self::CommunityLexiconAppDefsLinkRoleFDroid
}
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for LinkRole<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for LinkRole<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for LinkRole<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 LinkRole<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> jacquard_common::IntoStatic for LinkRole<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = LinkRole<S::Output>;
fn into_static(self) -> Self::Output {
match self {
LinkRole::CommunityLexiconAppDefsLinkRoleWebsite => {
LinkRole::CommunityLexiconAppDefsLinkRoleWebsite
}
LinkRole::CommunityLexiconAppDefsLinkRoleWebManifest => {
LinkRole::CommunityLexiconAppDefsLinkRoleWebManifest
}
LinkRole::CommunityLexiconAppDefsLinkRolePrivacyPolicy => {
LinkRole::CommunityLexiconAppDefsLinkRolePrivacyPolicy
}
LinkRole::CommunityLexiconAppDefsLinkRoleTermsOfService => {
LinkRole::CommunityLexiconAppDefsLinkRoleTermsOfService
}
LinkRole::CommunityLexiconAppDefsLinkRoleSupport => {
LinkRole::CommunityLexiconAppDefsLinkRoleSupport
}
LinkRole::CommunityLexiconAppDefsLinkRoleSourceCode => {
LinkRole::CommunityLexiconAppDefsLinkRoleSourceCode
}
LinkRole::CommunityLexiconAppDefsLinkRoleDocs => {
LinkRole::CommunityLexiconAppDefsLinkRoleDocs
}
LinkRole::CommunityLexiconAppDefsLinkRoleChangelog => {
LinkRole::CommunityLexiconAppDefsLinkRoleChangelog
}
LinkRole::CommunityLexiconAppDefsLinkRoleStatus => {
LinkRole::CommunityLexiconAppDefsLinkRoleStatus
}
LinkRole::CommunityLexiconAppDefsLinkRoleAppStore => {
LinkRole::CommunityLexiconAppDefsLinkRoleAppStore
}
LinkRole::CommunityLexiconAppDefsLinkRolePlayStore => {
LinkRole::CommunityLexiconAppDefsLinkRolePlayStore
}
LinkRole::CommunityLexiconAppDefsLinkRoleFDroid => {
LinkRole::CommunityLexiconAppDefsLinkRoleFDroid
}
LinkRole::Other(v) => LinkRole::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleAppStore;
impl core::fmt::Display for LinkRoleAppStore {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleAppStore")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleChangelog;
impl core::fmt::Display for LinkRoleChangelog {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleChangelog")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleDocs;
impl core::fmt::Display for LinkRoleDocs {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleDocs")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleFDroid;
impl core::fmt::Display for LinkRoleFDroid {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleFDroid")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRolePlayStore;
impl core::fmt::Display for LinkRolePlayStore {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRolePlayStore")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRolePrivacyPolicy;
impl core::fmt::Display for LinkRolePrivacyPolicy {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRolePrivacyPolicy")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleSourceCode;
impl core::fmt::Display for LinkRoleSourceCode {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleSourceCode")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleStatus;
impl core::fmt::Display for LinkRoleStatus {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleStatus")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleSupport;
impl core::fmt::Display for LinkRoleSupport {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleSupport")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleTermsOfService;
impl core::fmt::Display for LinkRoleTermsOfService {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleTermsOfService")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleWebManifest;
impl core::fmt::Display for LinkRoleWebManifest {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleWebManifest")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct LinkRoleWebsite;
impl core::fmt::Display for LinkRoleWebsite {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "linkRoleWebsite")
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Platform<S: BosStr = DefaultStr> {
CommunityLexiconAppDefsPlatformWeb,
CommunityLexiconAppDefsPlatformIos,
CommunityLexiconAppDefsPlatformAndroid,
CommunityLexiconAppDefsPlatformMacOs,
CommunityLexiconAppDefsPlatformWindows,
CommunityLexiconAppDefsPlatformLinux,
CommunityLexiconAppDefsPlatformCli,
Other(S),
}
impl<S: BosStr> Platform<S> {
pub fn as_str(&self) -> &str {
match self {
Self::CommunityLexiconAppDefsPlatformWeb => "community.lexicon.app.defs#platformWeb",
Self::CommunityLexiconAppDefsPlatformIos => "community.lexicon.app.defs#platformIOS",
Self::CommunityLexiconAppDefsPlatformAndroid => {
"community.lexicon.app.defs#platformAndroid"
}
Self::CommunityLexiconAppDefsPlatformMacOs => {
"community.lexicon.app.defs#platformMacOS"
}
Self::CommunityLexiconAppDefsPlatformWindows => {
"community.lexicon.app.defs#platformWindows"
}
Self::CommunityLexiconAppDefsPlatformLinux => {
"community.lexicon.app.defs#platformLinux"
}
Self::CommunityLexiconAppDefsPlatformCli => "community.lexicon.app.defs#platformCLI",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"community.lexicon.app.defs#platformWeb" => Self::CommunityLexiconAppDefsPlatformWeb,
"community.lexicon.app.defs#platformIOS" => Self::CommunityLexiconAppDefsPlatformIos,
"community.lexicon.app.defs#platformAndroid" => {
Self::CommunityLexiconAppDefsPlatformAndroid
}
"community.lexicon.app.defs#platformMacOS" => {
Self::CommunityLexiconAppDefsPlatformMacOs
}
"community.lexicon.app.defs#platformWindows" => {
Self::CommunityLexiconAppDefsPlatformWindows
}
"community.lexicon.app.defs#platformLinux" => {
Self::CommunityLexiconAppDefsPlatformLinux
}
"community.lexicon.app.defs#platformCLI" => Self::CommunityLexiconAppDefsPlatformCli,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for Platform<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for Platform<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for Platform<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 Platform<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> jacquard_common::IntoStatic for Platform<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = Platform<S::Output>;
fn into_static(self) -> Self::Output {
match self {
Platform::CommunityLexiconAppDefsPlatformWeb => {
Platform::CommunityLexiconAppDefsPlatformWeb
}
Platform::CommunityLexiconAppDefsPlatformIos => {
Platform::CommunityLexiconAppDefsPlatformIos
}
Platform::CommunityLexiconAppDefsPlatformAndroid => {
Platform::CommunityLexiconAppDefsPlatformAndroid
}
Platform::CommunityLexiconAppDefsPlatformMacOs => {
Platform::CommunityLexiconAppDefsPlatformMacOs
}
Platform::CommunityLexiconAppDefsPlatformWindows => {
Platform::CommunityLexiconAppDefsPlatformWindows
}
Platform::CommunityLexiconAppDefsPlatformLinux => {
Platform::CommunityLexiconAppDefsPlatformLinux
}
Platform::CommunityLexiconAppDefsPlatformCli => {
Platform::CommunityLexiconAppDefsPlatformCli
}
Platform::Other(v) => Platform::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformAndroid;
impl core::fmt::Display for PlatformAndroid {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformAndroid")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformCli;
impl core::fmt::Display for PlatformCli {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformCLI")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformIos;
impl core::fmt::Display for PlatformIos {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformIOS")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformLinux;
impl core::fmt::Display for PlatformLinux {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformLinux")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformMacOs;
impl core::fmt::Display for PlatformMacOs {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformMacOS")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformWeb;
impl core::fmt::Display for PlatformWeb {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformWeb")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PlatformWindows;
impl core::fmt::Display for PlatformWindows {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "platformWindows")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Preview;
impl core::fmt::Display for Preview {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "preview")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeAd;
impl core::fmt::Display for PurposeAd {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeAd")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeAppStore;
impl core::fmt::Display for PurposeAppStore {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeAppStore")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeBanner;
impl core::fmt::Display for PurposeBanner {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeBanner")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeHero;
impl core::fmt::Display for PurposeHero {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeHero")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeIcon;
impl core::fmt::Display for PurposeIcon {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeIcon")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeLogo;
impl core::fmt::Display for PurposeLogo {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeLogo")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeScreenshot;
impl core::fmt::Display for PurposeScreenshot {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeScreenshot")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct PurposeSocialCard;
impl core::fmt::Display for PurposeSocialCard {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "purposeSocialCard")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Released;
impl core::fmt::Display for Released {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "released")
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum Status<S: BosStr = DefaultStr> {
CommunityLexiconAppDefsUnreleased,
CommunityLexiconAppDefsPreview,
CommunityLexiconAppDefsReleased,
CommunityLexiconAppDefsUnmaintained,
CommunityLexiconAppDefsDiscontinued,
Other(S),
}
impl<S: BosStr> Status<S> {
pub fn as_str(&self) -> &str {
match self {
Self::CommunityLexiconAppDefsUnreleased => "community.lexicon.app.defs#unreleased",
Self::CommunityLexiconAppDefsPreview => "community.lexicon.app.defs#preview",
Self::CommunityLexiconAppDefsReleased => "community.lexicon.app.defs#released",
Self::CommunityLexiconAppDefsUnmaintained => "community.lexicon.app.defs#unmaintained",
Self::CommunityLexiconAppDefsDiscontinued => "community.lexicon.app.defs#discontinued",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"community.lexicon.app.defs#unreleased" => Self::CommunityLexiconAppDefsUnreleased,
"community.lexicon.app.defs#preview" => Self::CommunityLexiconAppDefsPreview,
"community.lexicon.app.defs#released" => Self::CommunityLexiconAppDefsReleased,
"community.lexicon.app.defs#unmaintained" => Self::CommunityLexiconAppDefsUnmaintained,
"community.lexicon.app.defs#discontinued" => Self::CommunityLexiconAppDefsDiscontinued,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for Status<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for Status<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for Status<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 Status<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> jacquard_common::IntoStatic for Status<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = Status<S::Output>;
fn into_static(self) -> Self::Output {
match self {
Status::CommunityLexiconAppDefsUnreleased => Status::CommunityLexiconAppDefsUnreleased,
Status::CommunityLexiconAppDefsPreview => Status::CommunityLexiconAppDefsPreview,
Status::CommunityLexiconAppDefsReleased => Status::CommunityLexiconAppDefsReleased,
Status::CommunityLexiconAppDefsUnmaintained => {
Status::CommunityLexiconAppDefsUnmaintained
}
Status::CommunityLexiconAppDefsDiscontinued => {
Status::CommunityLexiconAppDefsDiscontinued
}
Status::Other(v) => Status::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Unmaintained;
impl core::fmt::Display for Unmaintained {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "unmaintained")
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)]
pub struct Unreleased;
impl core::fmt::Display for Unreleased {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "unreleased")
}
}
impl<S: BosStr> LexiconSchema for AccountIndicator<S> {
fn nsid() -> &'static str {
"community.lexicon.app.defs"
}
fn def_name() -> &'static str {
"accountIndicator"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_app_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AspectRatio<S> {
fn nsid() -> &'static str {
"community.lexicon.app.defs"
}
fn def_name() -> &'static str {
"aspectRatio"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_app_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.height;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("height"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.width;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("width"),
min: 1i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Image<S> {
fn nsid() -> &'static str {
"community.lexicon.app.defs"
}
fn def_name() -> &'static str {
"image"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_app_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.alt;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("alt"),
max: 1000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.alt;
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 300usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("alt"),
max: 300usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.image {
{
let size = value.blob().size;
if size > 2000000usize {
return Err(ConstraintError::BlobTooLarge {
path: ValidationPath::from_field("image"),
max: 2000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.image {
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["image/*"];
let matched = accepted.iter().any(|pattern| {
if *pattern == "*/*" {
true
} else if pattern.ends_with("/*") {
let prefix = &pattern[..pattern.len() - 2];
mime.starts_with(prefix) && mime.as_bytes().get(prefix.len()) == Some(&b'/')
} else {
mime == *pattern
}
});
if !matched {
return Err(ConstraintError::BlobMimeTypeNotAccepted {
path: ValidationPath::from_field("image"),
accepted: vec!["image/*".to_string()],
actual: mime.to_string(),
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LexiconInterop<S> {
fn nsid() -> &'static str {
"community.lexicon.app.defs"
}
fn def_name() -> &'static str {
"lexiconInterop"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_app_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Link<S> {
fn nsid() -> &'static str {
"community.lexicon.app.defs"
}
fn def_name() -> &'static str {
"link"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_community_lexicon_app_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.label {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("label"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.label {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 50usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("label"),
max: 50usize,
actual: count,
});
}
}
}
Ok(())
}
}
pub mod account_indicator_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Collection;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Collection = Unset;
}
pub struct SetCollection<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCollection<St> {}
impl<St: State> State for SetCollection<St> {
type Collection = Set<members::collection>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct collection(());
}
}
pub struct AccountIndicatorBuilder<St: account_indicator_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Nsid<S>>, Option<RecordKey<Rkey<S>>>),
_type: PhantomData<fn() -> S>,
}
impl AccountIndicator<DefaultStr> {
pub fn new() -> AccountIndicatorBuilder<account_indicator_state::Empty, DefaultStr> {
AccountIndicatorBuilder::new()
}
}
impl<S: BosStr> AccountIndicator<S> {
pub fn builder() -> AccountIndicatorBuilder<account_indicator_state::Empty, S> {
AccountIndicatorBuilder::builder()
}
}
impl AccountIndicatorBuilder<account_indicator_state::Empty, DefaultStr> {
pub fn new() -> Self {
AccountIndicatorBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> AccountIndicatorBuilder<account_indicator_state::Empty, S> {
pub fn builder() -> Self {
AccountIndicatorBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AccountIndicatorBuilder<St, S>
where
St: account_indicator_state::State,
St::Collection: account_indicator_state::IsUnset,
{
pub fn collection(
mut self,
value: impl Into<Nsid<S>>,
) -> AccountIndicatorBuilder<account_indicator_state::SetCollection<St>, S> {
self._fields.0 = Option::Some(value.into());
AccountIndicatorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: account_indicator_state::State, S: BosStr> AccountIndicatorBuilder<St, S> {
pub fn rkey(mut self, value: impl Into<Option<RecordKey<Rkey<S>>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_rkey(mut self, value: Option<RecordKey<Rkey<S>>>) -> Self {
self._fields.1 = value;
self
}
}
impl<St, S: BosStr> AccountIndicatorBuilder<St, S>
where
St: account_indicator_state::State,
St::Collection: account_indicator_state::IsSet,
{
pub fn build(self) -> AccountIndicator<S> {
AccountIndicator {
collection: self._fields.0.unwrap(),
rkey: self._fields.1,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> AccountIndicator<S> {
AccountIndicator {
collection: self._fields.0.unwrap(),
rkey: self._fields.1,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_community_lexicon_app_defs() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("community.lexicon.app.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("accountIndicator"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A record whose presence in an account can indicate that the account probably uses this app.",
),
),
required: Some(vec![SmolStr::new_static("collection")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("collection"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Record collection to look for in an account repository.",
),
),
format: Some(LexStringFormat::Nsid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rkey"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Optional record key to look for within the collection.",
),
),
format: Some(LexStringFormat::RecordKey),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("aspectRatio"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"width:height represents an aspect ratio. It may be approximate.",
)),
required: Some(vec![
SmolStr::new_static("width"),
SmolStr::new_static("height"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("height"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("width"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("discontinued"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("image"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"An image associated with an app, including accessibility and display metadata. Exactly one of `image` (ATProto blob) or `uri` (remote URL) MUST be present. Consumers SHOULD ignore image items that have neither or both.",
),
),
required: Some(vec![SmolStr::new_static("alt")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Alt text description of the image, for accessibility.",
),
),
max_length: Some(1000usize),
max_graphemes: Some(300usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("aspectRatio"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#aspectRatio"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("image"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("purpose"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"How directories and stores should use the image. Omit this field when no known purpose fits.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Remote image URI.")),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lexiconInterop"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Self-declared AT Protocol lexicon interoperability signals.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("consumes"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Lexicon collections this app reads, displays, imports, or otherwise consumes.",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Nsid),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("produces"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Lexicon collections this app creates or publishes records for.",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Nsid),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("link"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A labeled URI associated with an app.")),
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("label"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Human-readable label for the URI.",
)),
max_length: Some(100usize),
max_graphemes: Some(50usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("role"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#linkRole"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Destination URI.")),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRole"),
LexUserType::String(LexString {
description: Some(CowStr::new_static(
"Known role of a link associated with an app.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleAppStore"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleChangelog"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleDocs"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleFDroid"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRolePlayStore"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRolePrivacyPolicy"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleSourceCode"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleStatus"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleSupport"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleTermsOfService"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleWebManifest"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkRoleWebsite"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platform"),
LexUserType::String(LexString {
description: Some(CowStr::new_static("Platform where an app is available.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformAndroid"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformCLI"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformIOS"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformLinux"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformMacOS"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformWeb"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platformWindows"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("preview"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeAd"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeAppStore"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeBanner"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeHero"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeIcon"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeLogo"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeScreenshot"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("purposeSocialCard"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("released"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexUserType::String(LexString {
description: Some(CowStr::new_static(
"Current release or maintenance status of an app.",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("unmaintained"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("unreleased"),
LexUserType::Token(LexToken {
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod aspect_ratio_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Height;
type Width;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Height = Unset;
type Width = Unset;
}
pub struct SetHeight<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHeight<St> {}
impl<St: State> State for SetHeight<St> {
type Height = Set<members::height>;
type Width = St::Width;
}
pub struct SetWidth<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetWidth<St> {}
impl<St: State> State for SetWidth<St> {
type Height = St::Height;
type Width = Set<members::width>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct height(());
pub struct width(());
}
}
pub struct AspectRatioBuilder<St: aspect_ratio_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl AspectRatio<DefaultStr> {
pub fn new() -> AspectRatioBuilder<aspect_ratio_state::Empty, DefaultStr> {
AspectRatioBuilder::new()
}
}
impl<S: BosStr> AspectRatio<S> {
pub fn builder() -> AspectRatioBuilder<aspect_ratio_state::Empty, S> {
AspectRatioBuilder::builder()
}
}
impl AspectRatioBuilder<aspect_ratio_state::Empty, DefaultStr> {
pub fn new() -> Self {
AspectRatioBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> AspectRatioBuilder<aspect_ratio_state::Empty, S> {
pub fn builder() -> Self {
AspectRatioBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AspectRatioBuilder<St, S>
where
St: aspect_ratio_state::State,
St::Height: aspect_ratio_state::IsUnset,
{
pub fn height(
mut self,
value: impl Into<i64>,
) -> AspectRatioBuilder<aspect_ratio_state::SetHeight<St>, S> {
self._fields.0 = Option::Some(value.into());
AspectRatioBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AspectRatioBuilder<St, S>
where
St: aspect_ratio_state::State,
St::Width: aspect_ratio_state::IsUnset,
{
pub fn width(
mut self,
value: impl Into<i64>,
) -> AspectRatioBuilder<aspect_ratio_state::SetWidth<St>, S> {
self._fields.1 = Option::Some(value.into());
AspectRatioBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AspectRatioBuilder<St, S>
where
St: aspect_ratio_state::State,
St::Height: aspect_ratio_state::IsSet,
St::Width: aspect_ratio_state::IsSet,
{
pub fn build(self) -> AspectRatio<S> {
AspectRatio {
height: self._fields.0.unwrap(),
width: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> AspectRatio<S> {
AspectRatio {
height: self._fields.0.unwrap(),
width: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod link_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct LinkBuilder<St: link_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<app::LinkRole<S>>, Option<UriValue<S>>),
_type: PhantomData<fn() -> S>,
}
impl Link<DefaultStr> {
pub fn new() -> LinkBuilder<link_state::Empty, DefaultStr> {
LinkBuilder::new()
}
}
impl<S: BosStr> Link<S> {
pub fn builder() -> LinkBuilder<link_state::Empty, S> {
LinkBuilder::builder()
}
}
impl LinkBuilder<link_state::Empty, DefaultStr> {
pub fn new() -> Self {
LinkBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> LinkBuilder<link_state::Empty, S> {
pub fn builder() -> Self {
LinkBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<St: link_state::State, S: BosStr> LinkBuilder<St, S> {
pub fn label(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_label(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<St: link_state::State, S: BosStr> LinkBuilder<St, S> {
pub fn role(mut self, value: impl Into<Option<app::LinkRole<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_role(mut self, value: Option<app::LinkRole<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<St, S: BosStr> LinkBuilder<St, S>
where
St: link_state::State,
St::Uri: link_state::IsUnset,
{
pub fn uri(mut self, value: impl Into<UriValue<S>>) -> LinkBuilder<link_state::SetUri<St>, S> {
self._fields.2 = Option::Some(value.into());
LinkBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> LinkBuilder<St, S>
where
St: link_state::State,
St::Uri: link_state::IsSet,
{
pub fn build(self) -> Link<S> {
Link {
label: self._fields.0,
role: self._fields.1,
uri: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Link<S> {
Link {
label: self._fields.0,
role: self._fields.1,
uri: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}