// @generated by jacquard-lexicon. DO NOT EDIT.
//
// Lexicon: me.linkna.linkinbio
//
// This file was automatically generated from Lexicon schemas.
// Any manual changes will be overwritten on the next regeneration.

#[allow(unused_imports)]
use alloc::collections::BTreeMap;

#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::CowStr;

#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::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::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;
/// Saved service credentials/identifiers for pre-filling widget forms.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ConnectedServices<'a> {
    ///GitHub username.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub github_username: Option<CowStr<'a>>,
    ///Goodreads numeric user ID.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub goodreads_user_id: Option<CowStr<'a>>,
}

/// A single day's contribution data from GitHub.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GithubContributionDay<'a> {
    ///Number of contributions on this day.
    pub count: i64,
    ///Date in YYYY-MM-DD format.
    #[serde(borrow)]
    pub date: CowStr<'a>,
    ///Contribution intensity level (0=none, 4=highest).
    pub level: i64,
}

/// A book from a Goodreads shelf.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct GoodreadsBook<'a> {
    ///Book author.
    #[serde(borrow)]
    pub author: CowStr<'a>,
    ///URL to the book cover image.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cover_url: Option<CowStr<'a>>,
    ///URL to the book on Goodreads.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub link: Option<CowStr<'a>>,
    ///User's rating (1-5), or absent if unrated.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub rating: Option<i64>,
    ///Book title.
    #[serde(borrow)]
    pub title: CowStr<'a>,
}

/// A standard link card.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct LinkCard<'a> {
    ///Whether the card is visible on the public page. Defaults to true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    ///Whether the card is visually highlighted.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub highlighted: Option<bool>,
    ///Unique identifier for the card.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub id: Option<CowStr<'a>>,
    ///Display text for the card (falls back to URL domain if empty).
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub text: Option<CowStr<'a>>,
    ///Card type discriminator. Value: 'link' or absent for link cards.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub r#type: Option<CowStr<'a>>,
    ///URL the card links to.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub url: Option<UriValue<'a>>,
}

/// A user's link-in-bio page containing cards, theme configuration, and social icons.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Linkinbio<'a> {
    ///Ordered list of cards on the page. Each card is a union of linkCard, widgetGoodreads, widgetGithub, or widgetTealfm.
    #[serde(borrow)]
    pub cards: Vec<LinkinbioCardsItem<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub connected_services: Option<linkinbio::ConnectedServices<'a>>,
    ///Social media icons displayed on the profile.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub social_icons: Option<Vec<linkinbio::SocialIcon<'a>>>,
    ///Deprecated: use themeConfig instead.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub theme: Option<CowStr<'a>>,
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub theme_config: Option<linkinbio::ThemeConfig<'a>>,
}


#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum LinkinbioCardsItem<'a> {
    #[serde(rename = "me.linkna.linkinbio#linkCard")]
    LinkCard(Box<linkinbio::LinkCard<'a>>),
    #[serde(rename = "me.linkna.linkinbio#widgetGoodreads")]
    WidgetGoodreads(Box<linkinbio::WidgetGoodreads<'a>>),
    #[serde(rename = "me.linkna.linkinbio#widgetGithub")]
    WidgetGithub(Box<linkinbio::WidgetGithub<'a>>),
    #[serde(rename = "me.linkna.linkinbio#widgetTealfm")]
    WidgetTealfm(Box<linkinbio::WidgetTealfm<'a>>),
}

/// Typed wrapper for GetRecord response with this collection's record type.

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LinkinbioGetRecordOutput<'a> {
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cid: Option<Cid<'a>>,
    #[serde(borrow)]
    pub uri: AtUri<'a>,
    #[serde(borrow)]
    pub value: Linkinbio<'a>,
}

/// A social media icon link.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SocialIcon<'a> {
    ///Unique identifier for the icon.
    #[serde(borrow)]
    pub id: CowStr<'a>,
    ///Platform identifier (e.g., 'bluesky', 'twitter', 'instagram').
    #[serde(borrow)]
    pub platform: CowStr<'a>,
    ///URL to the user's profile on this platform.
    #[serde(borrow)]
    pub url: UriValue<'a>,
}

/// A recently played track from teal.fm.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct TealfmPlay<'a> {
    ///Artist name(s).
    #[serde(borrow)]
    pub artist_name: CowStr<'a>,
    ///URL to the album cover image (from Cover Art Archive).
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cover_url: Option<CowStr<'a>>,
    ///URL to the track on the original music service.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub origin_url: Option<CowStr<'a>>,
    ///When the track was played.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub played_time: Option<Datetime>,
    ///Album/release name.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub release_name: Option<CowStr<'a>>,
    ///Track/song name.
    #[serde(borrow)]
    pub track_name: CowStr<'a>,
}

