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;
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::types::string::{Did, AtUri, Datetime};
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::actor::ProfileViewBasic;
use crate::app_bsky::feed::BlockedAuthor;
use crate::app_bsky::feed::PostView;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceEvent<'a> {
#[serde(borrow)]
pub attempt_id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub complete_ip: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub complete_ua: Option<CowStr<'a>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub email: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub init_ip: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub init_ua: Option<CowStr<'a>>,
#[serde(borrow)]
pub status: AgeAssuranceEventStatus<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceEventStatus<'a> {
Unknown,
Pending,
Assured,
Other(CowStr<'a>),
}
impl<'a> AgeAssuranceEventStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Unknown => "unknown",
Self::Pending => "pending",
Self::Assured => "assured",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for AgeAssuranceEventStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AgeAssuranceEventStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AgeAssuranceEventStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AgeAssuranceEventStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AgeAssuranceEventStatus<'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 AgeAssuranceEventStatus<'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 AgeAssuranceEventStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AgeAssuranceEventStatus<'_> {
type Output = AgeAssuranceEventStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct AgeAssuranceState<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
pub last_initiated_at: Option<Datetime>,
#[serde(borrow)]
pub status: AgeAssuranceStateStatus<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum AgeAssuranceStateStatus<'a> {
Unknown,
Pending,
Assured,
Blocked,
Other(CowStr<'a>),
}
impl<'a> AgeAssuranceStateStatus<'a> {
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(),
}
}
}
impl<'a> From<&'a str> for AgeAssuranceStateStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for AgeAssuranceStateStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"unknown" => Self::Unknown,
"pending" => Self::Pending,
"assured" => Self::Assured,
"blocked" => Self::Blocked,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for AgeAssuranceStateStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for AgeAssuranceStateStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for AgeAssuranceStateStatus<'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 AgeAssuranceStateStatus<'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 AgeAssuranceStateStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for AgeAssuranceStateStatus<'_> {
type Output = AgeAssuranceStateStatus<'static>;
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())
}
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonSearchActor<'a> {
#[serde(borrow)]
pub did: Did<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonSearchPost<'a> {
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonSearchStarterPack<'a> {
#[serde(borrow)]
pub uri: AtUri<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct SkeletonTrend<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub category: Option<CowStr<'a>>,
#[serde(borrow)]
pub dids: Vec<Did<'a>>,
#[serde(borrow)]
pub display_name: CowStr<'a>,
#[serde(borrow)]
pub link: CowStr<'a>,
pub post_count: i64,
pub started_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<SkeletonTrendStatus<'a>>,
#[serde(borrow)]
pub topic: CowStr<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum SkeletonTrendStatus<'a> {
Hot,
Other(CowStr<'a>),
}
impl<'a> SkeletonTrendStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Hot => "hot",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for SkeletonTrendStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"hot" => Self::Hot,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for SkeletonTrendStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"hot" => Self::Hot,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for SkeletonTrendStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for SkeletonTrendStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for SkeletonTrendStatus<'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 SkeletonTrendStatus<'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 SkeletonTrendStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for SkeletonTrendStatus<'_> {
type Output = SkeletonTrendStatus<'static>;
fn into_static(self) -> Self::Output {
match self {
SkeletonTrendStatus::Hot => SkeletonTrendStatus::Hot,
SkeletonTrendStatus::Other(v) => SkeletonTrendStatus::Other(v.into_static()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemBlocked<'a> {
#[serde(borrow)]
pub author: BlockedAuthor<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemNoUnauthenticated<'a> {}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemNotFound<'a> {}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ThreadItemPost<'a> {
pub hidden_by_threadgate: bool,
pub more_parents: bool,
pub more_replies: i64,
pub muted_by_viewer: bool,
pub op_thread: bool,
#[serde(borrow)]
pub post: PostView<'a>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct TrendView<'a> {
#[serde(borrow)]
pub actors: Vec<ProfileViewBasic<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub category: Option<CowStr<'a>>,
#[serde(borrow)]
pub display_name: CowStr<'a>,
#[serde(borrow)]
pub link: CowStr<'a>,
pub post_count: i64,
pub started_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub status: Option<TrendViewStatus<'a>>,
#[serde(borrow)]
pub topic: CowStr<'a>,
}
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub enum TrendViewStatus<'a> {
Hot,
Other(CowStr<'a>),
}
impl<'a> TrendViewStatus<'a> {
pub fn as_str(&self) -> &str {
match self {
Self::Hot => "hot",
Self::Other(s) => s.as_ref(),
}
}
}
impl<'a> From<&'a str> for TrendViewStatus<'a> {
fn from(s: &'a str) -> Self {
match s {
"hot" => Self::Hot,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> From<String> for TrendViewStatus<'a> {
fn from(s: String) -> Self {
match s.as_str() {
"hot" => Self::Hot,
_ => Self::Other(CowStr::from(s)),
}
}
}
impl<'a> core::fmt::Display for TrendViewStatus<'a> {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl<'a> AsRef<str> for TrendViewStatus<'a> {
fn as_ref(&self) -> &str {
self.as_str()
}
}
impl<'a> serde::Serialize for TrendViewStatus<'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 TrendViewStatus<'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 TrendViewStatus<'a> {
fn default() -> Self {
Self::Other(Default::default())
}
}
impl jacquard_common::IntoStatic for TrendViewStatus<'_> {
type Output = TrendViewStatus<'static>;
fn into_static(self) -> Self::Output {
match self {
TrendViewStatus::Hot => TrendViewStatus::Hot,
TrendViewStatus::Other(v) => TrendViewStatus::Other(v.into_static()),
}
}
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct TrendingTopic<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub description: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub display_name: Option<CowStr<'a>>,
#[serde(borrow)]
pub link: CowStr<'a>,
#[serde(borrow)]
pub topic: CowStr<'a>,
}
impl<'a> LexiconSchema for AgeAssuranceEvent<'a> {
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<'a> LexiconSchema for AgeAssuranceState<'a> {
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<'a> LexiconSchema for SkeletonSearchActor<'a> {
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<'a> LexiconSchema for SkeletonSearchPost<'a> {
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<'a> LexiconSchema for SkeletonSearchStarterPack<'a> {
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<'a> LexiconSchema for SkeletonTrend<'a> {
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<'a> LexiconSchema for ThreadItemBlocked<'a> {
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<'a> LexiconSchema for ThreadItemNoUnauthenticated<'a> {
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<'a> LexiconSchema for ThreadItemNotFound<'a> {
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<'a> LexiconSchema for ThreadItemPost<'a> {
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<'a> LexiconSchema for TrendView<'a> {
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<'a> LexiconSchema for TrendingTopic<'a> {
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 CreatedAt;
type Status;
type AttemptId;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type CreatedAt = Unset;
type Status = Unset;
type AttemptId = Unset;
}
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 CreatedAt = Set<members::created_at>;
type Status = S::Status;
type AttemptId = S::AttemptId;
}
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 CreatedAt = S::CreatedAt;
type Status = Set<members::status>;
type AttemptId = S::AttemptId;
}
pub struct SetAttemptId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAttemptId<S> {}
impl<S: State> State for SetAttemptId<S> {
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type AttemptId = Set<members::attempt_id>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct created_at(());
pub struct status(());
pub struct attempt_id(());
}
}
pub struct AgeAssuranceEventBuilder<'a, S: age_assurance_event_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<AgeAssuranceEventStatus<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> AgeAssuranceEvent<'a> {
pub fn new() -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
AgeAssuranceEventBuilder::new()
}
}
impl<'a> AgeAssuranceEventBuilder<'a, age_assurance_event_state::Empty> {
pub fn new() -> Self {
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::AttemptId: age_assurance_event_state::IsUnset,
{
pub fn attempt_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetAttemptId<S>> {
self._fields.0 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn complete_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_complete_ip(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn complete_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_complete_ua(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::CreatedAt: age_assurance_event_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetCreatedAt<S>> {
self._fields.3 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn email(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_email(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn init_ip(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_init_ip(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: age_assurance_event_state::State> AgeAssuranceEventBuilder<'a, S> {
pub fn init_ua(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_init_ua(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::Status: age_assurance_event_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<AgeAssuranceEventStatus<'a>>,
) -> AgeAssuranceEventBuilder<'a, age_assurance_event_state::SetStatus<S>> {
self._fields.7 = Option::Some(value.into());
AgeAssuranceEventBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> AgeAssuranceEventBuilder<'a, S>
where
S: age_assurance_event_state::State,
S::CreatedAt: age_assurance_event_state::IsSet,
S::Status: age_assurance_event_state::IsSet,
S::AttemptId: age_assurance_event_state::IsSet,
{
pub fn build(self) -> AgeAssuranceEvent<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> AgeAssuranceEvent<'a> {
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<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 SkeletonSearchActorBuilder<'a, S: skeleton_search_actor_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Did<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SkeletonSearchActor<'a> {
pub fn new() -> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::Empty> {
SkeletonSearchActorBuilder::new()
}
}
impl<'a> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::Empty> {
pub fn new() -> Self {
SkeletonSearchActorBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchActorBuilder<'a, S>
where
S: skeleton_search_actor_state::State,
S::Did: skeleton_search_actor_state::IsUnset,
{
pub fn did(
mut self,
value: impl Into<Did<'a>>,
) -> SkeletonSearchActorBuilder<'a, skeleton_search_actor_state::SetDid<S>> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchActorBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchActorBuilder<'a, S>
where
S: skeleton_search_actor_state::State,
S::Did: skeleton_search_actor_state::IsSet,
{
pub fn build(self) -> SkeletonSearchActor<'a> {
SkeletonSearchActor {
did: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SkeletonSearchActor<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SkeletonSearchPostBuilder<'a, S: skeleton_search_post_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtUri<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SkeletonSearchPost<'a> {
pub fn new() -> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::Empty> {
SkeletonSearchPostBuilder::new()
}
}
impl<'a> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::Empty> {
pub fn new() -> Self {
SkeletonSearchPostBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchPostBuilder<'a, S>
where
S: skeleton_search_post_state::State,
S::Uri: skeleton_search_post_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> SkeletonSearchPostBuilder<'a, skeleton_search_post_state::SetUri<S>> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchPostBuilder<'a, S>
where
S: skeleton_search_post_state::State,
S::Uri: skeleton_search_post_state::IsSet,
{
pub fn build(self) -> SkeletonSearchPost<'a> {
SkeletonSearchPost {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SkeletonSearchPost<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
}
}
pub struct SkeletonSearchStarterPackBuilder<
'a,
S: skeleton_search_starter_pack_state::State,
> {
_state: PhantomData<fn() -> S>,
_fields: (Option<AtUri<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SkeletonSearchStarterPack<'a> {
pub fn new() -> SkeletonSearchStarterPackBuilder<
'a,
skeleton_search_starter_pack_state::Empty,
> {
SkeletonSearchStarterPackBuilder::new()
}
}
impl<
'a,
> SkeletonSearchStarterPackBuilder<'a, skeleton_search_starter_pack_state::Empty> {
pub fn new() -> Self {
SkeletonSearchStarterPackBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchStarterPackBuilder<'a, S>
where
S: skeleton_search_starter_pack_state::State,
S::Uri: skeleton_search_starter_pack_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<AtUri<'a>>,
) -> SkeletonSearchStarterPackBuilder<
'a,
skeleton_search_starter_pack_state::SetUri<S>,
> {
self._fields.0 = Option::Some(value.into());
SkeletonSearchStarterPackBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonSearchStarterPackBuilder<'a, S>
where
S: skeleton_search_starter_pack_state::State,
S::Uri: skeleton_search_starter_pack_state::IsSet,
{
pub fn build(self) -> SkeletonSearchStarterPack<'a> {
SkeletonSearchStarterPack {
uri: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SkeletonSearchStarterPack<'a> {
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 DisplayName;
type PostCount;
type Link;
type StartedAt;
type Dids;
type Topic;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type DisplayName = Unset;
type PostCount = Unset;
type Link = Unset;
type StartedAt = Unset;
type Dids = Unset;
type Topic = Unset;
}
pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDisplayName<S> {}
impl<S: State> State for SetDisplayName<S> {
type DisplayName = Set<members::display_name>;
type PostCount = S::PostCount;
type Link = S::Link;
type StartedAt = S::StartedAt;
type Dids = S::Dids;
type Topic = S::Topic;
}
pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPostCount<S> {}
impl<S: State> State for SetPostCount<S> {
type DisplayName = S::DisplayName;
type PostCount = Set<members::post_count>;
type Link = S::Link;
type StartedAt = S::StartedAt;
type Dids = S::Dids;
type Topic = S::Topic;
}
pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLink<S> {}
impl<S: State> State for SetLink<S> {
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
type Link = Set<members::link>;
type StartedAt = S::StartedAt;
type Dids = S::Dids;
type Topic = S::Topic;
}
pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStartedAt<S> {}
impl<S: State> State for SetStartedAt<S> {
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
type Link = S::Link;
type StartedAt = Set<members::started_at>;
type Dids = S::Dids;
type Topic = S::Topic;
}
pub struct SetDids<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDids<S> {}
impl<S: State> State for SetDids<S> {
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
type Link = S::Link;
type StartedAt = S::StartedAt;
type Dids = Set<members::dids>;
type Topic = S::Topic;
}
pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTopic<S> {}
impl<S: State> State for SetTopic<S> {
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
type Link = S::Link;
type StartedAt = S::StartedAt;
type Dids = S::Dids;
type Topic = Set<members::topic>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct display_name(());
pub struct post_count(());
pub struct link(());
pub struct started_at(());
pub struct dids(());
pub struct topic(());
}
}
pub struct SkeletonTrendBuilder<'a, S: skeleton_trend_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<Vec<Did<'a>>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<i64>,
Option<Datetime>,
Option<SkeletonTrendStatus<'a>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> SkeletonTrend<'a> {
pub fn new() -> SkeletonTrendBuilder<'a, skeleton_trend_state::Empty> {
SkeletonTrendBuilder::new()
}
}
impl<'a> SkeletonTrendBuilder<'a, skeleton_trend_state::Empty> {
pub fn new() -> Self {
SkeletonTrendBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> {
pub fn category(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_category(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::Dids: skeleton_trend_state::IsUnset,
{
pub fn dids(
mut self,
value: impl Into<Vec<Did<'a>>>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDids<S>> {
self._fields.1 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::DisplayName: skeleton_trend_state::IsUnset,
{
pub fn display_name(
mut self,
value: impl Into<CowStr<'a>>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetDisplayName<S>> {
self._fields.2 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::Link: skeleton_trend_state::IsUnset,
{
pub fn link(
mut self,
value: impl Into<CowStr<'a>>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetLink<S>> {
self._fields.3 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::PostCount: skeleton_trend_state::IsUnset,
{
pub fn post_count(
mut self,
value: impl Into<i64>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetPostCount<S>> {
self._fields.4 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::StartedAt: skeleton_trend_state::IsUnset,
{
pub fn started_at(
mut self,
value: impl Into<Datetime>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetStartedAt<S>> {
self._fields.5 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: skeleton_trend_state::State> SkeletonTrendBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<SkeletonTrendStatus<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<SkeletonTrendStatus<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::Topic: skeleton_trend_state::IsUnset,
{
pub fn topic(
mut self,
value: impl Into<CowStr<'a>>,
) -> SkeletonTrendBuilder<'a, skeleton_trend_state::SetTopic<S>> {
self._fields.7 = Option::Some(value.into());
SkeletonTrendBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> SkeletonTrendBuilder<'a, S>
where
S: skeleton_trend_state::State,
S::DisplayName: skeleton_trend_state::IsSet,
S::PostCount: skeleton_trend_state::IsSet,
S::Link: skeleton_trend_state::IsSet,
S::StartedAt: skeleton_trend_state::IsSet,
S::Dids: skeleton_trend_state::IsSet,
S::Topic: skeleton_trend_state::IsSet,
{
pub fn build(self) -> SkeletonTrend<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> SkeletonTrend<'a> {
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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type Author = Set<members::author>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct author(());
}
}
pub struct ThreadItemBlockedBuilder<'a, S: thread_item_blocked_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<BlockedAuthor<'a>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ThreadItemBlocked<'a> {
pub fn new() -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::Empty> {
ThreadItemBlockedBuilder::new()
}
}
impl<'a> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::Empty> {
pub fn new() -> Self {
ThreadItemBlockedBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemBlockedBuilder<'a, S>
where
S: thread_item_blocked_state::State,
S::Author: thread_item_blocked_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<BlockedAuthor<'a>>,
) -> ThreadItemBlockedBuilder<'a, thread_item_blocked_state::SetAuthor<S>> {
self._fields.0 = Option::Some(value.into());
ThreadItemBlockedBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemBlockedBuilder<'a, S>
where
S: thread_item_blocked_state::State,
S::Author: thread_item_blocked_state::IsSet,
{
pub fn build(self) -> ThreadItemBlocked<'a> {
ThreadItemBlocked {
author: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ThreadItemBlocked<'a> {
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 HiddenByThreadgate;
type MoreParents;
type MutedByViewer;
type Post;
type MoreReplies;
type OpThread;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type HiddenByThreadgate = Unset;
type MoreParents = Unset;
type MutedByViewer = Unset;
type Post = Unset;
type MoreReplies = Unset;
type OpThread = Unset;
}
pub struct SetHiddenByThreadgate<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetHiddenByThreadgate<S> {}
impl<S: State> State for SetHiddenByThreadgate<S> {
type HiddenByThreadgate = Set<members::hidden_by_threadgate>;
type MoreParents = S::MoreParents;
type MutedByViewer = S::MutedByViewer;
type Post = S::Post;
type MoreReplies = S::MoreReplies;
type OpThread = S::OpThread;
}
pub struct SetMoreParents<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMoreParents<S> {}
impl<S: State> State for SetMoreParents<S> {
type HiddenByThreadgate = S::HiddenByThreadgate;
type MoreParents = Set<members::more_parents>;
type MutedByViewer = S::MutedByViewer;
type Post = S::Post;
type MoreReplies = S::MoreReplies;
type OpThread = S::OpThread;
}
pub struct SetMutedByViewer<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMutedByViewer<S> {}
impl<S: State> State for SetMutedByViewer<S> {
type HiddenByThreadgate = S::HiddenByThreadgate;
type MoreParents = S::MoreParents;
type MutedByViewer = Set<members::muted_by_viewer>;
type Post = S::Post;
type MoreReplies = S::MoreReplies;
type OpThread = S::OpThread;
}
pub struct SetPost<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPost<S> {}
impl<S: State> State for SetPost<S> {
type HiddenByThreadgate = S::HiddenByThreadgate;
type MoreParents = S::MoreParents;
type MutedByViewer = S::MutedByViewer;
type Post = Set<members::post>;
type MoreReplies = S::MoreReplies;
type OpThread = S::OpThread;
}
pub struct SetMoreReplies<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetMoreReplies<S> {}
impl<S: State> State for SetMoreReplies<S> {
type HiddenByThreadgate = S::HiddenByThreadgate;
type MoreParents = S::MoreParents;
type MutedByViewer = S::MutedByViewer;
type Post = S::Post;
type MoreReplies = Set<members::more_replies>;
type OpThread = S::OpThread;
}
pub struct SetOpThread<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetOpThread<S> {}
impl<S: State> State for SetOpThread<S> {
type HiddenByThreadgate = S::HiddenByThreadgate;
type MoreParents = S::MoreParents;
type MutedByViewer = S::MutedByViewer;
type Post = S::Post;
type MoreReplies = S::MoreReplies;
type OpThread = Set<members::op_thread>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct hidden_by_threadgate(());
pub struct more_parents(());
pub struct muted_by_viewer(());
pub struct post(());
pub struct more_replies(());
pub struct op_thread(());
}
}
pub struct ThreadItemPostBuilder<'a, S: thread_item_post_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<bool>,
Option<bool>,
Option<i64>,
Option<bool>,
Option<bool>,
Option<PostView<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ThreadItemPost<'a> {
pub fn new() -> ThreadItemPostBuilder<'a, thread_item_post_state::Empty> {
ThreadItemPostBuilder::new()
}
}
impl<'a> ThreadItemPostBuilder<'a, thread_item_post_state::Empty> {
pub fn new() -> Self {
ThreadItemPostBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::HiddenByThreadgate: thread_item_post_state::IsUnset,
{
pub fn hidden_by_threadgate(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetHiddenByThreadgate<S>> {
self._fields.0 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::MoreParents: thread_item_post_state::IsUnset,
{
pub fn more_parents(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreParents<S>> {
self._fields.1 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::MoreReplies: thread_item_post_state::IsUnset,
{
pub fn more_replies(
mut self,
value: impl Into<i64>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMoreReplies<S>> {
self._fields.2 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::MutedByViewer: thread_item_post_state::IsUnset,
{
pub fn muted_by_viewer(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetMutedByViewer<S>> {
self._fields.3 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::OpThread: thread_item_post_state::IsUnset,
{
pub fn op_thread(
mut self,
value: impl Into<bool>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetOpThread<S>> {
self._fields.4 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::Post: thread_item_post_state::IsUnset,
{
pub fn post(
mut self,
value: impl Into<PostView<'a>>,
) -> ThreadItemPostBuilder<'a, thread_item_post_state::SetPost<S>> {
self._fields.5 = Option::Some(value.into());
ThreadItemPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ThreadItemPostBuilder<'a, S>
where
S: thread_item_post_state::State,
S::HiddenByThreadgate: thread_item_post_state::IsSet,
S::MoreParents: thread_item_post_state::IsSet,
S::MutedByViewer: thread_item_post_state::IsSet,
S::Post: thread_item_post_state::IsSet,
S::MoreReplies: thread_item_post_state::IsSet,
S::OpThread: thread_item_post_state::IsSet,
{
pub fn build(self) -> ThreadItemPost<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ThreadItemPost<'a> {
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 Link;
type Actors;
type StartedAt;
type Topic;
type DisplayName;
type PostCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Link = Unset;
type Actors = Unset;
type StartedAt = Unset;
type Topic = Unset;
type DisplayName = Unset;
type PostCount = Unset;
}
pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLink<S> {}
impl<S: State> State for SetLink<S> {
type Link = Set<members::link>;
type Actors = S::Actors;
type StartedAt = S::StartedAt;
type Topic = S::Topic;
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
}
pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetActors<S> {}
impl<S: State> State for SetActors<S> {
type Link = S::Link;
type Actors = Set<members::actors>;
type StartedAt = S::StartedAt;
type Topic = S::Topic;
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
}
pub struct SetStartedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStartedAt<S> {}
impl<S: State> State for SetStartedAt<S> {
type Link = S::Link;
type Actors = S::Actors;
type StartedAt = Set<members::started_at>;
type Topic = S::Topic;
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
}
pub struct SetTopic<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTopic<S> {}
impl<S: State> State for SetTopic<S> {
type Link = S::Link;
type Actors = S::Actors;
type StartedAt = S::StartedAt;
type Topic = Set<members::topic>;
type DisplayName = S::DisplayName;
type PostCount = S::PostCount;
}
pub struct SetDisplayName<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetDisplayName<S> {}
impl<S: State> State for SetDisplayName<S> {
type Link = S::Link;
type Actors = S::Actors;
type StartedAt = S::StartedAt;
type Topic = S::Topic;
type DisplayName = Set<members::display_name>;
type PostCount = S::PostCount;
}
pub struct SetPostCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPostCount<S> {}
impl<S: State> State for SetPostCount<S> {
type Link = S::Link;
type Actors = S::Actors;
type StartedAt = S::StartedAt;
type Topic = S::Topic;
type DisplayName = S::DisplayName;
type PostCount = Set<members::post_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct link(());
pub struct actors(());
pub struct started_at(());
pub struct topic(());
pub struct display_name(());
pub struct post_count(());
}
}
pub struct TrendViewBuilder<'a, S: trend_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<Vec<ProfileViewBasic<'a>>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<i64>,
Option<Datetime>,
Option<TrendViewStatus<'a>>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> TrendView<'a> {
pub fn new() -> TrendViewBuilder<'a, trend_view_state::Empty> {
TrendViewBuilder::new()
}
}
impl<'a> TrendViewBuilder<'a, trend_view_state::Empty> {
pub fn new() -> Self {
TrendViewBuilder {
_state: PhantomData,
_fields: (None, None, None, None, None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::Actors: trend_view_state::IsUnset,
{
pub fn actors(
mut self,
value: impl Into<Vec<ProfileViewBasic<'a>>>,
) -> TrendViewBuilder<'a, trend_view_state::SetActors<S>> {
self._fields.0 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> {
pub fn category(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_category(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::DisplayName: trend_view_state::IsUnset,
{
pub fn display_name(
mut self,
value: impl Into<CowStr<'a>>,
) -> TrendViewBuilder<'a, trend_view_state::SetDisplayName<S>> {
self._fields.2 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::Link: trend_view_state::IsUnset,
{
pub fn link(
mut self,
value: impl Into<CowStr<'a>>,
) -> TrendViewBuilder<'a, trend_view_state::SetLink<S>> {
self._fields.3 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::PostCount: trend_view_state::IsUnset,
{
pub fn post_count(
mut self,
value: impl Into<i64>,
) -> TrendViewBuilder<'a, trend_view_state::SetPostCount<S>> {
self._fields.4 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::StartedAt: trend_view_state::IsUnset,
{
pub fn started_at(
mut self,
value: impl Into<Datetime>,
) -> TrendViewBuilder<'a, trend_view_state::SetStartedAt<S>> {
self._fields.5 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: trend_view_state::State> TrendViewBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<TrendViewStatus<'a>>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<TrendViewStatus<'a>>) -> Self {
self._fields.6 = value;
self
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::Topic: trend_view_state::IsUnset,
{
pub fn topic(
mut self,
value: impl Into<CowStr<'a>>,
) -> TrendViewBuilder<'a, trend_view_state::SetTopic<S>> {
self._fields.7 = Option::Some(value.into());
TrendViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> TrendViewBuilder<'a, S>
where
S: trend_view_state::State,
S::Link: trend_view_state::IsSet,
S::Actors: trend_view_state::IsSet,
S::StartedAt: trend_view_state::IsSet,
S::Topic: trend_view_state::IsSet,
S::DisplayName: trend_view_state::IsSet,
S::PostCount: trend_view_state::IsSet,
{
pub fn build(self) -> TrendView<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TrendView<'a> {
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),
}
}
}