#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct LivestreamView<'a> {
#[serde(borrow)]
pub author: crate::app_bsky::actor::ProfileViewBasic<'a>,
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
pub indexed_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub record: jacquard_common::types::value::Data<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub viewer_count: std::option::Option<
crate::place_stream::livestream::ViewerCount<'a>,
>,
}
pub mod livestream_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 IndexedAt;
type Author;
type Uri;
type Record;
type Cid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type IndexedAt = Unset;
type Author = Unset;
type Uri = Unset;
type Record = Unset;
type Cid = Unset;
}
pub struct SetIndexedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetIndexedAt<S> {}
impl<S: State> State for SetIndexedAt<S> {
type IndexedAt = Set<members::indexed_at>;
type Author = S::Author;
type Uri = S::Uri;
type Record = S::Record;
type Cid = S::Cid;
}
pub struct SetAuthor<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetAuthor<S> {}
impl<S: State> State for SetAuthor<S> {
type IndexedAt = S::IndexedAt;
type Author = Set<members::author>;
type Uri = S::Uri;
type Record = S::Record;
type Cid = S::Cid;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type IndexedAt = S::IndexedAt;
type Author = S::Author;
type Uri = Set<members::uri>;
type Record = S::Record;
type Cid = S::Cid;
}
pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetRecord<S> {}
impl<S: State> State for SetRecord<S> {
type IndexedAt = S::IndexedAt;
type Author = S::Author;
type Uri = S::Uri;
type Record = Set<members::record>;
type Cid = S::Cid;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type IndexedAt = S::IndexedAt;
type Author = S::Author;
type Uri = S::Uri;
type Record = S::Record;
type Cid = Set<members::cid>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct indexed_at(());
pub struct author(());
pub struct uri(());
pub struct record(());
pub struct cid(());
}
}
pub struct LivestreamViewBuilder<'a, S: livestream_view_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::value::Data<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<crate::place_stream::livestream::ViewerCount<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> LivestreamView<'a> {
pub fn new() -> LivestreamViewBuilder<'a, livestream_view_state::Empty> {
LivestreamViewBuilder::new()
}
}
impl<'a> LivestreamViewBuilder<'a, livestream_view_state::Empty> {
pub fn new() -> Self {
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::Author: livestream_view_state::IsUnset,
{
pub fn author(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> LivestreamViewBuilder<'a, livestream_view_state::SetAuthor<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::Cid: livestream_view_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> LivestreamViewBuilder<'a, livestream_view_state::SetCid<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::IndexedAt: livestream_view_state::IsUnset,
{
pub fn indexed_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> LivestreamViewBuilder<'a, livestream_view_state::SetIndexedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::Record: livestream_view_state::IsUnset,
{
pub fn record(
mut self,
value: impl Into<jacquard_common::types::value::Data<'a>>,
) -> LivestreamViewBuilder<'a, livestream_view_state::SetRecord<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::Uri: livestream_view_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> LivestreamViewBuilder<'a, livestream_view_state::SetUri<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
LivestreamViewBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: livestream_view_state::State> LivestreamViewBuilder<'a, S> {
pub fn viewer_count(
mut self,
value: impl Into<Option<crate::place_stream::livestream::ViewerCount<'a>>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_viewer_count(
mut self,
value: Option<crate::place_stream::livestream::ViewerCount<'a>>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S> LivestreamViewBuilder<'a, S>
where
S: livestream_view_state::State,
S::IndexedAt: livestream_view_state::IsSet,
S::Author: livestream_view_state::IsSet,
S::Uri: livestream_view_state::IsSet,
S::Record: livestream_view_state::IsSet,
S::Cid: livestream_view_state::IsSet,
{
pub fn build(self) -> LivestreamView<'a> {
LivestreamView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
indexed_at: self.__unsafe_private_named.2.unwrap(),
record: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.unwrap(),
viewer_count: self.__unsafe_private_named.5,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> LivestreamView<'a> {
LivestreamView {
author: self.__unsafe_private_named.0.unwrap(),
cid: self.__unsafe_private_named.1.unwrap(),
indexed_at: self.__unsafe_private_named.2.unwrap(),
record: self.__unsafe_private_named.3.unwrap(),
uri: self.__unsafe_private_named.4.unwrap(),
viewer_count: self.__unsafe_private_named.5,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_place_stream_livestream() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("place.stream.livestream"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("livestreamView"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid"),
::jacquard_common::deps::smol_str::SmolStr::new_static("author"),
::jacquard_common::deps::smol_str::SmolStr::new_static("record"),
::jacquard_common::deps::smol_str::SmolStr::new_static("indexedAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"author",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"indexedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"record",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown {
description: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: None,
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#viewerCount"),
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static(
"Record announcing a livestream is happening",
),
),
key: Some(::jacquard_common::CowStr::new_static("tid")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("title"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"agent",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The source of the livestream, if available, in a User Agent format: `<product> / <product-version> <comment>` e.g. Streamplace/0.7.5 iOS",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"canonicalUrl",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The primary URL where this livestream can be viewed, if available.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Uri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Client-declared timestamp when this livestream started.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"endedAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Client-declared timestamp when this livestream ended. Ended livestreams are not supposed to start up again.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"idleTimeoutSeconds",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"lastSeenAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Client-declared timestamp when this livestream was last seen by the Streamplace station.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"notificationSettings",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"place.stream.livestream#notificationSettings",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"post",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"com.atproto.repo.strongRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"thumb",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob {
description: None,
accept: None,
max_size: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"title",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The title of the livestream, as it will be announced to followers.",
),
),
format: None,
default: None,
min_length: None,
max_length: Some(1400usize),
min_graphemes: None,
max_graphemes: Some(140usize),
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"url",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The URL where this stream can be found. This is primarily a hint for other Streamplace nodes to locate and replicate the stream.",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Uri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"notificationSettings",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(vec![]),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"pushNotification",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean {
description: None,
default: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"streamplaceAnything",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("livestream")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"livestream",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion {
description: None,
refs: vec![
::jacquard_common::CowStr::new_static("#livestreamView"),
::jacquard_common::CowStr::new_static("#viewerCount"),
::jacquard_common::CowStr::new_static("#teleportArrival"),
::jacquard_common::CowStr::new_static("#teleportCanceled"),
::jacquard_common::CowStr::new_static("place.stream.defs#blockView"),
::jacquard_common::CowStr::new_static("place.stream.defs#renditions"),
::jacquard_common::CowStr::new_static("place.stream.defs#rendition"),
::jacquard_common::CowStr::new_static("place.stream.chat.defs#messageView")
],
closed: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"teleportArrival",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("teleportUri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("source"),
::jacquard_common::deps::smol_str::SmolStr::new_static("viewerCount"),
::jacquard_common::deps::smol_str::SmolStr::new_static("startsAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"chatProfile",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"place.stream.chat.profile",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"source",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"app.bsky.actor.defs#profileViewBasic",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"startsAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"When this teleport started",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"teleportUri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The URI of the teleport record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"viewerCount",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"teleportCanceled",
),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("teleportUri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("reason")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"reason",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Why this teleport was canceled",
),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"teleportUri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"The URI of the teleport record that was canceled",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("viewerCount"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("count")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"count",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger {
description: None,
default: None,
minimum: None,
maximum: None,
r#enum: None,
r#const: None,
}),
);
map
},
}),
);
map
},
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LivestreamView<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"livestreamView"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct Livestream<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub agent: std::option::Option<jacquard_common::CowStr<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub canonical_url: std::option::Option<jacquard_common::types::string::UriValue<'a>>,
pub created_at: jacquard_common::types::string::Datetime,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub ended_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub idle_timeout_seconds: std::option::Option<i64>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub last_seen_at: std::option::Option<jacquard_common::types::string::Datetime>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub notification_settings: std::option::Option<
crate::place_stream::livestream::NotificationSettings<'a>,
>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub post: std::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub thumb: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
#[serde(borrow)]
pub title: jacquard_common::CowStr<'a>,
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub url: std::option::Option<jacquard_common::types::string::UriValue<'a>>,
}
pub mod livestream_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 Title;
type CreatedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Title = Unset;
type CreatedAt = Unset;
}
pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTitle<S> {}
impl<S: State> State for SetTitle<S> {
type Title = Set<members::title>;
type CreatedAt = S::CreatedAt;
}
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 Title = S::Title;
type CreatedAt = Set<members::created_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct title(());
pub struct created_at(());
}
}
pub struct LivestreamBuilder<'a, S: livestream_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::UriValue<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<i64>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<
crate::place_stream::livestream::NotificationSettings<'a>,
>,
::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>,
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::UriValue<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> Livestream<'a> {
pub fn new() -> LivestreamBuilder<'a, livestream_state::Empty> {
LivestreamBuilder::new()
}
}
impl<'a> LivestreamBuilder<'a, livestream_state::Empty> {
pub fn new() -> Self {
LivestreamBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
None,
),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn agent(
mut self,
value: impl Into<Option<jacquard_common::CowStr<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_agent(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn canonical_url(
mut self,
value: impl Into<Option<jacquard_common::types::string::UriValue<'a>>>,
) -> Self {
self.__unsafe_private_named.1 = value.into();
self
}
pub fn maybe_canonical_url(
mut self,
value: Option<jacquard_common::types::string::UriValue<'a>>,
) -> Self {
self.__unsafe_private_named.1 = value;
self
}
}
impl<'a, S> LivestreamBuilder<'a, S>
where
S: livestream_state::State,
S::CreatedAt: livestream_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> LivestreamBuilder<'a, livestream_state::SetCreatedAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
LivestreamBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn ended_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.3 = value.into();
self
}
pub fn maybe_ended_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.3 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn idle_timeout_seconds(mut self, value: impl Into<Option<i64>>) -> Self {
self.__unsafe_private_named.4 = value.into();
self
}
pub fn maybe_idle_timeout_seconds(mut self, value: Option<i64>) -> Self {
self.__unsafe_private_named.4 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn last_seen_at(
mut self,
value: impl Into<Option<jacquard_common::types::string::Datetime>>,
) -> Self {
self.__unsafe_private_named.5 = value.into();
self
}
pub fn maybe_last_seen_at(
mut self,
value: Option<jacquard_common::types::string::Datetime>,
) -> Self {
self.__unsafe_private_named.5 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn notification_settings(
mut self,
value: impl Into<
Option<crate::place_stream::livestream::NotificationSettings<'a>>,
>,
) -> Self {
self.__unsafe_private_named.6 = value.into();
self
}
pub fn maybe_notification_settings(
mut self,
value: Option<crate::place_stream::livestream::NotificationSettings<'a>>,
) -> Self {
self.__unsafe_private_named.6 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn post(
mut self,
value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>,
) -> Self {
self.__unsafe_private_named.7 = value.into();
self
}
pub fn maybe_post(
mut self,
value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>,
) -> Self {
self.__unsafe_private_named.7 = value;
self
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn thumb(
mut self,
value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>,
) -> Self {
self.__unsafe_private_named.8 = value.into();
self
}
pub fn maybe_thumb(
mut self,
value: Option<jacquard_common::types::blob::BlobRef<'a>>,
) -> Self {
self.__unsafe_private_named.8 = value;
self
}
}
impl<'a, S> LivestreamBuilder<'a, S>
where
S: livestream_state::State,
S::Title: livestream_state::IsUnset,
{
pub fn title(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> LivestreamBuilder<'a, livestream_state::SetTitle<S>> {
self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into());
LivestreamBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: livestream_state::State> LivestreamBuilder<'a, S> {
pub fn url(
mut self,
value: impl Into<Option<jacquard_common::types::string::UriValue<'a>>>,
) -> Self {
self.__unsafe_private_named.10 = value.into();
self
}
pub fn maybe_url(
mut self,
value: Option<jacquard_common::types::string::UriValue<'a>>,
) -> Self {
self.__unsafe_private_named.10 = value;
self
}
}
impl<'a, S> LivestreamBuilder<'a, S>
where
S: livestream_state::State,
S::Title: livestream_state::IsSet,
S::CreatedAt: livestream_state::IsSet,
{
pub fn build(self) -> Livestream<'a> {
Livestream {
agent: self.__unsafe_private_named.0,
canonical_url: self.__unsafe_private_named.1,
created_at: self.__unsafe_private_named.2.unwrap(),
ended_at: self.__unsafe_private_named.3,
idle_timeout_seconds: self.__unsafe_private_named.4,
last_seen_at: self.__unsafe_private_named.5,
notification_settings: self.__unsafe_private_named.6,
post: self.__unsafe_private_named.7,
thumb: self.__unsafe_private_named.8,
title: self.__unsafe_private_named.9.unwrap(),
url: self.__unsafe_private_named.10,
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> Livestream<'a> {
Livestream {
agent: self.__unsafe_private_named.0,
canonical_url: self.__unsafe_private_named.1,
created_at: self.__unsafe_private_named.2.unwrap(),
ended_at: self.__unsafe_private_named.3,
idle_timeout_seconds: self.__unsafe_private_named.4,
last_seen_at: self.__unsafe_private_named.5,
notification_settings: self.__unsafe_private_named.6,
post: self.__unsafe_private_named.7,
thumb: self.__unsafe_private_named.8,
title: self.__unsafe_private_named.9.unwrap(),
url: self.__unsafe_private_named.10,
extra_data: Some(extra_data),
}
}
}
impl<'a> Livestream<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, LivestreamRecord>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct LivestreamGetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: Livestream<'a>,
}
impl From<LivestreamGetRecordOutput<'_>> for Livestream<'_> {
fn from(output: LivestreamGetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for Livestream<'_> {
const NSID: &'static str = "place.stream.livestream";
type Record = LivestreamRecord;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct LivestreamRecord;
impl jacquard_common::xrpc::XrpcResp for LivestreamRecord {
const NSID: &'static str = "place.stream.livestream";
const ENCODING: &'static str = "application/json";
type Output<'de> = LivestreamGetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for LivestreamRecord {
const NSID: &'static str = "place.stream.livestream";
type Record = LivestreamRecord;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Livestream<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
if let Some(ref value) = self.thumb {
{
let size = value.blob().size;
if size > 1000000usize {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobTooLarge {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"thumb",
),
max: 1000000usize,
actual: size,
});
}
}
}
if let Some(ref value) = self.thumb {
{
let mime = value.blob().mime_type.as_str();
let accepted: &[&str] = &["image/*"];
let matched = accepted
.iter()
.any(|pattern| {
if *pattern == "*/*" {
true
} else if pattern.ends_with("/*") {
let prefix = &pattern[..pattern.len() - 2];
mime.starts_with(prefix)
&& mime.as_bytes().get(prefix.len()) == Some(&b'/')
} else {
mime == *pattern
}
});
if !matched {
return Err(::jacquard_lexicon::validation::ConstraintError::BlobMimeTypeNotAccepted {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"thumb",
),
accepted: vec!["image/*".to_string()],
actual: mime.to_string(),
});
}
}
}
{
let value = &self.title;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 1400usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"title",
),
max: 1400usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.title;
{
let count = jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation::graphemes(
value.as_ref(),
true,
)
.count();
if count > 140usize {
return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes {
path: ::jacquard_lexicon::validation::ValidationPath::from_field(
"title",
),
max: 140usize,
actual: count,
});
}
}
}
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic,
Default
)]
#[serde(rename_all = "camelCase")]
pub struct NotificationSettings<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
pub push_notification: std::option::Option<bool>,
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotificationSettings<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"notificationSettings"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct StreamplaceAnything<'a> {
#[serde(borrow)]
pub livestream: StreamplaceAnythingLivestream<'a>,
}
pub mod streamplace_anything_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 Livestream;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Livestream = Unset;
}
pub struct SetLivestream<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetLivestream<S> {}
impl<S: State> State for SetLivestream<S> {
type Livestream = Set<members::livestream>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct livestream(());
}
}
pub struct StreamplaceAnythingBuilder<'a, S: streamplace_anything_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<StreamplaceAnythingLivestream<'a>>,),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> StreamplaceAnything<'a> {
pub fn new() -> StreamplaceAnythingBuilder<'a, streamplace_anything_state::Empty> {
StreamplaceAnythingBuilder::new()
}
}
impl<'a> StreamplaceAnythingBuilder<'a, streamplace_anything_state::Empty> {
pub fn new() -> Self {
StreamplaceAnythingBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> StreamplaceAnythingBuilder<'a, S>
where
S: streamplace_anything_state::State,
S::Livestream: streamplace_anything_state::IsUnset,
{
pub fn livestream(
mut self,
value: impl Into<StreamplaceAnythingLivestream<'a>>,
) -> StreamplaceAnythingBuilder<'a, streamplace_anything_state::SetLivestream<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
StreamplaceAnythingBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> StreamplaceAnythingBuilder<'a, S>
where
S: streamplace_anything_state::State,
S::Livestream: streamplace_anything_state::IsSet,
{
pub fn build(self) -> StreamplaceAnything<'a> {
StreamplaceAnything {
livestream: self.__unsafe_private_named.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> StreamplaceAnything<'a> {
StreamplaceAnything {
livestream: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
#[jacquard_derive::open_union]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(tag = "$type")]
#[serde(bound(deserialize = "'de: 'a"))]
pub enum StreamplaceAnythingLivestream<'a> {
#[serde(rename = "place.stream.livestream#livestreamView")]
LivestreamView(Box<crate::place_stream::livestream::LivestreamView<'a>>),
#[serde(rename = "place.stream.livestream#viewerCount")]
ViewerCount(Box<crate::place_stream::livestream::ViewerCount<'a>>),
#[serde(rename = "place.stream.livestream#teleportArrival")]
TeleportArrival(Box<crate::place_stream::livestream::TeleportArrival<'a>>),
#[serde(rename = "place.stream.livestream#teleportCanceled")]
TeleportCanceled(Box<crate::place_stream::livestream::TeleportCanceled<'a>>),
#[serde(rename = "place.stream.defs#blockView")]
BlockView(Box<crate::place_stream::BlockView<'a>>),
#[serde(rename = "place.stream.defs#renditions")]
Renditions(Box<crate::place_stream::Renditions<'a>>),
#[serde(rename = "place.stream.defs#rendition")]
Rendition(Box<crate::place_stream::Rendition<'a>>),
#[serde(rename = "place.stream.chat.defs#messageView")]
MessageView(Box<crate::place_stream::chat::MessageView<'a>>),
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StreamplaceAnything<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"streamplaceAnything"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TeleportArrival<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub chat_profile: std::option::Option<
crate::place_stream::chat::profile::Profile<'a>,
>,
#[serde(borrow)]
pub source: crate::app_bsky::actor::ProfileViewBasic<'a>,
pub starts_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub teleport_uri: jacquard_common::types::string::AtUri<'a>,
pub viewer_count: i64,
}
pub mod teleport_arrival_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 TeleportUri;
type Source;
type StartsAt;
type ViewerCount;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type TeleportUri = Unset;
type Source = Unset;
type StartsAt = Unset;
type ViewerCount = Unset;
}
pub struct SetTeleportUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTeleportUri<S> {}
impl<S: State> State for SetTeleportUri<S> {
type TeleportUri = Set<members::teleport_uri>;
type Source = S::Source;
type StartsAt = S::StartsAt;
type ViewerCount = S::ViewerCount;
}
pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSource<S> {}
impl<S: State> State for SetSource<S> {
type TeleportUri = S::TeleportUri;
type Source = Set<members::source>;
type StartsAt = S::StartsAt;
type ViewerCount = S::ViewerCount;
}
pub struct SetStartsAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetStartsAt<S> {}
impl<S: State> State for SetStartsAt<S> {
type TeleportUri = S::TeleportUri;
type Source = S::Source;
type StartsAt = Set<members::starts_at>;
type ViewerCount = S::ViewerCount;
}
pub struct SetViewerCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetViewerCount<S> {}
impl<S: State> State for SetViewerCount<S> {
type TeleportUri = S::TeleportUri;
type Source = S::Source;
type StartsAt = S::StartsAt;
type ViewerCount = Set<members::viewer_count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct teleport_uri(());
pub struct source(());
pub struct starts_at(());
pub struct viewer_count(());
}
}
pub struct TeleportArrivalBuilder<'a, S: teleport_arrival_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<crate::place_stream::chat::profile::Profile<'a>>,
::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>,
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
::core::option::Option<i64>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TeleportArrival<'a> {
pub fn new() -> TeleportArrivalBuilder<'a, teleport_arrival_state::Empty> {
TeleportArrivalBuilder::new()
}
}
impl<'a> TeleportArrivalBuilder<'a, teleport_arrival_state::Empty> {
pub fn new() -> Self {
TeleportArrivalBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S: teleport_arrival_state::State> TeleportArrivalBuilder<'a, S> {
pub fn chat_profile(
mut self,
value: impl Into<Option<crate::place_stream::chat::profile::Profile<'a>>>,
) -> Self {
self.__unsafe_private_named.0 = value.into();
self
}
pub fn maybe_chat_profile(
mut self,
value: Option<crate::place_stream::chat::profile::Profile<'a>>,
) -> Self {
self.__unsafe_private_named.0 = value;
self
}
}
impl<'a, S> TeleportArrivalBuilder<'a, S>
where
S: teleport_arrival_state::State,
S::Source: teleport_arrival_state::IsUnset,
{
pub fn source(
mut self,
value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>,
) -> TeleportArrivalBuilder<'a, teleport_arrival_state::SetSource<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
TeleportArrivalBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportArrivalBuilder<'a, S>
where
S: teleport_arrival_state::State,
S::StartsAt: teleport_arrival_state::IsUnset,
{
pub fn starts_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> TeleportArrivalBuilder<'a, teleport_arrival_state::SetStartsAt<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
TeleportArrivalBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportArrivalBuilder<'a, S>
where
S: teleport_arrival_state::State,
S::TeleportUri: teleport_arrival_state::IsUnset,
{
pub fn teleport_uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> TeleportArrivalBuilder<'a, teleport_arrival_state::SetTeleportUri<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
TeleportArrivalBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportArrivalBuilder<'a, S>
where
S: teleport_arrival_state::State,
S::ViewerCount: teleport_arrival_state::IsUnset,
{
pub fn viewer_count(
mut self,
value: impl Into<i64>,
) -> TeleportArrivalBuilder<'a, teleport_arrival_state::SetViewerCount<S>> {
self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into());
TeleportArrivalBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportArrivalBuilder<'a, S>
where
S: teleport_arrival_state::State,
S::TeleportUri: teleport_arrival_state::IsSet,
S::Source: teleport_arrival_state::IsSet,
S::StartsAt: teleport_arrival_state::IsSet,
S::ViewerCount: teleport_arrival_state::IsSet,
{
pub fn build(self) -> TeleportArrival<'a> {
TeleportArrival {
chat_profile: self.__unsafe_private_named.0,
source: self.__unsafe_private_named.1.unwrap(),
starts_at: self.__unsafe_private_named.2.unwrap(),
teleport_uri: self.__unsafe_private_named.3.unwrap(),
viewer_count: self.__unsafe_private_named.4.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TeleportArrival<'a> {
TeleportArrival {
chat_profile: self.__unsafe_private_named.0,
source: self.__unsafe_private_named.1.unwrap(),
starts_at: self.__unsafe_private_named.2.unwrap(),
teleport_uri: self.__unsafe_private_named.3.unwrap(),
viewer_count: self.__unsafe_private_named.4.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TeleportArrival<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"teleportArrival"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TeleportCanceled<'a> {
#[serde(borrow)]
pub reason: jacquard_common::CowStr<'a>,
#[serde(borrow)]
pub teleport_uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod teleport_canceled_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 TeleportUri;
type Reason;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type TeleportUri = Unset;
type Reason = Unset;
}
pub struct SetTeleportUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetTeleportUri<S> {}
impl<S: State> State for SetTeleportUri<S> {
type TeleportUri = Set<members::teleport_uri>;
type Reason = S::Reason;
}
pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetReason<S> {}
impl<S: State> State for SetReason<S> {
type TeleportUri = S::TeleportUri;
type Reason = Set<members::reason>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct teleport_uri(());
pub struct reason(());
}
}
pub struct TeleportCanceledBuilder<'a, S: teleport_canceled_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::CowStr<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TeleportCanceled<'a> {
pub fn new() -> TeleportCanceledBuilder<'a, teleport_canceled_state::Empty> {
TeleportCanceledBuilder::new()
}
}
impl<'a> TeleportCanceledBuilder<'a, teleport_canceled_state::Empty> {
pub fn new() -> Self {
TeleportCanceledBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportCanceledBuilder<'a, S>
where
S: teleport_canceled_state::State,
S::Reason: teleport_canceled_state::IsUnset,
{
pub fn reason(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TeleportCanceledBuilder<'a, teleport_canceled_state::SetReason<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
TeleportCanceledBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportCanceledBuilder<'a, S>
where
S: teleport_canceled_state::State,
S::TeleportUri: teleport_canceled_state::IsUnset,
{
pub fn teleport_uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> TeleportCanceledBuilder<'a, teleport_canceled_state::SetTeleportUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
TeleportCanceledBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TeleportCanceledBuilder<'a, S>
where
S: teleport_canceled_state::State,
S::TeleportUri: teleport_canceled_state::IsSet,
S::Reason: teleport_canceled_state::IsSet,
{
pub fn build(self) -> TeleportCanceled<'a> {
TeleportCanceled {
reason: self.__unsafe_private_named.0.unwrap(),
teleport_uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TeleportCanceled<'a> {
TeleportCanceled {
reason: self.__unsafe_private_named.0.unwrap(),
teleport_uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TeleportCanceled<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"teleportCanceled"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct ViewerCount<'a> {
pub count: i64,
}
pub mod viewer_count_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Count;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Count = Unset;
}
pub struct SetCount<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCount<S> {}
impl<S: State> State for SetCount<S> {
type Count = Set<members::count>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct count(());
}
}
pub struct ViewerCountBuilder<'a, S: viewer_count_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (::core::option::Option<i64>,),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> ViewerCount<'a> {
pub fn new() -> ViewerCountBuilder<'a, viewer_count_state::Empty> {
ViewerCountBuilder::new()
}
}
impl<'a> ViewerCountBuilder<'a, viewer_count_state::Empty> {
pub fn new() -> Self {
ViewerCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None,),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewerCountBuilder<'a, S>
where
S: viewer_count_state::State,
S::Count: viewer_count_state::IsUnset,
{
pub fn count(
mut self,
value: impl Into<i64>,
) -> ViewerCountBuilder<'a, viewer_count_state::SetCount<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
ViewerCountBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> ViewerCountBuilder<'a, S>
where
S: viewer_count_state::State,
S::Count: viewer_count_state::IsSet,
{
pub fn build(self) -> ViewerCount<'a> {
ViewerCount {
count: self.__unsafe_private_named.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> ViewerCount<'a> {
ViewerCount {
count: self.__unsafe_private_named.0.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerCount<'a> {
fn nsid() -> &'static str {
"place.stream.livestream"
}
fn def_name() -> &'static str {
"viewerCount"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_place_stream_livestream()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}