/// Theme configuration for the page appearance.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThemeConfig<'a> {
    ///Page background color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background_color: Option<CowStr<'a>>,
    ///CSS gradient for the page background.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background_gradient: Option<CowStr<'a>>,
    ///Background wallpaper image blob.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background_image: Option<BlobRef<'a>>,
    ///Optional credit URL for the wallpaper image artist. Stored for attribution purposes only, not displayed on the public page.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub background_image_credit: Option<UriValue<'a>>,
    ///Button content alignment. Default: left.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub button_alignment: Option<ThemeConfigButtonAlignment<'a>>,
    ///Whether buttons glow on hover. Default: false.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub button_hover_glow: Option<bool>,
    ///Color for the button hover glow effect.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub button_hover_glow_color: Option<CowStr<'a>>,
    ///Individual card/button background color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_background_color: Option<CowStr<'a>>,
    ///Card/button border color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_border_color: Option<CowStr<'a>>,
    ///Card/button border radius.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_border_radius: Option<ThemeConfigCardBorderRadius<'a>>,
    ///Card/button border color on hover.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_hover_color: Option<CowStr<'a>>,
    ///Card/button shadow intensity.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_shadow: Option<ThemeConfigCardShadow<'a>>,
    ///Card/button text color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub card_text_color: Option<CowStr<'a>>,
    ///Card container background color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub content_card_color: Option<CowStr<'a>>,
    ///Whether cursor has sparkle trail. Default: false.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub cursor_sparkles: Option<bool>,
    ///Custom cursor style. Default: default.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cursor_style: Option<ThemeConfigCursorStyle<'a>>,
    ///Font family for the page.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub font_family: Option<CowStr<'a>>,
    ///Font size. Default: md.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub font_size: Option<ThemeConfigFontSize<'a>>,
    ///Background particle effect. Default: none.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub particles: Option<ThemeConfigParticles<'a>>,
    ///Theme preset ID.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub preset: Option<CowStr<'a>>,
    ///Profile section alignment. Default: center.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub profile_alignment: Option<ThemeConfigProfileAlignment<'a>>,
    ///Profile picture shape. Default: circle.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub profile_picture_shape: Option<ThemeConfigProfilePictureShape<'a>>,
    ///Profile picture size. Default: sm.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub profile_picture_size: Option<ThemeConfigProfilePictureSize<'a>>,
    ///Profile section text color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub profile_text_color: Option<CowStr<'a>>,
    ///Whether Linkname branding is visible. Default: true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub show_branding: Option<bool>,
    ///Border color for social icons dock/sphere.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub social_icons_border_color: Option<CowStr<'a>>,
    ///Social icons color.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub social_icons_color: Option<CowStr<'a>>,
    ///Social icons container shape. Default: dock.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub social_icons_shape: Option<ThemeConfigSocialIconsShape<'a>>,
    ///Background color for social icons dock/sphere.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub social_icons_shape_color: Option<CowStr<'a>>,
}

/// Button content alignment. Default: left.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigButtonAlignment<'a> {
    Left,
    Right,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigButtonAlignment<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Left => "left",
            Self::Right => "right",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigButtonAlignment<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "left" => Self::Left,
            "right" => Self::Right,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigButtonAlignment<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "left" => Self::Left,
            "right" => Self::Right,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigButtonAlignment<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigButtonAlignment<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigButtonAlignment<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigButtonAlignment<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigButtonAlignment<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigButtonAlignment<'_> {
    type Output = ThemeConfigButtonAlignment<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            ThemeConfigButtonAlignment::Left => ThemeConfigButtonAlignment::Left,
            ThemeConfigButtonAlignment::Right => ThemeConfigButtonAlignment::Right,
            ThemeConfigButtonAlignment::Other(v) => {
                ThemeConfigButtonAlignment::Other(v.into_static())
            }
        }
    }
}

/// Card/button border radius.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCardBorderRadius<'a> {
    None,
    Sm,
    Md,
    Lg,
    Full,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigCardBorderRadius<'a> {
    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(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigCardBorderRadius<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "none" => Self::None,
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            "full" => Self::Full,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigCardBorderRadius<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "none" => Self::None,
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            "full" => Self::Full,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigCardBorderRadius<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigCardBorderRadius<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigCardBorderRadius<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigCardBorderRadius<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigCardBorderRadius<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigCardBorderRadius<'_> {
    type Output = ThemeConfigCardBorderRadius<'static>;
    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())
            }
        }
    }
}

/// Card/button shadow intensity.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCardShadow<'a> {
    None,
    Sm,
    Md,
    Lg,
    Xl,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigCardShadow<'a> {
    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(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigCardShadow<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "none" => Self::None,
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            "xl" => Self::Xl,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigCardShadow<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "none" => Self::None,
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            "xl" => Self::Xl,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigCardShadow<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigCardShadow<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigCardShadow<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigCardShadow<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigCardShadow<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigCardShadow<'_> {
    type Output = ThemeConfigCardShadow<'static>;
    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())
            }
        }
    }
}

/// Custom cursor style. Default: default.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigCursorStyle<'a> {
    Default,
    HelloKitty,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigCursorStyle<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Default => "default",
            Self::HelloKitty => "hello-kitty",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigCursorStyle<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "default" => Self::Default,
            "hello-kitty" => Self::HelloKitty,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigCursorStyle<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "default" => Self::Default,
            "hello-kitty" => Self::HelloKitty,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigCursorStyle<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigCursorStyle<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigCursorStyle<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigCursorStyle<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigCursorStyle<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigCursorStyle<'_> {
    type Output = ThemeConfigCursorStyle<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            ThemeConfigCursorStyle::Default => ThemeConfigCursorStyle::Default,
            ThemeConfigCursorStyle::HelloKitty => ThemeConfigCursorStyle::HelloKitty,
            ThemeConfigCursorStyle::Other(v) => {
                ThemeConfigCursorStyle::Other(v.into_static())
            }
        }
    }
}

/// Font size. Default: md.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigFontSize<'a> {
    Sm,
    Md,
    Lg,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigFontSize<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Sm => "sm",
            Self::Md => "md",
            Self::Lg => "lg",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigFontSize<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigFontSize<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigFontSize<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigFontSize<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigFontSize<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigFontSize<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigFontSize<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigFontSize<'_> {
    type Output = ThemeConfigFontSize<'static>;
    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()),
        }
    }
}

/// Background particle effect. Default: none.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigParticles<'a> {
    None,
    White,
    Blue,
    Leaves,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigParticles<'a> {
    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(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigParticles<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "none" => Self::None,
            "white" => Self::White,
            "blue" => Self::Blue,
            "leaves" => Self::Leaves,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigParticles<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "none" => Self::None,
            "white" => Self::White,
            "blue" => Self::Blue,
            "leaves" => Self::Leaves,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigParticles<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigParticles<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigParticles<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigParticles<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigParticles<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigParticles<'_> {
    type Output = ThemeConfigParticles<'static>;
    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())
            }
        }
    }
}

/// Profile section alignment. Default: center.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfileAlignment<'a> {
    Left,
    Center,
    Right,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigProfileAlignment<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Left => "left",
            Self::Center => "center",
            Self::Right => "right",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigProfileAlignment<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "left" => Self::Left,
            "center" => Self::Center,
            "right" => Self::Right,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigProfileAlignment<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "left" => Self::Left,
            "center" => Self::Center,
            "right" => Self::Right,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigProfileAlignment<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigProfileAlignment<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigProfileAlignment<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigProfileAlignment<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigProfileAlignment<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigProfileAlignment<'_> {
    type Output = ThemeConfigProfileAlignment<'static>;
    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())
            }
        }
    }
}

