#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, 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::{Datetime, Language};
use jacquard_common::types::value::Data;
use jacquard_derive::{IntoStatic, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::app_bsky::embed::external::ExternalRecord;
use crate::app_bsky::embed::images::Images;
use crate::app_bsky::embed::record::Record;
use crate::app_bsky::embed::record_with_media::RecordWithMedia;
use crate::app_bsky::embed::video::Video;
use crate::app_bsky::feed::threadgate::FollowerRule;
use crate::app_bsky::feed::threadgate::FollowingRule;
use crate::app_bsky::feed::threadgate::ListRule;
use crate::app_bsky::feed::threadgate::MentionRule;
use crate::app_bsky::richtext::facet::Facet;
use crate::app_chronosky::schedule::list_posts;
use crate::com_atproto::label::SelfLabels;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ImageView<S: BosStr = DefaultStr> {
pub images: Vec<list_posts::ImageViewImage<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 ImageViewImage<S: BosStr = DefaultStr> {
pub alt: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<S>,
pub fullsize: S,
pub thumb: 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 ListPosts<S: BosStr = DefaultStr> {
#[serde(default = "_default_limit")]
#[serde(skip_serializing_if = "Option::is_none")]
pub limit: Option<i64>,
#[serde(default = "_default_page")]
#[serde(skip_serializing_if = "Option::is_none")]
pub page: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub status: Option<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ListPostsOutput<S: BosStr = DefaultStr> {
pub pagination: list_posts::Pagination<S>,
pub posts: Vec<list_posts::ScheduledPost<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 Pagination<S: BosStr = DefaultStr> {
pub limit: i64,
pub page: i64,
pub total: i64,
pub total_pages: i64,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct ScheduledPost<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub at_rkey: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub at_uri: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub children: Option<Vec<list_posts::ScheduledPost<S>>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub embed: Option<ScheduledPostEmbed<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub error_msg: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub executed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
pub facets: Option<Vec<Facet<S>>>,
pub id: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub labels: Option<SelfLabels<S>>,
pub langs: Vec<Language>,
#[serde(skip_serializing_if = "Option::is_none")]
pub parent_post_id: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postgate_cid: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postgate_disable_embedding: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postgate_uri: Option<S>,
pub retry_count: i64,
pub scheduled_at: Datetime,
pub status: S,
pub text: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_depth: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub thread_position: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threadgate_cid: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threadgate_rules: Option<Vec<ScheduledPostThreadgateRulesItem<S>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub threadgate_uri: Option<S>,
pub updated_at: Datetime,
pub user_id: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ScheduledPostEmbed<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.embed.images")]
Images(Box<Images<S>>),
#[serde(rename = "app.chronosky.schedule.listPosts#imageView")]
ImageView(Box<list_posts::ImageView<S>>),
#[serde(rename = "app.bsky.embed.external")]
External(Box<ExternalRecord<S>>),
#[serde(rename = "app.bsky.embed.record")]
Record(Box<Record<S>>),
#[serde(rename = "app.bsky.embed.video")]
Video(Box<Video<S>>),
#[serde(rename = "app.bsky.embed.recordWithMedia")]
RecordWithMedia(Box<RecordWithMedia<S>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub enum ScheduledPostThreadgateRulesItem<S: BosStr = DefaultStr> {
#[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
ThreadgateMentionRule(Box<MentionRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#followerRule")]
ThreadgateFollowerRule(Box<FollowerRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#followingRule")]
ThreadgateFollowingRule(Box<FollowingRule<S>>),
#[serde(rename = "app.bsky.feed.threadgate#listRule")]
ThreadgateListRule(Box<ListRule<S>>),
}
impl<S: BosStr> LexiconSchema for ImageView<S> {
fn nsid() -> &'static str {
"app.chronosky.schedule.listPosts"
}
fn def_name() -> &'static str {
"imageView"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_chronosky_schedule_listPosts()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.images;
#[allow(unused_comparisons)]
if value.len() > 4usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("images"),
max: 4usize,
actual: value.len(),
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ImageViewImage<S> {
fn nsid() -> &'static str {
"app.chronosky.schedule.listPosts"
}
fn def_name() -> &'static str {
"imageViewImage"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_chronosky_schedule_listPosts()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.cid {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("cid"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
pub struct ListPostsResponse;
impl jacquard_common::xrpc::XrpcResp for ListPostsResponse {
const NSID: &'static str = "app.chronosky.schedule.listPosts";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = ListPostsOutput<S>;
type Err = jacquard_common::xrpc::GenericError;
}
impl<S: BosStr> jacquard_common::xrpc::XrpcRequest for ListPosts<S> {
const NSID: &'static str = "app.chronosky.schedule.listPosts";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Response = ListPostsResponse;
}
pub struct ListPostsRequest;
impl jacquard_common::xrpc::XrpcEndpoint for ListPostsRequest {
const PATH: &'static str = "/xrpc/app.chronosky.schedule.listPosts";
const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
type Request<S: BosStr> = ListPosts<S>;
type Response = ListPostsResponse;
}
impl<S: BosStr> LexiconSchema for Pagination<S> {
fn nsid() -> &'static str {
"app.chronosky.schedule.listPosts"
}
fn def_name() -> &'static str {
"pagination"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_chronosky_schedule_listPosts()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.limit;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("limit"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.page;
if *value < 1i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("page"),
min: 1i64,
actual: *value,
});
}
}
{
let value = &self.total;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("total"),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.total_pages;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("total_pages"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for ScheduledPost<S> {
fn nsid() -> &'static str {
"app.chronosky.schedule.listPosts"
}
fn def_name() -> &'static str {
"scheduledPost"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_app_chronosky_schedule_listPosts()
}
fn validate(&self) -> Result<(), ConstraintError> {
if let Some(ref value) = self.at_rkey {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("at_rkey"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.at_uri {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("at_uri"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.error_msg {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 2000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("error_msg"),
max: 2000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.langs;
#[allow(unused_comparisons)]
if value.len() > 3usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("langs"),
max: 3usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.parent_post_id {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("parent_post_id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.postgate_cid {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("postgate_cid"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.postgate_uri {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("postgate_uri"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.retry_count;
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("retry_count"),
min: 0i64,
actual: *value,
});
}
}
{
let value = &self.status;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 20usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("status"),
max: 20usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.text;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 3000usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("text"),
max: 3000usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.text;
{
let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count();
if count > 300usize {
return Err(ConstraintError::MaxGraphemes {
path: ValidationPath::from_field("text"),
max: 300usize,
actual: count,
});
}
}
}
if let Some(ref value) = self.thread_depth {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("thread_depth"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.thread_position {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("thread_position"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.threadgate_cid {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("threadgate_cid"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.threadgate_rules {
#[allow(unused_comparisons)]
if value.len() > 5usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("threadgate_rules"),
max: 5usize,
actual: value.len(),
});
}
}
if let Some(ref value) = self.threadgate_uri {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("threadgate_uri"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.user_id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 200usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("user_id"),
max: 200usize,
actual: <str>::len(value.as_ref()),
});
}
}
Ok(())
}
}
pub mod image_view_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Images;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Images = Unset;
}
pub struct SetImages<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetImages<St> {}
impl<St: State> State for SetImages<St> {
type Images = Set<members::images>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct images(());
}
}
pub struct ImageViewBuilder<S: BosStr, St: image_view_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<list_posts::ImageViewImage<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ImageView<S> {
pub fn new() -> ImageViewBuilder<S, image_view_state::Empty> {
ImageViewBuilder::new()
}
}
impl<S: BosStr> ImageViewBuilder<S, image_view_state::Empty> {
pub fn new() -> Self {
ImageViewBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ImageViewBuilder<S, St>
where
St: image_view_state::State,
St::Images: image_view_state::IsUnset,
{
pub fn images(
mut self,
value: impl Into<Vec<list_posts::ImageViewImage<S>>>,
) -> ImageViewBuilder<S, image_view_state::SetImages<St>> {
self._fields.0 = Option::Some(value.into());
ImageViewBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ImageViewBuilder<S, St>
where
St: image_view_state::State,
St::Images: image_view_state::IsSet,
{
pub fn build(self) -> ImageView<S> {
ImageView {
images: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ImageView<S> {
ImageView {
images: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_chronosky_schedule_listPosts() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("app.chronosky.schedule.listPosts"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("imageView"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Image embed view with CID references. Similar to app.bsky.embed.images#view but includes cid on each image.",
),
),
required: Some(vec![SmolStr::new_static("images")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("images"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"List of image views with CID references.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#imageViewImage"),
..Default::default()
}),
max_length: Some(4usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("imageViewImage"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Image view with CID for referencing in updatePost. Extends app.bsky.embed.images#viewImage with cid field.",
),
),
required: Some(
vec![
SmolStr::new_static("thumb"),
SmolStr::new_static("fullsize"), SmolStr::new_static("alt")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("alt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Alt text for the image."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("cid"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"CID of the image blob. Use this value with updatePost#imagesEmbed to reference this image without re-uploading.",
),
),
max_length: Some(200usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("fullsize"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Full-size URL for the image."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("thumb"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Thumbnail URL for the image."),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("main"),
LexUserType::XrpcQuery(LexXrpcQuery {
parameters: Some(LexXrpcQueryParameter::Params(LexXrpcParameters {
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("limit"),
LexXrpcParametersProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("page"),
LexXrpcParametersProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexXrpcParametersProperty::String(LexString {
description: Some(CowStr::new_static("Filter by post status.")),
max_length: Some(20usize),
..Default::default()
}),
);
map
},
..Default::default()
})),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("pagination"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static("Pagination information.")),
required: Some(vec![
SmolStr::new_static("page"),
SmolStr::new_static("limit"),
SmolStr::new_static("total"),
SmolStr::new_static("totalPages"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("limit"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("page"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(1i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("total"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("totalPages"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scheduledPost"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"Scheduled post object with AT Protocol standard fields.",
),
),
required: Some(
vec![
SmolStr::new_static("id"), SmolStr::new_static("userId"),
SmolStr::new_static("text"),
SmolStr::new_static("scheduledAt"),
SmolStr::new_static("status"),
SmolStr::new_static("createdAt"),
SmolStr::new_static("updatedAt"),
SmolStr::new_static("retryCount"),
SmolStr::new_static("langs")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("atRkey"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"AT Protocol record key. Present after successful execution.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("atUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"AT Protocol post URI (at://did:plc:.../app.bsky.feed.post/...). Present after successful execution.",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("children"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Child posts in thread. Only present for parent posts with children.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("#scheduledPost"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("createdAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Post creation datetime (ISO 8601)."),
),
format: Some(LexStringFormat::Datetime),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("embed"),
LexObjectProperty::Union(LexRefUnion {
description: Some(
CowStr::new_static(
"Embedded content such as images, external links, or quoted posts. For image embeds, returned as #imageView with thumb/fullsize URLs and CID references.",
),
),
refs: vec![
CowStr::new_static("app.bsky.embed.images"),
CowStr::new_static("#imageView"),
CowStr::new_static("app.bsky.embed.external"),
CowStr::new_static("app.bsky.embed.record"),
CowStr::new_static("app.bsky.embed.video"),
CowStr::new_static("app.bsky.embed.recordWithMedia")
],
..Default::default()
}),
);
map.insert(
SmolStr::new_static("errorMsg"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Error message if execution failed. Present only when status is FAILED.",
),
),
max_length: Some(2000usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("executedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Execution completion datetime (ISO 8601). Present only when status is COMPLETED or FAILED.",
),
),
format: Some(LexStringFormat::Datetime),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("facets"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Rich text facets for mentions, links, and hashtags (app.bsky.richtext.facet).",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("app.bsky.richtext.facet"),
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("id"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Post ID.")),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("labels"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static(
"com.atproto.label.defs#selfLabels",
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("langs"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Language codes for post content (app.bsky.feed.post#langs). ISO 639-1 or 639-3 codes.",
),
),
items: LexArrayItem::String(LexString {
format: Some(LexStringFormat::Language),
..Default::default()
}),
max_length: Some(3usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("parentPostId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Parent post ID for thread posts. Null for root posts.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postgateCid"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"CID for postgate record. Present after successful execution with postgate settings.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postgateDisableEmbedding"),
LexObjectProperty::Boolean(LexBoolean {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("postgateUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"AT Protocol URI for postgate record. Present after successful execution with postgate settings.",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("retryCount"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("scheduledAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Scheduled publication datetime (ISO 8601).",
),
),
format: Some(LexStringFormat::Datetime),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("status"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static("Post status.")),
max_length: Some(20usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("text"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Post content text (app.bsky.feed.post#text). May be empty if embeds are present.",
),
),
max_length: Some(3000usize),
max_graphemes: Some(300usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadDepth"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadPosition"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgateCid"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"CID for threadgate record. Present after successful execution with threadgate rules.",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgateRules"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"Reply restriction rules (app.bsky.feed.threadgate). Defines who can reply to this post.",
),
),
items: LexArrayItem::Union(LexRefUnion {
refs: vec![
CowStr::new_static("app.bsky.feed.threadgate#mentionRule"),
CowStr::new_static("app.bsky.feed.threadgate#followerRule"),
CowStr::new_static("app.bsky.feed.threadgate#followingRule"),
CowStr::new_static("app.bsky.feed.threadgate#listRule")
],
..Default::default()
}),
max_length: Some(5usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("threadgateUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"AT Protocol URI for threadgate record. Present after successful execution with threadgate rules.",
),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("updatedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Post last update datetime (ISO 8601)."),
),
format: Some(LexStringFormat::Datetime),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("userId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("User ID who created this post."),
),
max_length: Some(200usize),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
fn _default_limit() -> Option<i64> {
Some(20i64)
}
fn _default_page() -> Option<i64> {
Some(1i64)
}
pub mod list_posts_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {}
#[allow(non_camel_case_types)]
pub mod members {}
}
pub struct ListPostsBuilder<S: BosStr, St: list_posts_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>, Option<S>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ListPosts<S> {
pub fn new() -> ListPostsBuilder<S, list_posts_state::Empty> {
ListPostsBuilder::new()
}
}
impl<S: BosStr> ListPostsBuilder<S, list_posts_state::Empty> {
pub fn new() -> Self {
ListPostsBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: list_posts_state::State> ListPostsBuilder<S, St> {
pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_limit(mut self, value: Option<i64>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: list_posts_state::State> ListPostsBuilder<S, St> {
pub fn page(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_page(mut self, value: Option<i64>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: list_posts_state::State> ListPostsBuilder<S, St> {
pub fn status(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> ListPostsBuilder<S, St>
where
St: list_posts_state::State,
{
pub fn build(self) -> ListPosts<S> {
ListPosts {
limit: self._fields.0,
page: self._fields.1,
status: self._fields.2,
}
}
}
pub mod pagination_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Limit;
type Page;
type TotalPages;
type Total;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Limit = Unset;
type Page = Unset;
type TotalPages = Unset;
type Total = Unset;
}
pub struct SetLimit<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLimit<St> {}
impl<St: State> State for SetLimit<St> {
type Limit = Set<members::limit>;
type Page = St::Page;
type TotalPages = St::TotalPages;
type Total = St::Total;
}
pub struct SetPage<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetPage<St> {}
impl<St: State> State for SetPage<St> {
type Limit = St::Limit;
type Page = Set<members::page>;
type TotalPages = St::TotalPages;
type Total = St::Total;
}
pub struct SetTotalPages<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTotalPages<St> {}
impl<St: State> State for SetTotalPages<St> {
type Limit = St::Limit;
type Page = St::Page;
type TotalPages = Set<members::total_pages>;
type Total = St::Total;
}
pub struct SetTotal<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTotal<St> {}
impl<St: State> State for SetTotal<St> {
type Limit = St::Limit;
type Page = St::Page;
type TotalPages = St::TotalPages;
type Total = Set<members::total>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct limit(());
pub struct page(());
pub struct total_pages(());
pub struct total(());
}
}
pub struct PaginationBuilder<S: BosStr, St: pagination_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>, Option<i64>, Option<i64>),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> Pagination<S> {
pub fn new() -> PaginationBuilder<S, pagination_state::Empty> {
PaginationBuilder::new()
}
}
impl<S: BosStr> PaginationBuilder<S, pagination_state::Empty> {
pub fn new() -> Self {
PaginationBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PaginationBuilder<S, St>
where
St: pagination_state::State,
St::Limit: pagination_state::IsUnset,
{
pub fn limit(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<S, pagination_state::SetLimit<St>> {
self._fields.0 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PaginationBuilder<S, St>
where
St: pagination_state::State,
St::Page: pagination_state::IsUnset,
{
pub fn page(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<S, pagination_state::SetPage<St>> {
self._fields.1 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PaginationBuilder<S, St>
where
St: pagination_state::State,
St::Total: pagination_state::IsUnset,
{
pub fn total(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<S, pagination_state::SetTotal<St>> {
self._fields.2 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PaginationBuilder<S, St>
where
St: pagination_state::State,
St::TotalPages: pagination_state::IsUnset,
{
pub fn total_pages(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<S, pagination_state::SetTotalPages<St>> {
self._fields.3 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> PaginationBuilder<S, St>
where
St: pagination_state::State,
St::Limit: pagination_state::IsSet,
St::Page: pagination_state::IsSet,
St::TotalPages: pagination_state::IsSet,
St::Total: pagination_state::IsSet,
{
pub fn build(self) -> Pagination<S> {
Pagination {
limit: self._fields.0.unwrap(),
page: self._fields.1.unwrap(),
total: self._fields.2.unwrap(),
total_pages: self._fields.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Pagination<S> {
Pagination {
limit: self._fields.0.unwrap(),
page: self._fields.1.unwrap(),
total: self._fields.2.unwrap(),
total_pages: self._fields.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod scheduled_post_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Id;
type Text;
type UserId;
type UpdatedAt;
type Langs;
type RetryCount;
type CreatedAt;
type Status;
type ScheduledAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Id = Unset;
type Text = Unset;
type UserId = Unset;
type UpdatedAt = Unset;
type Langs = Unset;
type RetryCount = Unset;
type CreatedAt = Unset;
type Status = Unset;
type ScheduledAt = Unset;
}
pub struct SetId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetId<St> {}
impl<St: State> State for SetId<St> {
type Id = Set<members::id>;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetText<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetText<St> {}
impl<St: State> State for SetText<St> {
type Id = St::Id;
type Text = Set<members::text>;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetUserId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUserId<St> {}
impl<St: State> State for SetUserId<St> {
type Id = St::Id;
type Text = St::Text;
type UserId = Set<members::user_id>;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetUpdatedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUpdatedAt<St> {}
impl<St: State> State for SetUpdatedAt<St> {
type Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = Set<members::updated_at>;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetLangs<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetLangs<St> {}
impl<St: State> State for SetLangs<St> {
type Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = Set<members::langs>;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetRetryCount<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetRetryCount<St> {}
impl<St: State> State for SetRetryCount<St> {
type Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = Set<members::retry_count>;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
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 Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = Set<members::created_at>;
type Status = St::Status;
type ScheduledAt = St::ScheduledAt;
}
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 Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = Set<members::status>;
type ScheduledAt = St::ScheduledAt;
}
pub struct SetScheduledAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetScheduledAt<St> {}
impl<St: State> State for SetScheduledAt<St> {
type Id = St::Id;
type Text = St::Text;
type UserId = St::UserId;
type UpdatedAt = St::UpdatedAt;
type Langs = St::Langs;
type RetryCount = St::RetryCount;
type CreatedAt = St::CreatedAt;
type Status = St::Status;
type ScheduledAt = Set<members::scheduled_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct id(());
pub struct text(());
pub struct user_id(());
pub struct updated_at(());
pub struct langs(());
pub struct retry_count(());
pub struct created_at(());
pub struct status(());
pub struct scheduled_at(());
}
}
pub struct ScheduledPostBuilder<S: BosStr, St: scheduled_post_state::State> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<S>,
Option<Vec<list_posts::ScheduledPost<S>>>,
Option<Datetime>,
Option<ScheduledPostEmbed<S>>,
Option<S>,
Option<Datetime>,
Option<Vec<Facet<S>>>,
Option<S>,
Option<SelfLabels<S>>,
Option<Vec<Language>>,
Option<S>,
Option<S>,
Option<bool>,
Option<S>,
Option<i64>,
Option<Datetime>,
Option<S>,
Option<S>,
Option<i64>,
Option<i64>,
Option<S>,
Option<Vec<ScheduledPostThreadgateRulesItem<S>>>,
Option<S>,
Option<Datetime>,
Option<S>,
),
_type: PhantomData<fn() -> S>,
}
impl<S: BosStr> ScheduledPost<S> {
pub fn new() -> ScheduledPostBuilder<S, scheduled_post_state::Empty> {
ScheduledPostBuilder::new()
}
}
impl<S: BosStr> ScheduledPostBuilder<S, scheduled_post_state::Empty> {
pub fn new() -> Self {
ScheduledPostBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None, None, None, None,
None, None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn at_rkey(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_at_rkey(mut self, value: Option<S>) -> Self {
self._fields.0 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn at_uri(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_at_uri(mut self, value: Option<S>) -> Self {
self._fields.1 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn children(mut self, value: impl Into<Option<Vec<list_posts::ScheduledPost<S>>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_children(mut self, value: Option<Vec<list_posts::ScheduledPost<S>>>) -> Self {
self._fields.2 = value;
self
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::CreatedAt: scheduled_post_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetCreatedAt<St>> {
self._fields.3 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn embed(mut self, value: impl Into<Option<ScheduledPostEmbed<S>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_embed(mut self, value: Option<ScheduledPostEmbed<S>>) -> Self {
self._fields.4 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn error_msg(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_error_msg(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn executed_at(mut self, value: impl Into<Option<Datetime>>) -> Self {
self._fields.6 = value.into();
self
}
pub fn maybe_executed_at(mut self, value: Option<Datetime>) -> Self {
self._fields.6 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn facets(mut self, value: impl Into<Option<Vec<Facet<S>>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_facets(mut self, value: Option<Vec<Facet<S>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::Id: scheduled_post_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<S>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetId<St>> {
self._fields.8 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn labels(mut self, value: impl Into<Option<SelfLabels<S>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<SelfLabels<S>>) -> Self {
self._fields.9 = value;
self
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::Langs: scheduled_post_state::IsUnset,
{
pub fn langs(
mut self,
value: impl Into<Vec<Language>>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetLangs<St>> {
self._fields.10 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn parent_post_id(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_parent_post_id(mut self, value: Option<S>) -> Self {
self._fields.11 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn postgate_cid(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_postgate_cid(mut self, value: Option<S>) -> Self {
self._fields.12 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn postgate_disable_embedding(mut self, value: impl Into<Option<bool>>) -> Self {
self._fields.13 = value.into();
self
}
pub fn maybe_postgate_disable_embedding(mut self, value: Option<bool>) -> Self {
self._fields.13 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn postgate_uri(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_postgate_uri(mut self, value: Option<S>) -> Self {
self._fields.14 = value;
self
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::RetryCount: scheduled_post_state::IsUnset,
{
pub fn retry_count(
mut self,
value: impl Into<i64>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetRetryCount<St>> {
self._fields.15 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::ScheduledAt: scheduled_post_state::IsUnset,
{
pub fn scheduled_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetScheduledAt<St>> {
self._fields.16 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::Status: scheduled_post_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<S>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetStatus<St>> {
self._fields.17 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::Text: scheduled_post_state::IsUnset,
{
pub fn text(
mut self,
value: impl Into<S>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetText<St>> {
self._fields.18 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn thread_depth(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.19 = value.into();
self
}
pub fn maybe_thread_depth(mut self, value: Option<i64>) -> Self {
self._fields.19 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn thread_position(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.20 = value.into();
self
}
pub fn maybe_thread_position(mut self, value: Option<i64>) -> Self {
self._fields.20 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn threadgate_cid(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.21 = value.into();
self
}
pub fn maybe_threadgate_cid(mut self, value: Option<S>) -> Self {
self._fields.21 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn threadgate_rules(
mut self,
value: impl Into<Option<Vec<ScheduledPostThreadgateRulesItem<S>>>>,
) -> Self {
self._fields.22 = value.into();
self
}
pub fn maybe_threadgate_rules(
mut self,
value: Option<Vec<ScheduledPostThreadgateRulesItem<S>>>,
) -> Self {
self._fields.22 = value;
self
}
}
impl<S: BosStr, St: scheduled_post_state::State> ScheduledPostBuilder<S, St> {
pub fn threadgate_uri(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.23 = value.into();
self
}
pub fn maybe_threadgate_uri(mut self, value: Option<S>) -> Self {
self._fields.23 = value;
self
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::UpdatedAt: scheduled_post_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetUpdatedAt<St>> {
self._fields.24 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::UserId: scheduled_post_state::IsUnset,
{
pub fn user_id(
mut self,
value: impl Into<S>,
) -> ScheduledPostBuilder<S, scheduled_post_state::SetUserId<St>> {
self._fields.25 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<S: BosStr, St> ScheduledPostBuilder<S, St>
where
St: scheduled_post_state::State,
St::Id: scheduled_post_state::IsSet,
St::Text: scheduled_post_state::IsSet,
St::UserId: scheduled_post_state::IsSet,
St::UpdatedAt: scheduled_post_state::IsSet,
St::Langs: scheduled_post_state::IsSet,
St::RetryCount: scheduled_post_state::IsSet,
St::CreatedAt: scheduled_post_state::IsSet,
St::Status: scheduled_post_state::IsSet,
St::ScheduledAt: scheduled_post_state::IsSet,
{
pub fn build(self) -> ScheduledPost<S> {
ScheduledPost {
at_rkey: self._fields.0,
at_uri: self._fields.1,
children: self._fields.2,
created_at: self._fields.3.unwrap(),
embed: self._fields.4,
error_msg: self._fields.5,
executed_at: self._fields.6,
facets: self._fields.7,
id: self._fields.8.unwrap(),
labels: self._fields.9,
langs: self._fields.10.unwrap(),
parent_post_id: self._fields.11,
postgate_cid: self._fields.12,
postgate_disable_embedding: self._fields.13,
postgate_uri: self._fields.14,
retry_count: self._fields.15.unwrap(),
scheduled_at: self._fields.16.unwrap(),
status: self._fields.17.unwrap(),
text: self._fields.18.unwrap(),
thread_depth: self._fields.19,
thread_position: self._fields.20,
threadgate_cid: self._fields.21,
threadgate_rules: self._fields.22,
threadgate_uri: self._fields.23,
updated_at: self._fields.24.unwrap(),
user_id: self._fields.25.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> ScheduledPost<S> {
ScheduledPost {
at_rkey: self._fields.0,
at_uri: self._fields.1,
children: self._fields.2,
created_at: self._fields.3.unwrap(),
embed: self._fields.4,
error_msg: self._fields.5,
executed_at: self._fields.6,
facets: self._fields.7,
id: self._fields.8.unwrap(),
labels: self._fields.9,
langs: self._fields.10.unwrap(),
parent_post_id: self._fields.11,
postgate_cid: self._fields.12,
postgate_disable_embedding: self._fields.13,
postgate_uri: self._fields.14,
retry_count: self._fields.15.unwrap(),
scheduled_at: self._fields.16.unwrap(),
status: self._fields.17.unwrap(),
text: self._fields.18.unwrap(),
thread_depth: self._fields.19,
thread_position: self._fields.20,
threadgate_cid: self._fields.21,
threadgate_rules: self._fields.22,
threadgate_uri: self._fields.23,
updated_at: self._fields.24.unwrap(),
user_id: self._fields.25.unwrap(),
extra_data: Some(extra_data),
}
}
}