pub mod get_profile;
pub mod get_profiles;
pub mod profile;
pub mod profile_status;
pub mod search_actors;
pub mod status;
use jacquard_common::CowStr;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::Datetime;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::richtext::facet::Facet;
use crate::fm_teal::alpha::actor::profile::FeaturedItem;
use crate::fm_teal::alpha::feed::PlayView;
use crate::fm_teal::alpha::actor;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct MiniProfileView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub did: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub handle: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub banner: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description_facets: Option<Vec<Facet<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub did: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub featured_item: Option<FeaturedItem<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<actor::StatusView<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct StatusView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub expiry: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub item: Option<PlayView<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub time: Option<Datetime>,
}
impl<'a> LexiconSchema for MiniProfileView<'a> {
fn nsid() -> &'static str {
"fm.teal.alpha.actor.defs"
}
fn def_name() -> &'static str {
"miniProfileView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_fm_teal_alpha_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for ProfileView<'a> {
fn nsid() -> &'static str {
"fm.teal.alpha.actor.defs"
}
fn def_name() -> &'static str {
"profileView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_fm_teal_alpha_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<'a> LexiconSchema for StatusView<'a> {
fn nsid() -> &'static str {
"fm.teal.alpha.actor.defs"
}
fn def_name() -> &'static str {
"statusView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_fm_teal_alpha_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_fm_teal_alpha_actor_defs() -> 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("fm.teal.alpha.actor.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("miniProfileView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("IPLD of the avatar")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The decentralized identifier of the actor",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileView"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("IPLD of the avatar")),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("banner"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("IPLD of the banner image"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Free-form profile description text."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("descriptionFacets"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Annotations of text in the profile description (mentions, URLs, hashtags, etc). May be changed to another (backwards compatible) lexicon.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.richtext.facet"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The decentralized identifier of the actor",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("featuredItem"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"fm.teal.alpha.actor.profile#featuredItem",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#statusView"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("statusView"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A declaration of the status of the actor."),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("expiry"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("item"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"fm.teal.alpha.feed.defs#playView",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("time"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unix timestamp of when the item was recorded",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}