/// Profile picture shape. Default: circle.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfilePictureShape<'a> {
    Circle,
    Rounded,
    Square,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigProfilePictureShape<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Circle => "circle",
            Self::Rounded => "rounded",
            Self::Square => "square",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigProfilePictureShape<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "circle" => Self::Circle,
            "rounded" => Self::Rounded,
            "square" => Self::Square,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigProfilePictureShape<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "circle" => Self::Circle,
            "rounded" => Self::Rounded,
            "square" => Self::Square,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigProfilePictureShape<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigProfilePictureShape<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigProfilePictureShape<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigProfilePictureShape<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigProfilePictureShape<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigProfilePictureShape<'_> {
    type Output = ThemeConfigProfilePictureShape<'static>;
    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())
            }
        }
    }
}

/// Profile picture size. Default: sm.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigProfilePictureSize<'a> {
    Sm,
    Md,
    Lg,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigProfilePictureSize<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Sm => "sm",
            Self::Md => "md",
            Self::Lg => "lg",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigProfilePictureSize<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigProfilePictureSize<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "sm" => Self::Sm,
            "md" => Self::Md,
            "lg" => Self::Lg,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigProfilePictureSize<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigProfilePictureSize<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigProfilePictureSize<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigProfilePictureSize<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigProfilePictureSize<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigProfilePictureSize<'_> {
    type Output = ThemeConfigProfilePictureSize<'static>;
    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())
            }
        }
    }
}

/// Social icons container shape. Default: dock.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThemeConfigSocialIconsShape<'a> {
    Dock,
    Sphere,
    Other(CowStr<'a>),
}

impl<'a> ThemeConfigSocialIconsShape<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::Dock => "dock",
            Self::Sphere => "sphere",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for ThemeConfigSocialIconsShape<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "dock" => Self::Dock,
            "sphere" => Self::Sphere,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for ThemeConfigSocialIconsShape<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "dock" => Self::Dock,
            "sphere" => Self::Sphere,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for ThemeConfigSocialIconsShape<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for ThemeConfigSocialIconsShape<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for ThemeConfigSocialIconsShape<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for ThemeConfigSocialIconsShape<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for ThemeConfigSocialIconsShape<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for ThemeConfigSocialIconsShape<'_> {
    type Output = ThemeConfigSocialIconsShape<'static>;
    fn into_static(self) -> Self::Output {
        match self {
            ThemeConfigSocialIconsShape::Dock => ThemeConfigSocialIconsShape::Dock,
            ThemeConfigSocialIconsShape::Sphere => ThemeConfigSocialIconsShape::Sphere,
            ThemeConfigSocialIconsShape::Other(v) => {
                ThemeConfigSocialIconsShape::Other(v.into_static())
            }
        }
    }
}

/// A GitHub contributions graph widget card.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetGithub<'a> {
    ///Contribution data for the last year.
    #[serde(borrow)]
    pub contributions: Vec<linkinbio::GithubContributionDay<'a>>,
    ///Whether the widget is visible on the public page. Defaults to true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    ///GitHub username.
    #[serde(borrow)]
    pub github_username: CowStr<'a>,
    ///Unique identifier for the card.
    #[serde(borrow)]
    pub id: CowStr<'a>,
    ///When the contribution data was last fetched from GitHub.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_synced_at: Option<Datetime>,
    ///Widget display size. Default: 1x1.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub size: Option<WidgetGithubSize<'a>>,
    ///Total number of contributions in the last year.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub total_contributions: Option<i64>,
    ///Card type discriminator.
    #[serde(borrow)]
    pub r#type: CowStr<'a>,
}

/// Widget display size. Default: 1x1.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WidgetGithubSize<'a> {
    _1x1,
    _1x2,
    _2x2,
    Other(CowStr<'a>),
}

impl<'a> WidgetGithubSize<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::_1x1 => "1x1",
            Self::_1x2 => "1x2",
            Self::_2x2 => "2x2",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for WidgetGithubSize<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for WidgetGithubSize<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for WidgetGithubSize<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for WidgetGithubSize<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for WidgetGithubSize<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for WidgetGithubSize<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for WidgetGithubSize<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for WidgetGithubSize<'_> {
    type Output = WidgetGithubSize<'static>;
    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()),
        }
    }
}

/// A Goodreads bookshelf widget card.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetGoodreads<'a> {
    ///Books on the currently-reading shelf.
    #[serde(borrow)]
    pub books: Vec<linkinbio::GoodreadsBook<'a>>,
    ///Whether the widget is visible on the public page. Defaults to true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    ///Goodreads numeric user ID.
    #[serde(borrow)]
    pub goodreads_user_id: CowStr<'a>,
    ///Unique identifier for the card.
    #[serde(borrow)]
    pub id: CowStr<'a>,
    ///When the book data was last fetched from Goodreads.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_synced_at: Option<Datetime>,
    ///Books on the read shelf (used by 1x2 size).
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub read_books: Option<Vec<linkinbio::GoodreadsBook<'a>>>,
    ///Shelf name (currently-reading, read, or to-read).
    #[serde(borrow)]
    pub shelf: CowStr<'a>,
    ///Widget display size. Default: 1x1.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub size: Option<WidgetGoodreadsSize<'a>>,
    ///Card type discriminator.
    #[serde(borrow)]
    pub r#type: CowStr<'a>,
}

/// Widget display size. Default: 1x1.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WidgetGoodreadsSize<'a> {
    _1x1,
    _1x2,
    _2x2,
    Other(CowStr<'a>),
}

impl<'a> WidgetGoodreadsSize<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::_1x1 => "1x1",
            Self::_1x2 => "1x2",
            Self::_2x2 => "2x2",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for WidgetGoodreadsSize<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for WidgetGoodreadsSize<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for WidgetGoodreadsSize<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for WidgetGoodreadsSize<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for WidgetGoodreadsSize<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for WidgetGoodreadsSize<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for WidgetGoodreadsSize<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for WidgetGoodreadsSize<'_> {
    type Output = WidgetGoodreadsSize<'static>;
    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()),
        }
    }
}

/// A teal.fm recently played tracks widget card.

