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;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::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;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AdultContentPref<'a> {
#[serde(default = "_default_adult_content_pref_enabled")]
pub enabled: bool,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct BskyAppProgressGuide<'a> {
#[serde(borrow)]
pub guide: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct BskyAppStatePref<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub active_progress_guide: Option<actor::BskyAppProgressGuide<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub nuxs: Option<Vec<actor::Nux<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub queued_nudges: Option<Vec<CowStr<'a>>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ContentLabelPref<'a> {
#[serde(borrow)]
pub label: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labeler_did: Option<Did<'a>>,
#[serde(borrow)]
pub visibility: ContentLabelPrefVisibility<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ContentLabelPrefVisibility<'a> {
Ignore,
Show,
Warn,
Hide,
Other(CowStr<'a>),
}
impl<'a> ContentLabelPrefVisibility<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for ContentLabelPrefVisibility<'a> {
fn from(s: &'a str) -> Self {
match s {
"ignore" => Self::Ignore,
"show" => Self::Show,
"warn" => Self::Warn,
"hide" => Self::Hide,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ContentLabelPrefVisibility<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"ignore" => Self::Ignore,
"show" => Self::Show,
"warn" => Self::Warn,
"hide" => Self::Hide,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ContentLabelPrefVisibility<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ContentLabelPrefVisibility<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ContentLabelPrefVisibility<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ContentLabelPrefVisibility<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ContentLabelPrefVisibility<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ContentLabelPrefVisibility<'_> {
type Output = ContentLabelPrefVisibility<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct DeclaredAgePref<'a> {
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct FeedViewPref<'a> {
#[serde(borrow)]
pub feed: CowStr<'a>,
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct HiddenPostsPref<'a> {
#[serde(borrow)]
pub items: Vec<AtUri<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct InterestsPref<'a> {
#[serde(borrow)]
pub tags: Vec<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct KnownFollowers<'a> {
pub count: i64,
#[serde(borrow)]
pub followers: Vec<actor::ProfileViewBasic<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LabelerPrefItem<'a> {
#[serde(borrow)]
pub did: Did<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LabelersPref<'a> {
#[serde(borrow)]
pub labelers: Vec<actor::LabelerPrefItem<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct LiveEventPreferences<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub hidden_feed_ids: Option<Vec<CowStr<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default = "_default_live_event_preferences_hide_all_feeds")]
pub hide_all_feeds: Option<bool>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct MutedWord<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub actor_target: Option<MutedWordActorTarget<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub id: Option<CowStr<'a>>,
#[serde(borrow)]
pub targets: Vec<actor::MutedWordTarget<'a>>,
#[serde(borrow)]
pub value: CowStr<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum MutedWordActorTarget<'a> {
All,
ExcludeFollowing,
Other(CowStr<'a>),
}
impl<'a> MutedWordActorTarget<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::ExcludeFollowing => "exclude-following",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for MutedWordActorTarget<'a> {
fn from(s: &'a str) -> Self {
match s {
"all" => Self::All,
"exclude-following" => Self::ExcludeFollowing,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for MutedWordActorTarget<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"all" => Self::All,
"exclude-following" => Self::ExcludeFollowing,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for MutedWordActorTarget<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for MutedWordActorTarget<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for MutedWordActorTarget<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for MutedWordActorTarget<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for MutedWordActorTarget<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for MutedWordActorTarget<'_> {
type Output = MutedWordActorTarget<'static>;
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<'a> {
Content,
Tag,
Other(CowStr<'a>),
}
impl<'a> MutedWordTarget<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Content => "content",
Self::Tag => "tag",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for MutedWordTarget<'a> {
fn from(s: &'a str) -> Self {
match s {
"content" => Self::Content,
"tag" => Self::Tag,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for MutedWordTarget<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"content" => Self::Content,
"tag" => Self::Tag,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> AsRef<str> for MutedWordTarget<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> core::fmt::Display for MutedWordTarget<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> serde::Serialize for MutedWordTarget<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for MutedWordTarget<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl jacquard_common::IntoStatic for MutedWordTarget<'_> {
type Output = MutedWordTarget<'static>;
fn into_static(self) -> Self::Output {
match self {
MutedWordTarget::Content => MutedWordTarget::Content,
MutedWordTarget::Tag => MutedWordTarget::Tag,
MutedWordTarget::Other(v) => MutedWordTarget::Other(v.into_static()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct MutedWordsPref<'a> {
#[serde(borrow)]
pub items: Vec<actor::MutedWord<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Nux<'a> {
#[serde(default = "_default_nux_completed")]
pub completed: bool,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub data: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub expires_at: Option<Datetime>,
#[serde(borrow)]
pub id: CowStr<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct PersonalDetailsPref<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub birth_date: Option<Datetime>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct PostInteractionSettingsPref<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub postgate_embedding_rules: Option<Vec<DisableRule<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub threadgate_allow_rules: Option<
Vec<PostInteractionSettingsPrefThreadgateAllowRulesItem<'a>>,
>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
pub enum PostInteractionSettingsPrefThreadgateAllowRulesItem<'a> {
#[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
ThreadgateMentionRule(Box<MentionRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#followerRule")]
ThreadgateFollowerRule(Box<FollowerRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#followingRule")]
ThreadgateFollowingRule(Box<FollowingRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#listRule")]
ThreadgateListRule(Box<ListRule<'a>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "'de: 'a"))]
pub enum PreferencesItem<'a> {
#[serde(rename = "app.bsky.actor.defs#adultContentPref")]
AdultContentPref(Box<actor::AdultContentPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#contentLabelPref")]
ContentLabelPref(Box<actor::ContentLabelPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#savedFeedsPref")]
SavedFeedsPref(Box<actor::SavedFeedsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#savedFeedsPrefV2")]
SavedFeedsPrefV2(Box<actor::SavedFeedsPrefV2<'a>>),
#[serde(rename = "app.bsky.actor.defs#personalDetailsPref")]
PersonalDetailsPref(Box<actor::PersonalDetailsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#declaredAgePref")]
DeclaredAgePref(Box<actor::DeclaredAgePref<'a>>),
#[serde(rename = "app.bsky.actor.defs#feedViewPref")]
FeedViewPref(Box<actor::FeedViewPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#threadViewPref")]
ThreadViewPref(Box<actor::ThreadViewPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#interestsPref")]
InterestsPref(Box<actor::InterestsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#mutedWordsPref")]
MutedWordsPref(Box<actor::MutedWordsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#hiddenPostsPref")]
HiddenPostsPref(Box<actor::HiddenPostsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#bskyAppStatePref")]
BskyAppStatePref(Box<actor::BskyAppStatePref<'a>>),
#[serde(rename = "app.bsky.actor.defs#labelersPref")]
LabelersPref(Box<actor::LabelersPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#postInteractionSettingsPref")]
PostInteractionSettingsPref(Box<actor::PostInteractionSettingsPref<'a>>),
#[serde(rename = "app.bsky.actor.defs#verificationPrefs")]
VerificationPrefs(Box<actor::VerificationPrefs<'a>>),
#[serde(rename = "app.bsky.actor.defs#liveEventPreferences")]
LiveEventPreferences(Box<actor::LiveEventPreferences<'a>>),
}
pub type Preferences<'a> = Vec<PreferencesItem<'a>>;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileAssociated<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub activity_subscription: Option<actor::ProfileAssociatedActivitySubscription<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub chat: Option<actor::ProfileAssociatedChat<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub feedgens: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub germ: Option<actor::ProfileAssociatedGerm<'a>>,
#[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>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileAssociatedActivitySubscription<'a> {
#[serde(borrow)]
pub allow_subscriptions: ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
Followers,
Mutuals,
None,
Other(CowStr<'a>),
}
impl<'a> ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Followers => "followers",
Self::Mutuals => "mutuals",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn from(s: &'a str) -> Self {
match s {
"followers" => Self::Followers,
"mutuals" => Self::Mutuals,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"followers" => Self::Followers,
"mutuals" => Self::Mutuals,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de>
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic
for ProfileAssociatedActivitySubscriptionAllowSubscriptions<'_> {
type Output = ProfileAssociatedActivitySubscriptionAllowSubscriptions<'static>;
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(),
)
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ProfileAssociatedChat<'a> {
#[serde(borrow)]
pub allow_incoming: ProfileAssociatedChatAllowIncoming<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedChatAllowIncoming<'a> {
All,
None,
Following,
Other(CowStr<'a>),
}
impl<'a> ProfileAssociatedChatAllowIncoming<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::All => "all",
Self::None => "none",
Self::Following => "following",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ProfileAssociatedChatAllowIncoming<'a> {
fn from(s: &'a str) -> Self {
match s {
"all" => Self::All,
"none" => Self::None,
"following" => Self::Following,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ProfileAssociatedChatAllowIncoming<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"all" => Self::All,
"none" => Self::None,
"following" => Self::Following,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ProfileAssociatedChatAllowIncoming<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ProfileAssociatedChatAllowIncoming<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ProfileAssociatedChatAllowIncoming<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ProfileAssociatedChatAllowIncoming<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ProfileAssociatedChatAllowIncoming<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ProfileAssociatedChatAllowIncoming<'_> {
type Output = ProfileAssociatedChatAllowIncoming<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileAssociatedGerm<'a> {
#[serde(borrow)]
pub message_me_url: UriValue<'a>,
#[serde(borrow)]
pub show_button_to: ProfileAssociatedGermShowButtonTo<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ProfileAssociatedGermShowButtonTo<'a> {
UsersIFollow,
Everyone,
Other(CowStr<'a>),
}
impl<'a> ProfileAssociatedGermShowButtonTo<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::UsersIFollow => "usersIFollow",
Self::Everyone => "everyone",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for ProfileAssociatedGermShowButtonTo<'a> {
fn from(s: &'a str) -> Self {
match s {
"usersIFollow" => Self::UsersIFollow,
"everyone" => Self::Everyone,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ProfileAssociatedGermShowButtonTo<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"usersIFollow" => Self::UsersIFollow,
"everyone" => Self::Everyone,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ProfileAssociatedGermShowButtonTo<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ProfileAssociatedGermShowButtonTo<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ProfileAssociatedGermShowButtonTo<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ProfileAssociatedGermShowButtonTo<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ProfileAssociatedGermShowButtonTo<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ProfileAssociatedGermShowButtonTo<'_> {
type Output = ProfileAssociatedGermShowButtonTo<'static>;
fn into_static(self) -> Self::Output {
match self {
ProfileAssociatedGermShowButtonTo::UsersIFollow => {
ProfileAssociatedGermShowButtonTo::UsersIFollow
}
ProfileAssociatedGermShowButtonTo::Everyone => {
ProfileAssociatedGermShowButtonTo::Everyone
}
ProfileAssociatedGermShowButtonTo::Other(v) => {
ProfileAssociatedGermShowButtonTo::Other(v.into_static())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub associated: Option<actor::ProfileAssociated<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub debug: Option<Data<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pronouns: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<actor::StatusView<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub verification: Option<actor::VerificationState<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub viewer: Option<actor::ViewerState<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileViewBasic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub associated: Option<actor::ProfileAssociated<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub debug: Option<Data<'a>>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pronouns: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<actor::StatusView<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub verification: Option<actor::VerificationState<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub viewer: Option<actor::ViewerState<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ProfileViewDetailed<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub associated: Option<actor::ProfileAssociated<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub avatar: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub banner: Option<UriValue<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub created_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub debug: Option<Data<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(borrow)]
pub did: Did<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub followers_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub follows_count: Option<i64>,
#[serde(borrow)]
pub handle: Handle<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
pub indexed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub joined_via_starter_pack: Option<StarterPackViewBasic<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<Vec<Label<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pinned_post: Option<StrongRef<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub posts_count: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub pronouns: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<actor::StatusView<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub verification: Option<actor::VerificationState<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub viewer: Option<actor::ViewerState<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub website: Option<UriValue<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SavedFeed<'a> {
#[serde(borrow)]
pub id: CowStr<'a>,
pub pinned: bool,
#[serde(borrow)]
pub r#type: SavedFeedType<'a>,
#[serde(borrow)]
pub value: CowStr<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SavedFeedType<'a> {
Feed,
List,
Timeline,
Other(CowStr<'a>),
}
impl<'a> SavedFeedType<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Feed => "feed",
Self::List => "list",
Self::Timeline => "timeline",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for SavedFeedType<'a> {
fn from(s: &'a str) -> Self {
match s {
"feed" => Self::Feed,
"list" => Self::List,
"timeline" => Self::Timeline,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for SavedFeedType<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"feed" => Self::Feed,
"list" => Self::List,
"timeline" => Self::Timeline,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for SavedFeedType<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for SavedFeedType<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for SavedFeedType<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for SavedFeedType<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for SavedFeedType<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for SavedFeedType<'_> {
type Output = SavedFeedType<'static>;
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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SavedFeedsPref<'a> {
#[serde(borrow)]
pub pinned: Vec<AtUri<'a>>,
#[serde(borrow)]
pub saved: Vec<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub timeline_index: Option<i64>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SavedFeedsPrefV2<'a> {
#[serde(borrow)]
pub items: Vec<actor::SavedFeed<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct StatusView<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cid: Option<Cid<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub embed: Option<View<'a>>,
#[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>,
#[serde(borrow)]
pub record: Data<'a>,
#[serde(borrow)]
pub status: StatusViewStatus<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub uri: Option<AtUri<'a>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum StatusViewStatus<'a> {
Live,
Other(CowStr<'a>),
}
impl<'a> StatusViewStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Live => "app.bsky.actor.status#live",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for StatusViewStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"app.bsky.actor.status#live" => Self::Live,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for StatusViewStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"app.bsky.actor.status#live" => Self::Live,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for StatusViewStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for StatusViewStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for StatusViewStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for StatusViewStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for StatusViewStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for StatusViewStatus<'_> {
type Output = StatusViewStatus<'static>;
fn into_static(self) -> Self::Output {
match self {
StatusViewStatus::Live => StatusViewStatus::Live,
StatusViewStatus::Other(v) => StatusViewStatus::Other(v.into_static()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadViewPref<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub sort: Option<ThreadViewPrefSort<'a>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum ThreadViewPrefSort<'a> {
Oldest,
Newest,
MostLikes,
Random,
Hotness,
Other(CowStr<'a>),
}
impl<'a> ThreadViewPrefSort<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for ThreadViewPrefSort<'a> {
fn from(s: &'a str) -> Self {
match s {
"oldest" => Self::Oldest,
"newest" => Self::Newest,
"most-likes" => Self::MostLikes,
"random" => Self::Random,
"hotness" => Self::Hotness,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for ThreadViewPrefSort<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"oldest" => Self::Oldest,
"newest" => Self::Newest,
"most-likes" => Self::MostLikes,
"random" => Self::Random,
"hotness" => Self::Hotness,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for ThreadViewPrefSort<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for ThreadViewPrefSort<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for ThreadViewPrefSort<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for ThreadViewPrefSort<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for ThreadViewPrefSort<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for ThreadViewPrefSort<'_> {
type Output = ThreadViewPrefSort<'static>;
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()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct VerificationPrefs<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default = "_default_verification_prefs_hide_badges")]
pub hide_badges: Option<bool>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct VerificationState<'a> {
#[serde(borrow)]
pub trusted_verifier_status: VerificationStateTrustedVerifierStatus<'a>,
#[serde(borrow)]
pub verifications: Vec<actor::VerificationView<'a>>,
#[serde(borrow)]
pub verified_status: VerificationStateVerifiedStatus<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum VerificationStateTrustedVerifierStatus<'a> {
Valid,
Invalid,
None,
Other(CowStr<'a>),
}
impl<'a> VerificationStateTrustedVerifierStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Valid => "valid",
Self::Invalid => "invalid",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for VerificationStateTrustedVerifierStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for VerificationStateTrustedVerifierStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for VerificationStateTrustedVerifierStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for VerificationStateTrustedVerifierStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for VerificationStateTrustedVerifierStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for VerificationStateTrustedVerifierStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for VerificationStateTrustedVerifierStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for VerificationStateTrustedVerifierStatus<'_> {
type Output = VerificationStateTrustedVerifierStatus<'static>;
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<'a> {
Valid,
Invalid,
None,
Other(CowStr<'a>),
}
impl<'a> VerificationStateVerifiedStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Valid => "valid",
Self::Invalid => "invalid",
Self::None => "none",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for VerificationStateVerifiedStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for VerificationStateVerifiedStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"valid" => Self::Valid,
"invalid" => Self::Invalid,
"none" => Self::None,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for VerificationStateVerifiedStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for VerificationStateVerifiedStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for VerificationStateVerifiedStatus<'a> {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, 'a> serde::Deserialize<'de> for VerificationStateVerifiedStatus<'a>
where
'de: 'a,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = <&'de str>::deserialize(deserializer)?;
Ok(Self::from(s))
}
}
impl<'a> Default for VerificationStateVerifiedStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for VerificationStateVerifiedStatus<'_> {
type Output = VerificationStateVerifiedStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct VerificationView<'a> {
pub created_at: Datetime,
pub is_valid: bool,
#[serde(borrow)]
pub issuer: Did<'a>,
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ViewerState<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub activity_subscription: Option<ActivitySubscription<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub blocked_by: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub blocking: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub blocking_by_list: Option<ListViewBasic<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub followed_by: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub following: Option<AtUri<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub known_followers: Option<actor::KnownFollowers<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub muted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub muted_by_list: Option<ListViewBasic<'a>>,
}
impl<'a> LexiconSchema for AdultContentPref<'a> {
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<'a> LexiconSchema for BskyAppProgressGuide<'a> {
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<'a> LexiconSchema for BskyAppStatePref<'a> {
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<'a> LexiconSchema for ContentLabelPref<'a> {
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<'a> LexiconSchema for DeclaredAgePref<'a> {
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<'a> LexiconSchema for FeedViewPref<'a> {
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<'a> LexiconSchema for HiddenPostsPref<'a> {
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<'a> LexiconSchema for InterestsPref<'a> {
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<'a> LexiconSchema for KnownFollowers<'a> {
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<'a> LexiconSchema for LabelerPrefItem<'a> {
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<'a> LexiconSchema for LabelersPref<'a> {
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<'a> LexiconSchema for LiveEventPreferences<'a> {
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<'a> LexiconSchema for MutedWord<'a> {
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<'a> LexiconSchema for MutedWordsPref<'a> {
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<'a> LexiconSchema for Nux<'a> {
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<'a> LexiconSchema for PersonalDetailsPref<'a> {
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<'a> LexiconSchema for PostInteractionSettingsPref<'a> {
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<'a> LexiconSchema for ProfileAssociated<'a> {
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<'a> LexiconSchema for ProfileAssociatedActivitySubscription<'a> {
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<'a> LexiconSchema for ProfileAssociatedChat<'a> {
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<'a> LexiconSchema for ProfileAssociatedGerm<'a> {
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<'a> LexiconSchema for ProfileView<'a> {
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<'a> LexiconSchema for ProfileViewBasic<'a> {
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<'a> LexiconSchema for ProfileViewDetailed<'a> {
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<'a> LexiconSchema for SavedFeed<'a> {
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<'a> LexiconSchema for SavedFeedsPref<'a> {
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<'a> LexiconSchema for SavedFeedsPrefV2<'a> {
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<'a> LexiconSchema for StatusView<'a> {
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<'a> LexiconSchema for ThreadViewPref<'a> {
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<'a> LexiconSchema for VerificationPrefs<'a> {
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<'a> LexiconSchema for VerificationState<'a> {
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<'a> LexiconSchema for VerificationView<'a> {
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<'a> LexiconSchema for ViewerState<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetEnabled<S> {}
impl<S: State> State for SetEnabled<S> {
type Enabled = Set<members::enabled>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct enabled(());
}
}
pub struct AdultContentPrefBuilder<'a, S: adult_content_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<bool>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> AdultContentPref<'a> {
pub fn new() -> AdultContentPrefBuilder<'a, adult_content_pref_state::Empty> {
AdultContentPrefBuilder::new()
}
}
impl<'a> AdultContentPrefBuilder<'a, adult_content_pref_state::Empty> {
pub fn new() -> Self {
AdultContentPrefBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> AdultContentPrefBuilder<'a, S>
where
S: adult_content_pref_state::State,
S::Enabled: adult_content_pref_state::IsUnset,
{
pub fn enabled(
mut self,
value: impl Into<bool>,
) -> AdultContentPrefBuilder<'a, adult_content_pref_state::SetEnabled<S>> {
self._fields.0 = Option::Some(value.into());
AdultContentPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> AdultContentPrefBuilder<'a, S>
where
S: adult_content_pref_state::State,
S::Enabled: adult_content_pref_state::IsSet,
{
pub fn build(self) -> AdultContentPref<'a> {
AdultContentPref {
enabled: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> AdultContentPref<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetItems<S> {}
impl<S: State> State for SetItems<S> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct HiddenPostsPrefBuilder<'a, S: hidden_posts_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<AtUri<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> HiddenPostsPref<'a> {
pub fn new() -> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::Empty> {
HiddenPostsPrefBuilder::new()
}
}
impl<'a> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::Empty> {
pub fn new() -> Self {
HiddenPostsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> HiddenPostsPrefBuilder<'a, S>
where
S: hidden_posts_pref_state::State,
S::Items: hidden_posts_pref_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<AtUri<'a>>>,
) -> HiddenPostsPrefBuilder<'a, hidden_posts_pref_state::SetItems<S>> {
self._fields.0 = Option::Some(value.into());
HiddenPostsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> HiddenPostsPrefBuilder<'a, S>
where
S: hidden_posts_pref_state::State,
S::Items: hidden_posts_pref_state::IsSet,
{
pub fn build(self) -> HiddenPostsPref<'a> {
HiddenPostsPref {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> HiddenPostsPref<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTags<S> {}
impl<S: State> State for SetTags<S> {
type Tags = Set<members::tags>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct tags(());
}
}
pub struct InterestsPrefBuilder<'a, S: interests_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<CowStr<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> InterestsPref<'a> {
pub fn new() -> InterestsPrefBuilder<'a, interests_pref_state::Empty> {
InterestsPrefBuilder::new()
}
}
impl<'a> InterestsPrefBuilder<'a, interests_pref_state::Empty> {
pub fn new() -> Self {
InterestsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> InterestsPrefBuilder<'a, S>
where
S: interests_pref_state::State,
S::Tags: interests_pref_state::IsUnset,
{
pub fn tags(
mut self,
value: impl Into<Vec<CowStr<'a>>>,
) -> InterestsPrefBuilder<'a, interests_pref_state::SetTags<S>> {
self._fields.0 = Option::Some(value.into());
InterestsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> InterestsPrefBuilder<'a, S>
where
S: interests_pref_state::State,
S::Tags: interests_pref_state::IsSet,
{
pub fn build(self) -> InterestsPref<'a> {
InterestsPref {
tags: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> InterestsPref<'a> {
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 Count;
type Followers;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Count = Unset;
type Followers = Unset;
}
pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCount<S> {}
impl<S: State> State for SetCount<S> {
type Count = Set<members::count>;
type Followers = S::Followers;
}
pub struct SetFollowers<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetFollowers<S> {}
impl<S: State> State for SetFollowers<S> {
type Count = S::Count;
type Followers = Set<members::followers>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct count(());
pub struct followers(());
}
}
pub struct KnownFollowersBuilder<'a, S: known_followers_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<i64>, Option<Vec<actor::ProfileViewBasic<'a>>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> KnownFollowers<'a> {
pub fn new() -> KnownFollowersBuilder<'a, known_followers_state::Empty> {
KnownFollowersBuilder::new()
}
}
impl<'a> KnownFollowersBuilder<'a, known_followers_state::Empty> {
pub fn new() -> Self {
KnownFollowersBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> KnownFollowersBuilder<'a, S>
where
S: known_followers_state::State,
S::Count: known_followers_state::IsUnset,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> KnownFollowersBuilder<'a, known_followers_state::SetCount<S>> {
self._fields.0 = Option::Some(value.into());
KnownFollowersBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> KnownFollowersBuilder<'a, S>
where
S: known_followers_state::State,
S::Followers: known_followers_state::IsUnset,
{
pub fn followers(
mut self,
value: impl Into<Vec<actor::ProfileViewBasic<'a>>>,
) -> KnownFollowersBuilder<'a, known_followers_state::SetFollowers<S>> {
self._fields.1 = Option::Some(value.into());
KnownFollowersBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> KnownFollowersBuilder<'a, S>
where
S: known_followers_state::State,
S::Count: known_followers_state::IsSet,
S::Followers: known_followers_state::IsSet,
{
pub fn build(self) -> KnownFollowers<'a> {
KnownFollowers {
count: self._fields.0.unwrap(),
followers: self._fields.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> KnownFollowers<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct LabelerPrefItemBuilder<'a, S: labeler_pref_item_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Did<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> LabelerPrefItem<'a> {
pub fn new() -> LabelerPrefItemBuilder<'a, labeler_pref_item_state::Empty> {
LabelerPrefItemBuilder::new()
}
}
impl<'a> LabelerPrefItemBuilder<'a, labeler_pref_item_state::Empty> {
pub fn new() -> Self {
LabelerPrefItemBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> LabelerPrefItemBuilder<'a, S>
where
S: labeler_pref_item_state::State,
S::Did: labeler_pref_item_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> LabelerPrefItemBuilder<'a, labeler_pref_item_state::SetDid<S>> {
self._fields.0 = Option::Some(value.into());
LabelerPrefItemBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> LabelerPrefItemBuilder<'a, S>
where
S: labeler_pref_item_state::State,
S::Did: labeler_pref_item_state::IsSet,
{
pub fn build(self) -> LabelerPrefItem<'a> {
LabelerPrefItem {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> LabelerPrefItem<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLabelers<S> {}
impl<S: State> State for SetLabelers<S> {
type Labelers = Set<members::labelers>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct labelers(());
}
}
pub struct LabelersPrefBuilder<'a, S: labelers_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<actor::LabelerPrefItem<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> LabelersPref<'a> {
pub fn new() -> LabelersPrefBuilder<'a, labelers_pref_state::Empty> {
LabelersPrefBuilder::new()
}
}
impl<'a> LabelersPrefBuilder<'a, labelers_pref_state::Empty> {
pub fn new() -> Self {
LabelersPrefBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> LabelersPrefBuilder<'a, S>
where
S: labelers_pref_state::State,
S::Labelers: labelers_pref_state::IsUnset,
{
pub fn labelers(
mut self,
value: impl Into<Vec<actor::LabelerPrefItem<'a>>>,
) -> LabelersPrefBuilder<'a, labelers_pref_state::SetLabelers<S>> {
self._fields.0 = Option::Some(value.into());
LabelersPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> LabelersPrefBuilder<'a, S>
where
S: labelers_pref_state::State,
S::Labelers: labelers_pref_state::IsSet,
{
pub fn build(self) -> LabelersPref<'a> {
LabelersPref {
labelers: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> LabelersPref<'a> {
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 Targets;
type Value;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Targets = Unset;
type Value = Unset;
}
pub struct SetTargets<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTargets<S> {}
impl<S: State> State for SetTargets<S> {
type Targets = Set<members::targets>;
type Value = S::Value;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Targets = S::Targets;
type Value = Set<members::value>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct targets(());
pub struct value(());
}
}
pub struct MutedWordBuilder<'a, S: muted_word_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<MutedWordActorTarget<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<Vec<actor::MutedWordTarget<'a>>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> MutedWord<'a> {
pub fn new() -> MutedWordBuilder<'a, muted_word_state::Empty> {
MutedWordBuilder::new()
}
}
impl<'a> MutedWordBuilder<'a, muted_word_state::Empty> {
pub fn new() -> Self {
MutedWordBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: muted_word_state::State> MutedWordBuilder<'a, S> {
pub fn actor_target(
mut self,
value: impl Into<Option<MutedWordActorTarget<'a>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_actor_target(
mut self,
value: Option<MutedWordActorTarget<'a>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: muted_word_state::State> MutedWordBuilder<'a, S> {
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<'a, S: muted_word_state::State> MutedWordBuilder<'a, S> {
pub fn id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_id(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> MutedWordBuilder<'a, S>
where
S: muted_word_state::State,
S::Targets: muted_word_state::IsUnset,
{
pub fn targets(
mut self,
value: impl Into<Vec<actor::MutedWordTarget<'a>>>,
) -> MutedWordBuilder<'a, muted_word_state::SetTargets<S>> {
self._fields.3 = Option::Some(value.into());
MutedWordBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> MutedWordBuilder<'a, S>
where
S: muted_word_state::State,
S::Value: muted_word_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<CowStr<'a>>,
) -> MutedWordBuilder<'a, muted_word_state::SetValue<S>> {
self._fields.4 = Option::Some(value.into());
MutedWordBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> MutedWordBuilder<'a, S>
where
S: muted_word_state::State,
S::Targets: muted_word_state::IsSet,
S::Value: muted_word_state::IsSet,
{
pub fn build(self) -> MutedWord<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> MutedWord<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetItems<S> {}
impl<S: State> State for SetItems<S> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct MutedWordsPrefBuilder<'a, S: muted_words_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<actor::MutedWord<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> MutedWordsPref<'a> {
pub fn new() -> MutedWordsPrefBuilder<'a, muted_words_pref_state::Empty> {
MutedWordsPrefBuilder::new()
}
}
impl<'a> MutedWordsPrefBuilder<'a, muted_words_pref_state::Empty> {
pub fn new() -> Self {
MutedWordsPrefBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> MutedWordsPrefBuilder<'a, S>
where
S: muted_words_pref_state::State,
S::Items: muted_words_pref_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<actor::MutedWord<'a>>>,
) -> MutedWordsPrefBuilder<'a, muted_words_pref_state::SetItems<S>> {
self._fields.0 = Option::Some(value.into());
MutedWordsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> MutedWordsPrefBuilder<'a, S>
where
S: muted_words_pref_state::State,
S::Items: muted_words_pref_state::IsSet,
{
pub fn build(self) -> MutedWordsPref<'a> {
MutedWordsPref {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> MutedWordsPref<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Id = Set<members::id>;
type Completed = S::Completed;
}
pub struct SetCompleted<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCompleted<S> {}
impl<S: State> State for SetCompleted<S> {
type Id = S::Id;
type Completed = Set<members::completed>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct completed(());
}
}
pub struct NuxBuilder<'a, S: nux_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<bool>, Option<CowStr<'a>>, Option<Datetime>, Option<CowStr<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Nux<'a> {
pub fn new() -> NuxBuilder<'a, nux_state::Empty> {
NuxBuilder::new()
}
}
impl<'a> NuxBuilder<'a, nux_state::Empty> {
pub fn new() -> Self {
NuxBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> NuxBuilder<'a, S>
where
S: nux_state::State,
S::Completed: nux_state::IsUnset,
{
pub fn completed(
mut self,
value: impl Into<bool>,
) -> NuxBuilder<'a, nux_state::SetCompleted<S>> {
self._fields.0 = Option::Some(value.into());
NuxBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: nux_state::State> NuxBuilder<'a, S> {
pub fn data(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_data(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: nux_state::State> NuxBuilder<'a, S> {
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<'a, S> NuxBuilder<'a, S>
where
S: nux_state::State,
S::Id: nux_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<CowStr<'a>>,
) -> NuxBuilder<'a, nux_state::SetId<S>> {
self._fields.3 = Option::Some(value.into());
NuxBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> NuxBuilder<'a, S>
where
S: nux_state::State,
S::Id: nux_state::IsSet,
S::Completed: nux_state::IsSet,
{
pub fn build(self) -> Nux<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> Nux<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetShowButtonTo<S> {}
impl<S: State> State for SetShowButtonTo<S> {
type ShowButtonTo = Set<members::show_button_to>;
type MessageMeUrl = S::MessageMeUrl;
}
pub struct SetMessageMeUrl<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMessageMeUrl<S> {}
impl<S: State> State for SetMessageMeUrl<S> {
type ShowButtonTo = S::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<'a, S: profile_associated_germ_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<UriValue<'a>>, Option<ProfileAssociatedGermShowButtonTo<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileAssociatedGerm<'a> {
pub fn new() -> ProfileAssociatedGermBuilder<
'a,
profile_associated_germ_state::Empty,
> {
ProfileAssociatedGermBuilder::new()
}
}
impl<'a> ProfileAssociatedGermBuilder<'a, profile_associated_germ_state::Empty> {
pub fn new() -> Self {
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: (None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ProfileAssociatedGermBuilder<'a, S>
where
S: profile_associated_germ_state::State,
S::MessageMeUrl: profile_associated_germ_state::IsUnset,
{
pub fn message_me_url(
mut self,
value: impl Into<UriValue<'a>>,
) -> ProfileAssociatedGermBuilder<
'a,
profile_associated_germ_state::SetMessageMeUrl<S>,
> {
self._fields.0 = Option::Some(value.into());
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ProfileAssociatedGermBuilder<'a, S>
where
S: profile_associated_germ_state::State,
S::ShowButtonTo: profile_associated_germ_state::IsUnset,
{
pub fn show_button_to(
mut self,
value: impl Into<ProfileAssociatedGermShowButtonTo<'a>>,
) -> ProfileAssociatedGermBuilder<
'a,
profile_associated_germ_state::SetShowButtonTo<S>,
> {
self._fields.1 = Option::Some(value.into());
ProfileAssociatedGermBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ProfileAssociatedGermBuilder<'a, S>
where
S: profile_associated_germ_state::State,
S::ShowButtonTo: profile_associated_germ_state::IsSet,
S::MessageMeUrl: profile_associated_germ_state::IsSet,
{
pub fn build(self) -> ProfileAssociatedGerm<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ProfileAssociatedGerm<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type Handle = S::Handle;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Did = S::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewBuilder<'a, S: profile_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<actor::ProfileAssociated<'a>>,
Option<UriValue<'a>>,
Option<Datetime>,
Option<Data<'a>>,
Option<CowStr<'a>>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<Datetime>,
Option<Vec<Label<'a>>>,
Option<CowStr<'a>>,
Option<actor::StatusView<'a>>,
Option<actor::VerificationState<'a>>,
Option<actor::ViewerState<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileView<'a> {
pub fn new() -> ProfileViewBuilder<'a, profile_view_state::Empty> {
ProfileViewBuilder::new()
}
}
impl<'a> ProfileViewBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<'a>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<'a>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn debug(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Did: profile_view_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> {
self._fields.5 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Handle: profile_view_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> {
self._fields.7 = Option::Some(value.into());
ProfileViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
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<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn pronouns(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<'a>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<'a>>,
) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S> ProfileViewBuilder<'a, S>
where
S: profile_view_state::State,
S::Did: profile_view_state::IsSet,
S::Handle: profile_view_state::IsSet,
{
pub fn build(self) -> ProfileView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ProfileView<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Handle = Set<members::handle>;
type Did = S::Did;
}
pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Handle = S::Handle;
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct handle(());
pub struct did(());
}
}
pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<actor::ProfileAssociated<'a>>,
Option<UriValue<'a>>,
Option<Datetime>,
Option<Data<'a>>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<Handle<'a>>,
Option<Vec<Label<'a>>>,
Option<CowStr<'a>>,
Option<actor::StatusView<'a>>,
Option<actor::VerificationState<'a>>,
Option<actor::ViewerState<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileViewBasic<'a> {
pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> {
ProfileViewBasicBuilder::new()
}
}
impl<'a> ProfileViewBasicBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<'a>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<'a>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
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<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn debug(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<'a>>) -> Self {
self._fields.3 = value;
self
}
}
impl<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Did: profile_view_basic_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> {
self._fields.4 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Handle: profile_view_basic_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> {
self._fields.6 = Option::Some(value.into());
ProfileViewBasicBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn pronouns(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.8 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.8 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<'a>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<'a>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<'a>>>,
) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<'a>>,
) -> Self {
self._fields.10 = value;
self
}
}
impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S> ProfileViewBasicBuilder<'a, S>
where
S: profile_view_basic_state::State,
S::Handle: profile_view_basic_state::IsSet,
S::Did: profile_view_basic_state::IsSet,
{
pub fn build(self) -> ProfileViewBasic<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ProfileViewBasic<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDid<S> {}
impl<S: State> State for SetDid<S> {
type Did = Set<members::did>;
type Handle = S::Handle;
}
pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHandle<S> {}
impl<S: State> State for SetHandle<S> {
type Did = S::Did;
type Handle = Set<members::handle>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
pub struct handle(());
}
}
pub struct ProfileViewDetailedBuilder<'a, S: profile_view_detailed_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<actor::ProfileAssociated<'a>>,
Option<UriValue<'a>>,
Option<UriValue<'a>>,
Option<Datetime>,
Option<Data<'a>>,
Option<CowStr<'a>>,
Option<Did<'a>>,
Option<CowStr<'a>>,
Option<i64>,
Option<i64>,
Option<Handle<'a>>,
Option<Datetime>,
Option<StarterPackViewBasic<'a>>,
Option<Vec<Label<'a>>>,
Option<StrongRef<'a>>,
Option<i64>,
Option<CowStr<'a>>,
Option<actor::StatusView<'a>>,
Option<actor::VerificationState<'a>>,
Option<actor::ViewerState<'a>>,
Option<UriValue<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ProfileViewDetailed<'a> {
pub fn new() -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::Empty> {
ProfileViewDetailedBuilder::new()
}
}
impl<'a> ProfileViewDetailedBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn associated(
mut self,
value: impl Into<Option<actor::ProfileAssociated<'a>>>,
) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_associated(
mut self,
value: Option<actor::ProfileAssociated<'a>>,
) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn avatar(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_avatar(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn banner(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_banner(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
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<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn debug(mut self, value: impl Into<Option<Data<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_debug(mut self, value: Option<Data<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn description(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S> ProfileViewDetailedBuilder<'a, S>
where
S: profile_view_detailed_state::State,
S::Did: profile_view_detailed_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetDid<S>> {
self._fields.6 = Option::Some(value.into());
ProfileViewDetailedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn display_name(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_display_name(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
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<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
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<'a, S> ProfileViewDetailedBuilder<'a, S>
where
S: profile_view_detailed_state::State,
S::Handle: profile_view_detailed_state::IsUnset,
{
pub fn handle(
mut self,
value: impl Into<Handle<'a>>,
) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetHandle<S>> {
self._fields.10 = Option::Some(value.into());
ProfileViewDetailedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
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<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn joined_via_starter_pack(
mut self,
value: impl Into<Option<StarterPackViewBasic<'a>>>,
) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_joined_via_starter_pack(
mut self,
value: Option<StarterPackViewBasic<'a>>,
) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<Vec<Label<'a>>>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<Vec<Label<'a>>>) -> Self {
self._fields.13 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn pinned_post(mut self, value: impl Into<Option<StrongRef<'a>>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_pinned_post(mut self, value: Option<StrongRef<'a>>) -> Self {
self._fields.14 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
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<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn pronouns(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.16 = value.into();
self
}
pub fn maybe_pronouns(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.16 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<actor::StatusView<'a>>>) -> Self {
self._fields.17 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<actor::StatusView<'a>>) -> Self {
self._fields.17 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn verification(
mut self,
value: impl Into<Option<actor::VerificationState<'a>>>,
) -> Self {
self._fields.18 = value.into();
self
}
pub fn maybe_verification(
mut self,
value: Option<actor::VerificationState<'a>>,
) -> Self {
self._fields.18 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn viewer(mut self, value: impl Into<Option<actor::ViewerState<'a>>>) -> Self {
self._fields.19 = value.into();
self
}
pub fn maybe_viewer(mut self, value: Option<actor::ViewerState<'a>>) -> Self {
self._fields.19 = value;
self
}
}
impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> {
pub fn website(mut self, value: impl Into<Option<UriValue<'a>>>) -> Self {
self._fields.20 = value.into();
self
}
pub fn maybe_website(mut self, value: Option<UriValue<'a>>) -> Self {
self._fields.20 = value;
self
}
}
impl<'a, S> ProfileViewDetailedBuilder<'a, S>
where
S: profile_view_detailed_state::State,
S::Did: profile_view_detailed_state::IsSet,
S::Handle: profile_view_detailed_state::IsSet,
{
pub fn build(self) -> ProfileViewDetailed<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> ProfileViewDetailed<'a> {
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 Pinned;
type Type;
type Id;
type Value;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Pinned = Unset;
type Type = Unset;
type Id = Unset;
type Value = Unset;
}
pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPinned<S> {}
impl<S: State> State for SetPinned<S> {
type Pinned = Set<members::pinned>;
type Type = S::Type;
type Id = S::Id;
type Value = S::Value;
}
pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetType<S> {}
impl<S: State> State for SetType<S> {
type Pinned = S::Pinned;
type Type = Set<members::r#type>;
type Id = S::Id;
type Value = S::Value;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Pinned = S::Pinned;
type Type = S::Type;
type Id = Set<members::id>;
type Value = S::Value;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Pinned = S::Pinned;
type Type = S::Type;
type Id = S::Id;
type Value = Set<members::value>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct pinned(());
pub struct r#type(());
pub struct id(());
pub struct value(());
}
}
pub struct SavedFeedBuilder<'a, S: saved_feed_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<bool>,
Option<SavedFeedType<'a>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SavedFeed<'a> {
pub fn new() -> SavedFeedBuilder<'a, saved_feed_state::Empty> {
SavedFeedBuilder::new()
}
}
impl<'a> SavedFeedBuilder<'a, saved_feed_state::Empty> {
pub fn new() -> Self {
SavedFeedBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedBuilder<'a, S>
where
S: saved_feed_state::State,
S::Id: saved_feed_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<CowStr<'a>>,
) -> SavedFeedBuilder<'a, saved_feed_state::SetId<S>> {
self._fields.0 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedBuilder<'a, S>
where
S: saved_feed_state::State,
S::Pinned: saved_feed_state::IsUnset,
{
pub fn pinned(
mut self,
value: impl Into<bool>,
) -> SavedFeedBuilder<'a, saved_feed_state::SetPinned<S>> {
self._fields.1 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedBuilder<'a, S>
where
S: saved_feed_state::State,
S::Type: saved_feed_state::IsUnset,
{
pub fn r#type(
mut self,
value: impl Into<SavedFeedType<'a>>,
) -> SavedFeedBuilder<'a, saved_feed_state::SetType<S>> {
self._fields.2 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedBuilder<'a, S>
where
S: saved_feed_state::State,
S::Value: saved_feed_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<CowStr<'a>>,
) -> SavedFeedBuilder<'a, saved_feed_state::SetValue<S>> {
self._fields.3 = Option::Some(value.into());
SavedFeedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedBuilder<'a, S>
where
S: saved_feed_state::State,
S::Pinned: saved_feed_state::IsSet,
S::Type: saved_feed_state::IsSet,
S::Id: saved_feed_state::IsSet,
S::Value: saved_feed_state::IsSet,
{
pub fn build(self) -> SavedFeed<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> SavedFeed<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSaved<S> {}
impl<S: State> State for SetSaved<S> {
type Saved = Set<members::saved>;
type Pinned = S::Pinned;
}
pub struct SetPinned<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPinned<S> {}
impl<S: State> State for SetPinned<S> {
type Saved = S::Saved;
type Pinned = Set<members::pinned>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct saved(());
pub struct pinned(());
}
}
pub struct SavedFeedsPrefBuilder<'a, S: saved_feeds_pref_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<AtUri<'a>>>, Option<Vec<AtUri<'a>>>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SavedFeedsPref<'a> {
pub fn new() -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::Empty> {
SavedFeedsPrefBuilder::new()
}
}
impl<'a> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::Empty> {
pub fn new() -> Self {
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedsPrefBuilder<'a, S>
where
S: saved_feeds_pref_state::State,
S::Pinned: saved_feeds_pref_state::IsUnset,
{
pub fn pinned(
mut self,
value: impl Into<Vec<AtUri<'a>>>,
) -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::SetPinned<S>> {
self._fields.0 = Option::Some(value.into());
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedsPrefBuilder<'a, S>
where
S: saved_feeds_pref_state::State,
S::Saved: saved_feeds_pref_state::IsUnset,
{
pub fn saved(
mut self,
value: impl Into<Vec<AtUri<'a>>>,
) -> SavedFeedsPrefBuilder<'a, saved_feeds_pref_state::SetSaved<S>> {
self._fields.1 = Option::Some(value.into());
SavedFeedsPrefBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: saved_feeds_pref_state::State> SavedFeedsPrefBuilder<'a, S> {
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<'a, S> SavedFeedsPrefBuilder<'a, S>
where
S: saved_feeds_pref_state::State,
S::Saved: saved_feeds_pref_state::IsSet,
S::Pinned: saved_feeds_pref_state::IsSet,
{
pub fn build(self) -> SavedFeedsPref<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> SavedFeedsPref<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetItems<S> {}
impl<S: State> State for SetItems<S> {
type Items = Set<members::items>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct items(());
}
}
pub struct SavedFeedsPrefV2Builder<'a, S: saved_feeds_pref_v2_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<actor::SavedFeed<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SavedFeedsPrefV2<'a> {
pub fn new() -> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::Empty> {
SavedFeedsPrefV2Builder::new()
}
}
impl<'a> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::Empty> {
pub fn new() -> Self {
SavedFeedsPrefV2Builder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedsPrefV2Builder<'a, S>
where
S: saved_feeds_pref_v2_state::State,
S::Items: saved_feeds_pref_v2_state::IsUnset,
{
pub fn items(
mut self,
value: impl Into<Vec<actor::SavedFeed<'a>>>,
) -> SavedFeedsPrefV2Builder<'a, saved_feeds_pref_v2_state::SetItems<S>> {
self._fields.0 = Option::Some(value.into());
SavedFeedsPrefV2Builder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SavedFeedsPrefV2Builder<'a, S>
where
S: saved_feeds_pref_v2_state::State,
S::Items: saved_feeds_pref_v2_state::IsSet,
{
pub fn build(self) -> SavedFeedsPrefV2<'a> {
SavedFeedsPrefV2 {
items: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> SavedFeedsPrefV2<'a> {
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 Status;
type Record;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Status = Unset;
type Record = Unset;
}
pub struct SetStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStatus<S> {}
impl<S: State> State for SetStatus<S> {
type Status = Set<members::status>;
type Record = S::Record;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type Status = S::Status;
type Record = Set<members::record>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct status(());
pub struct record(());
}
}
pub struct StatusViewBuilder<'a, S: status_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Cid<'a>>,
Option<View<'a>>,
Option<Datetime>,
Option<bool>,
Option<bool>,
Option<Data<'a>>,
Option<StatusViewStatus<'a>>,
Option<AtUri<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> StatusView<'a> {
pub fn new() -> StatusViewBuilder<'a, status_view_state::Empty> {
StatusViewBuilder::new()
}
}
impl<'a> StatusViewBuilder<'a, status_view_state::Empty> {
pub fn new() -> Self {
StatusViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
pub fn cid(mut self, value: impl Into<Option<Cid<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_cid(mut self, value: Option<Cid<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
pub fn embed(mut self, value: impl Into<Option<View<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_embed(mut self, value: Option<View<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
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<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
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<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
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<'a, S> StatusViewBuilder<'a, S>
where
S: status_view_state::State,
S::Record: status_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<Data<'a>>,
) -> StatusViewBuilder<'a, status_view_state::SetRecord<S>> {
self._fields.5 = Option::Some(value.into());
StatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> StatusViewBuilder<'a, S>
where
S: status_view_state::State,
S::Status: status_view_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<StatusViewStatus<'a>>,
) -> StatusViewBuilder<'a, status_view_state::SetStatus<S>> {
self._fields.6 = Option::Some(value.into());
StatusViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: status_view_state::State> StatusViewBuilder<'a, S> {
pub fn uri(mut self, value: impl Into<Option<AtUri<'a>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_uri(mut self, value: Option<AtUri<'a>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> StatusViewBuilder<'a, S>
where
S: status_view_state::State,
S::Status: status_view_state::IsSet,
S::Record: status_view_state::IsSet,
{
pub fn build(self) -> StatusView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> StatusView<'a> {
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 TrustedVerifierStatus;
type VerifiedStatus;
type Verifications;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type TrustedVerifierStatus = Unset;
type VerifiedStatus = Unset;
type Verifications = Unset;
}
pub struct SetTrustedVerifierStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTrustedVerifierStatus<S> {}
impl<S: State> State for SetTrustedVerifierStatus<S> {
type TrustedVerifierStatus = Set<members::trusted_verifier_status>;
type VerifiedStatus = S::VerifiedStatus;
type Verifications = S::Verifications;
}
pub struct SetVerifiedStatus<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetVerifiedStatus<S> {}
impl<S: State> State for SetVerifiedStatus<S> {
type TrustedVerifierStatus = S::TrustedVerifierStatus;
type VerifiedStatus = Set<members::verified_status>;
type Verifications = S::Verifications;
}
pub struct SetVerifications<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetVerifications<S> {}
impl<S: State> State for SetVerifications<S> {
type TrustedVerifierStatus = S::TrustedVerifierStatus;
type VerifiedStatus = S::VerifiedStatus;
type Verifications = Set<members::verifications>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct trusted_verifier_status(());
pub struct verified_status(());
pub struct verifications(());
}
}
pub struct VerificationStateBuilder<'a, S: verification_state_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<VerificationStateTrustedVerifierStatus<'a>>,
Option<Vec<actor::VerificationView<'a>>>,
Option<VerificationStateVerifiedStatus<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> VerificationState<'a> {
pub fn new() -> VerificationStateBuilder<'a, verification_state_state::Empty> {
VerificationStateBuilder::new()
}
}
impl<'a> VerificationStateBuilder<'a, verification_state_state::Empty> {
pub fn new() -> Self {
VerificationStateBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationStateBuilder<'a, S>
where
S: verification_state_state::State,
S::TrustedVerifierStatus: verification_state_state::IsUnset,
{
pub fn trusted_verifier_status(
mut self,
value: impl Into<VerificationStateTrustedVerifierStatus<'a>>,
) -> VerificationStateBuilder<
'a,
verification_state_state::SetTrustedVerifierStatus<S>,
> {
self._fields.0 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationStateBuilder<'a, S>
where
S: verification_state_state::State,
S::Verifications: verification_state_state::IsUnset,
{
pub fn verifications(
mut self,
value: impl Into<Vec<actor::VerificationView<'a>>>,
) -> VerificationStateBuilder<'a, verification_state_state::SetVerifications<S>> {
self._fields.1 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationStateBuilder<'a, S>
where
S: verification_state_state::State,
S::VerifiedStatus: verification_state_state::IsUnset,
{
pub fn verified_status(
mut self,
value: impl Into<VerificationStateVerifiedStatus<'a>>,
) -> VerificationStateBuilder<'a, verification_state_state::SetVerifiedStatus<S>> {
self._fields.2 = Option::Some(value.into());
VerificationStateBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationStateBuilder<'a, S>
where
S: verification_state_state::State,
S::TrustedVerifierStatus: verification_state_state::IsSet,
S::VerifiedStatus: verification_state_state::IsSet,
S::Verifications: verification_state_state::IsSet,
{
pub fn build(self) -> VerificationState<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> VerificationState<'a> {
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 IsValid;
type Issuer;
type CreatedAt;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IsValid = Unset;
type Issuer = Unset;
type CreatedAt = Unset;
type Uri = Unset;
}
pub struct SetIsValid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIsValid<S> {}
impl<S: State> State for SetIsValid<S> {
type IsValid = Set<members::is_valid>;
type Issuer = S::Issuer;
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
}
pub struct SetIssuer<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIssuer<S> {}
impl<S: State> State for SetIssuer<S> {
type IsValid = S::IsValid;
type Issuer = Set<members::issuer>;
type CreatedAt = S::CreatedAt;
type Uri = S::Uri;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type IsValid = S::IsValid;
type Issuer = S::Issuer;
type CreatedAt = Set<members::created_at>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type IsValid = S::IsValid;
type Issuer = S::Issuer;
type CreatedAt = S::CreatedAt;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct is_valid(());
pub struct issuer(());
pub struct created_at(());
pub struct uri(());
}
}
pub struct VerificationViewBuilder<'a, S: verification_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Datetime>, Option<bool>, Option<Did<'a>>, Option<AtUri<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> VerificationView<'a> {
pub fn new() -> VerificationViewBuilder<'a, verification_view_state::Empty> {
VerificationViewBuilder::new()
}
}
impl<'a> VerificationViewBuilder<'a, verification_view_state::Empty> {
pub fn new() -> Self {
VerificationViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationViewBuilder<'a, S>
where
S: verification_view_state::State,
S::CreatedAt: verification_view_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> VerificationViewBuilder<'a, verification_view_state::SetCreatedAt<S>> {
self._fields.0 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationViewBuilder<'a, S>
where
S: verification_view_state::State,
S::IsValid: verification_view_state::IsUnset,
{
pub fn is_valid(
mut self,
value: impl Into<bool>,
) -> VerificationViewBuilder<'a, verification_view_state::SetIsValid<S>> {
self._fields.1 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationViewBuilder<'a, S>
where
S: verification_view_state::State,
S::Issuer: verification_view_state::IsUnset,
{
pub fn issuer(
mut self,
value: impl Into<Did<'a>>,
) -> VerificationViewBuilder<'a, verification_view_state::SetIssuer<S>> {
self._fields.2 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationViewBuilder<'a, S>
where
S: verification_view_state::State,
S::Uri: verification_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> VerificationViewBuilder<'a, verification_view_state::SetUri<S>> {
self._fields.3 = Option::Some(value.into());
VerificationViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> VerificationViewBuilder<'a, S>
where
S: verification_view_state::State,
S::IsValid: verification_view_state::IsSet,
S::Issuer: verification_view_state::IsSet,
S::CreatedAt: verification_view_state::IsSet,
S::Uri: verification_view_state::IsSet,
{
pub fn build(self) -> VerificationView<'a> {
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<jacquard_common::deps::smol_str::SmolStr, Data<'a>>,
) -> VerificationView<'a> {
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),
}
}
}