pub mod get_preferences;
pub mod get_profile;
pub mod get_profiles;
pub mod get_suggestions;
pub mod profile;
pub mod put_preferences;
pub mod search_actors;
pub mod search_actors_typeahead;
pub mod status;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, 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::app_bsky::embed::external::View;
use crate::app_bsky::feed::postgate::DisableRule;
use crate::app_bsky::feed::threadgate::FollowerRule;
use crate::app_bsky::feed::threadgate::FollowingRule;
use crate::app_bsky::feed::threadgate::ListRule;
use crate::app_bsky::feed::threadgate::MentionRule;
use crate::app_bsky::graph::ListViewBasic;
use crate::app_bsky::graph::StarterPackViewBasic;
use crate::app_bsky::notification::ActivitySubscription;
use crate::com_atproto::label::Label;
use crate::com_atproto::repo::strong_ref::StrongRef;
use crate::app_bsky::actor;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AdultContentPref<S: BosStr = DefaultStr> {
#[serde(default = "_default_adult_content_pref_enabled")]
pub enabled: bool,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BskyAppProgressGuide<S: BosStr = DefaultStr> {
pub guide: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct BskyAppStatePref<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub active_progress_guide: Option<actor::BskyAppProgressGuide<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub nuxs: Option<Vec<actor::Nux<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub queued_nudges: Option<Vec<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ContentLabelPref<S: BosStr = DefaultStr> {
pub label: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub labeler_did: Option<Did<S>>,
pub visibility: ContentLabelPrefVisibility<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ContentLabelPrefVisibility<S: BosStr = DefaultStr> {
Ignore,
Show,
Warn,
Hide,
Other(S),
}
impl<S: BosStr> ContentLabelPrefVisibility<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Ignore => "ignore",
Self::Show => "show",
Self::Warn => "warn",
Self::Hide => "hide",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"ignore" => Self::Ignore,
"show" => Self::Show,
"warn" => Self::Warn,
"hide" => Self::Hide,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ContentLabelPrefVisibility<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ContentLabelPrefVisibility<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ContentLabelPrefVisibility<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ContentLabelPrefVisibility<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ContentLabelPrefVisibility<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ContentLabelPrefVisibility<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ContentLabelPrefVisibility<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ContentLabelPrefVisibility::Ignore => ContentLabelPrefVisibility::Ignore,
ContentLabelPrefVisibility::Show => ContentLabelPrefVisibility::Show,
ContentLabelPrefVisibility::Warn => ContentLabelPrefVisibility::Warn,
ContentLabelPrefVisibility::Hide => ContentLabelPrefVisibility::Hide,
ContentLabelPrefVisibility::Other(v) => {
ContentLabelPrefVisibility::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct DeclaredAgePref<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub is_over_age13: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_over_age16: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_over_age18: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct FeedViewPref<S: BosStr = DefaultStr> {
pub feed: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_quote_posts: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_replies: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_replies_by_like_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default = "_default_feed_view_pref_hide_replies_by_unfollowed")]
pub hide_replies_by_unfollowed: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub hide_reposts: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct HiddenPostsPref<S: BosStr = DefaultStr> {
pub items: Vec<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct InterestsPref<S: BosStr = DefaultStr> {
pub tags: Vec<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct KnownFollowers<S: BosStr = DefaultStr> {
pub count: i64,
pub followers: Vec<actor::ProfileViewBasic<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LabelerPrefItem<S: BosStr = DefaultStr> {
pub did: Did<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LabelersPref<S: BosStr = DefaultStr> {
pub labelers: Vec<actor::LabelerPrefItem<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct LiveEventPreferences<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub hidden_feed_ids: Option<Vec<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default = "_default_live_event_preferences_hide_all_feeds")]
pub hide_all_feeds: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct MutedWord<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub actor_target: Option<MutedWordActorTarget<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub id: Option<S>,
pub targets: Vec<actor::MutedWordTarget<S>>,
pub value: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MutedWordActorTarget<S: BosStr = DefaultStr> {
All,
ExcludeFollowing,
Other(S),
}
impl<S: BosStr> MutedWordActorTarget<S> {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::ExcludeFollowing => "exclude-following",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"all" => Self::All,
"exclude-following" => Self::ExcludeFollowing,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for MutedWordActorTarget<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for MutedWordActorTarget<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for MutedWordActorTarget<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for MutedWordActorTarget<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for MutedWordActorTarget<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for MutedWordActorTarget<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = MutedWordActorTarget<S::Output>;
fn into_static(self) -> Self::Output {
match self {
MutedWordActorTarget::All => MutedWordActorTarget::All,
MutedWordActorTarget::ExcludeFollowing => {
MutedWordActorTarget::ExcludeFollowing
}
MutedWordActorTarget::Other(v) => {
MutedWordActorTarget::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MutedWordTarget<S: BosStr = DefaultStr> {
Content,
Tag,
Other(S),
}
impl<S: BosStr> MutedWordTarget<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Content => "content",
Self::Tag => "tag",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"content" => Self::Content,
"tag" => Self::Tag,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> AsRef<str> for MutedWordTarget<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> core::fmt::Display for MutedWordTarget<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> Serialize for MutedWordTarget<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for MutedWordTarget<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr> jacquard_common::IntoStatic for MutedWordTarget<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = MutedWordTarget<S::Output>;
fn into_static(self) -> Self::Output {
match self {
MutedWordTarget::Content => MutedWordTarget::Content,
MutedWordTarget::Tag => MutedWordTarget::Tag,
MutedWordTarget::Other(v) => MutedWordTarget::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct MutedWordsPref<S: BosStr = DefaultStr> {
pub items: Vec<actor::MutedWord<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct Nux<S: BosStr = DefaultStr> {
#[serde(default = "_default_nux_completed")]
pub completed: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub data: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Datetime>,
pub id: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PersonalDetailsPref<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub birth_date: Option<Datetime>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct PostInteractionSettingsPref<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub postgate_embedding_rules: Option<Vec<DisableRule<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threadgate_allow_rules: Option<
Vec<PostInteractionSettingsPrefThreadgateAllowRulesItem<S>>,
>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PostInteractionSettingsPrefThreadgateAllowRulesItem<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
ThreadgateMentionRule(Box<MentionRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#followerRule")]
ThreadgateFollowerRule(Box<FollowerRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#followingRule")]
ThreadgateFollowingRule(Box<FollowingRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#listRule")]
ThreadgateListRule(Box<ListRule<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum PreferencesItem<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.actor.defs#adultContentPref")]
AdultContentPref(Box<actor::AdultContentPref<S>>),
#[serde(rename = "app.bsky.actor.defs#contentLabelPref")]
ContentLabelPref(Box<actor::ContentLabelPref<S>>),
#[serde(rename = "app.bsky.actor.defs#savedFeedsPref")]
SavedFeedsPref(Box<actor::SavedFeedsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#savedFeedsPrefV2")]
SavedFeedsPrefV2(Box<actor::SavedFeedsPrefV2<S>>),
#[serde(rename = "app.bsky.actor.defs#personalDetailsPref")]
PersonalDetailsPref(Box<actor::PersonalDetailsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#declaredAgePref")]
DeclaredAgePref(Box<actor::DeclaredAgePref<S>>),
#[serde(rename = "app.bsky.actor.defs#feedViewPref")]
FeedViewPref(Box<actor::FeedViewPref<S>>),
#[serde(rename = "app.bsky.actor.defs#threadViewPref")]
ThreadViewPref(Box<actor::ThreadViewPref<S>>),
#[serde(rename = "app.bsky.actor.defs#interestsPref")]
InterestsPref(Box<actor::InterestsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#mutedWordsPref")]
MutedWordsPref(Box<actor::MutedWordsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#hiddenPostsPref")]
HiddenPostsPref(Box<actor::HiddenPostsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#bskyAppStatePref")]
BskyAppStatePref(Box<actor::BskyAppStatePref<S>>),
#[serde(rename = "app.bsky.actor.defs#labelersPref")]
LabelersPref(Box<actor::LabelersPref<S>>),
#[serde(rename = "app.bsky.actor.defs#postInteractionSettingsPref")]
PostInteractionSettingsPref(Box<actor::PostInteractionSettingsPref<S>>),
#[serde(rename = "app.bsky.actor.defs#verificationPrefs")]
VerificationPrefs(Box<actor::VerificationPrefs<S>>),
#[serde(rename = "app.bsky.actor.defs#liveEventPreferences")]
LiveEventPreferences(Box<actor::LiveEventPreferences<S>>),
}
pub type Preferences<S = DefaultStr> = Vec<PreferencesItem<S>>;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociated<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_subscription: Option<actor::ProfileAssociatedActivitySubscription<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub chat: Option<actor::ProfileAssociatedChat<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feedgens: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub germ: Option<actor::ProfileAssociatedGerm<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labeler: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub lists: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub starter_packs: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedActivitySubscription<S: BosStr = DefaultStr> {
pub allow_subscriptions: ProfileAssociatedActivitySubscriptionAllowSubscriptions<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedActivitySubscriptionAllowSubscriptions<
S: BosStr = DefaultStr,
> {
Followers,
Mutuals,
None,
Other(S),
}
impl<S: BosStr> ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Followers => "followers",
Self::Mutuals => "mutuals",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"followers" => Self::Followers,
"mutuals" => Self::Mutuals,
"none" => Self::None,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str>
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ProfileAssociatedActivitySubscriptionAllowSubscriptions<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Followers => {
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Followers
}
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Mutuals => {
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Mutuals
}
ProfileAssociatedActivitySubscriptionAllowSubscriptions::None => {
ProfileAssociatedActivitySubscriptionAllowSubscriptions::None
}
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Other(v) => {
ProfileAssociatedActivitySubscriptionAllowSubscriptions::Other(
v.into_static(),
)
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedChat<S: BosStr = DefaultStr> {
pub allow_incoming: ProfileAssociatedChatAllowIncoming<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedChatAllowIncoming<S: BosStr = DefaultStr> {
All,
None,
Following,
Other(S),
}
impl<S: BosStr> ProfileAssociatedChatAllowIncoming<S> {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::None => "none",
Self::Following => "following",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"all" => Self::All,
"none" => Self::None,
"following" => Self::Following,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ProfileAssociatedChatAllowIncoming<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ProfileAssociatedChatAllowIncoming<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ProfileAssociatedChatAllowIncoming<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedChatAllowIncoming<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ProfileAssociatedChatAllowIncoming<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ProfileAssociatedChatAllowIncoming<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ProfileAssociatedChatAllowIncoming<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ProfileAssociatedChatAllowIncoming::All => {
ProfileAssociatedChatAllowIncoming::All
}
ProfileAssociatedChatAllowIncoming::None => {
ProfileAssociatedChatAllowIncoming::None
}
ProfileAssociatedChatAllowIncoming::Following => {
ProfileAssociatedChatAllowIncoming::Following
}
ProfileAssociatedChatAllowIncoming::Other(v) => {
ProfileAssociatedChatAllowIncoming::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileAssociatedGerm<S: BosStr = DefaultStr> {
pub message_me_url: UriValue<S>,
pub show_button_to: ProfileAssociatedGermShowButtonTo<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedGermShowButtonTo<S: BosStr = DefaultStr> {
UsersIFollow,
Everyone,
Other(S),
}
impl<S: BosStr> ProfileAssociatedGermShowButtonTo<S> {
pub fn as_str(&self) -> &str {
match self {
Self::UsersIFollow => "usersIFollow",
Self::Everyone => "everyone",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"usersIFollow" => Self::UsersIFollow,
"everyone" => Self::Everyone,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ProfileAssociatedGermShowButtonTo<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ProfileAssociatedGermShowButtonTo<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ProfileAssociatedGermShowButtonTo<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for ProfileAssociatedGermShowButtonTo<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ProfileAssociatedGermShowButtonTo<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ProfileAssociatedGermShowButtonTo<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ProfileAssociatedGermShowButtonTo<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ProfileAssociatedGermShowButtonTo::UsersIFollow => {
ProfileAssociatedGermShowButtonTo::UsersIFollow
}
ProfileAssociatedGermShowButtonTo::Everyone => {
ProfileAssociatedGermShowButtonTo::Everyone
}
ProfileAssociatedGermShowButtonTo::Other(v) => {
ProfileAssociatedGermShowButtonTo::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub associated: Option<actor::ProfileAssociated<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pronouns: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<actor::StatusView<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification: Option<actor::VerificationState<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileViewBasic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub associated: Option<actor::ProfileAssociated<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug: Option<Data<S>>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pronouns: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<actor::StatusView<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification: Option<actor::VerificationState<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerState<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ProfileViewDetailed<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub associated: Option<actor::ProfileAssociated<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub banner: Option<UriValue<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub debug: Option<Data<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
pub did: Did<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub followers_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follows_count: Option<i64>,
pub handle: Handle<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub joined_via_starter_pack: Option<StarterPackViewBasic<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<Vec<Label<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pinned_post: Option<StrongRef<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub posts_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub pronouns: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<actor::StatusView<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification: Option<actor::VerificationState<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub viewer: Option<actor::ViewerState<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub website: Option<UriValue<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeed<S: BosStr = DefaultStr> {
pub id: S,
pub pinned: bool,
pub r#type: SavedFeedType<S>,
pub value: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SavedFeedType<S: BosStr = DefaultStr> {
Feed,
List,
Timeline,
Other(S),
}
impl<S: BosStr> SavedFeedType<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Feed => "feed",
Self::List => "list",
Self::Timeline => "timeline",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"feed" => Self::Feed,
"list" => Self::List,
"timeline" => Self::Timeline,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for SavedFeedType<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for SavedFeedType<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for SavedFeedType<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SavedFeedType<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for SavedFeedType<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for SavedFeedType<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = SavedFeedType<S::Output>;
fn into_static(self) -> Self::Output {
match self {
SavedFeedType::Feed => SavedFeedType::Feed,
SavedFeedType::List => SavedFeedType::List,
SavedFeedType::Timeline => SavedFeedType::Timeline,
SavedFeedType::Other(v) => SavedFeedType::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeedsPref<S: BosStr = DefaultStr> {
pub pinned: Vec<AtUri<S>>,
pub saved: Vec<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline_index: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SavedFeedsPrefV2<S: BosStr = DefaultStr> {
pub items: Vec<actor::SavedFeed<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct StatusView<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub embed: Option<View<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_active: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub is_disabled: Option<bool>,
pub record: Data<S>,
pub status: StatusViewStatus<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub uri: Option<AtUri<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StatusViewStatus<S: BosStr = DefaultStr> {
Live,
Other(S),
}
impl<S: BosStr> StatusViewStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Live => "app.bsky.actor.status#live",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"app.bsky.actor.status#live" => Self::Live,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for StatusViewStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for StatusViewStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for StatusViewStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for StatusViewStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for StatusViewStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for StatusViewStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = StatusViewStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
StatusViewStatus::Live => StatusViewStatus::Live,
StatusViewStatus::Other(v) => StatusViewStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadViewPref<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub sort: Option<ThreadViewPrefSort<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThreadViewPrefSort<S: BosStr = DefaultStr> {
Oldest,
Newest,
MostLikes,
Random,
Hotness,
Other(S),
}
impl<S: BosStr> ThreadViewPrefSort<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Oldest => "oldest",
Self::Newest => "newest",
Self::MostLikes => "most-likes",
Self::Random => "random",
Self::Hotness => "hotness",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"oldest" => Self::Oldest,
"newest" => Self::Newest,
"most-likes" => Self::MostLikes,
"random" => Self::Random,
"hotness" => Self::Hotness,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for ThreadViewPrefSort<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for ThreadViewPrefSort<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for ThreadViewPrefSort<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ThreadViewPrefSort<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for ThreadViewPrefSort<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for ThreadViewPrefSort<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = ThreadViewPrefSort<S::Output>;
fn into_static(self) -> Self::Output {
match self {
ThreadViewPrefSort::Oldest => ThreadViewPrefSort::Oldest,
ThreadViewPrefSort::Newest => ThreadViewPrefSort::Newest,
ThreadViewPrefSort::MostLikes => ThreadViewPrefSort::MostLikes,
ThreadViewPrefSort::Random => ThreadViewPrefSort::Random,
ThreadViewPrefSort::Hotness => ThreadViewPrefSort::Hotness,
ThreadViewPrefSort::Other(v) => ThreadViewPrefSort::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationPrefs<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default = "_default_verification_prefs_hide_badges")]
pub hide_badges: Option<bool>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationState<S: BosStr = DefaultStr> {
pub trusted_verifier_status: VerificationStateTrustedVerifierStatus<S>,
pub verifications: Vec<actor::VerificationView<S>>,
pub verified_status: VerificationStateVerifiedStatus<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VerificationStateTrustedVerifierStatus<S: BosStr = DefaultStr> {
Valid,
Invalid,
None,
Other(S),
}
impl<S: BosStr> VerificationStateTrustedVerifierStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Valid => "valid",
Self::Invalid => "invalid",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for VerificationStateTrustedVerifierStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for VerificationStateTrustedVerifierStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for VerificationStateTrustedVerifierStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for VerificationStateTrustedVerifierStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for VerificationStateTrustedVerifierStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for VerificationStateTrustedVerifierStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = VerificationStateTrustedVerifierStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
VerificationStateTrustedVerifierStatus::Valid => {
VerificationStateTrustedVerifierStatus::Valid
}
VerificationStateTrustedVerifierStatus::Invalid => {
VerificationStateTrustedVerifierStatus::Invalid
}
VerificationStateTrustedVerifierStatus::None => {
VerificationStateTrustedVerifierStatus::None
}
VerificationStateTrustedVerifierStatus::Other(v) => {
VerificationStateTrustedVerifierStatus::Other(v.into_static())
}
}
}
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VerificationStateVerifiedStatus<S: BosStr = DefaultStr> {
Valid,
Invalid,
None,
Other(S),
}
impl<S: BosStr> VerificationStateVerifiedStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Valid => "valid",
Self::Invalid => "invalid",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for VerificationStateVerifiedStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for VerificationStateVerifiedStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for VerificationStateVerifiedStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de>
for VerificationStateVerifiedStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for VerificationStateVerifiedStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for VerificationStateVerifiedStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = VerificationStateVerifiedStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
VerificationStateVerifiedStatus::Valid => {
VerificationStateVerifiedStatus::Valid
}
VerificationStateVerifiedStatus::Invalid => {
VerificationStateVerifiedStatus::Invalid
}
VerificationStateVerifiedStatus::None => {
VerificationStateVerifiedStatus::None
}
VerificationStateVerifiedStatus::Other(v) => {
VerificationStateVerifiedStatus::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct VerificationView<S: BosStr = DefaultStr> {
pub created_at: Datetime,
pub is_valid: bool,
pub issuer: Did<S>,
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ViewerState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub activity_subscription: Option<ActivitySubscription<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocking: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocking_by_list: Option<ListViewBasic<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub followed_by: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub following: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub known_followers: Option<actor::KnownFollowers<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted_by_list: Option<ListViewBasic<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for AdultContentPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"adultContentPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for BskyAppProgressGuide<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"bskyAppProgressGuide"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.guide;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("guide"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for BskyAppStatePref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"bskyAppStatePref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.nuxs {
#[allow(unused_comparisons)]
if value.len() > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("nuxs"),
max: 100usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.queued_nudges {
#[allow(unused_comparisons)]
if value.len() > 1000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("queued_nudges"),
max: 1000usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ContentLabelPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"contentLabelPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for DeclaredAgePref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"declaredAgePref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for FeedViewPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"feedViewPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for HiddenPostsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"hiddenPostsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for InterestsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"interestsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.tags;
#[allow(unused_comparisons)]
if value.len() > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("tags"),
max: 100usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for KnownFollowers<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"knownFollowers"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.followers;
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("followers"),
max: 5usize,
actual: value.len(),
});
}
}
{
let value = &self.followers;
#[allow(unused_comparisons)]
if value.len() < 0usize {
return Err(ConstraintError::MinLength {
path: ValidationPath::from_field("followers"),
min: 0usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LabelerPrefItem<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"labelerPrefItem"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LabelersPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"labelersPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for LiveEventPreferences<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"liveEventPreferences"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for MutedWord<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"mutedWord"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.value;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 10000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("value"),
max: 10000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.value;
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 1000usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("value"),
max: 1000usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for MutedWordsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"mutedWordsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Nux<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"nux"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.data {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("data"),
max: 3000usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.data {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 300usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("data"),
max: 300usize,
actual: count,
});
}
}
}
{
let value = &self.id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PersonalDetailsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"personalDetailsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for PostInteractionSettingsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"postInteractionSettingsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.postgate_embedding_rules {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("postgate_embedding_rules"),
max: 5usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.threadgate_allow_rules {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("threadgate_allow_rules"),
max: 5usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileAssociated<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileAssociated"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileAssociatedActivitySubscription<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileAssociatedActivitySubscription"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileAssociatedChat<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileAssociatedChat"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileAssociatedGerm<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileAssociatedGerm"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileView<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.display_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("display_name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.display_name {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("display_name"),
max: 64usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileViewBasic<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileViewBasic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.display_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("display_name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.display_name {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("display_name"),
max: 64usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ProfileViewDetailed<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"profileViewDetailed"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2560usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 2560usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 256usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("description"),
max: 256usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.display_name {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 640usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("display_name"),
max: 640usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.display_name {
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 64usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("display_name"),
max: 64usize,
actual: count,
});
}
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SavedFeed<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"savedFeed"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SavedFeedsPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"savedFeedsPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SavedFeedsPrefV2<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"savedFeedsPrefV2"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for StatusView<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"statusView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadViewPref<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"threadViewPref"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for VerificationPrefs<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"verificationPrefs"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for VerificationState<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"verificationState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for VerificationView<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"verificationView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ViewerState<S> {
fn nsid() -> &'static str {
"app.bsky.actor.defs"
}
fn def_name() -> &'static str {
"viewerState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_actor_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn _default_adult_content_pref_enabled() -> bool {
false
}
impl Default for AdultContentPref {
fn default() -> Self {
Self {
enabled: false,
extra_data: Default::default(),
}
}
}
pub mod adult_content_pref_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 Enabled;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Enabled = Unset;
}
pub struct SetEnabled<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEnabled<St> {}
impl<St: State> State for SetEnabled<St> {
type Enabled = Set<members::enabled>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct enabled(());
}
}
pub struct AdultContentPrefBuilder<S: BosStr, St: adult_content_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<bool>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> AdultContentPref<S> {
pub fn new() -> AdultContentPrefBuilder<S, adult_content_pref_state::Empty> {
AdultContentPrefBuilder::new()
}
}
impl<S: BosStr> AdultContentPrefBuilder<S, adult_content_pref_state::Empty> {
pub fn new() -> Self {
AdultContentPrefBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AdultContentPrefBuilder<S, St>
where
St: adult_content_pref_state::State,
St::Enabled: adult_content_pref_state::IsUnset,
{
pub fn enabled(
mut self,
value: impl Into<bool>,
) -> AdultContentPrefBuilder<S, adult_content_pref_state::SetEnabled<St>> {
self._fields.0 = Option::Some(value.into());
AdultContentPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AdultContentPrefBuilder<S, St>
where
St: adult_content_pref_state::State,
St::Enabled: adult_content_pref_state::IsSet,
{
pub fn build(self) -> AdultContentPref<S> {
AdultContentPref {
enabled: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> AdultContentPref<S> {
AdultContentPref {
enabled: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_bsky_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("app.bsky.actor.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("adultContentPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("enabled")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("enabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bskyAppProgressGuide"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"If set, an active progress guide. Once completed, can be set to undefined. Should have unspecced fields tracking progress.",
),
),
required: Some(vec![SmolStr::new_static("guide")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("guide"),
LexObjectProperty::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("bskyAppStatePref"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A grab bag of state that's specific to the bsky.app program. Third-party apps shouldn't use this.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("activeProgressGuide"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#bskyAppProgressGuide"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("nuxs"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Storage for NUXs the user has encountered.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.actor.defs#nux"),
..Default::default()
}),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("queuedNudges"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"An array of tokens which identify nudges (modals, popups, tours, highlight dots) that should be shown to the user.",
),
),
items: LexArrayItem::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
max_length: Some(1000usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("contentLabelPref"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("label"),
SmolStr::new_static("visibility")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("label"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("labelerDid"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Which labeler does this preference apply to? If undefined, applies globally.",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("visibility"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("declaredAgePref"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("isOverAge13"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isOverAge16"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isOverAge18"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedViewPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("feed")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("feed"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The URI of the feed, or an identifier which describes the feed.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideQuotePosts"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideReplies"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideRepliesByLikeCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideRepliesByUnfollowed"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideReposts"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hiddenPostsPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("items")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("items"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"A list of URIs of posts the account owner has hidden.",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("interestsPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("tags")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("tags"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"A list of tags which describe the account owner's interests gathered during onboarding.",
),
),
items: LexArrayItem::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("knownFollowers"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"The subject's followers whom you also follow",
),
),
required: Some(
vec![
SmolStr::new_static("count"),
SmolStr::new_static("followers")
],
),
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("followers"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#profileViewBasic"),
..Default::default()
}),
min_length: Some(0usize),
max_length: Some(5usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labelerPrefItem"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("did")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labelersPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("labelers")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("labelers"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#labelerPrefItem"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("liveEventPreferences"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("Preferences for live events."),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("hiddenFeedIds"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"A list of feed IDs that the user has hidden from live events.",
),
),
items: LexArrayItem::String(LexString {
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("hideAllFeeds"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mutedWord"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A word that the account owner has muted."),
),
required: Some(
vec![
SmolStr::new_static("value"), SmolStr::new_static("targets")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("actorTarget"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Groups of users to apply the muted word to. If undefined, applies to all users.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expiresAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time at which the muted word will expire and no longer be applied.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("targets"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"The intended targets of the muted word.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#mutedWordTarget",
),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The muted word itself."),
),
max_length: Some(10000usize),
max_graphemes: Some(1000usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mutedWordTarget"),
LexUserType::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mutedWordsPref"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("items")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("items"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"A list of words the account owner has muted.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.actor.defs#mutedWord"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("nux"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A new user experiences (NUX) storage object"),
),
required: Some(
vec![SmolStr::new_static("id"), SmolStr::new_static("completed")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("completed"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("data"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Arbitrary data for the NUX. The structure is defined by the NUX itself. Limited to 300 characters.",
),
),
max_length: Some(3000usize),
max_graphemes: Some(300usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expiresAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time at which the NUX will expire and should be considered completed.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
max_length: Some(100usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("personalDetailsPref"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("birthDate"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The birth date of account owner."),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postInteractionSettingsPref"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Default post interaction settings for the account. These values should be applied as default values when creating new posts. These refs should mirror the threadgate and postgate records exactly.",
),
),
required: Some(vec![]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("postgateEmbeddingRules"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Matches postgate record. List of rules defining who can embed this users posts. If value is an empty array or is undefined, no particular rules apply and anyone can embed.",
),
),
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("app.bsky.feed.postgate#disableRule")
],
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgateAllowRules"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Matches threadgate record. List of rules defining who can reply to this users posts. If value is an empty array, no one can reply. If value is undefined, anyone can reply.",
),
),
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("app.bsky.feed.threadgate#mentionRule"),
CowStr::new_static("app.bsky.feed.threadgate#followerRule"),
CowStr::new_static("app.bsky.feed.threadgate#followingRule"),
CowStr::new_static("app.bsky.feed.threadgate#listRule")
],
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("preferences"),
LexUserType::Array(LexArray {
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("#adultContentPref"),
CowStr::new_static("#contentLabelPref"),
CowStr::new_static("#savedFeedsPref"),
CowStr::new_static("#savedFeedsPrefV2"),
CowStr::new_static("#personalDetailsPref"),
CowStr::new_static("#declaredAgePref"),
CowStr::new_static("#feedViewPref"),
CowStr::new_static("#threadViewPref"),
CowStr::new_static("#interestsPref"),
CowStr::new_static("#mutedWordsPref"),
CowStr::new_static("#hiddenPostsPref"),
CowStr::new_static("#bskyAppStatePref"),
CowStr::new_static("#labelersPref"),
CowStr::new_static("#postInteractionSettingsPref"),
CowStr::new_static("#verificationPrefs"),
CowStr::new_static("#liveEventPreferences")
],
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileAssociated"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("activitySubscription"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"#profileAssociatedActivitySubscription",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("chat"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#profileAssociatedChat"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("feedgens"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("germ"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#profileAssociatedGerm"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labeler"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("lists"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("starterPacks"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileAssociatedActivitySubscription"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("allowSubscriptions")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("allowSubscriptions"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileAssociatedChat"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("allowIncoming")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("allowIncoming"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileAssociatedGerm"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("showButtonTo"),
SmolStr::new_static("messageMeUrl")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("messageMeUrl"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("showButtonTo"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileView"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("associated"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#profileAssociated"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("debug"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronouns"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#statusView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verification"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#verificationState"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileViewBasic"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("associated"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#profileAssociated"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("debug"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronouns"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#statusView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verification"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#verificationState"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerState"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("profileViewDetailed"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("did"), SmolStr::new_static("handle")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("associated"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#profileAssociated"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("avatar"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("banner"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("debug"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
max_length: Some(2560usize),
max_graphemes: Some(256usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("did"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString {
max_length: Some(640usize),
max_graphemes: Some(64usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followersCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followsCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("handle"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Handle),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("indexedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("joinedViaStarterPack"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.graph.defs#starterPackViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.label.defs#label"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pinnedPost"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postsCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pronouns"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#statusView"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verification"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#verificationState"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewer"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#viewerState"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("website"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Uri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("savedFeed"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("type"),
SmolStr::new_static("value"), SmolStr::new_static("pinned")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("pinned"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("type"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("value"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("savedFeedsPref"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("pinned"), SmolStr::new_static("saved")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("pinned"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("saved"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("timelineIndex"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("savedFeedsPrefV2"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("items")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("items"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.actor.defs#savedFeed"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("statusView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("status"), SmolStr::new_static("record")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Cid),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("embed"),
LexObjectProperty::Union(LexRefUnion {
description: Some(
CowStr::new_static(
"An optional embed associated with the status.",
),
),
refs: vec![
CowStr::new_static("app.bsky.embed.external#view")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("expiresAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date when this status will expire. The application might choose to no longer return the status after expiration.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isActive"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isDisabled"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("record"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The status for the account."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadViewPref"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("sort"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Sorting mode for threads."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verificationPrefs"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Preferences for how verified accounts appear in the app.",
),
),
required: Some(vec![]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("hideBadges"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verificationState"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Represents the verification information about the user this object is attached to.",
),
),
required: Some(
vec![
SmolStr::new_static("verifications"),
SmolStr::new_static("verifiedStatus"),
SmolStr::new_static("trustedVerifierStatus")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("trustedVerifierStatus"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user's status as a trusted verifier.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verifications"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"All verifications issued by trusted verifiers on behalf of this user. Verifications by untrusted verifiers are not included.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#verificationView"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verifiedStatus"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user's status as a verified account.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verificationView"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"An individual verification for an associated subject.",
),
),
required: Some(
vec![
SmolStr::new_static("issuer"), SmolStr::new_static("uri"),
SmolStr::new_static("isValid"),
SmolStr::new_static("createdAt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Timestamp when the verification was created.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("isValid"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("issuer"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The user who issued this verification."),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The AT-URI of the verification record."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("viewerState"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Metadata about the requesting account's relationship with the subject account. Only has meaningful content for authed requests.",
),
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("activitySubscription"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.notification.defs#activitySubscription",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockedBy"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blocking"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("blockingByList"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.graph.defs#listViewBasic",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("followedBy"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("following"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("knownFollowers"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#knownFollowers"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("muted"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mutedByList"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.graph.defs#listViewBasic",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
fn _default_feed_view_pref_hide_replies_by_unfollowed() -> Option<bool> {
Some(true)
}
pub mod hidden_posts_pref_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 Items;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Items = Unset;
}
pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetItems<St> {}
impl<St: State> State for SetItems<St> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct HiddenPostsPrefBuilder<S: BosStr, St: hidden_posts_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<AtUri<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> HiddenPostsPref<S> {
pub fn new() -> HiddenPostsPrefBuilder<S, hidden_posts_pref_state::Empty> {
HiddenPostsPrefBuilder::new()
}
}
impl<S: BosStr> HiddenPostsPrefBuilder<S, hidden_posts_pref_state::Empty> {
pub fn new() -> Self {
HiddenPostsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> HiddenPostsPrefBuilder<S, St>
where
St: hidden_posts_pref_state::State,
St::Items: hidden_posts_pref_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<AtUri<S>>>,
) -> HiddenPostsPrefBuilder<S, hidden_posts_pref_state::SetItems<St>> {
self._fields.0 = Option::Some(value.into());
HiddenPostsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> HiddenPostsPrefBuilder<S, St>
where
St: hidden_posts_pref_state::State,
St::Items: hidden_posts_pref_state::IsSet,
{
pub fn build(self) -> HiddenPostsPref<S> {
HiddenPostsPref {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> HiddenPostsPref<S> {
HiddenPostsPref {
items: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod interests_pref_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 Tags;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Tags = Unset;
}
pub struct SetTags<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTags<St> {}
impl<St: State> State for SetTags<St> {
type Tags = Set<members::tags>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct tags(());
}
}
pub struct InterestsPrefBuilder<S: BosStr, St: interests_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> InterestsPref<S> {
pub fn new() -> InterestsPrefBuilder<S, interests_pref_state::Empty> {
InterestsPrefBuilder::new()
}
}
impl<S: BosStr> InterestsPrefBuilder<S, interests_pref_state::Empty> {
pub fn new() -> Self {
InterestsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> InterestsPrefBuilder<S, St>
where
St: interests_pref_state::State,
St::Tags: interests_pref_state::IsUnset,
{
pub fn tags(
mut self,
value: impl Into<Vec<S>>,
) -> InterestsPrefBuilder<S, interests_pref_state::SetTags<St>> {
self._fields.0 = Option::Some(value.into());
InterestsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> InterestsPrefBuilder<S, St>
where
St: interests_pref_state::State,
St::Tags: interests_pref_state::IsSet,
{
pub fn build(self) -> InterestsPref<S> {
InterestsPref {
tags: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> InterestsPref<S> {
InterestsPref {
tags: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod known_followers_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 Followers;
type Count;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Followers = Unset;
type Count = Unset;
}
pub struct SetFollowers<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetFollowers<St> {}
impl<St: State> State for SetFollowers<St> {
type Followers = Set<members::followers>;
type Count = St::Count;
}
pub struct SetCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCount<St> {}
impl<St: State> State for SetCount<St> {
type Followers = St::Followers;
type Count = Set<members::count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct followers(());
pub struct count(());
}
}
pub struct KnownFollowersBuilder<S: BosStr, St: known_followers_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<Vec<actor::ProfileViewBasic<S>>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> KnownFollowers<S> {
pub fn new() -> KnownFollowersBuilder<S, known_followers_state::Empty> {
KnownFollowersBuilder::new()
}
}
impl<S: BosStr> KnownFollowersBuilder<S, known_followers_state::Empty> {
pub fn new() -> Self {
KnownFollowersBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> KnownFollowersBuilder<S, St>
where
St: known_followers_state::State,
St::Count: known_followers_state::IsUnset,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> KnownFollowersBuilder<S, known_followers_state::SetCount<St>> {
self._fields.0 = Option::Some(value.into());
KnownFollowersBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> KnownFollowersBuilder<S, St>
where
St: known_followers_state::State,
St::Followers: known_followers_state::IsUnset,
{
pub fn followers(
mut self,
value: impl Into<Vec<actor::ProfileViewBasic<S>>>,
) -> KnownFollowersBuilder<S, known_followers_state::SetFollowers<St>> {
self._fields.1 = Option::Some(value.into());
KnownFollowersBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> KnownFollowersBuilder<S, St>
where
St: known_followers_state::State,
St::Followers: known_followers_state::IsSet,
St::Count: known_followers_state::IsSet,
{
pub fn build(self) -> KnownFollowers<S> {
KnownFollowers {
count: self._fields.0.unwrap(),
followers: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> KnownFollowers<S> {
KnownFollowers {
count: self._fields.0.unwrap(),
followers: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod labeler_pref_item_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 Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct LabelerPrefItemBuilder<S: BosStr, St: labeler_pref_item_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> LabelerPrefItem<S> {
pub fn new() -> LabelerPrefItemBuilder<S, labeler_pref_item_state::Empty> {
LabelerPrefItemBuilder::new()
}
}
impl<S: BosStr> LabelerPrefItemBuilder<S, labeler_pref_item_state::Empty> {
pub fn new() -> Self {
LabelerPrefItemBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LabelerPrefItemBuilder<S, St>
where
St: labeler_pref_item_state::State,
St::Did: labeler_pref_item_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> LabelerPrefItemBuilder<S, labeler_pref_item_state::SetDid<St>> {
self._fields.0 = Option::Some(value.into());
LabelerPrefItemBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LabelerPrefItemBuilder<S, St>
where
St: labeler_pref_item_state::State,
St::Did: labeler_pref_item_state::IsSet,
{
pub fn build(self) -> LabelerPrefItem<S> {
LabelerPrefItem {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> LabelerPrefItem<S> {
LabelerPrefItem {
did: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod labelers_pref_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 Labelers;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Labelers = Unset;
}
pub struct SetLabelers<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLabelers<St> {}
impl<St: State> State for SetLabelers<St> {
type Labelers = Set<members::labelers>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct labelers(());
}
}
pub struct LabelersPrefBuilder<S: BosStr, St: labelers_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<actor::LabelerPrefItem<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> LabelersPref<S> {
pub fn new() -> LabelersPrefBuilder<S, labelers_pref_state::Empty> {
LabelersPrefBuilder::new()
}
}
impl<S: BosStr> LabelersPrefBuilder<S, labelers_pref_state::Empty> {
pub fn new() -> Self {
LabelersPrefBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LabelersPrefBuilder<S, St>
where
St: labelers_pref_state::State,
St::Labelers: labelers_pref_state::IsUnset,
{
pub fn labelers(
mut self,
value: impl Into<Vec<actor::LabelerPrefItem<S>>>,
) -> LabelersPrefBuilder<S, labelers_pref_state::SetLabelers<St>> {
self._fields.0 = Option::Some(value.into());
LabelersPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> LabelersPrefBuilder<S, St>
where
St: labelers_pref_state::State,
St::Labelers: labelers_pref_state::IsSet,
{
pub fn build(self) -> LabelersPref<S> {
LabelersPref {
labelers: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> LabelersPref<S> {
LabelersPref {
labelers: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn _default_live_event_preferences_hide_all_feeds() -> Option<bool> {
Some(false)
}
impl Default for LiveEventPreferences {
fn default() -> Self {
Self {
hidden_feed_ids: None,
hide_all_feeds: Some(false),
extra_data: Default::default(),
}
}
}
pub mod muted_word_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 Value;
type Targets;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Value = Unset;
type Targets = Unset;
}
pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetValue<St> {}
impl<St: State> State for SetValue<St> {
type Value = Set<members::value>;
type Targets = St::Targets;
}
pub struct SetTargets<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTargets<St> {}
impl<St: State> State for SetTargets<St> {
type Value = St::Value;
type Targets = Set<members::targets>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct value(());
pub struct targets(());
}
}
pub struct MutedWordBuilder<S: BosStr, St: muted_word_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<MutedWordActorTarget<S>>,
Option<Datetime>,
Option<S>,
Option<Vec<actor::MutedWordTarget<S>>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> MutedWord<S> {
pub fn new() -> MutedWordBuilder<S, muted_word_state::Empty> {
MutedWordBuilder::new()
}
}
impl<S: BosStr> MutedWordBuilder<S, muted_word_state::Empty> {
pub fn new() -> Self {
MutedWordBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: muted_word_state::State> MutedWordBuilder<S, St> {
pub fn actor_target(
mut self,
value: impl Into<Option<MutedWordActorTarget<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_actor_target(mut self, value: Option<MutedWordActorTarget<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: muted_word_state::State> MutedWordBuilder<S, St> {
pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: muted_word_state::State> MutedWordBuilder<S, St> {
pub fn id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_id(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> MutedWordBuilder<S, St>
where
St: muted_word_state::State,
St::Targets: muted_word_state::IsUnset,
{
pub fn targets(
mut self,
value: impl Into<Vec<actor::MutedWordTarget<S>>>,
) -> MutedWordBuilder<S, muted_word_state::SetTargets<St>> {
self._fields.3 = Option::Some(value.into());
MutedWordBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MutedWordBuilder<S, St>
where
St: muted_word_state::State,
St::Value: muted_word_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<S>,
) -> MutedWordBuilder<S, muted_word_state::SetValue<St>> {
self._fields.4 = Option::Some(value.into());
MutedWordBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MutedWordBuilder<S, St>
where
St: muted_word_state::State,
St::Value: muted_word_state::IsSet,
St::Targets: muted_word_state::IsSet,
{
pub fn build(self) -> MutedWord<S> {
MutedWord {
actor_target: self._fields.0,
expires_at: self._fields.1,
id: self._fields.2,
targets: self._fields.3.unwrap(),
value: self._fields.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> MutedWord<S> {
MutedWord {
actor_target: self._fields.0,
expires_at: self._fields.1,
id: self._fields.2,
targets: self._fields.3.unwrap(),
value: self._fields.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod muted_words_pref_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 Items;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Items = Unset;
}
pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetItems<St> {}
impl<St: State> State for SetItems<St> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct MutedWordsPrefBuilder<S: BosStr, St: muted_words_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<actor::MutedWord<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> MutedWordsPref<S> {
pub fn new() -> MutedWordsPrefBuilder<S, muted_words_pref_state::Empty> {
MutedWordsPrefBuilder::new()
}
}
impl<S: BosStr> MutedWordsPrefBuilder<S, muted_words_pref_state::Empty> {
pub fn new() -> Self {
MutedWordsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MutedWordsPrefBuilder<S, St>
where
St: muted_words_pref_state::State,
St::Items: muted_words_pref_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<actor::MutedWord<S>>>,
) -> MutedWordsPrefBuilder<S, muted_words_pref_state::SetItems<St>> {
self._fields.0 = Option::Some(value.into());
MutedWordsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> MutedWordsPrefBuilder<S, St>
where
St: muted_words_pref_state::State,
St::Items: muted_words_pref_state::IsSet,
{
pub fn build(self) -> MutedWordsPref<S> {
MutedWordsPref {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> MutedWordsPref<S> {
MutedWordsPref {
items: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn _default_nux_completed() -> bool {
false
}
pub mod nux_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 Completed;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Completed = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Completed = St::Completed;
}
pub struct SetCompleted<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCompleted<St> {}
impl<St: State> State for SetCompleted<St> {
type Id = St::Id;
type Completed = Set<members::completed>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct completed(());
}
}
pub struct NuxBuilder<S: BosStr, St: nux_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<bool>, Option<S>, Option<Datetime>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Nux<S> {
pub fn new() -> NuxBuilder<S, nux_state::Empty> {
NuxBuilder::new()
}
}
impl<S: BosStr> NuxBuilder<S, nux_state::Empty> {
pub fn new() -> Self {
NuxBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NuxBuilder<S, St>
where
St: nux_state::State,
St::Completed: nux_state::IsUnset,
{
pub fn completed(
mut self,
value: impl Into<bool>,
) -> NuxBuilder<S, nux_state::SetCompleted<St>> {
self._fields.0 = Option::Some(value.into());
NuxBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: nux_state::State> NuxBuilder<S, St> {
pub fn data(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_data(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: nux_state::State> NuxBuilder<S, St> {
pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> NuxBuilder<S, St>
where
St: nux_state::State,
St::Id: nux_state::IsUnset,
{
pub fn id(mut self, value: impl Into<S>) -> NuxBuilder<S, nux_state::SetId<St>> {
self._fields.3 = Option::Some(value.into());
NuxBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> NuxBuilder<S, St>
where
St: nux_state::State,
St::Id: nux_state::IsSet,
St::Completed: nux_state::IsSet,
{
pub fn build(self) -> Nux<S> {
Nux {
completed: self._fields.0.unwrap(),
data: self._fields.1,
expires_at: self._fields.2,
id: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Nux<S> {
Nux {
completed: self._fields.0.unwrap(),
data: self._fields.1,
expires_at: self._fields.2,
id: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod profile_associated_germ_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 ShowButtonTo;
type MessageMeUrl;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type ShowButtonTo = Unset;
type MessageMeUrl = Unset;
}
pub struct SetShowButtonTo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetShowButtonTo<St> {}
impl<St: State> State for SetShowButtonTo<St> {
type ShowButtonTo = Set<members::show_button_to>;
type MessageMeUrl = St::MessageMeUrl;
}
pub struct SetMessageMeUrl<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMessageMeUrl<St> {}
impl<St: State> State for SetMessageMeUrl<St> {
type ShowButtonTo = St::ShowButtonTo;
type MessageMeUrl = Set<members::message_me_url>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct show_button_to(());
pub struct message_me_url(());
}
}
pub struct ProfileAssociatedGermBuilder<
S: BosStr,
St: profile_associated_germ_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<UriValue<S>>, Option<ProfileAssociatedGermShowButtonTo<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileAssociatedGerm<S> {
pub fn new() -> ProfileAssociatedGermBuilder<
S,
profile_associated_germ_state::Empty,
> {
ProfileAssociatedGermBuilder::new()
}
}
impl<S: BosStr> ProfileAssociatedGermBuilder<S, profile_associated_germ_state::Empty> {
pub fn new() -> Self {
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: (None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ProfileAssociatedGermBuilder<S, St>
where
St: profile_associated_germ_state::State,
St::MessageMeUrl: profile_associated_germ_state::IsUnset,
{
pub fn message_me_url(
mut self,
value: impl Into<UriValue<S>>,
) -> ProfileAssociatedGermBuilder<
S,
profile_associated_germ_state::SetMessageMeUrl<St>,
> {
self._fields.0 = Option::Some(value.into());
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ProfileAssociatedGermBuilder<S, St>
where
St: profile_associated_germ_state::State,
St::ShowButtonTo: profile_associated_germ_state::IsUnset,
{
pub fn show_button_to(
mut self,
value: impl Into<ProfileAssociatedGermShowButtonTo<S>>,
) -> ProfileAssociatedGermBuilder<
S,
profile_associated_germ_state::SetShowButtonTo<St>,
> {
self._fields.1 = Option::Some(value.into());
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ProfileAssociatedGermBuilder<S, St>
where
St: profile_associated_germ_state::State,
St::ShowButtonTo: profile_associated_germ_state::IsSet,
St::MessageMeUrl: profile_associated_germ_state::IsSet,
{
pub fn build(self) -> ProfileAssociatedGerm<S> {
ProfileAssociatedGerm {
message_me_url: self._fields.0.unwrap(),
show_button_to: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ProfileAssociatedGerm<S> {
ProfileAssociatedGerm {
message_me_url: self._fields.0.unwrap(),
show_button_to: self._fields.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod profile_view_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 Did;
type Handle;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Handle = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
type Handle = St::Handle;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Did = St::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewBuilder<S: BosStr, St: profile_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<actor::ProfileAssociated<S>>,
Option<UriValue<S>>,
Option<Datetime>,
Option<Data<S>>,
Option<S>,
Option<Did<S>>,
Option<S>,
Option<Handle<S>>,
Option<Datetime>,
Option<Vec<Label<S>>>,
Option<S>,
Option<actor::StatusView<S>>,
Option<actor::VerificationState<S>>,
Option<actor::ViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileView<S> {
pub fn new() -> ProfileViewBuilder<S, profile_view_state::Empty> {
ProfileViewBuilder::new()
}
}
impl<S: BosStr> ProfileViewBuilder<S, profile_view_state::Empty> {
pub fn new() -> Self {
ProfileViewBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<S>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Did: profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ProfileViewBuilder<S, profile_view_state::SetDid<St>> {
self._fields.5 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Handle: profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> ProfileViewBuilder<S, profile_view_state::SetHandle<St>> {
self._fields.7 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<S>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<S>>,
) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St: profile_view_state::State> ProfileViewBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBuilder<S, St>
where
St: profile_view_state::State,
St::Did: profile_view_state::IsSet,
St::Handle: profile_view_state::IsSet,
{
pub fn build(self) -> ProfileView<S> {
ProfileView {
associated: self._fields.0,
avatar: self._fields.1,
created_at: self._fields.2,
debug: self._fields.3,
description: self._fields.4,
did: self._fields.5.unwrap(),
display_name: self._fields.6,
handle: self._fields.7.unwrap(),
indexed_at: self._fields.8,
labels: self._fields.9,
pronouns: self._fields.10,
status: self._fields.11,
verification: self._fields.12,
viewer: self._fields.13,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ProfileView<S> {
ProfileView {
associated: self._fields.0,
avatar: self._fields.1,
created_at: self._fields.2,
debug: self._fields.3,
description: self._fields.4,
did: self._fields.5.unwrap(),
display_name: self._fields.6,
handle: self._fields.7.unwrap(),
indexed_at: self._fields.8,
labels: self._fields.9,
pronouns: self._fields.10,
status: self._fields.11,
verification: self._fields.12,
viewer: self._fields.13,
extra_data: Some(extra_data),
}
}
}
pub mod profile_view_basic_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 Handle;
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Handle = Unset;
type Did = Unset;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Handle = Set<members::handle>;
type Did = St::Did;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Handle = St::Handle;
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct did(());
}
}
pub struct ProfileViewBasicBuilder<S: BosStr, St: profile_view_basic_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<actor::ProfileAssociated<S>>,
Option<UriValue<S>>,
Option<Datetime>,
Option<Data<S>>,
Option<Did<S>>,
Option<S>,
Option<Handle<S>>,
Option<Vec<Label<S>>>,
Option<S>,
Option<actor::StatusView<S>>,
Option<actor::VerificationState<S>>,
Option<actor::ViewerState<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileViewBasic<S> {
pub fn new() -> ProfileViewBasicBuilder<S, profile_view_basic_state::Empty> {
ProfileViewBasicBuilder::new()
}
}
impl<S: BosStr> ProfileViewBasicBuilder<S, profile_view_basic_state::Empty> {
pub fn new() -> Self {
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<S>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Did: profile_view_basic_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ProfileViewBasicBuilder<S, profile_view_basic_state::SetDid<St>> {
self._fields.4 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Handle: profile_view_basic_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> ProfileViewBasicBuilder<S, profile_view_basic_state::SetHandle<St>> {
self._fields.6 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
self._fields.8 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<S>>>,
) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<S>>,
) -> Self {
self._fields.10 = value;
self
}
}
impl<S: BosStr, St: profile_view_basic_state::State> ProfileViewBasicBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St> ProfileViewBasicBuilder<S, St>
where
St: profile_view_basic_state::State,
St::Handle: profile_view_basic_state::IsSet,
St::Did: profile_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileViewBasic<S> {
ProfileViewBasic {
associated: self._fields.0,
avatar: self._fields.1,
created_at: self._fields.2,
debug: self._fields.3,
did: self._fields.4.unwrap(),
display_name: self._fields.5,
handle: self._fields.6.unwrap(),
labels: self._fields.7,
pronouns: self._fields.8,
status: self._fields.9,
verification: self._fields.10,
viewer: self._fields.11,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ProfileViewBasic<S> {
ProfileViewBasic {
associated: self._fields.0,
avatar: self._fields.1,
created_at: self._fields.2,
debug: self._fields.3,
did: self._fields.4.unwrap(),
display_name: self._fields.5,
handle: self._fields.6.unwrap(),
labels: self._fields.7,
pronouns: self._fields.8,
status: self._fields.9,
verification: self._fields.10,
viewer: self._fields.11,
extra_data: Some(extra_data),
}
}
}
pub mod profile_view_detailed_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 Did;
type Handle;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
type Handle = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
type Handle = St::Handle;
}
pub struct SetHandle<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHandle<St> {}
impl<St: State> State for SetHandle<St> {
type Did = St::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewDetailedBuilder<
S: BosStr,
St: profile_view_detailed_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<actor::ProfileAssociated<S>>,
Option<UriValue<S>>,
Option<UriValue<S>>,
Option<Datetime>,
Option<Data<S>>,
Option<S>,
Option<Did<S>>,
Option<S>,
Option<i64>,
Option<i64>,
Option<Handle<S>>,
Option<Datetime>,
Option<StarterPackViewBasic<S>>,
Option<Vec<Label<S>>>,
Option<StrongRef<S>>,
Option<i64>,
Option<S>,
Option<actor::StatusView<S>>,
Option<actor::VerificationState<S>>,
Option<actor::ViewerState<S>>,
Option<UriValue<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ProfileViewDetailed<S> {
pub fn new() -> ProfileViewDetailedBuilder<S, profile_view_detailed_state::Empty> {
ProfileViewDetailedBuilder::new()
}
}
impl<S: BosStr> ProfileViewDetailedBuilder<S, profile_view_detailed_state::Empty> {
pub fn new() -> Self {
ProfileViewDetailedBuilder {
_state: PhantomData,
_fields: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_type: PhantomData,
}
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<S>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<S>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn banner(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_banner(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.2 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn created_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_created_at(mut self, value: Option<Datetime>) -> Self {
self._fields.3 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn debug(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St> ProfileViewDetailedBuilder<S, St>
where
St: profile_view_detailed_state::State,
St::Did: profile_view_detailed_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> ProfileViewDetailedBuilder<S, profile_view_detailed_state::SetDid<St>> {
self._fields.6 = Option::Some(value.into());
ProfileViewDetailedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn display_name(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<S>) -> Self {
self._fields.7 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn followers_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_followers_count(mut self, value: Option<i64>) -> Self {
self._fields.8 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn follows_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_follows_count(mut self, value: Option<i64>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St> ProfileViewDetailedBuilder<S, St>
where
St: profile_view_detailed_state::State,
St::Handle: profile_view_detailed_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<S>>,
) -> ProfileViewDetailedBuilder<S, profile_view_detailed_state::SetHandle<St>> {
self._fields.10 = Option::Some(value.into());
ProfileViewDetailedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn indexed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_indexed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.11 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn joined_via_starter_pack(
mut self,
value: impl Into<Option<StarterPackViewBasic<S>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_joined_via_starter_pack(
mut self,
value: Option<StarterPackViewBasic<S>>,
) -> Self {
self._fields.12 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<S>>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<S>>>) -> Self {
self._fields.13 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn pinned_post(mut self, value: impl Into<Option<StrongRef<S>>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_pinned_post(mut self, value: Option<StrongRef<S>>) -> Self {
self._fields.14 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn posts_count(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.15 = value.into();
self
}
pub fn maybe_posts_count(mut self, value: Option<i64>) -> Self {
self._fields.15 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn pronouns(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<S>) -> Self {
self._fields.16 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<S>>>) -> Self {
self._fields.17 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<S>>) -> Self {
self._fields.17 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<S>>>,
) -> Self {
self._fields.18 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<S>>,
) -> Self {
self._fields.18 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<S>>>) -> Self {
self._fields.19 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<S>>) -> Self {
self._fields.19 = value;
self
}
}
impl<
S: BosStr,
St: profile_view_detailed_state::State,
> ProfileViewDetailedBuilder<S, St> {
pub fn website(mut self, value: impl Into<Option<UriValue<S>>>) -> Self {
self._fields.20 = value.into();
self
}
pub fn maybe_website(mut self, value: Option<UriValue<S>>) -> Self {
self._fields.20 = value;
self
}
}
impl<S: BosStr, St> ProfileViewDetailedBuilder<S, St>
where
St: profile_view_detailed_state::State,
St::Did: profile_view_detailed_state::IsSet,
St::Handle: profile_view_detailed_state::IsSet,
{
pub fn build(self) -> ProfileViewDetailed<S> {
ProfileViewDetailed {
associated: self._fields.0,
avatar: self._fields.1,
banner: self._fields.2,
created_at: self._fields.3,
debug: self._fields.4,
description: self._fields.5,
did: self._fields.6.unwrap(),
display_name: self._fields.7,
followers_count: self._fields.8,
follows_count: self._fields.9,
handle: self._fields.10.unwrap(),
indexed_at: self._fields.11,
joined_via_starter_pack: self._fields.12,
labels: self._fields.13,
pinned_post: self._fields.14,
posts_count: self._fields.15,
pronouns: self._fields.16,
status: self._fields.17,
verification: self._fields.18,
viewer: self._fields.19,
website: self._fields.20,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ProfileViewDetailed<S> {
ProfileViewDetailed {
associated: self._fields.0,
avatar: self._fields.1,
banner: self._fields.2,
created_at: self._fields.3,
debug: self._fields.4,
description: self._fields.5,
did: self._fields.6.unwrap(),
display_name: self._fields.7,
followers_count: self._fields.8,
follows_count: self._fields.9,
handle: self._fields.10.unwrap(),
indexed_at: self._fields.11,
joined_via_starter_pack: self._fields.12,
labels: self._fields.13,
pinned_post: self._fields.14,
posts_count: self._fields.15,
pronouns: self._fields.16,
status: self._fields.17,
verification: self._fields.18,
viewer: self._fields.19,
website: self._fields.20,
extra_data: Some(extra_data),
}
}
}
pub mod saved_feed_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 Type;
type Value;
type Id;
type Pinned;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Type = Unset;
type Value = Unset;
type Id = Unset;
type Pinned = Unset;
}
pub struct SetType<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetType<St> {}
impl<St: State> State for SetType<St> {
type Type = Set<members::r#type>;
type Value = St::Value;
type Id = St::Id;
type Pinned = St::Pinned;
}
pub struct SetValue<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetValue<St> {}
impl<St: State> State for SetValue<St> {
type Type = St::Type;
type Value = Set<members::value>;
type Id = St::Id;
type Pinned = St::Pinned;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Type = St::Type;
type Value = St::Value;
type Id = Set<members::id>;
type Pinned = St::Pinned;
}
pub struct SetPinned<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPinned<St> {}
impl<St: State> State for SetPinned<St> {
type Type = St::Type;
type Value = St::Value;
type Id = St::Id;
type Pinned = Set<members::pinned>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct r#type(());
pub struct value(());
pub struct id(());
pub struct pinned(());
}
}
pub struct SavedFeedBuilder<S: BosStr, St: saved_feed_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<bool>, Option<SavedFeedType<S>>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SavedFeed<S> {
pub fn new() -> SavedFeedBuilder<S, saved_feed_state::Empty> {
SavedFeedBuilder::new()
}
}
impl<S: BosStr> SavedFeedBuilder<S, saved_feed_state::Empty> {
pub fn new() -> Self {
SavedFeedBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedBuilder<S, St>
where
St: saved_feed_state::State,
St::Id: saved_feed_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> SavedFeedBuilder<S, saved_feed_state::SetId<St>> {
self._fields.0 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedBuilder<S, St>
where
St: saved_feed_state::State,
St::Pinned: saved_feed_state::IsUnset,
{
pub fn pinned(
mut self,
value: impl Into<bool>,
) -> SavedFeedBuilder<S, saved_feed_state::SetPinned<St>> {
self._fields.1 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedBuilder<S, St>
where
St: saved_feed_state::State,
St::Type: saved_feed_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<SavedFeedType<S>>,
) -> SavedFeedBuilder<S, saved_feed_state::SetType<St>> {
self._fields.2 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedBuilder<S, St>
where
St: saved_feed_state::State,
St::Value: saved_feed_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<S>,
) -> SavedFeedBuilder<S, saved_feed_state::SetValue<St>> {
self._fields.3 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedBuilder<S, St>
where
St: saved_feed_state::State,
St::Type: saved_feed_state::IsSet,
St::Value: saved_feed_state::IsSet,
St::Id: saved_feed_state::IsSet,
St::Pinned: saved_feed_state::IsSet,
{
pub fn build(self) -> SavedFeed<S> {
SavedFeed {
id: self._fields.0.unwrap(),
pinned: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
value: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SavedFeed<S> {
SavedFeed {
id: self._fields.0.unwrap(),
pinned: self._fields.1.unwrap(),
r#type: self._fields.2.unwrap(),
value: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod saved_feeds_pref_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 Saved;
type Pinned;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Saved = Unset;
type Pinned = Unset;
}
pub struct SetSaved<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSaved<St> {}
impl<St: State> State for SetSaved<St> {
type Saved = Set<members::saved>;
type Pinned = St::Pinned;
}
pub struct SetPinned<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPinned<St> {}
impl<St: State> State for SetPinned<St> {
type Saved = St::Saved;
type Pinned = Set<members::pinned>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct saved(());
pub struct pinned(());
}
}
pub struct SavedFeedsPrefBuilder<S: BosStr, St: saved_feeds_pref_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<AtUri<S>>>, Option<Vec<AtUri<S>>>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SavedFeedsPref<S> {
pub fn new() -> SavedFeedsPrefBuilder<S, saved_feeds_pref_state::Empty> {
SavedFeedsPrefBuilder::new()
}
}
impl<S: BosStr> SavedFeedsPrefBuilder<S, saved_feeds_pref_state::Empty> {
pub fn new() -> Self {
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedsPrefBuilder<S, St>
where
St: saved_feeds_pref_state::State,
St::Pinned: saved_feeds_pref_state::IsUnset,
{
pub fn pinned(
mut self,
value: impl Into<Vec<AtUri<S>>>,
) -> SavedFeedsPrefBuilder<S, saved_feeds_pref_state::SetPinned<St>> {
self._fields.0 = Option::Some(value.into());
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedsPrefBuilder<S, St>
where
St: saved_feeds_pref_state::State,
St::Saved: saved_feeds_pref_state::IsUnset,
{
pub fn saved(
mut self,
value: impl Into<Vec<AtUri<S>>>,
) -> SavedFeedsPrefBuilder<S, saved_feeds_pref_state::SetSaved<St>> {
self._fields.1 = Option::Some(value.into());
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: saved_feeds_pref_state::State> SavedFeedsPrefBuilder<S, St> {
pub fn timeline_index(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_timeline_index(mut self, value: Option<i64>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> SavedFeedsPrefBuilder<S, St>
where
St: saved_feeds_pref_state::State,
St::Saved: saved_feeds_pref_state::IsSet,
St::Pinned: saved_feeds_pref_state::IsSet,
{
pub fn build(self) -> SavedFeedsPref<S> {
SavedFeedsPref {
pinned: self._fields.0.unwrap(),
saved: self._fields.1.unwrap(),
timeline_index: self._fields.2,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SavedFeedsPref<S> {
SavedFeedsPref {
pinned: self._fields.0.unwrap(),
saved: self._fields.1.unwrap(),
timeline_index: self._fields.2,
extra_data: Some(extra_data),
}
}
}
pub mod saved_feeds_pref_v2_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 Items;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Items = Unset;
}
pub struct SetItems<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetItems<St> {}
impl<St: State> State for SetItems<St> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct SavedFeedsPrefV2Builder<S: BosStr, St: saved_feeds_pref_v2_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<actor::SavedFeed<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SavedFeedsPrefV2<S> {
pub fn new() -> SavedFeedsPrefV2Builder<S, saved_feeds_pref_v2_state::Empty> {
SavedFeedsPrefV2Builder::new()
}
}
impl<S: BosStr> SavedFeedsPrefV2Builder<S, saved_feeds_pref_v2_state::Empty> {
pub fn new() -> Self {
SavedFeedsPrefV2Builder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedsPrefV2Builder<S, St>
where
St: saved_feeds_pref_v2_state::State,
St::Items: saved_feeds_pref_v2_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<actor::SavedFeed<S>>>,
) -> SavedFeedsPrefV2Builder<S, saved_feeds_pref_v2_state::SetItems<St>> {
self._fields.0 = Option::Some(value.into());
SavedFeedsPrefV2Builder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SavedFeedsPrefV2Builder<S, St>
where
St: saved_feeds_pref_v2_state::State,
St::Items: saved_feeds_pref_v2_state::IsSet,
{
pub fn build(self) -> SavedFeedsPrefV2<S> {
SavedFeedsPrefV2 {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SavedFeedsPrefV2<S> {
SavedFeedsPrefV2 {
items: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod status_view_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 Record;
type Status;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Record = Unset;
type Status = Unset;
}
pub struct SetRecord<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRecord<St> {}
impl<St: State> State for SetRecord<St> {
type Record = Set<members::record>;
type Status = St::Status;
}
pub struct SetStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStatus<St> {}
impl<St: State> State for SetStatus<St> {
type Record = St::Record;
type Status = Set<members::status>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct record(());
pub struct status(());
}
}
pub struct StatusViewBuilder<S: BosStr, St: status_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Cid<S>>,
Option<View<S>>,
Option<Datetime>,
Option<bool>,
Option<bool>,
Option<Data<S>>,
Option<StatusViewStatus<S>>,
Option<AtUri<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> StatusView<S> {
pub fn new() -> StatusViewBuilder<S, status_view_state::Empty> {
StatusViewBuilder::new()
}
}
impl<S: BosStr> StatusViewBuilder<S, status_view_state::Empty> {
pub fn new() -> Self {
StatusViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn cid(mut self, value: impl Into<Option<Cid<S>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cid(mut self, value: Option<Cid<S>>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn embed(mut self, value: impl Into<Option<View<S>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_embed(mut self, value: Option<View<S>>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn expires_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_expires_at(mut self, value: Option<Datetime>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn is_active(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_is_active(mut self, value: Option<bool>) -> Self {
self._fields.3 = value;
self
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn is_disabled(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_is_disabled(mut self, value: Option<bool>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St> StatusViewBuilder<S, St>
where
St: status_view_state::State,
St::Record: status_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<Data<S>>,
) -> StatusViewBuilder<S, status_view_state::SetRecord<St>> {
self._fields.5 = Option::Some(value.into());
StatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> StatusViewBuilder<S, St>
where
St: status_view_state::State,
St::Status: status_view_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<StatusViewStatus<S>>,
) -> StatusViewBuilder<S, status_view_state::SetStatus<St>> {
self._fields.6 = Option::Some(value.into());
StatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: status_view_state::State> StatusViewBuilder<S, St> {
pub fn uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_uri(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> StatusViewBuilder<S, St>
where
St: status_view_state::State,
St::Record: status_view_state::IsSet,
St::Status: status_view_state::IsSet,
{
pub fn build(self) -> StatusView<S> {
StatusView {
cid: self._fields.0,
embed: self._fields.1,
expires_at: self._fields.2,
is_active: self._fields.3,
is_disabled: self._fields.4,
record: self._fields.5.unwrap(),
status: self._fields.6.unwrap(),
uri: self._fields.7,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> StatusView<S> {
StatusView {
cid: self._fields.0,
embed: self._fields.1,
expires_at: self._fields.2,
is_active: self._fields.3,
is_disabled: self._fields.4,
record: self._fields.5.unwrap(),
status: self._fields.6.unwrap(),
uri: self._fields.7,
extra_data: Some(extra_data),
}
}
}
fn _default_verification_prefs_hide_badges() -> Option<bool> {
Some(false)
}
impl Default for VerificationPrefs {
fn default() -> Self {
Self {
hide_badges: Some(false),
extra_data: Default::default(),
}
}
}
pub mod verification_state_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 Verifications;
type VerifiedStatus;
type TrustedVerifierStatus;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Verifications = Unset;
type VerifiedStatus = Unset;
type TrustedVerifierStatus = Unset;
}
pub struct SetVerifications<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetVerifications<St> {}
impl<St: State> State for SetVerifications<St> {
type Verifications = Set<members::verifications>;
type VerifiedStatus = St::VerifiedStatus;
type TrustedVerifierStatus = St::TrustedVerifierStatus;
}
pub struct SetVerifiedStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetVerifiedStatus<St> {}
impl<St: State> State for SetVerifiedStatus<St> {
type Verifications = St::Verifications;
type VerifiedStatus = Set<members::verified_status>;
type TrustedVerifierStatus = St::TrustedVerifierStatus;
}
pub struct SetTrustedVerifierStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTrustedVerifierStatus<St> {}
impl<St: State> State for SetTrustedVerifierStatus<St> {
type Verifications = St::Verifications;
type VerifiedStatus = St::VerifiedStatus;
type TrustedVerifierStatus = Set<members::trusted_verifier_status>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct verifications(());
pub struct verified_status(());
pub struct trusted_verifier_status(());
}
}
pub struct VerificationStateBuilder<S: BosStr, St: verification_state_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<VerificationStateTrustedVerifierStatus<S>>,
Option<Vec<actor::VerificationView<S>>>,
Option<VerificationStateVerifiedStatus<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> VerificationState<S> {
pub fn new() -> VerificationStateBuilder<S, verification_state_state::Empty> {
VerificationStateBuilder::new()
}
}
impl<S: BosStr> VerificationStateBuilder<S, verification_state_state::Empty> {
pub fn new() -> Self {
VerificationStateBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationStateBuilder<S, St>
where
St: verification_state_state::State,
St::TrustedVerifierStatus: verification_state_state::IsUnset,
{
pub fn trusted_verifier_status(
mut self,
value: impl Into<VerificationStateTrustedVerifierStatus<S>>,
) -> VerificationStateBuilder<
S,
verification_state_state::SetTrustedVerifierStatus<St>,
> {
self._fields.0 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationStateBuilder<S, St>
where
St: verification_state_state::State,
St::Verifications: verification_state_state::IsUnset,
{
pub fn verifications(
mut self,
value: impl Into<Vec<actor::VerificationView<S>>>,
) -> VerificationStateBuilder<S, verification_state_state::SetVerifications<St>> {
self._fields.1 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationStateBuilder<S, St>
where
St: verification_state_state::State,
St::VerifiedStatus: verification_state_state::IsUnset,
{
pub fn verified_status(
mut self,
value: impl Into<VerificationStateVerifiedStatus<S>>,
) -> VerificationStateBuilder<S, verification_state_state::SetVerifiedStatus<St>> {
self._fields.2 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationStateBuilder<S, St>
where
St: verification_state_state::State,
St::Verifications: verification_state_state::IsSet,
St::VerifiedStatus: verification_state_state::IsSet,
St::TrustedVerifierStatus: verification_state_state::IsSet,
{
pub fn build(self) -> VerificationState<S> {
VerificationState {
trusted_verifier_status: self._fields.0.unwrap(),
verifications: self._fields.1.unwrap(),
verified_status: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> VerificationState<S> {
VerificationState {
trusted_verifier_status: self._fields.0.unwrap(),
verifications: self._fields.1.unwrap(),
verified_status: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod verification_view_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 Uri;
type IsValid;
type CreatedAt;
type Issuer;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type IsValid = Unset;
type CreatedAt = Unset;
type Issuer = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
type IsValid = St::IsValid;
type CreatedAt = St::CreatedAt;
type Issuer = St::Issuer;
}
pub struct SetIsValid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIsValid<St> {}
impl<St: State> State for SetIsValid<St> {
type Uri = St::Uri;
type IsValid = Set<members::is_valid>;
type CreatedAt = St::CreatedAt;
type Issuer = St::Issuer;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Uri = St::Uri;
type IsValid = St::IsValid;
type CreatedAt = Set<members::created_at>;
type Issuer = St::Issuer;
}
pub struct SetIssuer<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIssuer<St> {}
impl<St: State> State for SetIssuer<St> {
type Uri = St::Uri;
type IsValid = St::IsValid;
type CreatedAt = St::CreatedAt;
type Issuer = Set<members::issuer>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct is_valid(());
pub struct created_at(());
pub struct issuer(());
}
}
pub struct VerificationViewBuilder<S: BosStr, St: verification_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Datetime>, Option<bool>, Option<Did<S>>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> VerificationView<S> {
pub fn new() -> VerificationViewBuilder<S, verification_view_state::Empty> {
VerificationViewBuilder::new()
}
}
impl<S: BosStr> VerificationViewBuilder<S, verification_view_state::Empty> {
pub fn new() -> Self {
VerificationViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationViewBuilder<S, St>
where
St: verification_view_state::State,
St::CreatedAt: verification_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> VerificationViewBuilder<S, verification_view_state::SetCreatedAt<St>> {
self._fields.0 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationViewBuilder<S, St>
where
St: verification_view_state::State,
St::IsValid: verification_view_state::IsUnset,
{
pub fn is_valid(
mut self,
value: impl Into<bool>,
) -> VerificationViewBuilder<S, verification_view_state::SetIsValid<St>> {
self._fields.1 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationViewBuilder<S, St>
where
St: verification_view_state::State,
St::Issuer: verification_view_state::IsUnset,
{
pub fn issuer(
mut self,
value: impl Into<Did<S>>,
) -> VerificationViewBuilder<S, verification_view_state::SetIssuer<St>> {
self._fields.2 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationViewBuilder<S, St>
where
St: verification_view_state::State,
St::Uri: verification_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> VerificationViewBuilder<S, verification_view_state::SetUri<St>> {
self._fields.3 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> VerificationViewBuilder<S, St>
where
St: verification_view_state::State,
St::Uri: verification_view_state::IsSet,
St::IsValid: verification_view_state::IsSet,
St::CreatedAt: verification_view_state::IsSet,
St::Issuer: verification_view_state::IsSet,
{
pub fn build(self) -> VerificationView<S> {
VerificationView {
created_at: self._fields.0.unwrap(),
is_valid: self._fields.1.unwrap(),
issuer: self._fields.2.unwrap(),
uri: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> VerificationView<S> {
VerificationView {
created_at: self._fields.0.unwrap(),
is_valid: self._fields.1.unwrap(),
issuer: self._fields.2.unwrap(),
uri: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}