#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetTealfm<'a> {
    ///Copyright notice for cover art images.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub cover_art_notice: Option<CowStr<'a>>,
    ///Whether the widget is visible on the public page. Defaults to true.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub enabled: Option<bool>,
    ///Unique identifier for the card.
    #[serde(borrow)]
    pub id: CowStr<'a>,
    ///When the play data was last fetched from the PDS.
    #[serde(skip_serializing_if = "Option::is_none")]
    pub last_synced_at: Option<Datetime>,
    ///Recently played tracks.
    #[serde(borrow)]
    pub plays: Vec<linkinbio::TealfmPlay<'a>>,
    ///Widget display size. Default: 1x1.
    #[serde(skip_serializing_if = "Option::is_none")]
    #[serde(borrow)]
    pub size: Option<WidgetTealfmSize<'a>>,
    ///Card type discriminator.
    #[serde(borrow)]
    pub r#type: CowStr<'a>,
}

/// Widget display size. Default: 1x1.

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum WidgetTealfmSize<'a> {
    _1x1,
    _1x2,
    _2x2,
    Other(CowStr<'a>),
}

impl<'a> WidgetTealfmSize<'a> {
    pub fn as_str(&self) -> &str {
        match self {
            Self::_1x1 => "1x1",
            Self::_1x2 => "1x2",
            Self::_2x2 => "2x2",
            Self::Other(s) => s.as_ref(),
        }
    }
}

impl<'a> From<&'a str> for WidgetTealfmSize<'a> {
    fn from(s: &'a str) -> Self {
        match s {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> From<String> for WidgetTealfmSize<'a> {
    fn from(s: String) -> Self {
        match s.as_str() {
            "1x1" => Self::_1x1,
            "1x2" => Self::_1x2,
            "2x2" => Self::_2x2,
            _ => Self::Other(CowStr::from(s)),
        }
    }
}

impl<'a> core::fmt::Display for WidgetTealfmSize<'a> {
    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
        write!(f, "{}", self.as_str())
    }
}

impl<'a> AsRef<str> for WidgetTealfmSize<'a> {
    fn as_ref(&self) -> &str {
        self.as_str()
    }
}

impl<'a> serde::Serialize for WidgetTealfmSize<'a> {
    fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
    where
        S: serde::Serializer,
    {
        serializer.serialize_str(self.as_str())
    }
}

impl<'de, 'a> serde::Deserialize<'de> for WidgetTealfmSize<'a>
where
    'de: 'a,
{
    fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
    where
        D: serde::Deserializer<'de>,
    {
        let s = <&'de str>::deserialize(deserializer)?;
        Ok(Self::from(s))
    }
}

impl<'a> Default for WidgetTealfmSize<'a> {
    fn default() -> Self {
        Self::Other(Default::default())
    }
}

impl jacquard_common::IntoStatic for WidgetTealfmSize<'_> {
    type Output = WidgetTealfmSize<'static>;
    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<'a> Linkinbio<'a> {
    pub fn uri(
        uri: impl Into<CowStr<'a>>,
    ) -> Result<RecordUri<'a, LinkinbioRecord>, UriError> {
        RecordUri::try_from_uri(AtUri::new_cow(uri.into())?)
    }
}

