pub mod get_age_assurance_state;
pub mod get_config;
pub mod get_onboarding_suggested_starter_packs;
pub mod get_onboarding_suggested_starter_packs_skeleton;
pub mod get_onboarding_suggested_users_skeleton;
pub mod get_popular_feed_generators;
pub mod get_post_thread_other_v2;
pub mod get_post_thread_v2;
pub mod get_suggested_feeds;
pub mod get_suggested_feeds_skeleton;
pub mod get_suggested_onboarding_users;
pub mod get_suggested_starter_packs;
pub mod get_suggested_starter_packs_skeleton;
pub mod get_suggested_users;
pub mod get_suggested_users_skeleton;
pub mod get_suggestions_skeleton;
pub mod get_tagged_suggestions;
pub mod get_trending_topics;
pub mod get_trends;
pub mod get_trends_skeleton;
pub mod init_age_assurance;
pub mod search_actors_skeleton;
pub mod search_posts_skeleton;
pub mod search_starter_packs_skeleton;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, AtUri, Datetime};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
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::actor::ProfileViewBasic;
use crate::app_bsky::feed::BlockedAuthor;
use crate::app_bsky::feed::PostView;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AgeAssuranceEvent<S: BosStr = DefaultStr> {
pub attempt_id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_ip: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub complete_ua: Option<S>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub email: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub init_ip: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub init_ua: Option<S>,
pub status: AgeAssuranceEventStatus<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceEventStatus<S: BosStr = DefaultStr> {
Unknown,
Pending,
Assured,
Other(S),
}
impl<S: BosStr> AgeAssuranceEventStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Pending => "pending",
Self::Assured => "assured",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AgeAssuranceEventStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AgeAssuranceEventStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AgeAssuranceEventStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AgeAssuranceEventStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AgeAssuranceEventStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AgeAssuranceEventStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AgeAssuranceEventStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AgeAssuranceEventStatus::Unknown => AgeAssuranceEventStatus::Unknown,
AgeAssuranceEventStatus::Pending => AgeAssuranceEventStatus::Pending,
AgeAssuranceEventStatus::Assured => AgeAssuranceEventStatus::Assured,
AgeAssuranceEventStatus::Other(v) => {
AgeAssuranceEventStatus::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct AgeAssuranceState<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub last_initiated_at: Option<Datetime>,
pub status: AgeAssuranceStateStatus<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceStateStatus<S: BosStr = DefaultStr> {
Unknown,
Pending,
Assured,
Blocked,
Other(S),
}
impl<S: BosStr> AgeAssuranceStateStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Pending => "pending",
Self::Assured => "assured",
Self::Blocked => "blocked",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
"blocked" => Self::Blocked,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for AgeAssuranceStateStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for AgeAssuranceStateStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for AgeAssuranceStateStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for AgeAssuranceStateStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for AgeAssuranceStateStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for AgeAssuranceStateStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = AgeAssuranceStateStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
AgeAssuranceStateStatus::Unknown => AgeAssuranceStateStatus::Unknown,
AgeAssuranceStateStatus::Pending => AgeAssuranceStateStatus::Pending,
AgeAssuranceStateStatus::Assured => AgeAssuranceStateStatus::Assured,
AgeAssuranceStateStatus::Blocked => AgeAssuranceStateStatus::Blocked,
AgeAssuranceStateStatus::Other(v) => {
AgeAssuranceStateStatus::Other(v.into_static())
}
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonSearchActor<S: BosStr = DefaultStr> {
pub did: Did<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonSearchPost<S: BosStr = DefaultStr> {
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonSearchStarterPack<S: BosStr = DefaultStr> {
pub uri: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SkeletonTrend<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<S>,
pub dids: Vec<Did<S>>,
pub display_name: S,
pub link: S,
pub post_count: i64,
pub started_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<SkeletonTrendStatus<S>>,
pub topic: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SkeletonTrendStatus<S: BosStr = DefaultStr> {
Hot,
Other(S),
}
impl<S: BosStr> SkeletonTrendStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Hot => "hot",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"hot" => Self::Hot,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for SkeletonTrendStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for SkeletonTrendStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for SkeletonTrendStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for SkeletonTrendStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for SkeletonTrendStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for SkeletonTrendStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = SkeletonTrendStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
SkeletonTrendStatus::Hot => SkeletonTrendStatus::Hot,
SkeletonTrendStatus::Other(v) => SkeletonTrendStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadItemBlocked<S: BosStr = DefaultStr> {
pub author: BlockedAuthor<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadItemNoUnauthenticated<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadItemNotFound<S: BosStr = DefaultStr> {
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct ThreadItemPost<S: BosStr = DefaultStr> {
pub hidden_by_threadgate: bool,
pub more_parents: bool,
pub more_replies: i64,
pub muted_by_viewer: bool,
pub op_thread: bool,
pub post: PostView<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct TrendView<S: BosStr = DefaultStr> {
pub actors: Vec<ProfileViewBasic<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub category: Option<S>,
pub display_name: S,
pub link: S,
pub post_count: i64,
pub started_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<TrendViewStatus<S>>,
pub topic: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrendViewStatus<S: BosStr = DefaultStr> {
Hot,
Other(S),
}
impl<S: BosStr> TrendViewStatus<S> {
pub fn as_str(&self) -> &str {
match self {
Self::Hot => "hot",
Self::Other(s) => s.as_ref(),
}
}
pub fn from_value(s: S) -> Self {
match s.as_ref() {
"hot" => Self::Hot,
_ => Self::Other(s),
}
}
}
impl<S: BosStr> core::fmt::Display for TrendViewStatus<S> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<S: BosStr> AsRef<str> for TrendViewStatus<S> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<S: BosStr> Serialize for TrendViewStatus<S> {
fn serialize<Ser>(&self, serializer: Ser) -> Result<Ser::Ok, Ser::Error>
where
Ser: serde::Serializer,
{
serializer.serialize_str(self.as_str())
}
}
impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for TrendViewStatus<S> {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
let s = S::deserialize(deserializer)?;
Ok(Self::from_value(s))
}
}
impl<S: BosStr + Default> Default for TrendViewStatus<S> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl<S: BosStr> jacquard_common::IntoStatic for TrendViewStatus<S>
where
S: BosStr + jacquard_common::IntoStatic,
S::Output: BosStr,
{
type Output = TrendViewStatus<S::Output>;
fn into_static(self) -> Self::Output {
match self {
TrendViewStatus::Hot => TrendViewStatus::Hot,
TrendViewStatus::Other(v) => TrendViewStatus::Other(v.into_static()),
}
}
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct TrendingTopic<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub display_name: Option<S>,
pub link: S,
pub topic: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for AgeAssuranceEvent<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"ageAssuranceEvent"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for AgeAssuranceState<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"ageAssuranceState"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonSearchActor<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"skeletonSearchActor"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonSearchPost<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"skeletonSearchPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonSearchStarterPack<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"skeletonSearchStarterPack"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SkeletonTrend<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"skeletonTrend"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadItemBlocked<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"threadItemBlocked"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadItemNoUnauthenticated<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"threadItemNoUnauthenticated"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadItemNotFound<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"threadItemNotFound"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ThreadItemPost<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"threadItemPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TrendView<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"trendView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for TrendingTopic<S> {
fn nsid() -> &'static str {
"app.bsky.unspecced.defs"
}
fn def_name() -> &'static str {
"trendingTopic"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_bsky_unspecced_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod age_assurance_event_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 CreatedAt;
type AttemptId;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Status = Unset;
type CreatedAt = Unset;
type AttemptId = Unset;
}
pub struct SetStatus<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStatus<St> {}
impl<St: State> State for SetStatus<St> {
type Status = Set<members::status>;
type CreatedAt = St::CreatedAt;
type AttemptId = St::AttemptId;
}
pub struct SetCreatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCreatedAt<St> {}
impl<St: State> State for SetCreatedAt<St> {
type Status = St::Status;
type CreatedAt = Set<members::created_at>;
type AttemptId = St::AttemptId;
}
pub struct SetAttemptId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAttemptId<St> {}
impl<St: State> State for SetAttemptId<St> {
type Status = St::Status;
type CreatedAt = St::CreatedAt;
type AttemptId = Set<members::attempt_id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct status(());
pub struct created_at(());
pub struct attempt_id(());
}
}
pub struct AgeAssuranceEventBuilder<S: BosStr, St: age_assurance_event_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<S>,
Option<S>,
Option<Datetime>,
Option<S>,
Option<S>,
Option<S>,
Option<AgeAssuranceEventStatus<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> AgeAssuranceEvent<S> {
pub fn new() -> AgeAssuranceEventBuilder<S, age_assurance_event_state::Empty> {
AgeAssuranceEventBuilder::new()
}
}
impl<S: BosStr> AgeAssuranceEventBuilder<S, age_assurance_event_state::Empty> {
pub fn new() -> Self {
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::AttemptId: age_assurance_event_state::IsUnset,
{
pub fn attempt_id(
mut self,
value: impl Into<S>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetAttemptId<St>> {
self._fields.0 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn complete_ip(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_complete_ip(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn complete_ua(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_complete_ua(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::CreatedAt: age_assurance_event_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetCreatedAt<St>> {
self._fields.3 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn email(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<S>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn init_ip(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_init_ip(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: age_assurance_event_state::State> AgeAssuranceEventBuilder<S, St> {
pub fn init_ua(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_init_ua(mut self, value: Option<S>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::Status: age_assurance_event_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<AgeAssuranceEventStatus<S>>,
) -> AgeAssuranceEventBuilder<S, age_assurance_event_state::SetStatus<St>> {
self._fields.7 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> AgeAssuranceEventBuilder<S, St>
where
St: age_assurance_event_state::State,
St::Status: age_assurance_event_state::IsSet,
St::CreatedAt: age_assurance_event_state::IsSet,
St::AttemptId: age_assurance_event_state::IsSet,
{
pub fn build(self) -> AgeAssuranceEvent<S> {
AgeAssuranceEvent {
attempt_id: self._fields.0.unwrap(),
complete_ip: self._fields.1,
complete_ua: self._fields.2,
created_at: self._fields.3.unwrap(),
email: self._fields.4,
init_ip: self._fields.5,
init_ua: self._fields.6,
status: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> AgeAssuranceEvent<S> {
AgeAssuranceEvent {
attempt_id: self._fields.0.unwrap(),
complete_ip: self._fields.1,
complete_ua: self._fields.2,
created_at: self._fields.3.unwrap(),
email: self._fields.4,
init_ip: self._fields.5,
init_ua: self._fields.6,
status: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_bsky_unspecced_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.unspecced.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("ageAssuranceEvent"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Object used to store age assurance data in stash.",
),
),
required: Some(
vec![
SmolStr::new_static("createdAt"),
SmolStr::new_static("status"),
SmolStr::new_static("attemptId")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("attemptId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The unique identifier for this instance of the age assurance flow, in UUID format.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("completeIp"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The IP address used when completing the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("completeUa"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user agent used when completing the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The date and time of this write operation.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("email"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("The email used for AA."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initIp"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The IP address used when initiating the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("initUa"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The user agent used when initiating the AA flow.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The status of the age assurance process.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("ageAssuranceState"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"The computed state of the age assurance process, returned to the user in question on certain authenticated requests.",
),
),
required: Some(vec![SmolStr::new_static("status")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("lastInitiatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The timestamp when this state was last updated.",
),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"The status of the age assurance process.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeletonSearchActor"),
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("skeletonSearchPost"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeletonSearchStarterPack"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("uri")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("uri"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("skeletonTrend"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("topic"),
SmolStr::new_static("displayName"),
SmolStr::new_static("link"),
SmolStr::new_static("startedAt"),
SmolStr::new_static("postCount"), SmolStr::new_static("dids")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("category"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("dids"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Did),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("link"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("postCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("startedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("topic"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadItemBlocked"),
LexUserType::Object(LexObject {
required: Some(vec![SmolStr::new_static("author")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("author"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.feed.defs#blockedAuthor",
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadItemNoUnauthenticated"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadItemNotFound"),
LexUserType::Object(LexObject {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadItemPost"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("post"),
SmolStr::new_static("moreParents"),
SmolStr::new_static("moreReplies"),
SmolStr::new_static("opThread"),
SmolStr::new_static("hiddenByThreadgate"),
SmolStr::new_static("mutedByViewer")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("hiddenByThreadgate"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moreParents"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("moreReplies"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mutedByViewer"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("opThread"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("post"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.feed.defs#postView"),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("trendView"),
LexUserType::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("topic"),
SmolStr::new_static("displayName"),
SmolStr::new_static("link"),
SmolStr::new_static("startedAt"),
SmolStr::new_static("postCount"),
SmolStr::new_static("actors")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("actors"),
LexObjectProperty::Array(LexArray {
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("category"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("link"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("postCount"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("startedAt"),
LexObjectProperty::String(LexString {
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("topic"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("trendingTopic"),
LexUserType::Object(LexObject {
required: Some(
vec![SmolStr::new_static("topic"), SmolStr::new_static("link")],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("displayName"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("link"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map.insert(
SmolStr::new_static("topic"),
LexObjectProperty::String(LexString { ..Default::default() }),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod skeleton_search_actor_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Did;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Did = Unset;
}
pub struct SetDid<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDid<St> {}
impl<St: State> State for SetDid<St> {
type Did = Set<members::did>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct did(());
}
}
pub struct SkeletonSearchActorBuilder<
S: BosStr,
St: skeleton_search_actor_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Did<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonSearchActor<S> {
pub fn new() -> SkeletonSearchActorBuilder<S, skeleton_search_actor_state::Empty> {
SkeletonSearchActorBuilder::new()
}
}
impl<S: BosStr> SkeletonSearchActorBuilder<S, skeleton_search_actor_state::Empty> {
pub fn new() -> Self {
SkeletonSearchActorBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchActorBuilder<S, St>
where
St: skeleton_search_actor_state::State,
St::Did: skeleton_search_actor_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<S>>,
) -> SkeletonSearchActorBuilder<S, skeleton_search_actor_state::SetDid<St>> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchActorBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchActorBuilder<S, St>
where
St: skeleton_search_actor_state::State,
St::Did: skeleton_search_actor_state::IsSet,
{
pub fn build(self) -> SkeletonSearchActor<S> {
SkeletonSearchActor {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonSearchActor<S> {
SkeletonSearchActor {
did: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod skeleton_search_post_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SkeletonSearchPostBuilder<S: BosStr, St: skeleton_search_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonSearchPost<S> {
pub fn new() -> SkeletonSearchPostBuilder<S, skeleton_search_post_state::Empty> {
SkeletonSearchPostBuilder::new()
}
}
impl<S: BosStr> SkeletonSearchPostBuilder<S, skeleton_search_post_state::Empty> {
pub fn new() -> Self {
SkeletonSearchPostBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchPostBuilder<S, St>
where
St: skeleton_search_post_state::State,
St::Uri: skeleton_search_post_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> SkeletonSearchPostBuilder<S, skeleton_search_post_state::SetUri<St>> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchPostBuilder<S, St>
where
St: skeleton_search_post_state::State,
St::Uri: skeleton_search_post_state::IsSet,
{
pub fn build(self) -> SkeletonSearchPost<S> {
SkeletonSearchPost {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonSearchPost<S> {
SkeletonSearchPost {
uri: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod skeleton_search_starter_pack_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
}
pub struct SetUri<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUri<St> {}
impl<St: State> State for SetUri<St> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SkeletonSearchStarterPackBuilder<
S: BosStr,
St: skeleton_search_starter_pack_state::State,
> {
_state: PhantomData<fn() -> St>,
_fields: (Option<AtUri<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonSearchStarterPack<S> {
pub fn new() -> SkeletonSearchStarterPackBuilder<
S,
skeleton_search_starter_pack_state::Empty,
> {
SkeletonSearchStarterPackBuilder::new()
}
}
impl<
S: BosStr,
> SkeletonSearchStarterPackBuilder<S, skeleton_search_starter_pack_state::Empty> {
pub fn new() -> Self {
SkeletonSearchStarterPackBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchStarterPackBuilder<S, St>
where
St: skeleton_search_starter_pack_state::State,
St::Uri: skeleton_search_starter_pack_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<S>>,
) -> SkeletonSearchStarterPackBuilder<
S,
skeleton_search_starter_pack_state::SetUri<St>,
> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchStarterPackBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonSearchStarterPackBuilder<S, St>
where
St: skeleton_search_starter_pack_state::State,
St::Uri: skeleton_search_starter_pack_state::IsSet,
{
pub fn build(self) -> SkeletonSearchStarterPack<S> {
SkeletonSearchStarterPack {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonSearchStarterPack<S> {
SkeletonSearchStarterPack {
uri: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod skeleton_trend_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 Dids;
type StartedAt;
type DisplayName;
type Link;
type PostCount;
type Topic;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Dids = Unset;
type StartedAt = Unset;
type DisplayName = Unset;
type Link = Unset;
type PostCount = Unset;
type Topic = Unset;
}
pub struct SetDids<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDids<St> {}
impl<St: State> State for SetDids<St> {
type Dids = Set<members::dids>;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
type Link = St::Link;
type PostCount = St::PostCount;
type Topic = St::Topic;
}
pub struct SetStartedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStartedAt<St> {}
impl<St: State> State for SetStartedAt<St> {
type Dids = St::Dids;
type StartedAt = Set<members::started_at>;
type DisplayName = St::DisplayName;
type Link = St::Link;
type PostCount = St::PostCount;
type Topic = St::Topic;
}
pub struct SetDisplayName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDisplayName<St> {}
impl<St: State> State for SetDisplayName<St> {
type Dids = St::Dids;
type StartedAt = St::StartedAt;
type DisplayName = Set<members::display_name>;
type Link = St::Link;
type PostCount = St::PostCount;
type Topic = St::Topic;
}
pub struct SetLink<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLink<St> {}
impl<St: State> State for SetLink<St> {
type Dids = St::Dids;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
type Link = Set<members::link>;
type PostCount = St::PostCount;
type Topic = St::Topic;
}
pub struct SetPostCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPostCount<St> {}
impl<St: State> State for SetPostCount<St> {
type Dids = St::Dids;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
type Link = St::Link;
type PostCount = Set<members::post_count>;
type Topic = St::Topic;
}
pub struct SetTopic<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTopic<St> {}
impl<St: State> State for SetTopic<St> {
type Dids = St::Dids;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
type Link = St::Link;
type PostCount = St::PostCount;
type Topic = Set<members::topic>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct dids(());
pub struct started_at(());
pub struct display_name(());
pub struct link(());
pub struct post_count(());
pub struct topic(());
}
}
pub struct SkeletonTrendBuilder<S: BosStr, St: skeleton_trend_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<Vec<Did<S>>>,
Option<S>,
Option<S>,
Option<i64>,
Option<Datetime>,
Option<SkeletonTrendStatus<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> SkeletonTrend<S> {
pub fn new() -> SkeletonTrendBuilder<S, skeleton_trend_state::Empty> {
SkeletonTrendBuilder::new()
}
}
impl<S: BosStr> SkeletonTrendBuilder<S, skeleton_trend_state::Empty> {
pub fn new() -> Self {
SkeletonTrendBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: skeleton_trend_state::State> SkeletonTrendBuilder<S, St> {
pub fn category(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_category(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::Dids: skeleton_trend_state::IsUnset,
{
pub fn dids(
mut self,
value: impl Into<Vec<Did<S>>>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetDids<St>> {
self._fields.1 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::DisplayName: skeleton_trend_state::IsUnset,
{
pub fn display_name(
mut self,
value: impl Into<S>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetDisplayName<St>> {
self._fields.2 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::Link: skeleton_trend_state::IsUnset,
{
pub fn link(
mut self,
value: impl Into<S>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetLink<St>> {
self._fields.3 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::PostCount: skeleton_trend_state::IsUnset,
{
pub fn post_count(
mut self,
value: impl Into<i64>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetPostCount<St>> {
self._fields.4 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::StartedAt: skeleton_trend_state::IsUnset,
{
pub fn started_at(
mut self,
value: impl Into<Datetime>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetStartedAt<St>> {
self._fields.5 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: skeleton_trend_state::State> SkeletonTrendBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<SkeletonTrendStatus<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<SkeletonTrendStatus<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::Topic: skeleton_trend_state::IsUnset,
{
pub fn topic(
mut self,
value: impl Into<S>,
) -> SkeletonTrendBuilder<S, skeleton_trend_state::SetTopic<St>> {
self._fields.7 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> SkeletonTrendBuilder<S, St>
where
St: skeleton_trend_state::State,
St::Dids: skeleton_trend_state::IsSet,
St::StartedAt: skeleton_trend_state::IsSet,
St::DisplayName: skeleton_trend_state::IsSet,
St::Link: skeleton_trend_state::IsSet,
St::PostCount: skeleton_trend_state::IsSet,
St::Topic: skeleton_trend_state::IsSet,
{
pub fn build(self) -> SkeletonTrend<S> {
SkeletonTrend {
category: self._fields.0,
dids: self._fields.1.unwrap(),
display_name: self._fields.2.unwrap(),
link: self._fields.3.unwrap(),
post_count: self._fields.4.unwrap(),
started_at: self._fields.5.unwrap(),
status: self._fields.6,
topic: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SkeletonTrend<S> {
SkeletonTrend {
category: self._fields.0,
dids: self._fields.1.unwrap(),
display_name: self._fields.2.unwrap(),
link: self._fields.3.unwrap(),
post_count: self._fields.4.unwrap(),
started_at: self._fields.5.unwrap(),
status: self._fields.6,
topic: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod thread_item_blocked_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 Author;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Author = Unset;
}
pub struct SetAuthor<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAuthor<St> {}
impl<St: State> State for SetAuthor<St> {
type Author = Set<members::author>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
}
}
pub struct ThreadItemBlockedBuilder<S: BosStr, St: thread_item_blocked_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<BlockedAuthor<S>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ThreadItemBlocked<S> {
pub fn new() -> ThreadItemBlockedBuilder<S, thread_item_blocked_state::Empty> {
ThreadItemBlockedBuilder::new()
}
}
impl<S: BosStr> ThreadItemBlockedBuilder<S, thread_item_blocked_state::Empty> {
pub fn new() -> Self {
ThreadItemBlockedBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemBlockedBuilder<S, St>
where
St: thread_item_blocked_state::State,
St::Author: thread_item_blocked_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<BlockedAuthor<S>>,
) -> ThreadItemBlockedBuilder<S, thread_item_blocked_state::SetAuthor<St>> {
self._fields.0 = Option::Some(value.into());
ThreadItemBlockedBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemBlockedBuilder<S, St>
where
St: thread_item_blocked_state::State,
St::Author: thread_item_blocked_state::IsSet,
{
pub fn build(self) -> ThreadItemBlocked<S> {
ThreadItemBlocked {
author: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ThreadItemBlocked<S> {
ThreadItemBlocked {
author: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod thread_item_post_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 Post;
type HiddenByThreadgate;
type OpThread;
type MutedByViewer;
type MoreReplies;
type MoreParents;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Post = Unset;
type HiddenByThreadgate = Unset;
type OpThread = Unset;
type MutedByViewer = Unset;
type MoreReplies = Unset;
type MoreParents = Unset;
}
pub struct SetPost<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPost<St> {}
impl<St: State> State for SetPost<St> {
type Post = Set<members::post>;
type HiddenByThreadgate = St::HiddenByThreadgate;
type OpThread = St::OpThread;
type MutedByViewer = St::MutedByViewer;
type MoreReplies = St::MoreReplies;
type MoreParents = St::MoreParents;
}
pub struct SetHiddenByThreadgate<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetHiddenByThreadgate<St> {}
impl<St: State> State for SetHiddenByThreadgate<St> {
type Post = St::Post;
type HiddenByThreadgate = Set<members::hidden_by_threadgate>;
type OpThread = St::OpThread;
type MutedByViewer = St::MutedByViewer;
type MoreReplies = St::MoreReplies;
type MoreParents = St::MoreParents;
}
pub struct SetOpThread<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetOpThread<St> {}
impl<St: State> State for SetOpThread<St> {
type Post = St::Post;
type HiddenByThreadgate = St::HiddenByThreadgate;
type OpThread = Set<members::op_thread>;
type MutedByViewer = St::MutedByViewer;
type MoreReplies = St::MoreReplies;
type MoreParents = St::MoreParents;
}
pub struct SetMutedByViewer<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMutedByViewer<St> {}
impl<St: State> State for SetMutedByViewer<St> {
type Post = St::Post;
type HiddenByThreadgate = St::HiddenByThreadgate;
type OpThread = St::OpThread;
type MutedByViewer = Set<members::muted_by_viewer>;
type MoreReplies = St::MoreReplies;
type MoreParents = St::MoreParents;
}
pub struct SetMoreReplies<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMoreReplies<St> {}
impl<St: State> State for SetMoreReplies<St> {
type Post = St::Post;
type HiddenByThreadgate = St::HiddenByThreadgate;
type OpThread = St::OpThread;
type MutedByViewer = St::MutedByViewer;
type MoreReplies = Set<members::more_replies>;
type MoreParents = St::MoreParents;
}
pub struct SetMoreParents<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetMoreParents<St> {}
impl<St: State> State for SetMoreParents<St> {
type Post = St::Post;
type HiddenByThreadgate = St::HiddenByThreadgate;
type OpThread = St::OpThread;
type MutedByViewer = St::MutedByViewer;
type MoreReplies = St::MoreReplies;
type MoreParents = Set<members::more_parents>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post(());
pub struct hidden_by_threadgate(());
pub struct op_thread(());
pub struct muted_by_viewer(());
pub struct more_replies(());
pub struct more_parents(());
}
}
pub struct ThreadItemPostBuilder<S: BosStr, St: thread_item_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<bool>,
Option<bool>,
Option<i64>,
Option<bool>,
Option<bool>,
Option<PostView<S>>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ThreadItemPost<S> {
pub fn new() -> ThreadItemPostBuilder<S, thread_item_post_state::Empty> {
ThreadItemPostBuilder::new()
}
}
impl<S: BosStr> ThreadItemPostBuilder<S, thread_item_post_state::Empty> {
pub fn new() -> Self {
ThreadItemPostBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::HiddenByThreadgate: thread_item_post_state::IsUnset,
{
pub fn hidden_by_threadgate(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetHiddenByThreadgate<St>> {
self._fields.0 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::MoreParents: thread_item_post_state::IsUnset,
{
pub fn more_parents(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetMoreParents<St>> {
self._fields.1 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::MoreReplies: thread_item_post_state::IsUnset,
{
pub fn more_replies(
mut self,
value: impl Into<i64>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetMoreReplies<St>> {
self._fields.2 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::MutedByViewer: thread_item_post_state::IsUnset,
{
pub fn muted_by_viewer(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetMutedByViewer<St>> {
self._fields.3 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::OpThread: thread_item_post_state::IsUnset,
{
pub fn op_thread(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetOpThread<St>> {
self._fields.4 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::Post: thread_item_post_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<PostView<S>>,
) -> ThreadItemPostBuilder<S, thread_item_post_state::SetPost<St>> {
self._fields.5 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ThreadItemPostBuilder<S, St>
where
St: thread_item_post_state::State,
St::Post: thread_item_post_state::IsSet,
St::HiddenByThreadgate: thread_item_post_state::IsSet,
St::OpThread: thread_item_post_state::IsSet,
St::MutedByViewer: thread_item_post_state::IsSet,
St::MoreReplies: thread_item_post_state::IsSet,
St::MoreParents: thread_item_post_state::IsSet,
{
pub fn build(self) -> ThreadItemPost<S> {
ThreadItemPost {
hidden_by_threadgate: self._fields.0.unwrap(),
more_parents: self._fields.1.unwrap(),
more_replies: self._fields.2.unwrap(),
muted_by_viewer: self._fields.3.unwrap(),
op_thread: self._fields.4.unwrap(),
post: self._fields.5.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> ThreadItemPost<S> {
ThreadItemPost {
hidden_by_threadgate: self._fields.0.unwrap(),
more_parents: self._fields.1.unwrap(),
more_replies: self._fields.2.unwrap(),
muted_by_viewer: self._fields.3.unwrap(),
op_thread: self._fields.4.unwrap(),
post: self._fields.5.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod trend_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 PostCount;
type Actors;
type Topic;
type Link;
type StartedAt;
type DisplayName;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type PostCount = Unset;
type Actors = Unset;
type Topic = Unset;
type Link = Unset;
type StartedAt = Unset;
type DisplayName = Unset;
}
pub struct SetPostCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPostCount<St> {}
impl<St: State> State for SetPostCount<St> {
type PostCount = Set<members::post_count>;
type Actors = St::Actors;
type Topic = St::Topic;
type Link = St::Link;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
}
pub struct SetActors<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetActors<St> {}
impl<St: State> State for SetActors<St> {
type PostCount = St::PostCount;
type Actors = Set<members::actors>;
type Topic = St::Topic;
type Link = St::Link;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
}
pub struct SetTopic<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTopic<St> {}
impl<St: State> State for SetTopic<St> {
type PostCount = St::PostCount;
type Actors = St::Actors;
type Topic = Set<members::topic>;
type Link = St::Link;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
}
pub struct SetLink<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLink<St> {}
impl<St: State> State for SetLink<St> {
type PostCount = St::PostCount;
type Actors = St::Actors;
type Topic = St::Topic;
type Link = Set<members::link>;
type StartedAt = St::StartedAt;
type DisplayName = St::DisplayName;
}
pub struct SetStartedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStartedAt<St> {}
impl<St: State> State for SetStartedAt<St> {
type PostCount = St::PostCount;
type Actors = St::Actors;
type Topic = St::Topic;
type Link = St::Link;
type StartedAt = Set<members::started_at>;
type DisplayName = St::DisplayName;
}
pub struct SetDisplayName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetDisplayName<St> {}
impl<St: State> State for SetDisplayName<St> {
type PostCount = St::PostCount;
type Actors = St::Actors;
type Topic = St::Topic;
type Link = St::Link;
type StartedAt = St::StartedAt;
type DisplayName = Set<members::display_name>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct post_count(());
pub struct actors(());
pub struct topic(());
pub struct link(());
pub struct started_at(());
pub struct display_name(());
}
}
pub struct TrendViewBuilder<S: BosStr, St: trend_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<Vec<ProfileViewBasic<S>>>,
Option<S>,
Option<S>,
Option<S>,
Option<i64>,
Option<Datetime>,
Option<TrendViewStatus<S>>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> TrendView<S> {
pub fn new() -> TrendViewBuilder<S, trend_view_state::Empty> {
TrendViewBuilder::new()
}
}
impl<S: BosStr> TrendViewBuilder<S, trend_view_state::Empty> {
pub fn new() -> Self {
TrendViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::Actors: trend_view_state::IsUnset,
{
pub fn actors(
mut self,
value: impl Into<Vec<ProfileViewBasic<S>>>,
) -> TrendViewBuilder<S, trend_view_state::SetActors<St>> {
self._fields.0 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: trend_view_state::State> TrendViewBuilder<S, St> {
pub fn category(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_category(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::DisplayName: trend_view_state::IsUnset,
{
pub fn display_name(
mut self,
value: impl Into<S>,
) -> TrendViewBuilder<S, trend_view_state::SetDisplayName<St>> {
self._fields.2 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::Link: trend_view_state::IsUnset,
{
pub fn link(
mut self,
value: impl Into<S>,
) -> TrendViewBuilder<S, trend_view_state::SetLink<St>> {
self._fields.3 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::PostCount: trend_view_state::IsUnset,
{
pub fn post_count(
mut self,
value: impl Into<i64>,
) -> TrendViewBuilder<S, trend_view_state::SetPostCount<St>> {
self._fields.4 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::StartedAt: trend_view_state::IsUnset,
{
pub fn started_at(
mut self,
value: impl Into<Datetime>,
) -> TrendViewBuilder<S, trend_view_state::SetStartedAt<St>> {
self._fields.5 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: trend_view_state::State> TrendViewBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<TrendViewStatus<S>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<TrendViewStatus<S>>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::Topic: trend_view_state::IsUnset,
{
pub fn topic(
mut self,
value: impl Into<S>,
) -> TrendViewBuilder<S, trend_view_state::SetTopic<St>> {
self._fields.7 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> TrendViewBuilder<S, St>
where
St: trend_view_state::State,
St::PostCount: trend_view_state::IsSet,
St::Actors: trend_view_state::IsSet,
St::Topic: trend_view_state::IsSet,
St::Link: trend_view_state::IsSet,
St::StartedAt: trend_view_state::IsSet,
St::DisplayName: trend_view_state::IsSet,
{
pub fn build(self) -> TrendView<S> {
TrendView {
actors: self._fields.0.unwrap(),
category: self._fields.1,
display_name: self._fields.2.unwrap(),
link: self._fields.3.unwrap(),
post_count: self._fields.4.unwrap(),
started_at: self._fields.5.unwrap(),
status: self._fields.6,
topic: self._fields.7.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> TrendView<S> {
TrendView {
actors: self._fields.0.unwrap(),
category: self._fields.1,
display_name: self._fields.2.unwrap(),
link: self._fields.3.unwrap(),
post_count: self._fields.4.unwrap(),
started_at: self._fields.5.unwrap(),
status: self._fields.6,
topic: self._fields.7.unwrap(),
extra_data: Some(extra_data),
}
}
}