#[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::{Datetime, Language};
use jacquard_derive::{IntoStatic, lexicon, open_union};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::app_bsky::embed::external::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::com_atproto::label::SelfLabels;
use crate::app_chronosky::schedule::list_posts;
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ImageView<'a> {
#[serde(borrow)]
pub images: Vec<list_posts::ImageViewImage<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase")]
pub struct ImageViewImage<'a> {
#[serde(borrow)]
pub alt: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub cid: Option<CowStr<'a>>,
#[serde(borrow)]
pub fullsize: CowStr<'a>,
#[serde(borrow)]
pub thumb: CowStr<'a>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ListPosts<'a> {
#[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")]
#[serde(borrow)]
pub status: Option<CowStr<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ListPostsOutput<'a> {
#[serde(borrow)]
pub pagination: list_posts::Pagination<'a>,
#[serde(borrow)]
pub posts: Vec<list_posts::ScheduledPost<'a>>,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct Pagination<'a> {
pub limit: i64,
pub page: i64,
pub total: i64,
pub total_pages: i64,
}
#[lexicon]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct ScheduledPost<'a> {
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub at_rkey: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub at_uri: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub children: Option<Vec<list_posts::ScheduledPost<'a>>>,
pub created_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub embed: Option<ScheduledPostEmbed<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub error_msg: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub executed_at: Option<Datetime>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub facets: Option<Vec<Facet<'a>>>,
#[serde(borrow)]
pub id: CowStr<'a>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub labels: Option<SelfLabels<'a>>,
pub langs: Vec<Language>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub parent_post_id: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub postgate_cid: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub postgate_disable_embedding: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub postgate_uri: Option<CowStr<'a>>,
pub retry_count: i64,
pub scheduled_at: Datetime,
#[serde(borrow)]
pub status: CowStr<'a>,
#[serde(borrow)]
pub text: CowStr<'a>,
#[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")]
#[serde(borrow)]
pub threadgate_cid: Option<CowStr<'a>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub threadgate_rules: Option<Vec<ScheduledPostThreadgateRulesItem<'a>>>,
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(borrow)]
pub threadgate_uri: Option<CowStr<'a>>,
pub updated_at: Datetime,
#[serde(borrow)]
pub user_id: CowStr<'a>,
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ScheduledPostEmbed<'a> {
#[serde(rename = "app.bsky.embed.images")]
Images(Box<Images<'a>>),
#[serde(rename = "app.chronosky.schedule.listPosts#imageView")]
ImageView(Box<list_posts::ImageView<'a>>),
#[serde(rename = "app.bsky.embed.external")]
External(Box<ExternalRecord<'a>>),
#[serde(rename = "app.bsky.embed.record")]
Record(Box<Record<'a>>),
#[serde(rename = "app.bsky.embed.video")]
Video(Box<Video<'a>>),
#[serde(rename = "app.bsky.embed.recordWithMedia")]
RecordWithMedia(Box<RecordWithMedia<'a>>),
}
#[open_union]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum ScheduledPostThreadgateRulesItem<'a> {
#[serde(rename = "app.bsky.feed.threadgate#mentionRule")]
ThreadgateMentionRule(Box<MentionRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#followerRule")]
ThreadgateFollowerRule(Box<FollowerRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#followingRule")]
ThreadgateFollowingRule(Box<FollowingRule<'a>>),
#[serde(rename = "app.bsky.feed.threadgate#listRule")]
ThreadgateListRule(Box<ListRule<'a>>),
}
impl<'a> LexiconSchema for ImageView<'a> {
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<'a> LexiconSchema for ImageViewImage<'a> {
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<'de> = ListPostsOutput<'de>;
type Err<'de> = jacquard_common::xrpc::GenericError<'de>;
}
impl<'a> jacquard_common::xrpc::XrpcRequest for ListPosts<'a> {
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<'de> = ListPosts<'de>;
type Response = ListPostsResponse;
}
impl<'a> LexiconSchema for Pagination<'a> {
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<'a> LexiconSchema for ScheduledPost<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[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<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetImages<S> {}
impl<S: State> State for SetImages<S> {
type Images = Set<members::images>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct images(());
}
}
pub struct ImageViewBuilder<'a, S: image_view_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<Vec<list_posts::ImageViewImage<'a>>>,),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ImageView<'a> {
pub fn new() -> ImageViewBuilder<'a, image_view_state::Empty> {
ImageViewBuilder::new()
}
}
impl<'a> ImageViewBuilder<'a, image_view_state::Empty> {
pub fn new() -> Self {
ImageViewBuilder {
_state: PhantomData,
_fields: (None,),
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageViewBuilder<'a, S>
where
S: image_view_state::State,
S::Images: image_view_state::IsUnset,
{
pub fn images(
mut self,
value: impl Into<Vec<list_posts::ImageViewImage<'a>>>,
) -> ImageViewBuilder<'a, image_view_state::SetImages<S>> {
self._fields.0 = Option::Some(value.into());
ImageViewBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ImageViewBuilder<'a, S>
where
S: image_view_state::State,
S::Images: image_view_state::IsSet,
{
pub fn build(self) -> ImageView<'a> {
ImageView {
images: 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>,
>,
) -> ImageView<'a> {
ImageView {
images: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_app_chronosky_schedule_listPosts() -> 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.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::{Set, Unset, IsSet, IsUnset};
#[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<'a, S: list_posts_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<i64>, Option<i64>, Option<CowStr<'a>>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ListPosts<'a> {
pub fn new() -> ListPostsBuilder<'a, list_posts_state::Empty> {
ListPostsBuilder::new()
}
}
impl<'a> ListPostsBuilder<'a, list_posts_state::Empty> {
pub fn new() -> Self {
ListPostsBuilder {
_state: PhantomData,
_fields: (None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S: list_posts_state::State> ListPostsBuilder<'a, S> {
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<'a, S: list_posts_state::State> ListPostsBuilder<'a, S> {
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<'a, S: list_posts_state::State> ListPostsBuilder<'a, S> {
pub fn status(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_status(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> ListPostsBuilder<'a, S>
where
S: list_posts_state::State,
{
pub fn build(self) -> ListPosts<'a> {
ListPosts {
limit: self._fields.0,
page: self._fields.1,
status: self._fields.2,
}
}
}
pub mod pagination_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 Total;
type Page;
type TotalPages;
type Limit;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Total = Unset;
type Page = Unset;
type TotalPages = Unset;
type Limit = Unset;
}
pub struct SetTotal<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTotal<S> {}
impl<S: State> State for SetTotal<S> {
type Total = Set<members::total>;
type Page = S::Page;
type TotalPages = S::TotalPages;
type Limit = S::Limit;
}
pub struct SetPage<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPage<S> {}
impl<S: State> State for SetPage<S> {
type Total = S::Total;
type Page = Set<members::page>;
type TotalPages = S::TotalPages;
type Limit = S::Limit;
}
pub struct SetTotalPages<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTotalPages<S> {}
impl<S: State> State for SetTotalPages<S> {
type Total = S::Total;
type Page = S::Page;
type TotalPages = Set<members::total_pages>;
type Limit = S::Limit;
}
pub struct SetLimit<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLimit<S> {}
impl<S: State> State for SetLimit<S> {
type Total = S::Total;
type Page = S::Page;
type TotalPages = S::TotalPages;
type Limit = Set<members::limit>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct total(());
pub struct page(());
pub struct total_pages(());
pub struct limit(());
}
}
pub struct PaginationBuilder<'a, S: pagination_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (Option<i64>, Option<i64>, Option<i64>, Option<i64>),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> Pagination<'a> {
pub fn new() -> PaginationBuilder<'a, pagination_state::Empty> {
PaginationBuilder::new()
}
}
impl<'a> PaginationBuilder<'a, pagination_state::Empty> {
pub fn new() -> Self {
PaginationBuilder {
_state: PhantomData,
_fields: (None, None, None, None),
_lifetime: PhantomData,
}
}
}
impl<'a, S> PaginationBuilder<'a, S>
where
S: pagination_state::State,
S::Limit: pagination_state::IsUnset,
{
pub fn limit(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<'a, pagination_state::SetLimit<S>> {
self._fields.0 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> PaginationBuilder<'a, S>
where
S: pagination_state::State,
S::Page: pagination_state::IsUnset,
{
pub fn page(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<'a, pagination_state::SetPage<S>> {
self._fields.1 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> PaginationBuilder<'a, S>
where
S: pagination_state::State,
S::Total: pagination_state::IsUnset,
{
pub fn total(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<'a, pagination_state::SetTotal<S>> {
self._fields.2 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> PaginationBuilder<'a, S>
where
S: pagination_state::State,
S::TotalPages: pagination_state::IsUnset,
{
pub fn total_pages(
mut self,
value: impl Into<i64>,
) -> PaginationBuilder<'a, pagination_state::SetTotalPages<S>> {
self._fields.3 = Option::Some(value.into());
PaginationBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> PaginationBuilder<'a, S>
where
S: pagination_state::State,
S::Total: pagination_state::IsSet,
S::Page: pagination_state::IsSet,
S::TotalPages: pagination_state::IsSet,
S::Limit: pagination_state::IsSet,
{
pub fn build(self) -> Pagination<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Pagination<'a> {
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::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Text;
type ScheduledAt;
type Id;
type UpdatedAt;
type CreatedAt;
type Status;
type UserId;
type RetryCount;
type Langs;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Text = Unset;
type ScheduledAt = Unset;
type Id = Unset;
type UpdatedAt = Unset;
type CreatedAt = Unset;
type Status = Unset;
type UserId = Unset;
type RetryCount = Unset;
type Langs = Unset;
}
pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetText<S> {}
impl<S: State> State for SetText<S> {
type Text = Set<members::text>;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
pub struct SetScheduledAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetScheduledAt<S> {}
impl<S: State> State for SetScheduledAt<S> {
type Text = S::Text;
type ScheduledAt = Set<members::scheduled_at>;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetId<S> {}
impl<S: State> State for SetId<S> {
type Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = Set<members::id>;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUpdatedAt<S> {}
impl<S: State> State for SetUpdatedAt<S> {
type Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = Set<members::updated_at>;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
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 Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = Set<members::created_at>;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
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 Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = Set<members::status>;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
pub struct SetUserId<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUserId<S> {}
impl<S: State> State for SetUserId<S> {
type Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = Set<members::user_id>;
type RetryCount = S::RetryCount;
type Langs = S::Langs;
}
pub struct SetRetryCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRetryCount<S> {}
impl<S: State> State for SetRetryCount<S> {
type Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = Set<members::retry_count>;
type Langs = S::Langs;
}
pub struct SetLangs<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLangs<S> {}
impl<S: State> State for SetLangs<S> {
type Text = S::Text;
type ScheduledAt = S::ScheduledAt;
type Id = S::Id;
type UpdatedAt = S::UpdatedAt;
type CreatedAt = S::CreatedAt;
type Status = S::Status;
type UserId = S::UserId;
type RetryCount = S::RetryCount;
type Langs = Set<members::langs>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct text(());
pub struct scheduled_at(());
pub struct id(());
pub struct updated_at(());
pub struct created_at(());
pub struct status(());
pub struct user_id(());
pub struct retry_count(());
pub struct langs(());
}
}
pub struct ScheduledPostBuilder<'a, S: scheduled_post_state::State> {
_state: PhantomData<fn() -> S>,
_fields: (
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<Vec<list_posts::ScheduledPost<'a>>>,
Option<Datetime>,
Option<ScheduledPostEmbed<'a>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<Vec<Facet<'a>>>,
Option<CowStr<'a>>,
Option<SelfLabels<'a>>,
Option<Vec<Language>>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<bool>,
Option<CowStr<'a>>,
Option<i64>,
Option<Datetime>,
Option<CowStr<'a>>,
Option<CowStr<'a>>,
Option<i64>,
Option<i64>,
Option<CowStr<'a>>,
Option<Vec<ScheduledPostThreadgateRulesItem<'a>>>,
Option<CowStr<'a>>,
Option<Datetime>,
Option<CowStr<'a>>,
),
_lifetime: PhantomData<&'a ()>,
}
impl<'a> ScheduledPost<'a> {
pub fn new() -> ScheduledPostBuilder<'a, scheduled_post_state::Empty> {
ScheduledPostBuilder::new()
}
}
impl<'a> ScheduledPostBuilder<'a, 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,
),
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn at_rkey(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.0 = value.into();
self
}
pub fn maybe_at_rkey(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.0 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn at_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.1 = value.into();
self
}
pub fn maybe_at_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.1 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn children(
mut self,
value: impl Into<Option<Vec<list_posts::ScheduledPost<'a>>>>,
) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_children(
mut self,
value: Option<Vec<list_posts::ScheduledPost<'a>>>,
) -> Self {
self._fields.2 = value;
self
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::CreatedAt: scheduled_post_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetCreatedAt<S>> {
self._fields.3 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn embed(mut self, value: impl Into<Option<ScheduledPostEmbed<'a>>>) -> Self {
self._fields.4 = value.into();
self
}
pub fn maybe_embed(mut self, value: Option<ScheduledPostEmbed<'a>>) -> Self {
self._fields.4 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn error_msg(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_error_msg(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.5 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
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<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn facets(mut self, value: impl Into<Option<Vec<Facet<'a>>>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_facets(mut self, value: Option<Vec<Facet<'a>>>) -> Self {
self._fields.7 = value;
self
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::Id: scheduled_post_state::IsUnset,
{
pub fn id(
mut self,
value: impl Into<CowStr<'a>>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetId<S>> {
self._fields.8 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn labels(mut self, value: impl Into<Option<SelfLabels<'a>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_labels(mut self, value: Option<SelfLabels<'a>>) -> Self {
self._fields.9 = value;
self
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::Langs: scheduled_post_state::IsUnset,
{
pub fn langs(
mut self,
value: impl Into<Vec<Language>>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetLangs<S>> {
self._fields.10 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn parent_post_id(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.11 = value.into();
self
}
pub fn maybe_parent_post_id(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.11 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn postgate_cid(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.12 = value.into();
self
}
pub fn maybe_postgate_cid(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.12 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
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<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn postgate_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.14 = value.into();
self
}
pub fn maybe_postgate_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.14 = value;
self
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::RetryCount: scheduled_post_state::IsUnset,
{
pub fn retry_count(
mut self,
value: impl Into<i64>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetRetryCount<S>> {
self._fields.15 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::ScheduledAt: scheduled_post_state::IsUnset,
{
pub fn scheduled_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetScheduledAt<S>> {
self._fields.16 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::Status: scheduled_post_state::IsUnset,
{
pub fn status(
mut self,
value: impl Into<CowStr<'a>>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetStatus<S>> {
self._fields.17 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::Text: scheduled_post_state::IsUnset,
{
pub fn text(
mut self,
value: impl Into<CowStr<'a>>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetText<S>> {
self._fields.18 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
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<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
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<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn threadgate_cid(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.21 = value.into();
self
}
pub fn maybe_threadgate_cid(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.21 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn threadgate_rules(
mut self,
value: impl Into<Option<Vec<ScheduledPostThreadgateRulesItem<'a>>>>,
) -> Self {
self._fields.22 = value.into();
self
}
pub fn maybe_threadgate_rules(
mut self,
value: Option<Vec<ScheduledPostThreadgateRulesItem<'a>>>,
) -> Self {
self._fields.22 = value;
self
}
}
impl<'a, S: scheduled_post_state::State> ScheduledPostBuilder<'a, S> {
pub fn threadgate_uri(mut self, value: impl Into<Option<CowStr<'a>>>) -> Self {
self._fields.23 = value.into();
self
}
pub fn maybe_threadgate_uri(mut self, value: Option<CowStr<'a>>) -> Self {
self._fields.23 = value;
self
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::UpdatedAt: scheduled_post_state::IsUnset,
{
pub fn updated_at(
mut self,
value: impl Into<Datetime>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetUpdatedAt<S>> {
self._fields.24 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::UserId: scheduled_post_state::IsUnset,
{
pub fn user_id(
mut self,
value: impl Into<CowStr<'a>>,
) -> ScheduledPostBuilder<'a, scheduled_post_state::SetUserId<S>> {
self._fields.25 = Option::Some(value.into());
ScheduledPostBuilder {
_state: PhantomData,
_fields: self._fields,
_lifetime: PhantomData,
}
}
}
impl<'a, S> ScheduledPostBuilder<'a, S>
where
S: scheduled_post_state::State,
S::Text: scheduled_post_state::IsSet,
S::ScheduledAt: scheduled_post_state::IsSet,
S::Id: scheduled_post_state::IsSet,
S::UpdatedAt: scheduled_post_state::IsSet,
S::CreatedAt: scheduled_post_state::IsSet,
S::Status: scheduled_post_state::IsSet,
S::UserId: scheduled_post_state::IsSet,
S::RetryCount: scheduled_post_state::IsSet,
S::Langs: scheduled_post_state::IsSet,
{
pub fn build(self) -> ScheduledPost<'a> {
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<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ScheduledPost<'a> {
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),
}
}
}