impl<'a> LexiconSchema for ConnectedServices<'a> {
    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<'a> LexiconSchema for GithubContributionDay<'a> {
    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<'a> LexiconSchema for GoodreadsBook<'a> {
    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<'a> LexiconSchema for LinkCard<'a> {
    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(())
    }
}

/// Marker type for deserializing records from this collection.

#[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<'de> = LinkinbioGetRecordOutput<'de>;
    type Err<'de> = RecordError<'de>;
}

impl From<LinkinbioGetRecordOutput<'_>> for Linkinbio<'_> {
    fn from(output: LinkinbioGetRecordOutput<'_>) -> Self {
        use jacquard_common::IntoStatic;
        output.value.into_static()
    }
}

impl Collection for Linkinbio<'_> {
    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<'a> LexiconSchema for Linkinbio<'a> {
    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<'a> LexiconSchema for SocialIcon<'a> {
    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<'a> LexiconSchema for TealfmPlay<'a> {
    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<'a> LexiconSchema for ThemeConfig<'a> {
    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<'a> LexiconSchema for WidgetGithub<'a> {
    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<'a> LexiconSchema for WidgetGoodreads<'a> {
    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<'a> LexiconSchema for WidgetTealfm<'a> {
    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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Level;
        type Date;
        type Count;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Level = Unset;
        type Date = Unset;
        type Count = Unset;
    }
    ///State transition - sets the `level` field to Set
    pub struct SetLevel<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetLevel<S> {}
    impl<S: State> State for SetLevel<S> {
        type Level = Set<members::level>;
        type Date = S::Date;
        type Count = S::Count;
    }
    ///State transition - sets the `date` field to Set
    pub struct SetDate<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetDate<S> {}
    impl<S: State> State for SetDate<S> {
        type Level = S::Level;
        type Date = Set<members::date>;
        type Count = S::Count;
    }
    ///State transition - sets the `count` field to Set
    pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCount<S> {}
    impl<S: State> State for SetCount<S> {
        type Level = S::Level;
        type Date = S::Date;
        type Count = Set<members::count>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `level` field
        pub struct level(());
        ///Marker type for the `date` field
        pub struct date(());
        ///Marker type for the `count` field
        pub struct count(());
    }
}

/// Builder for constructing an instance of this type
pub struct GithubContributionDayBuilder<'a, S: github_contribution_day_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<i64>, Option<CowStr<'a>>, Option<i64>),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> GithubContributionDay<'a> {
    /// Create a new builder for this type
    pub fn new() -> GithubContributionDayBuilder<
        'a,
        github_contribution_day_state::Empty,
    > {
        GithubContributionDayBuilder::new()
    }
}

impl<'a> GithubContributionDayBuilder<'a, github_contribution_day_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        GithubContributionDayBuilder {
            _state: PhantomData,
            _fields: (None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> GithubContributionDayBuilder<'a, S>
where
    S: github_contribution_day_state::State,
    S::Count: github_contribution_day_state::IsUnset,
{
    /// Set the `count` field (required)
    pub fn count(
        mut self,
        value: impl Into<i64>,
    ) -> GithubContributionDayBuilder<'a, github_contribution_day_state::SetCount<S>> {
        self._fields.0 = Option::Some(value.into());
        GithubContributionDayBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> GithubContributionDayBuilder<'a, S>
where
    S: github_contribution_day_state::State,
    S::Date: github_contribution_day_state::IsUnset,
{
    /// Set the `date` field (required)
    pub fn date(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> GithubContributionDayBuilder<'a, github_contribution_day_state::SetDate<S>> {
        self._fields.1 = Option::Some(value.into());
        GithubContributionDayBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> GithubContributionDayBuilder<'a, S>
where
    S: github_contribution_day_state::State,
    S::Level: github_contribution_day_state::IsUnset,
{
    /// Set the `level` field (required)
    pub fn level(
        mut self,
        value: impl Into<i64>,
    ) -> GithubContributionDayBuilder<'a, github_contribution_day_state::SetLevel<S>> {
        self._fields.2 = Option::Some(value.into());
        GithubContributionDayBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> GithubContributionDayBuilder<'a, S>
where
    S: github_contribution_day_state::State,
    S::Level: github_contribution_day_state::IsSet,
    S::Date: github_contribution_day_state::IsSet,
    S::Count: github_contribution_day_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> GithubContributionDay<'a> {
        GithubContributionDay {
            count: self._fields.0.unwrap(),
            date: self._fields.1.unwrap(),
            level: self._fields.2.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> GithubContributionDay<'a> {
        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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Cards;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Cards = Unset;
    }
    ///State transition - sets the `cards` field to Set
    pub struct SetCards<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetCards<S> {}
    impl<S: State> State for SetCards<S> {
        type Cards = Set<members::cards>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `cards` field
        pub struct cards(());
    }
}

/// Builder for constructing an instance of this type
pub struct LinkinbioBuilder<'a, S: linkinbio_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Vec<LinkinbioCardsItem<'a>>>,
        Option<linkinbio::ConnectedServices<'a>>,
        Option<Vec<linkinbio::SocialIcon<'a>>>,
        Option<CowStr<'a>>,
        Option<linkinbio::ThemeConfig<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> Linkinbio<'a> {
    /// Create a new builder for this type
    pub fn new() -> LinkinbioBuilder<'a, linkinbio_state::Empty> {
        LinkinbioBuilder::new()
    }
}

impl<'a> LinkinbioBuilder<'a, linkinbio_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        LinkinbioBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> LinkinbioBuilder<'a, S>
where
    S: linkinbio_state::State,
    S::Cards: linkinbio_state::IsUnset,
{
    /// Set the `cards` field (required)
    pub fn cards(
        mut self,
        value: impl Into<Vec<LinkinbioCardsItem<'a>>>,
    ) -> LinkinbioBuilder<'a, linkinbio_state::SetCards<S>> {
        self._fields.0 = Option::Some(value.into());
        LinkinbioBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: linkinbio_state::State> LinkinbioBuilder<'a, S> {
    /// Set the `connectedServices` field (optional)
    pub fn connected_services(
        mut self,
        value: impl Into<Option<linkinbio::ConnectedServices<'a>>>,
    ) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `connectedServices` field to an Option value (optional)
    pub fn maybe_connected_services(
        mut self,
        value: Option<linkinbio::ConnectedServices<'a>>,
    ) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S: linkinbio_state::State> LinkinbioBuilder<'a, S> {
    /// Set the `socialIcons` field (optional)
    pub fn social_icons(
        mut self,
        value: impl Into<Option<Vec<linkinbio::SocialIcon<'a>>>>,
    ) -> Self {
        self._fields.2 = value.into();
        self
    }
    /// Set the `socialIcons` field to an Option value (optional)
    pub fn maybe_social_icons(
        mut self,
        value: Option<Vec<linkinbio::SocialIcon<'a>>>,
    ) -> Self {
        self._fields.2 = value;
        self
    }
}

impl<'a, S: linkinbio_state::State> LinkinbioBuilder<'a, S> {
    /// Set the `theme` field (optional)
    pub fn theme(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `theme` field to an Option value (optional)
    pub fn maybe_theme(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S: linkinbio_state::State> LinkinbioBuilder<'a, S> {
    /// Set the `themeConfig` field (optional)
    pub fn theme_config(
        mut self,
        value: impl Into<Option<linkinbio::ThemeConfig<'a>>>,
    ) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `themeConfig` field to an Option value (optional)
    pub fn maybe_theme_config(
        mut self,
        value: Option<linkinbio::ThemeConfig<'a>>,
    ) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S> LinkinbioBuilder<'a, S>
where
    S: linkinbio_state::State,
    S::Cards: linkinbio_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> Linkinbio<'a> {
        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(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> Linkinbio<'a> {
        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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Url;
        type Id;
        type Platform;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Url = Unset;
        type Id = Unset;
        type Platform = Unset;
    }
    ///State transition - sets the `url` field to Set
    pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetUrl<S> {}
    impl<S: State> State for SetUrl<S> {
        type Url = Set<members::url>;
        type Id = S::Id;
        type Platform = S::Platform;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetId<S> {}
    impl<S: State> State for SetId<S> {
        type Url = S::Url;
        type Id = Set<members::id>;
        type Platform = S::Platform;
    }
    ///State transition - sets the `platform` field to Set
    pub struct SetPlatform<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPlatform<S> {}
    impl<S: State> State for SetPlatform<S> {
        type Url = S::Url;
        type Id = S::Id;
        type Platform = Set<members::platform>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `url` field
        pub struct url(());
        ///Marker type for the `id` field
        pub struct id(());
        ///Marker type for the `platform` field
        pub struct platform(());
    }
}

/// Builder for constructing an instance of this type
pub struct SocialIconBuilder<'a, S: social_icon_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (Option<CowStr<'a>>, Option<CowStr<'a>>, Option<UriValue<'a>>),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> SocialIcon<'a> {
    /// Create a new builder for this type
    pub fn new() -> SocialIconBuilder<'a, social_icon_state::Empty> {
        SocialIconBuilder::new()
    }
}

impl<'a> SocialIconBuilder<'a, social_icon_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        SocialIconBuilder {
            _state: PhantomData,
            _fields: (None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SocialIconBuilder<'a, S>
where
    S: social_icon_state::State,
    S::Id: social_icon_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> SocialIconBuilder<'a, social_icon_state::SetId<S>> {
        self._fields.0 = Option::Some(value.into());
        SocialIconBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SocialIconBuilder<'a, S>
where
    S: social_icon_state::State,
    S::Platform: social_icon_state::IsUnset,
{
    /// Set the `platform` field (required)
    pub fn platform(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> SocialIconBuilder<'a, social_icon_state::SetPlatform<S>> {
        self._fields.1 = Option::Some(value.into());
        SocialIconBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SocialIconBuilder<'a, S>
where
    S: social_icon_state::State,
    S::Url: social_icon_state::IsUnset,
{
    /// Set the `url` field (required)
    pub fn url(
        mut self,
        value: impl Into<UriValue<'a>>,
    ) -> SocialIconBuilder<'a, social_icon_state::SetUrl<S>> {
        self._fields.2 = Option::Some(value.into());
        SocialIconBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> SocialIconBuilder<'a, S>
where
    S: social_icon_state::State,
    S::Url: social_icon_state::IsSet,
    S::Id: social_icon_state::IsSet,
    S::Platform: social_icon_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> SocialIcon<'a> {
        SocialIcon {
            id: self._fields.0.unwrap(),
            platform: self._fields.1.unwrap(),
            url: self._fields.2.unwrap(),
            extra_data: Default::default(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> SocialIcon<'a> {
        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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Id;
        type GithubUsername;
        type Type;
        type Contributions;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Id = Unset;
        type GithubUsername = Unset;
        type Type = Unset;
        type Contributions = Unset;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetId<S> {}
    impl<S: State> State for SetId<S> {
        type Id = Set<members::id>;
        type GithubUsername = S::GithubUsername;
        type Type = S::Type;
        type Contributions = S::Contributions;
    }
    ///State transition - sets the `github_username` field to Set
    pub struct SetGithubUsername<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetGithubUsername<S> {}
    impl<S: State> State for SetGithubUsername<S> {
        type Id = S::Id;
        type GithubUsername = Set<members::github_username>;
        type Type = S::Type;
        type Contributions = S::Contributions;
    }
    ///State transition - sets the `type` field to Set
    pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetType<S> {}
    impl<S: State> State for SetType<S> {
        type Id = S::Id;
        type GithubUsername = S::GithubUsername;
        type Type = Set<members::r#type>;
        type Contributions = S::Contributions;
    }
    ///State transition - sets the `contributions` field to Set
    pub struct SetContributions<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetContributions<S> {}
    impl<S: State> State for SetContributions<S> {
        type Id = S::Id;
        type GithubUsername = S::GithubUsername;
        type Type = S::Type;
        type Contributions = Set<members::contributions>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `id` field
        pub struct id(());
        ///Marker type for the `github_username` field
        pub struct github_username(());
        ///Marker type for the `type` field
        pub struct r#type(());
        ///Marker type for the `contributions` field
        pub struct contributions(());
    }
}

/// Builder for constructing an instance of this type
pub struct WidgetGithubBuilder<'a, S: widget_github_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Vec<linkinbio::GithubContributionDay<'a>>>,
        Option<bool>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<WidgetGithubSize<'a>>,
        Option<i64>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> WidgetGithub<'a> {
    /// Create a new builder for this type
    pub fn new() -> WidgetGithubBuilder<'a, widget_github_state::Empty> {
        WidgetGithubBuilder::new()
    }
}

impl<'a> WidgetGithubBuilder<'a, widget_github_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        WidgetGithubBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGithubBuilder<'a, S>
where
    S: widget_github_state::State,
    S::Contributions: widget_github_state::IsUnset,
{
    /// Set the `contributions` field (required)
    pub fn contributions(
        mut self,
        value: impl Into<Vec<linkinbio::GithubContributionDay<'a>>>,
    ) -> WidgetGithubBuilder<'a, widget_github_state::SetContributions<S>> {
        self._fields.0 = Option::Some(value.into());
        WidgetGithubBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_github_state::State> WidgetGithubBuilder<'a, S> {
    /// Set the `enabled` field (optional)
    pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `enabled` field to an Option value (optional)
    pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S> WidgetGithubBuilder<'a, S>
where
    S: widget_github_state::State,
    S::GithubUsername: widget_github_state::IsUnset,
{
    /// Set the `githubUsername` field (required)
    pub fn github_username(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGithubBuilder<'a, widget_github_state::SetGithubUsername<S>> {
        self._fields.2 = Option::Some(value.into());
        WidgetGithubBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGithubBuilder<'a, S>
where
    S: widget_github_state::State,
    S::Id: widget_github_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGithubBuilder<'a, widget_github_state::SetId<S>> {
        self._fields.3 = Option::Some(value.into());
        WidgetGithubBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_github_state::State> WidgetGithubBuilder<'a, S> {
    /// Set the `lastSyncedAt` field (optional)
    pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `lastSyncedAt` field to an Option value (optional)
    pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: widget_github_state::State> WidgetGithubBuilder<'a, S> {
    /// Set the `size` field (optional)
    pub fn size(mut self, value: impl Into<Option<WidgetGithubSize<'a>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `size` field to an Option value (optional)
    pub fn maybe_size(mut self, value: Option<WidgetGithubSize<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S: widget_github_state::State> WidgetGithubBuilder<'a, S> {
    /// Set the `totalContributions` field (optional)
    pub fn total_contributions(mut self, value: impl Into<Option<i64>>) -> Self {
        self._fields.6 = value.into();
        self
    }
    /// Set the `totalContributions` field to an Option value (optional)
    pub fn maybe_total_contributions(mut self, value: Option<i64>) -> Self {
        self._fields.6 = value;
        self
    }
}

impl<'a, S> WidgetGithubBuilder<'a, S>
where
    S: widget_github_state::State,
    S::Type: widget_github_state::IsUnset,
{
    /// Set the `type` field (required)
    pub fn r#type(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGithubBuilder<'a, widget_github_state::SetType<S>> {
        self._fields.7 = Option::Some(value.into());
        WidgetGithubBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGithubBuilder<'a, S>
where
    S: widget_github_state::State,
    S::Id: widget_github_state::IsSet,
    S::GithubUsername: widget_github_state::IsSet,
    S::Type: widget_github_state::IsSet,
    S::Contributions: widget_github_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> WidgetGithub<'a> {
        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(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> WidgetGithub<'a> {
        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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type GoodreadsUserId;
        type Id;
        type Shelf;
        type Type;
        type Books;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type GoodreadsUserId = Unset;
        type Id = Unset;
        type Shelf = Unset;
        type Type = Unset;
        type Books = Unset;
    }
    ///State transition - sets the `goodreads_user_id` field to Set
    pub struct SetGoodreadsUserId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetGoodreadsUserId<S> {}
    impl<S: State> State for SetGoodreadsUserId<S> {
        type GoodreadsUserId = Set<members::goodreads_user_id>;
        type Id = S::Id;
        type Shelf = S::Shelf;
        type Type = S::Type;
        type Books = S::Books;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetId<S> {}
    impl<S: State> State for SetId<S> {
        type GoodreadsUserId = S::GoodreadsUserId;
        type Id = Set<members::id>;
        type Shelf = S::Shelf;
        type Type = S::Type;
        type Books = S::Books;
    }
    ///State transition - sets the `shelf` field to Set
    pub struct SetShelf<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetShelf<S> {}
    impl<S: State> State for SetShelf<S> {
        type GoodreadsUserId = S::GoodreadsUserId;
        type Id = S::Id;
        type Shelf = Set<members::shelf>;
        type Type = S::Type;
        type Books = S::Books;
    }
    ///State transition - sets the `type` field to Set
    pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetType<S> {}
    impl<S: State> State for SetType<S> {
        type GoodreadsUserId = S::GoodreadsUserId;
        type Id = S::Id;
        type Shelf = S::Shelf;
        type Type = Set<members::r#type>;
        type Books = S::Books;
    }
    ///State transition - sets the `books` field to Set
    pub struct SetBooks<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetBooks<S> {}
    impl<S: State> State for SetBooks<S> {
        type GoodreadsUserId = S::GoodreadsUserId;
        type Id = S::Id;
        type Shelf = S::Shelf;
        type Type = S::Type;
        type Books = Set<members::books>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `goodreads_user_id` field
        pub struct goodreads_user_id(());
        ///Marker type for the `id` field
        pub struct id(());
        ///Marker type for the `shelf` field
        pub struct shelf(());
        ///Marker type for the `type` field
        pub struct r#type(());
        ///Marker type for the `books` field
        pub struct books(());
    }
}

/// Builder for constructing an instance of this type
pub struct WidgetGoodreadsBuilder<'a, S: widget_goodreads_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<Vec<linkinbio::GoodreadsBook<'a>>>,
        Option<bool>,
        Option<CowStr<'a>>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<Vec<linkinbio::GoodreadsBook<'a>>>,
        Option<CowStr<'a>>,
        Option<WidgetGoodreadsSize<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> WidgetGoodreads<'a> {
    /// Create a new builder for this type
    pub fn new() -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::Empty> {
        WidgetGoodreadsBuilder::new()
    }
}

impl<'a> WidgetGoodreadsBuilder<'a, widget_goodreads_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::Books: widget_goodreads_state::IsUnset,
{
    /// Set the `books` field (required)
    pub fn books(
        mut self,
        value: impl Into<Vec<linkinbio::GoodreadsBook<'a>>>,
    ) -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::SetBooks<S>> {
        self._fields.0 = Option::Some(value.into());
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_goodreads_state::State> WidgetGoodreadsBuilder<'a, S> {
    /// Set the `enabled` field (optional)
    pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `enabled` field to an Option value (optional)
    pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::GoodreadsUserId: widget_goodreads_state::IsUnset,
{
    /// Set the `goodreadsUserId` field (required)
    pub fn goodreads_user_id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::SetGoodreadsUserId<S>> {
        self._fields.2 = Option::Some(value.into());
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::Id: widget_goodreads_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::SetId<S>> {
        self._fields.3 = Option::Some(value.into());
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_goodreads_state::State> WidgetGoodreadsBuilder<'a, S> {
    /// Set the `lastSyncedAt` field (optional)
    pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.4 = value.into();
        self
    }
    /// Set the `lastSyncedAt` field to an Option value (optional)
    pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.4 = value;
        self
    }
}

impl<'a, S: widget_goodreads_state::State> WidgetGoodreadsBuilder<'a, S> {
    /// Set the `readBooks` field (optional)
    pub fn read_books(
        mut self,
        value: impl Into<Option<Vec<linkinbio::GoodreadsBook<'a>>>>,
    ) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `readBooks` field to an Option value (optional)
    pub fn maybe_read_books(
        mut self,
        value: Option<Vec<linkinbio::GoodreadsBook<'a>>>,
    ) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::Shelf: widget_goodreads_state::IsUnset,
{
    /// Set the `shelf` field (required)
    pub fn shelf(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::SetShelf<S>> {
        self._fields.6 = Option::Some(value.into());
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_goodreads_state::State> WidgetGoodreadsBuilder<'a, S> {
    /// Set the `size` field (optional)
    pub fn size(mut self, value: impl Into<Option<WidgetGoodreadsSize<'a>>>) -> Self {
        self._fields.7 = value.into();
        self
    }
    /// Set the `size` field to an Option value (optional)
    pub fn maybe_size(mut self, value: Option<WidgetGoodreadsSize<'a>>) -> Self {
        self._fields.7 = value;
        self
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::Type: widget_goodreads_state::IsUnset,
{
    /// Set the `type` field (required)
    pub fn r#type(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::SetType<S>> {
        self._fields.8 = Option::Some(value.into());
        WidgetGoodreadsBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
    S: widget_goodreads_state::State,
    S::GoodreadsUserId: widget_goodreads_state::IsSet,
    S::Id: widget_goodreads_state::IsSet,
    S::Shelf: widget_goodreads_state::IsSet,
    S::Type: widget_goodreads_state::IsSet,
    S::Books: widget_goodreads_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> WidgetGoodreads<'a> {
        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(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> WidgetGoodreads<'a> {
        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 {}
    }
    /// State trait tracking which required fields have been set
    pub trait State: sealed::Sealed {
        type Id;
        type Plays;
        type Type;
    }
    /// Empty state - all required fields are unset
    pub struct Empty(());
    impl sealed::Sealed for Empty {}
    impl State for Empty {
        type Id = Unset;
        type Plays = Unset;
        type Type = Unset;
    }
    ///State transition - sets the `id` field to Set
    pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetId<S> {}
    impl<S: State> State for SetId<S> {
        type Id = Set<members::id>;
        type Plays = S::Plays;
        type Type = S::Type;
    }
    ///State transition - sets the `plays` field to Set
    pub struct SetPlays<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetPlays<S> {}
    impl<S: State> State for SetPlays<S> {
        type Id = S::Id;
        type Plays = Set<members::plays>;
        type Type = S::Type;
    }
    ///State transition - sets the `type` field to Set
    pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
    impl<S: State> sealed::Sealed for SetType<S> {}
    impl<S: State> State for SetType<S> {
        type Id = S::Id;
        type Plays = S::Plays;
        type Type = Set<members::r#type>;
    }
    /// Marker types for field names
    #[allow(non_camel_case_types)]
    pub mod members {
        ///Marker type for the `id` field
        pub struct id(());
        ///Marker type for the `plays` field
        pub struct plays(());
        ///Marker type for the `type` field
        pub struct r#type(());
    }
}

/// Builder for constructing an instance of this type
pub struct WidgetTealfmBuilder<'a, S: widget_tealfm_state::State> {
    _state: PhantomData<fn() -> S>,
    _fields: (
        Option<CowStr<'a>>,
        Option<bool>,
        Option<CowStr<'a>>,
        Option<Datetime>,
        Option<Vec<linkinbio::TealfmPlay<'a>>>,
        Option<WidgetTealfmSize<'a>>,
        Option<CowStr<'a>>,
    ),
    _lifetime: PhantomData<&'a ()>,
}

impl<'a> WidgetTealfm<'a> {
    /// Create a new builder for this type
    pub fn new() -> WidgetTealfmBuilder<'a, widget_tealfm_state::Empty> {
        WidgetTealfmBuilder::new()
    }
}

impl<'a> WidgetTealfmBuilder<'a, widget_tealfm_state::Empty> {
    /// Create a new builder with all fields unset
    pub fn new() -> Self {
        WidgetTealfmBuilder {
            _state: PhantomData,
            _fields: (None, None, None, None, None, None, None),
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_tealfm_state::State> WidgetTealfmBuilder<'a, S> {
    /// Set the `coverArtNotice` field (optional)
    pub fn cover_art_notice(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
        self._fields.0 = value.into();
        self
    }
    /// Set the `coverArtNotice` field to an Option value (optional)
    pub fn maybe_cover_art_notice(mut self, value: Option<CowStr<'a>>) -> Self {
        self._fields.0 = value;
        self
    }
}

impl<'a, S: widget_tealfm_state::State> WidgetTealfmBuilder<'a, S> {
    /// Set the `enabled` field (optional)
    pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
        self._fields.1 = value.into();
        self
    }
    /// Set the `enabled` field to an Option value (optional)
    pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
        self._fields.1 = value;
        self
    }
}

impl<'a, S> WidgetTealfmBuilder<'a, S>
where
    S: widget_tealfm_state::State,
    S::Id: widget_tealfm_state::IsUnset,
{
    /// Set the `id` field (required)
    pub fn id(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetTealfmBuilder<'a, widget_tealfm_state::SetId<S>> {
        self._fields.2 = Option::Some(value.into());
        WidgetTealfmBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_tealfm_state::State> WidgetTealfmBuilder<'a, S> {
    /// Set the `lastSyncedAt` field (optional)
    pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
        self._fields.3 = value.into();
        self
    }
    /// Set the `lastSyncedAt` field to an Option value (optional)
    pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
        self._fields.3 = value;
        self
    }
}

impl<'a, S> WidgetTealfmBuilder<'a, S>
where
    S: widget_tealfm_state::State,
    S::Plays: widget_tealfm_state::IsUnset,
{
    /// Set the `plays` field (required)
    pub fn plays(
        mut self,
        value: impl Into<Vec<linkinbio::TealfmPlay<'a>>>,
    ) -> WidgetTealfmBuilder<'a, widget_tealfm_state::SetPlays<S>> {
        self._fields.4 = Option::Some(value.into());
        WidgetTealfmBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S: widget_tealfm_state::State> WidgetTealfmBuilder<'a, S> {
    /// Set the `size` field (optional)
    pub fn size(mut self, value: impl Into<Option<WidgetTealfmSize<'a>>>) -> Self {
        self._fields.5 = value.into();
        self
    }
    /// Set the `size` field to an Option value (optional)
    pub fn maybe_size(mut self, value: Option<WidgetTealfmSize<'a>>) -> Self {
        self._fields.5 = value;
        self
    }
}

impl<'a, S> WidgetTealfmBuilder<'a, S>
where
    S: widget_tealfm_state::State,
    S::Type: widget_tealfm_state::IsUnset,
{
    /// Set the `type` field (required)
    pub fn r#type(
        mut self,
        value: impl Into<CowStr<'a>>,
    ) -> WidgetTealfmBuilder<'a, widget_tealfm_state::SetType<S>> {
        self._fields.6 = Option::Some(value.into());
        WidgetTealfmBuilder {
            _state: PhantomData,
            _fields: self._fields,
            _lifetime: PhantomData,
        }
    }
}

impl<'a, S> WidgetTealfmBuilder<'a, S>
where
    S: widget_tealfm_state::State,
    S::Id: widget_tealfm_state::IsSet,
    S::Plays: widget_tealfm_state::IsSet,
    S::Type: widget_tealfm_state::IsSet,
{
    /// Build the final struct
    pub fn build(self) -> WidgetTealfm<'a> {
        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(),
        }
    }
    /// Build the final struct with custom extra_data
    pub fn build_with_data(
        self,
        extra_data: BTreeMap<
            jacquard_common::deps::smol_str::SmolStr,
            jacquard_common::types::value::Data<'a>,
        >,
    ) -> WidgetTealfm<'a> {
        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),
        }
    }
}