#[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;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ConnectedServices<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub github_username: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub goodreads_user_id: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct GithubContributionDay<'a> {
pub count: i64,
#[serde(borrow)]
pub date: CowStr<'a>,
pub level: i64,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct GoodreadsBook<'a> {
#[serde(borrow)]
pub author: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cover_url: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub link: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub rating: Option<i64>,
#[serde(borrow)]
pub title: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct LinkCard<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub highlighted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub text: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub r#type: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub url: Option<UriValue<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Linkinbio<'a> {
#[serde(borrow)]
pub cards: Vec<LinkinbioCardsItem<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub connected_services: Option<linkinbio::ConnectedServices<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub social_icons: Option<Vec<linkinbio::SocialIcon<'a>>>,
#[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>>),
}
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SocialIcon<'a> {
#[serde(borrow)]
pub id: CowStr<'a>,
#[serde(borrow)]
pub platform: CowStr<'a>,
#[serde(borrow)]
pub url: UriValue<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct TealfmPlay<'a> {
#[serde(borrow)]
pub artist_name: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cover_url: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub origin_url: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub played_time: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub release_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub track_name: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThemeConfig<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub background_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub background_gradient: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub background_image: Option<BlobRef<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub background_image_credit: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub button_alignment: Option<ThemeConfigButtonAlignment<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub button_hover_glow: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub button_hover_glow_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_background_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_border_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_border_radius: Option<ThemeConfigCardBorderRadius<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_hover_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_shadow: Option<ThemeConfigCardShadow<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub card_text_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub content_card_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cursor_sparkles: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cursor_style: Option<ThemeConfigCursorStyle<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub font_family: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub font_size: Option<ThemeConfigFontSize<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub particles: Option<ThemeConfigParticles<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub preset: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub profile_alignment: Option<ThemeConfigProfileAlignment<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub profile_picture_shape: Option<ThemeConfigProfilePictureShape<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub profile_picture_size: Option<ThemeConfigProfilePictureSize<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub profile_text_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub show_branding: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub social_icons_border_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub social_icons_color: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub social_icons_shape: Option<ThemeConfigSocialIconsShape<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub social_icons_shape_color: Option<CowStr<'a>>,
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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()),
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetGithub<'a> {
#[serde(borrow)]
pub contributions: Vec<linkinbio::GithubContributionDay<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(borrow)]
pub github_username: CowStr<'a>,
#[serde(borrow)]
pub id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub size: Option<WidgetGithubSize<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub total_contributions: Option<i64>,
#[serde(borrow)]
pub r#type: CowStr<'a>,
}
#[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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetGoodreads<'a> {
#[serde(borrow)]
pub books: Vec<linkinbio::GoodreadsBook<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(borrow)]
pub goodreads_user_id: CowStr<'a>,
#[serde(borrow)]
pub id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub read_books: Option<Vec<linkinbio::GoodreadsBook<'a>>>,
#[serde(borrow)]
pub shelf: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub size: Option<WidgetGoodreadsSize<'a>>,
#[serde(borrow)]
pub r#type: CowStr<'a>,
}
#[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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct WidgetTealfm<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cover_art_notice: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub enabled: Option<bool>,
#[serde(borrow)]
pub id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub last_synced_at: Option<Datetime>,
#[serde(borrow)]
pub plays: Vec<linkinbio::TealfmPlay<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub size: Option<WidgetTealfmSize<'a>>,
#[serde(borrow)]
pub r#type: CowStr<'a>,
}
#[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(())
}
}
#[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 {}
}
pub trait State: sealed::Sealed {
type Level;
type Date;
type Count;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Level = Unset;
type Date = Unset;
type Count = Unset;
}
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;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct level(());
pub struct date(());
pub struct count(());
}
}
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> {
pub fn new() -> GithubContributionDayBuilder<
'a,
github_contribution_day_state::Empty,
> {
GithubContributionDayBuilder::new()
}
}
impl<'a> GithubContributionDayBuilder<'a, github_contribution_day_state::Empty> {
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,
{
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,
{
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,
{
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,
{
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(),
}
}
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 {}
}
pub trait State: sealed::Sealed {
type Cards;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cards = Unset;
}
pub struct SetCards<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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cards(());
}
}
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> {
pub fn new() -> LinkinbioBuilder<'a, linkinbio_state::Empty> {
LinkinbioBuilder::new()
}
}
impl<'a> LinkinbioBuilder<'a, linkinbio_state::Empty> {
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,
{
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> {
pub fn connected_services(
mut self,
value: impl Into<Option<linkinbio::ConnectedServices<'a>>>,
) -> Self {
self._fields.1 = value.into();
self
}
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> {
pub fn social_icons(
mut self,
value: impl Into<Option<Vec<linkinbio::SocialIcon<'a>>>>,
) -> Self {
self._fields.2 = value.into();
self
}
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> {
pub fn theme(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
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> {
pub fn theme_config(
mut self,
value: impl Into<Option<linkinbio::ThemeConfig<'a>>>,
) -> Self {
self._fields.4 = value.into();
self
}
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,
{
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(),
}
}
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 {}
}
pub trait State: sealed::Sealed {
type Url;
type Id;
type Platform;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Url = Unset;
type Id = Unset;
type Platform = Unset;
}
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;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct url(());
pub struct id(());
pub struct platform(());
}
}
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> {
pub fn new() -> SocialIconBuilder<'a, social_icon_state::Empty> {
SocialIconBuilder::new()
}
}
impl<'a> SocialIconBuilder<'a, social_icon_state::Empty> {
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,
{
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,
{
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,
{
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,
{
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(),
}
}
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 {}
}
pub trait State: sealed::Sealed {
type Id;
type GithubUsername;
type Type;
type Contributions;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type GithubUsername = Unset;
type Type = Unset;
type Contributions = Unset;
}
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;
}
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;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct github_username(());
pub struct r#type(());
pub struct contributions(());
}
}
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> {
pub fn new() -> WidgetGithubBuilder<'a, widget_github_state::Empty> {
WidgetGithubBuilder::new()
}
}
impl<'a> WidgetGithubBuilder<'a, widget_github_state::Empty> {
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,
{
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> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> WidgetGithubBuilder<'a, S>
where
S: widget_github_state::State,
S::GithubUsername: widget_github_state::IsUnset,
{
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,
{
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> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: widget_github_state::State> WidgetGithubBuilder<'a, S> {
pub fn size(mut self, value: impl Into<Option<WidgetGithubSize<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
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> {
pub fn total_contributions(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_total_contributions(mut self, value: Option<i64>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> WidgetGithubBuilder<'a, S>
where
S: widget_github_state::State,
S::Type: widget_github_state::IsUnset,
{
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,
{
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(),
}
}
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 {}
}
pub trait State: sealed::Sealed {
type GoodreadsUserId;
type Id;
type Shelf;
type Type;
type Books;
}
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;
}
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;
}
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;
}
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;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct goodreads_user_id(());
pub struct id(());
pub struct shelf(());
pub struct r#type(());
pub struct books(());
}
}
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> {
pub fn new() -> WidgetGoodreadsBuilder<'a, widget_goodreads_state::Empty> {
WidgetGoodreadsBuilder::new()
}
}
impl<'a> WidgetGoodreadsBuilder<'a, widget_goodreads_state::Empty> {
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,
{
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> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> WidgetGoodreadsBuilder<'a, S>
where
S: widget_goodreads_state::State,
S::GoodreadsUserId: widget_goodreads_state::IsUnset,
{
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,
{
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> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: widget_goodreads_state::State> WidgetGoodreadsBuilder<'a, S> {
pub fn read_books(
mut self,
value: impl Into<Option<Vec<linkinbio::GoodreadsBook<'a>>>>,
) -> Self {
self._fields.5 = value.into();
self
}
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,
{
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> {
pub fn size(mut self, value: impl Into<Option<WidgetGoodreadsSize<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
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,
{
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,
{
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(),
}
}
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 {}
}
pub trait State: sealed::Sealed {
type Id;
type Plays;
type Type;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Plays = Unset;
type Type = Unset;
}
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;
}
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;
}
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>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct plays(());
pub struct r#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> {
pub fn new() -> WidgetTealfmBuilder<'a, widget_tealfm_state::Empty> {
WidgetTealfmBuilder::new()
}
}
impl<'a> WidgetTealfmBuilder<'a, widget_tealfm_state::Empty> {
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> {
pub fn cover_art_notice(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
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> {
pub fn enabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_enabled(mut self, value: Option<bool>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> WidgetTealfmBuilder<'a, S>
where
S: widget_tealfm_state::State,
S::Id: widget_tealfm_state::IsUnset,
{
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> {
pub fn last_synced_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_last_synced_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> WidgetTealfmBuilder<'a, S>
where
S: widget_tealfm_state::State,
S::Plays: widget_tealfm_state::IsUnset,
{
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> {
pub fn size(mut self, value: impl Into<Option<WidgetTealfmSize<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
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,
{
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,
{
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(),
}
}
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),
}
}
}