#[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::blob::BlobRef;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon, open_union};
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::me_linkna::linkinbio;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ConnectedServices<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub github_username: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub goodreads_user_id: Option<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 GithubContributionDay<S: BosStr = DefaultStr> {
pub count: i64,
pub date: S,
pub level: 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, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct GoodreadsBook<S: BosStr = DefaultStr> {
pub author: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub cover_url: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub link: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rating: Option<i64>,
pub title: 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, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LinkCard<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub highlighted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub text: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub r#type: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<UriValue<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",
rename = "me.linkna.linkinbio",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Linkinbio<S: BosStr = DefaultStr> {
pub cards: Vec<LinkinbioCardsItem<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub connected_services: Option<linkinbio::ConnectedServices<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub social_icons: Option<Vec<linkinbio::SocialIcon<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub theme: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub theme_config: Option<linkinbio::ThemeConfig<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum LinkinbioCardsItem<S: BosStr = DefaultStr> {
#[serde(rename = "me.linkna.linkinbio#linkCard")]
LinkCard(Box<linkinbio::LinkCard<S>>),
#[serde(rename = "me.linkna.linkinbio#widgetGoodreads")]
WidgetGoodreads(Box<linkinbio::WidgetGoodreads<S>>),
#[serde(rename = "me.linkna.linkinbio#widgetGithub")]
WidgetGithub(Box<linkinbio::WidgetGithub<S>>),
#[serde(rename = "me.linkna.linkinbio#widgetTealfm")]
WidgetTealfm(Box<linkinbio::WidgetTealfm<S>>),
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LinkinbioGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Linkinbio<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SocialIcon<S: BosStr = DefaultStr> {
pub id: S,
pub platform: S,
pub url: UriValue<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, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct TealfmPlay<S: BosStr = DefaultStr> {
pub artist_name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub cover_url: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub origin_url: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub played_time: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub release_name: Option<S>,
pub track_name: 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, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThemeConfig<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub background_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub background_gradient: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub background_image: Option<BlobRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub background_image_credit: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub button_alignment: Option<ThemeConfigButtonAlignment<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub button_hover_glow: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub button_hover_glow_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_background_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_border_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_border_radius: Option<ThemeConfigCardBorderRadius<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_hover_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_shadow: Option<ThemeConfigCardShadow<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub card_text_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content_card_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor_sparkles: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor_style: Option<ThemeConfigCursorStyle<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub font_family: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub font_size: Option<ThemeConfigFontSize<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub particles: Option<ThemeConfigParticles<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub preset: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub profile_alignment: Option<ThemeConfigProfileAlignment<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub profile_picture_shape: Option<ThemeConfigProfilePictureShape<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub profile_picture_size: Option<ThemeConfigProfilePictureSize<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub profile_text_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub show_branding: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub social_icons_border_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub social_icons_color: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub social_icons_shape: Option<ThemeConfigSocialIconsShape<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub social_icons_shape_color: Option<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 ThemeConfigButtonAlignment<S: BosStr = DefaultStr> {
Left,
Right,
Other(S),
}
impl<S: BosStr> ThemeConfigButtonAlignment<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Left => "left",
Self::Right => "right",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"left" => Self::Left,
"right" => Self::Right,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigButtonAlignment<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigButtonAlignment<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigButtonAlignment<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 ThemeConfigButtonAlignment<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 ThemeConfigButtonAlignment<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigButtonAlignment<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigButtonAlignment<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigButtonAlignment::Left => ThemeConfigButtonAlignment::Left,
ThemeConfigButtonAlignment::Right => ThemeConfigButtonAlignment::Right,
ThemeConfigButtonAlignment::Other(v) => {
ThemeConfigButtonAlignment::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCardBorderRadius<S: BosStr = DefaultStr> {
None,
Sm,
Md,
Lg,
Full,
Other(S),
}
impl<S: BosStr> ThemeConfigCardBorderRadius<S> {
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::Sm => "sm",
Self::Md => "md",
Self::Lg => "lg",
Self::Full => "full",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"none" => Self::None,
"sm" => Self::Sm,
"md" => Self::Md,
"lg" => Self::Lg,
"full" => Self::Full,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigCardBorderRadius<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigCardBorderRadius<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigCardBorderRadius<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 ThemeConfigCardBorderRadius<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 ThemeConfigCardBorderRadius<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigCardBorderRadius<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigCardBorderRadius<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigCardBorderRadius::None => ThemeConfigCardBorderRadius::None,
ThemeConfigCardBorderRadius::Sm => ThemeConfigCardBorderRadius::Sm,
ThemeConfigCardBorderRadius::Md => ThemeConfigCardBorderRadius::Md,
ThemeConfigCardBorderRadius::Lg => ThemeConfigCardBorderRadius::Lg,
ThemeConfigCardBorderRadius::Full => ThemeConfigCardBorderRadius::Full,
ThemeConfigCardBorderRadius::Other(v) => {
ThemeConfigCardBorderRadius::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCardShadow<S: BosStr = DefaultStr> {
None,
Sm,
Md,
Lg,
Xl,
Other(S),
}
impl<S: BosStr> ThemeConfigCardShadow<S> {
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::Sm => "sm",
Self::Md => "md",
Self::Lg => "lg",
Self::Xl => "xl",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"none" => Self::None,
"sm" => Self::Sm,
"md" => Self::Md,
"lg" => Self::Lg,
"xl" => Self::Xl,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigCardShadow<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigCardShadow<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigCardShadow<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 ThemeConfigCardShadow<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 ThemeConfigCardShadow<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigCardShadow<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigCardShadow<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigCardShadow::None => ThemeConfigCardShadow::None,
ThemeConfigCardShadow::Sm => ThemeConfigCardShadow::Sm,
ThemeConfigCardShadow::Md => ThemeConfigCardShadow::Md,
ThemeConfigCardShadow::Lg => ThemeConfigCardShadow::Lg,
ThemeConfigCardShadow::Xl => ThemeConfigCardShadow::Xl,
ThemeConfigCardShadow::Other(v) => {
ThemeConfigCardShadow::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCursorStyle<S: BosStr = DefaultStr> {
Default,
HelloKitty,
Other(S),
}
impl<S: BosStr> ThemeConfigCursorStyle<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Default => "default",
Self::HelloKitty => "hello-kitty",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"default" => Self::Default,
"hello-kitty" => Self::HelloKitty,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigCursorStyle<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigCursorStyle<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigCursorStyle<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 ThemeConfigCursorStyle<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 ThemeConfigCursorStyle<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigCursorStyle<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigCursorStyle<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigCursorStyle::Default => ThemeConfigCursorStyle::Default,
ThemeConfigCursorStyle::HelloKitty => ThemeConfigCursorStyle::HelloKitty,
ThemeConfigCursorStyle::Other(v) => {
ThemeConfigCursorStyle::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigFontSize<S: BosStr = DefaultStr> {
Sm,
Md,
Lg,
Other(S),
}
impl<S: BosStr> ThemeConfigFontSize<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Sm => "sm",
Self::Md => "md",
Self::Lg => "lg",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"sm" => Self::Sm,
"md" => Self::Md,
"lg" => Self::Lg,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigFontSize<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigFontSize<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigFontSize<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 ThemeConfigFontSize<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 ThemeConfigFontSize<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigFontSize<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigFontSize<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigFontSize::Sm => ThemeConfigFontSize::Sm,
ThemeConfigFontSize::Md => ThemeConfigFontSize::Md,
ThemeConfigFontSize::Lg => ThemeConfigFontSize::Lg,
ThemeConfigFontSize::Other(v) => ThemeConfigFontSize::Other(v.into_static()),
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigParticles<S: BosStr = DefaultStr> {
None,
White,
Blue,
Leaves,
Other(S),
}
impl<S: BosStr> ThemeConfigParticles<S> {
pub fn as_str(&self) -> &str {
match self {
Self::None => "none",
Self::White => "white",
Self::Blue => "blue",
Self::Leaves => "leaves",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"none" => Self::None,
"white" => Self::White,
"blue" => Self::Blue,
"leaves" => Self::Leaves,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigParticles<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigParticles<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigParticles<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 ThemeConfigParticles<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 ThemeConfigParticles<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigParticles<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigParticles<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigParticles::None => ThemeConfigParticles::None,
ThemeConfigParticles::White => ThemeConfigParticles::White,
ThemeConfigParticles::Blue => ThemeConfigParticles::Blue,
ThemeConfigParticles::Leaves => ThemeConfigParticles::Leaves,
ThemeConfigParticles::Other(v) => {
ThemeConfigParticles::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfileAlignment<S: BosStr = DefaultStr> {
Left,
Center,
Right,
Other(S),
}
impl<S: BosStr> ThemeConfigProfileAlignment<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Left => "left",
Self::Center => "center",
Self::Right => "right",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"left" => Self::Left,
"center" => Self::Center,
"right" => Self::Right,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigProfileAlignment<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigProfileAlignment<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigProfileAlignment<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 ThemeConfigProfileAlignment<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 ThemeConfigProfileAlignment<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigProfileAlignment<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigProfileAlignment<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigProfileAlignment::Left => ThemeConfigProfileAlignment::Left,
ThemeConfigProfileAlignment::Center => ThemeConfigProfileAlignment::Center,
ThemeConfigProfileAlignment::Right => ThemeConfigProfileAlignment::Right,
ThemeConfigProfileAlignment::Other(v) => {
ThemeConfigProfileAlignment::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfilePictureShape<S: BosStr = DefaultStr> {
Circle,
Rounded,
Square,
Other(S),
}
impl<S: BosStr> ThemeConfigProfilePictureShape<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Circle => "circle",
Self::Rounded => "rounded",
Self::Square => "square",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"circle" => Self::Circle,
"rounded" => Self::Rounded,
"square" => Self::Square,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigProfilePictureShape<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigProfilePictureShape<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigProfilePictureShape<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 ThemeConfigProfilePictureShape<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 ThemeConfigProfilePictureShape<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigProfilePictureShape<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigProfilePictureShape<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigProfilePictureShape::Circle => {
ThemeConfigProfilePictureShape::Circle
}
ThemeConfigProfilePictureShape::Rounded => {
ThemeConfigProfilePictureShape::Rounded
}
ThemeConfigProfilePictureShape::Square => {
ThemeConfigProfilePictureShape::Square
}
ThemeConfigProfilePictureShape::Other(v) => {
ThemeConfigProfilePictureShape::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfilePictureSize<S: BosStr = DefaultStr> {
Sm,
Md,
Lg,
Other(S),
}
impl<S: BosStr> ThemeConfigProfilePictureSize<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Sm => "sm",
Self::Md => "md",
Self::Lg => "lg",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"sm" => Self::Sm,
"md" => Self::Md,
"lg" => Self::Lg,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigProfilePictureSize<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigProfilePictureSize<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigProfilePictureSize<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 ThemeConfigProfilePictureSize<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 ThemeConfigProfilePictureSize<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigProfilePictureSize<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigProfilePictureSize<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigProfilePictureSize::Sm => ThemeConfigProfilePictureSize::Sm,
ThemeConfigProfilePictureSize::Md => ThemeConfigProfilePictureSize::Md,
ThemeConfigProfilePictureSize::Lg => ThemeConfigProfilePictureSize::Lg,
ThemeConfigProfilePictureSize::Other(v) => {
ThemeConfigProfilePictureSize::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigSocialIconsShape<S: BosStr = DefaultStr> {
Dock,
Sphere,
Other(S),
}
impl<S: BosStr> ThemeConfigSocialIconsShape<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Dock => "dock",
Self::Sphere => "sphere",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"dock" => Self::Dock,
"sphere" => Self::Sphere,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThemeConfigSocialIconsShape<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThemeConfigSocialIconsShape<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThemeConfigSocialIconsShape<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 ThemeConfigSocialIconsShape<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 ThemeConfigSocialIconsShape<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThemeConfigSocialIconsShape<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThemeConfigSocialIconsShape<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThemeConfigSocialIconsShape::Dock => ThemeConfigSocialIconsShape::Dock,
ThemeConfigSocialIconsShape::Sphere => ThemeConfigSocialIconsShape::Sphere,
ThemeConfigSocialIconsShape::Other(v) => {
ThemeConfigSocialIconsShape::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct WidgetGithub<S: BosStr = DefaultStr> {
pub contributions: Vec<linkinbio::GithubContributionDay<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
pub github_username: S,
pub id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<WidgetGithubSize<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_contributions: Option<i64>,
pub r#type: 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 WidgetGithubSize<S: BosStr = DefaultStr> {
_1x1,
_1x2,
_2x2,
Other(S),
}
impl<S: BosStr> WidgetGithubSize<S> {
pub fn as_str(&self) -> &str {
match self {
Self::_1x1 => "1x1",
Self::_1x2 => "1x2",
Self::_2x2 => "2x2",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"1x1" => Self::_1x1,
"1x2" => Self::_1x2,
"2x2" => Self::_2x2,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WidgetGithubSize<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WidgetGithubSize<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WidgetGithubSize<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 WidgetGithubSize<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 WidgetGithubSize<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WidgetGithubSize<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WidgetGithubSize<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WidgetGithubSize::_1x1 => WidgetGithubSize::_1x1,
WidgetGithubSize::_1x2 => WidgetGithubSize::_1x2,
WidgetGithubSize::_2x2 => WidgetGithubSize::_2x2,
WidgetGithubSize::Other(v) => WidgetGithubSize::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct WidgetGoodreads<S: BosStr = DefaultStr> {
pub books: Vec<linkinbio::GoodreadsBook<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
pub goodreads_user_id: S,
pub id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub read_books: Option<Vec<linkinbio::GoodreadsBook<S>>>,
pub shelf: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<WidgetGoodreadsSize<S>>,
pub r#type: 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 WidgetGoodreadsSize<S: BosStr = DefaultStr> {
_1x1,
_1x2,
_2x2,
Other(S),
}
impl<S: BosStr> WidgetGoodreadsSize<S> {
pub fn as_str(&self) -> &str {
match self {
Self::_1x1 => "1x1",
Self::_1x2 => "1x2",
Self::_2x2 => "2x2",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"1x1" => Self::_1x1,
"1x2" => Self::_1x2,
"2x2" => Self::_2x2,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WidgetGoodreadsSize<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WidgetGoodreadsSize<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WidgetGoodreadsSize<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 WidgetGoodreadsSize<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 WidgetGoodreadsSize<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WidgetGoodreadsSize<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WidgetGoodreadsSize<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WidgetGoodreadsSize::_1x1 => WidgetGoodreadsSize::_1x1,
WidgetGoodreadsSize::_1x2 => WidgetGoodreadsSize::_1x2,
WidgetGoodreadsSize::_2x2 => WidgetGoodreadsSize::_2x2,
WidgetGoodreadsSize::Other(v) => WidgetGoodreadsSize::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct WidgetTealfm<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cover_art_notice: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
pub id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
pub plays: Vec<linkinbio::TealfmPlay<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<WidgetTealfmSize<S>>,
pub r#type: 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 WidgetTealfmSize<S: BosStr = DefaultStr> {
_1x1,
_1x2,
_2x2,
Other(S),
}
impl<S: BosStr> WidgetTealfmSize<S> {
pub fn as_str(&self) -> &str {
match self {
Self::_1x1 => "1x1",
Self::_1x2 => "1x2",
Self::_2x2 => "2x2",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"1x1" => Self::_1x1,
"1x2" => Self::_1x2,
"2x2" => Self::_2x2,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for WidgetTealfmSize<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for WidgetTealfmSize<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for WidgetTealfmSize<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 WidgetTealfmSize<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 WidgetTealfmSize<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for WidgetTealfmSize<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = WidgetTealfmSize<S::Output>;
fn into_static(self) -> Self::Output {
match self {
WidgetTealfmSize::_1x1 => WidgetTealfmSize::_1x1,
WidgetTealfmSize::_1x2 => WidgetTealfmSize::_1x2,
WidgetTealfmSize::_2x2 => WidgetTealfmSize::_2x2,
WidgetTealfmSize::Other(v) => WidgetTealfmSize::Other(v.into_static()),
}
}
}
impl<S: BosStr> Linkinbio<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, LinkinbioRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
impl<S: BosStr> LexiconSchema for ConnectedServices<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"connectedServices"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for GithubContributionDay<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"githubContributionDay"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.level;
if *value > 4i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("level"),
max: 4i64,
actual: *value,
});
}
}
{
let value = &self.level;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("level"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for GoodreadsBook<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"goodreadsBook"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.rating {
if *value > 5i64 {
return Err(ConstraintError::Maximum {
path: ValidationPath::from_field("rating"),
max: 5i64,
actual: *value,
});
}
}
if let Some(ref value) = self.rating {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("rating"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LinkCard<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"linkCard"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.text {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("text"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct LinkinbioRecord;
impl XrpcResp for LinkinbioRecord {
const NSID: &'static str = "me.linkna.linkinbio";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = LinkinbioGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<LinkinbioGetRecordOutput<S>> for Linkinbio<S> {
fn from(output: LinkinbioGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Linkinbio<S> {
const NSID: &'static str = "me.linkna.linkinbio";
type Record = LinkinbioRecord;
}
impl Collection for LinkinbioRecord {
const NSID: &'static str = "me.linkna.linkinbio";
type Record = LinkinbioRecord;
}
impl<S: BosStr> LexiconSchema for Linkinbio<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SocialIcon<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"socialIcon"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TealfmPlay<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"tealfmPlay"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThemeConfig<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"themeConfig"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.background_image {
{
let size = value.blob().size;
if size > 10000000usize {
return Err(ConstraintError::BlobTooLarge {
path: ValidationPath::from_field("background_image"),
max: 10000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.background_image {
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["image/png", "image/jpeg", "image/webp"];
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("background_image"),
accepted: vec![
"image/png".to_string(), "image/jpeg".to_string(),
"image/webp".to_string()
],
actual: mime.to_string(),
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for WidgetGithub<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"widgetGithub"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for WidgetGoodreads<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"widgetGoodreads"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for WidgetTealfm<S> {
fn nsid() -> &'static str {
"me.linkna.linkinbio"
}
fn def_name() -> &'static str {
"widgetTealfm"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_me_linkna_linkinbio()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_me_linkna_linkinbio() -> 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("me.linkna.linkinbio"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("connectedServices"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Saved service credentials/identifiers for pre-filling widget forms.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("githubUsername"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("GitHub username.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("goodreadsUserId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Goodreads numeric user ID."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("githubContributionDay"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A single day's contribution data from GitHub.",
),
),
required: Some(
vec![
SmolStr::new_static("date"), SmolStr::new_static("count"),
SmolStr::new_static("level")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("count"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("date"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Date in YYYY-MM-DD format."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("level"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(4i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("goodreadsBook"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A book from a Goodreads shelf."),
),
required: Some(
vec![SmolStr::new_static("title"), SmolStr::new_static("author")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Book author.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coverUrl"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("URL to the book cover image."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("link"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("URL to the book on Goodreads."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rating"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
maximum: Some(5i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("title"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Book title.")),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("linkCard"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A standard link card.")),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("enabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("highlighted"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the card."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("text"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Display text for the card (falls back to URL domain if empty).",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Card type discriminator. Value: 'link' or absent for link cards.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("url"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("URL the card links to."),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"A user's link-in-bio page containing cards, theme configuration, and social icons.",
),
),
key: Some(CowStr::new_static("literal:self")),
record: LexRecordRecord::Object(LexObject {
required: Some(vec![SmolStr::new_static("cards")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cards"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Ordered list of cards on the page. Each card is a union of linkCard, widgetGoodreads, widgetGithub, or widgetTealfm.",
),
),
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#linkCard"),
CowStr::new_static("#widgetGoodreads"),
CowStr::new_static("#widgetGithub"),
CowStr::new_static("#widgetTealfm")
],
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("connectedServices"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#connectedServices"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIcons"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Social media icons displayed on the profile.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#socialIcon"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("theme"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Deprecated: use themeConfig instead."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("themeConfig"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#themeConfig"),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIcon"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("A social media icon link.")),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("platform"),
SmolStr::new_static("url")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the icon."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("platform"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Platform identifier (e.g., 'bluesky', 'twitter', 'instagram').",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("url"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URL to the user's profile on this platform.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tealfmPlay"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A recently played track from teal.fm."),
),
required: Some(
vec![
SmolStr::new_static("trackName"),
SmolStr::new_static("artistName")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("artistName"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Artist name(s).")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("coverUrl"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URL to the album cover image (from Cover Art Archive).",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("originUrl"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"URL to the track on the original music service.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("playedTime"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the track was played."),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("releaseName"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Album/release name."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("trackName"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Track/song name.")),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("themeConfig"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Theme configuration for the page appearance.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("backgroundColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Page background color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("backgroundGradient"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("CSS gradient for the page background."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("backgroundImage"),
LexObjectProperty::Blob(LexBlob { ..Default::default() }),
);
map.insert(
SmolStr::new_static("backgroundImageCredit"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Optional credit URL for the wallpaper image artist. Stored for attribution purposes only, not displayed on the public page.",
),
),
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("buttonAlignment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Button content alignment. Default: left.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("buttonHoverGlow"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("buttonHoverGlowColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Color for the button hover glow effect.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardBackgroundColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Individual card/button background color.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardBorderColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card/button border color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardBorderRadius"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card/button border radius."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardHoverColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card/button border color on hover."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardShadow"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card/button shadow intensity."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cardTextColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card/button text color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("contentCardColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card container background color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cursorSparkles"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cursorStyle"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Custom cursor style. Default: default."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("fontFamily"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Font family for the page."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("fontSize"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Font size. Default: md."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("particles"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Background particle effect. Default: none.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("preset"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Theme preset ID.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileAlignment"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Profile section alignment. Default: center.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profilePictureShape"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Profile picture shape. Default: circle.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profilePictureSize"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Profile picture size. Default: sm."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileTextColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Profile section text color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("showBranding"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIconsBorderColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Border color for social icons dock/sphere.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIconsColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Social icons color."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIconsShape"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Social icons container shape. Default: dock.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("socialIconsShapeColor"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Background color for social icons dock/sphere.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("widgetGithub"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A GitHub contributions graph widget card."),
),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("githubUsername"),
SmolStr::new_static("contributions")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("contributions"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Contribution data for the last year."),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#githubContributionDay"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("enabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("githubUsername"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("GitHub username.")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the card."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastSyncedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the contribution data was last fetched from GitHub.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("size"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Widget display size. Default: 1x1."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalContributions"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card type discriminator."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("widgetGoodreads"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A Goodreads bookshelf widget card."),
),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("goodreadsUserId"),
SmolStr::new_static("shelf"), SmolStr::new_static("books")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("books"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Books on the currently-reading shelf."),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#goodreadsBook"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("enabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("goodreadsUserId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Goodreads numeric user ID."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the card."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastSyncedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the book data was last fetched from Goodreads.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("readBooks"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Books on the read shelf (used by 1x2 size).",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#goodreadsBook"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("shelf"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Shelf name (currently-reading, read, or to-read).",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("size"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Widget display size. Default: 1x1."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card type discriminator."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("widgetTealfm"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A teal.fm recently played tracks widget card.",
),
),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("plays")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("coverArtNotice"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Copyright notice for cover art images."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("enabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Unique identifier for the card."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lastSyncedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"When the play data was last fetched from the PDS.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("plays"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static("Recently played tracks."),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#tealfmPlay"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("size"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Widget display size. Default: 1x1."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Card type discriminator."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod github_contribution_day_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 Level;
type Count;
type Date;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Level = Unset;
type Count = Unset;
type Date = Unset;
}
pub struct SetLevel<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLevel<St> {}
impl<St: State> State for SetLevel<St> {
type Level = Set<members::level>;
type Count = St::Count;
type Date = St::Date;
}
pub struct SetCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCount<St> {}
impl<St: State> State for SetCount<St> {
type Level = St::Level;
type Count = Set<members::count>;
type Date = St::Date;
}
pub struct SetDate<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDate<St> {}
impl<St: State> State for SetDate<St> {
type Level = St::Level;
type Count = St::Count;
type Date = Set<members::date>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct level(());
pub struct count(());
pub struct date(());
}
}
pub struct GithubContributionDayBuilder<
S: BosStr,
St: github_contribution_day_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<S>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> GithubContributionDay<S> {
pub fn new() -> GithubContributionDayBuilder<
S,
github_contribution_day_state::Empty,
> {
GithubContributionDayBuilder::new()
}
}
impl<S: BosStr> GithubContributionDayBuilder<S, github_contribution_day_state::Empty> {
pub fn new() -> Self {
GithubContributionDayBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GithubContributionDayBuilder<S, St>
where
St: github_contribution_day_state::State,
St::Count: github_contribution_day_state::IsUnset,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> GithubContributionDayBuilder<S, github_contribution_day_state::SetCount<St>> {
self._fields.0 = Option::Some(value.into());
GithubContributionDayBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GithubContributionDayBuilder<S, St>
where
St: github_contribution_day_state::State,
St::Date: github_contribution_day_state::IsUnset,
{
pub fn date(
mut self,
value: impl Into<S>,
) -> GithubContributionDayBuilder<S, github_contribution_day_state::SetDate<St>> {
self._fields.1 = Option::Some(value.into());
GithubContributionDayBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GithubContributionDayBuilder<S, St>
where
St: github_contribution_day_state::State,
St::Level: github_contribution_day_state::IsUnset,
{
pub fn level(
mut self,
value: impl Into<i64>,
) -> GithubContributionDayBuilder<S, github_contribution_day_state::SetLevel<St>> {
self._fields.2 = Option::Some(value.into());
GithubContributionDayBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> GithubContributionDayBuilder<S, St>
where
St: github_contribution_day_state::State,
St::Level: github_contribution_day_state::IsSet,
St::Count: github_contribution_day_state::IsSet,
St::Date: github_contribution_day_state::IsSet,
{
pub fn build(self) -> GithubContributionDay<S> {
GithubContributionDay {
count: self._fields.0.unwrap(),
date: self._fields.1.unwrap(),
level: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> GithubContributionDay<S> {
GithubContributionDay {
count: self._fields.0.unwrap(),
date: self._fields.1.unwrap(),
level: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod linkinbio_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 Cards;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cards = Unset;
}
pub struct SetCards<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCards<St> {}
impl<St: State> State for SetCards<St> {
type Cards = Set<members::cards>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cards(());
}
}
pub struct LinkinbioBuilder<S: BosStr, St: linkinbio_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<LinkinbioCardsItem<S>>>,
Option<linkinbio::ConnectedServices<S>>,
Option<Vec<linkinbio::SocialIcon<S>>>,
Option<S>,
Option<linkinbio::ThemeConfig<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Linkinbio<S> {
pub fn new() -> LinkinbioBuilder<S, linkinbio_state::Empty> {
LinkinbioBuilder::new()
}
}
impl<S: BosStr> LinkinbioBuilder<S, linkinbio_state::Empty> {
pub fn new() -> Self {
LinkinbioBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LinkinbioBuilder<S, St>
where
St: linkinbio_state::State,
St::Cards: linkinbio_state::IsUnset,
{
pub fn cards(
mut self,
value: impl Into<Vec<LinkinbioCardsItem<S>>>,
) -> LinkinbioBuilder<S, linkinbio_state::SetCards<St>> {
self._fields.0 = Option::Some(value.into());
LinkinbioBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: linkinbio_state::State> LinkinbioBuilder<S, St> {
pub fn connected_services(
mut self,
value: impl Into<Option<linkinbio::ConnectedServices<S>>>,
) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_connected_services(
mut self,
value: Option<linkinbio::ConnectedServices<S>>,
) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: linkinbio_state::State> LinkinbioBuilder<S, St> {
pub fn social_icons(
mut self,
value: impl Into<Option<Vec<linkinbio::SocialIcon<S>>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_social_icons(
mut self,
value: Option<Vec<linkinbio::SocialIcon<S>>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: linkinbio_state::State> LinkinbioBuilder<S, St> {
pub fn theme(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_theme(mut self, value: Option<S>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: linkinbio_state::State> LinkinbioBuilder<S, St> {
pub fn theme_config(
mut self,
value: impl Into<Option<linkinbio::ThemeConfig<S>>>,
) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_theme_config(
mut self,
value: Option<linkinbio::ThemeConfig<S>>,
) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> LinkinbioBuilder<S, St>
where
St: linkinbio_state::State,
St::Cards: linkinbio_state::IsSet,
{
pub fn build(self) -> Linkinbio<S> {
Linkinbio {
cards: self._fields.0.unwrap(),
connected_services: self._fields.1,
social_icons: self._fields.2,
theme: self._fields.3,
theme_config: self._fields.4,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> Linkinbio<S> {
Linkinbio {
cards: self._fields.0.unwrap(),
connected_services: self._fields.1,
social_icons: self._fields.2,
theme: self._fields.3,
theme_config: self._fields.4,
extra_data: Some(extra_data),
}
}
}
pub mod social_icon_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 Id;
type Platform;
type Url;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Platform = Unset;
type Url = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Platform = St::Platform;
type Url = St::Url;
}
pub struct SetPlatform<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPlatform<St> {}
impl<St: State> State for SetPlatform<St> {
type Id = St::Id;
type Platform = Set<members::platform>;
type Url = St::Url;
}
pub struct SetUrl<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUrl<St> {}
impl<St: State> State for SetUrl<St> {
type Id = St::Id;
type Platform = St::Platform;
type Url = Set<members::url>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct platform(());
pub struct url(());
}
}
pub struct SocialIconBuilder<S: BosStr, St: social_icon_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<UriValue<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SocialIcon<S> {
pub fn new() -> SocialIconBuilder<S, social_icon_state::Empty> {
SocialIconBuilder::new()
}
}
impl<S: BosStr> SocialIconBuilder<S, social_icon_state::Empty> {
pub fn new() -> Self {
SocialIconBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SocialIconBuilder<S, St>
where
St: social_icon_state::State,
St::Id: social_icon_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> SocialIconBuilder<S, social_icon_state::SetId<St>> {
self._fields.0 = Option::Some(value.into());
SocialIconBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SocialIconBuilder<S, St>
where
St: social_icon_state::State,
St::Platform: social_icon_state::IsUnset,
{
pub fn platform(
mut self,
value: impl Into<S>,
) -> SocialIconBuilder<S, social_icon_state::SetPlatform<St>> {
self._fields.1 = Option::Some(value.into());
SocialIconBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SocialIconBuilder<S, St>
where
St: social_icon_state::State,
St::Url: social_icon_state::IsUnset,
{
pub fn url(
mut self,
value: impl Into<UriValue<S>>,
) -> SocialIconBuilder<S, social_icon_state::SetUrl<St>> {
self._fields.2 = Option::Some(value.into());
SocialIconBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SocialIconBuilder<S, St>
where
St: social_icon_state::State,
St::Id: social_icon_state::IsSet,
St::Platform: social_icon_state::IsSet,
St::Url: social_icon_state::IsSet,
{
pub fn build(self) -> SocialIcon<S> {
SocialIcon {
id: self._fields.0.unwrap(),
platform: self._fields.1.unwrap(),
url: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SocialIcon<S> {
SocialIcon {
id: self._fields.0.unwrap(),
platform: self._fields.1.unwrap(),
url: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod widget_github_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 Id;
type Type;
type Contributions;
type GithubUsername;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Type = Unset;
type Contributions = Unset;
type GithubUsername = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Type = St::Type;
type Contributions = St::Contributions;
type GithubUsername = St::GithubUsername;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Id = St::Id;
type Type = Set<members::r#type>;
type Contributions = St::Contributions;
type GithubUsername = St::GithubUsername;
}
pub struct SetContributions<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetContributions<St> {}
impl<St: State> State for SetContributions<St> {
type Id = St::Id;
type Type = St::Type;
type Contributions = Set<members::contributions>;
type GithubUsername = St::GithubUsername;
}
pub struct SetGithubUsername<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetGithubUsername<St> {}
impl<St: State> State for SetGithubUsername<St> {
type Id = St::Id;
type Type = St::Type;
type Contributions = St::Contributions;
type GithubUsername = Set<members::github_username>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct r#type(());
pub struct contributions(());
pub struct github_username(());
}
}
pub struct WidgetGithubBuilder<S: BosStr, St: widget_github_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<linkinbio::GithubContributionDay<S>>>,
Option<bool>,
Option<S>,
Option<S>,
Option<Datetime>,
Option<WidgetGithubSize<S>>,
Option<i64>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> WidgetGithub<S> {
pub fn new() -> WidgetGithubBuilder<S, widget_github_state::Empty> {
WidgetGithubBuilder::new()
}
}
impl<S: BosStr> WidgetGithubBuilder<S, widget_github_state::Empty> {
pub fn new() -> Self {
WidgetGithubBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGithubBuilder<S, St>
where
St: widget_github_state::State,
St::Contributions: widget_github_state::IsUnset,
{
pub fn contributions(
mut self,
value: impl Into<Vec<linkinbio::GithubContributionDay<S>>>,
) -> WidgetGithubBuilder<S, widget_github_state::SetContributions<St>> {
self._fields.0 = Option::Some(value.into());
WidgetGithubBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_github_state::State> WidgetGithubBuilder<S, St> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> WidgetGithubBuilder<S, St>
where
St: widget_github_state::State,
St::GithubUsername: widget_github_state::IsUnset,
{
pub fn github_username(
mut self,
value: impl Into<S>,
) -> WidgetGithubBuilder<S, widget_github_state::SetGithubUsername<St>> {
self._fields.2 = Option::Some(value.into());
WidgetGithubBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGithubBuilder<S, St>
where
St: widget_github_state::State,
St::Id: widget_github_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> WidgetGithubBuilder<S, widget_github_state::SetId<St>> {
self._fields.3 = Option::Some(value.into());
WidgetGithubBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_github_state::State> WidgetGithubBuilder<S, St> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: widget_github_state::State> WidgetGithubBuilder<S, St> {
pub fn size(mut self, value: impl Into<Option<WidgetGithubSize<S>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_size(mut self, value: Option<WidgetGithubSize<S>>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: widget_github_state::State> WidgetGithubBuilder<S, St> {
pub fn total_contributions(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_total_contributions(mut self, value: Option<i64>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> WidgetGithubBuilder<S, St>
where
St: widget_github_state::State,
St::Type: widget_github_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> WidgetGithubBuilder<S, widget_github_state::SetType<St>> {
self._fields.7 = Option::Some(value.into());
WidgetGithubBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGithubBuilder<S, St>
where
St: widget_github_state::State,
St::Id: widget_github_state::IsSet,
St::Type: widget_github_state::IsSet,
St::Contributions: widget_github_state::IsSet,
St::GithubUsername: widget_github_state::IsSet,
{
pub fn build(self) -> WidgetGithub<S> {
WidgetGithub {
contributions: self._fields.0.unwrap(),
enabled: self._fields.1,
github_username: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
last_synced_at: self._fields.4,
size: self._fields.5,
total_contributions: self._fields.6,
r#type: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> WidgetGithub<S> {
WidgetGithub {
contributions: self._fields.0.unwrap(),
enabled: self._fields.1,
github_username: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
last_synced_at: self._fields.4,
size: self._fields.5,
total_contributions: self._fields.6,
r#type: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod widget_goodreads_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 GoodreadsUserId;
type Id;
type Shelf;
type Books;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type GoodreadsUserId = Unset;
type Id = Unset;
type Shelf = Unset;
type Books = Unset;
type Type = Unset;
}
pub struct SetGoodreadsUserId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetGoodreadsUserId<St> {}
impl<St: State> State for SetGoodreadsUserId<St> {
type GoodreadsUserId = Set<members::goodreads_user_id>;
type Id = St::Id;
type Shelf = St::Shelf;
type Books = St::Books;
type Type = St::Type;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type GoodreadsUserId = St::GoodreadsUserId;
type Id = Set<members::id>;
type Shelf = St::Shelf;
type Books = St::Books;
type Type = St::Type;
}
pub struct SetShelf<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetShelf<St> {}
impl<St: State> State for SetShelf<St> {
type GoodreadsUserId = St::GoodreadsUserId;
type Id = St::Id;
type Shelf = Set<members::shelf>;
type Books = St::Books;
type Type = St::Type;
}
pub struct SetBooks<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetBooks<St> {}
impl<St: State> State for SetBooks<St> {
type GoodreadsUserId = St::GoodreadsUserId;
type Id = St::Id;
type Shelf = St::Shelf;
type Books = Set<members::books>;
type Type = St::Type;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type GoodreadsUserId = St::GoodreadsUserId;
type Id = St::Id;
type Shelf = St::Shelf;
type Books = St::Books;
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct goodreads_user_id(());
pub struct id(());
pub struct shelf(());
pub struct books(());
pub struct r#type(());
}
}
pub struct WidgetGoodreadsBuilder<S: BosStr, St: widget_goodreads_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<linkinbio::GoodreadsBook<S>>>,
Option<bool>,
Option<S>,
Option<S>,
Option<Datetime>,
Option<Vec<linkinbio::GoodreadsBook<S>>>,
Option<S>,
Option<WidgetGoodreadsSize<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> WidgetGoodreads<S> {
pub fn new() -> WidgetGoodreadsBuilder<S, widget_goodreads_state::Empty> {
WidgetGoodreadsBuilder::new()
}
}
impl<S: BosStr> WidgetGoodreadsBuilder<S, widget_goodreads_state::Empty> {
pub fn new() -> Self {
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::Books: widget_goodreads_state::IsUnset,
{
pub fn books(
mut self,
value: impl Into<Vec<linkinbio::GoodreadsBook<S>>>,
) -> WidgetGoodreadsBuilder<S, widget_goodreads_state::SetBooks<St>> {
self._fields.0 = Option::Some(value.into());
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_goodreads_state::State> WidgetGoodreadsBuilder<S, St> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::GoodreadsUserId: widget_goodreads_state::IsUnset,
{
pub fn goodreads_user_id(
mut self,
value: impl Into<S>,
) -> WidgetGoodreadsBuilder<S, widget_goodreads_state::SetGoodreadsUserId<St>> {
self._fields.2 = Option::Some(value.into());
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::Id: widget_goodreads_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> WidgetGoodreadsBuilder<S, widget_goodreads_state::SetId<St>> {
self._fields.3 = Option::Some(value.into());
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_goodreads_state::State> WidgetGoodreadsBuilder<S, St> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: widget_goodreads_state::State> WidgetGoodreadsBuilder<S, St> {
pub fn read_books(
mut self,
value: impl Into<Option<Vec<linkinbio::GoodreadsBook<S>>>>,
) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_read_books(
mut self,
value: Option<Vec<linkinbio::GoodreadsBook<S>>>,
) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::Shelf: widget_goodreads_state::IsUnset,
{
pub fn shelf(
mut self,
value: impl Into<S>,
) -> WidgetGoodreadsBuilder<S, widget_goodreads_state::SetShelf<St>> {
self._fields.6 = Option::Some(value.into());
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_goodreads_state::State> WidgetGoodreadsBuilder<S, St> {
pub fn size(mut self, value: impl Into<Option<WidgetGoodreadsSize<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_size(mut self, value: Option<WidgetGoodreadsSize<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::Type: widget_goodreads_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> WidgetGoodreadsBuilder<S, widget_goodreads_state::SetType<St>> {
self._fields.8 = Option::Some(value.into());
WidgetGoodreadsBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetGoodreadsBuilder<S, St>
where
St: widget_goodreads_state::State,
St::GoodreadsUserId: widget_goodreads_state::IsSet,
St::Id: widget_goodreads_state::IsSet,
St::Shelf: widget_goodreads_state::IsSet,
St::Books: widget_goodreads_state::IsSet,
St::Type: widget_goodreads_state::IsSet,
{
pub fn build(self) -> WidgetGoodreads<S> {
WidgetGoodreads {
books: self._fields.0.unwrap(),
enabled: self._fields.1,
goodreads_user_id: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
last_synced_at: self._fields.4,
read_books: self._fields.5,
shelf: self._fields.6.unwrap(),
size: self._fields.7,
r#type: self._fields.8.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> WidgetGoodreads<S> {
WidgetGoodreads {
books: self._fields.0.unwrap(),
enabled: self._fields.1,
goodreads_user_id: self._fields.2.unwrap(),
id: self._fields.3.unwrap(),
last_synced_at: self._fields.4,
read_books: self._fields.5,
shelf: self._fields.6.unwrap(),
size: self._fields.7,
r#type: self._fields.8.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod widget_tealfm_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 Plays;
type Id;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Plays = Unset;
type Id = Unset;
type Type = Unset;
}
pub struct SetPlays<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPlays<St> {}
impl<St: State> State for SetPlays<St> {
type Plays = Set<members::plays>;
type Id = St::Id;
type Type = St::Type;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Plays = St::Plays;
type Id = Set<members::id>;
type Type = St::Type;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Plays = St::Plays;
type Id = St::Id;
type Type = Set<members::r#type>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct plays(());
pub struct id(());
pub struct r#type(());
}
}
pub struct WidgetTealfmBuilder<S: BosStr, St: widget_tealfm_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<bool>,
Option<S>,
Option<Datetime>,
Option<Vec<linkinbio::TealfmPlay<S>>>,
Option<WidgetTealfmSize<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> WidgetTealfm<S> {
pub fn new() -> WidgetTealfmBuilder<S, widget_tealfm_state::Empty> {
WidgetTealfmBuilder::new()
}
}
impl<S: BosStr> WidgetTealfmBuilder<S, widget_tealfm_state::Empty> {
pub fn new() -> Self {
WidgetTealfmBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_tealfm_state::State> WidgetTealfmBuilder<S, St> {
pub fn cover_art_notice(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cover_art_notice(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: widget_tealfm_state::State> WidgetTealfmBuilder<S, St> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> WidgetTealfmBuilder<S, St>
where
St: widget_tealfm_state::State,
St::Id: widget_tealfm_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> WidgetTealfmBuilder<S, widget_tealfm_state::SetId<St>> {
self._fields.2 = Option::Some(value.into());
WidgetTealfmBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_tealfm_state::State> WidgetTealfmBuilder<S, St> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> WidgetTealfmBuilder<S, St>
where
St: widget_tealfm_state::State,
St::Plays: widget_tealfm_state::IsUnset,
{
pub fn plays(
mut self,
value: impl Into<Vec<linkinbio::TealfmPlay<S>>>,
) -> WidgetTealfmBuilder<S, widget_tealfm_state::SetPlays<St>> {
self._fields.4 = Option::Some(value.into());
WidgetTealfmBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: widget_tealfm_state::State> WidgetTealfmBuilder<S, St> {
pub fn size(mut self, value: impl Into<Option<WidgetTealfmSize<S>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_size(mut self, value: Option<WidgetTealfmSize<S>>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> WidgetTealfmBuilder<S, St>
where
St: widget_tealfm_state::State,
St::Type: widget_tealfm_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<S>,
) -> WidgetTealfmBuilder<S, widget_tealfm_state::SetType<St>> {
self._fields.6 = Option::Some(value.into());
WidgetTealfmBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> WidgetTealfmBuilder<S, St>
where
St: widget_tealfm_state::State,
St::Plays: widget_tealfm_state::IsSet,
St::Id: widget_tealfm_state::IsSet,
St::Type: widget_tealfm_state::IsSet,
{
pub fn build(self) -> WidgetTealfm<S> {
WidgetTealfm {
cover_art_notice: self._fields.0,
enabled: self._fields.1,
id: self._fields.2.unwrap(),
last_synced_at: self._fields.3,
plays: self._fields.4.unwrap(),
size: self._fields.5,
r#type: self._fields.6.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> WidgetTealfm<S> {
WidgetTealfm {
cover_art_notice: self._fields.0,
enabled: self._fields.1,
id: self._fields.2.unwrap(),
last_synced_at: self._fields.3,
plays: self._fields.4.unwrap(),
size: self._fields.5,
r#type: self._fields.6.unwrap(),
extra_data: Some(extra_data),
}
}
}