pub mod create_upload;
pub mod get_upload_status;
pub mod get_video;
pub mod get_video_list;
pub mod origin;
pub mod publish_video;
pub mod track;
pub mod view_count;
#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::string::{Did, AtUri};
use jacquard_common::types::value::Data;
use jacquard_derive::IntoStatic;
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Serialize, Deserialize};
use crate::com_atproto::repo::strong_ref::StrongRef;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct MuxlTrack<S: BosStr = DefaultStr> {
pub blob: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub language: Option<S>,
pub media_type: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub signing_key: Option<Did<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub size: Option<i64>,
pub track_id: S,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SourceClip<S: BosStr = DefaultStr> {
pub end: i64,
pub start: i64,
pub video: AtUri<S>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))]
pub struct SourceTracks<S: BosStr = DefaultStr> {
pub tracks: Vec<StrongRef<S>>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> LexiconSchema for MuxlTrack<S> {
fn nsid() -> &'static str {
"place.stream.media.defs"
}
fn def_name() -> &'static str {
"muxlTrack"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_place_stream_media_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SourceClip<S> {
fn nsid() -> &'static str {
"place.stream.media.defs"
}
fn def_name() -> &'static str {
"sourceClip"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_place_stream_media_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
impl<S: BosStr> LexiconSchema for SourceTracks<S> {
fn nsid() -> &'static str {
"place.stream.media.defs"
}
fn def_name() -> &'static str {
"sourceTracks"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_place_stream_media_defs()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
fn lexicon_doc_place_stream_media_defs() -> LexiconDoc<'static> {
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
use alloc::collections::BTreeMap;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("place.stream.media.defs"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("muxlTrack"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static("A track backed by a MUXL container"),
),
required: Some(
vec![
SmolStr::new_static("blob"), SmolStr::new_static("trackId"),
SmolStr::new_static("mediaType")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("blob"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"BLAKE-3 content hash (BDASL CID) of the source video segment.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("language"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Language of the track, if applicable."),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("mediaType"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Type of the track: video, audio, or text.",
),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signingKey"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"did:key of the ephemeral key that C2PA-signed this track's segments. The private key is discarded once the track is produced, so it can only ever have signed this content.",
),
),
format: Some(LexStringFormat::Did),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("size"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("trackId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"ID of the track within the MUXL container. 1-indexed for MP4 reasons.",
),
),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceClip"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"An object representing that this video's source is a clip from another video.",
),
),
required: Some(
vec![
SmolStr::new_static("video"), SmolStr::new_static("start"),
SmolStr::new_static("end")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("end"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("start"),
LexObjectProperty::Integer(LexInteger {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("video"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("AT URI of the video we're clipping."),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sourceTracks"),
LexUserType::Object(LexObject {
description: Some(
CowStr::new_static(
"A collection of tracks representing the canonical source of a video.",
),
),
required: Some(vec![SmolStr::new_static("tracks")]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("tracks"),
LexObjectProperty::Array(LexArray {
description: Some(
CowStr::new_static(
"The canonical list of tracks specifying the source of a video.",
),
),
items: LexArrayItem::Ref(LexRef {
r#ref: CowStr::new_static("com.atproto.repo.strongRef"),
..Default::default()
}),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod source_clip_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 End;
type Start;
type Video;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type End = Unset;
type Start = Unset;
type Video = Unset;
}
pub struct SetEnd<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetEnd<St> {}
impl<St: State> State for SetEnd<St> {
type End = Set<members::end>;
type Start = St::Start;
type Video = St::Video;
}
pub struct SetStart<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetStart<St> {}
impl<St: State> State for SetStart<St> {
type End = St::End;
type Start = Set<members::start>;
type Video = St::Video;
}
pub struct SetVideo<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetVideo<St> {}
impl<St: State> State for SetVideo<St> {
type End = St::End;
type Start = St::Start;
type Video = Set<members::video>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct end(());
pub struct start(());
pub struct video(());
}
}
pub struct SourceClipBuilder<St: source_clip_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<i64>, Option<i64>, Option<AtUri<S>>),
_type: PhantomData<fn() -> S>,
}
impl SourceClip<DefaultStr> {
pub fn new() -> SourceClipBuilder<source_clip_state::Empty, DefaultStr> {
SourceClipBuilder::new()
}
}
impl<S: BosStr> SourceClip<S> {
pub fn builder() -> SourceClipBuilder<source_clip_state::Empty, S> {
SourceClipBuilder::builder()
}
}
impl SourceClipBuilder<source_clip_state::Empty, DefaultStr> {
pub fn new() -> Self {
SourceClipBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> SourceClipBuilder<source_clip_state::Empty, S> {
pub fn builder() -> Self {
SourceClipBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceClipBuilder<St, S>
where
St: source_clip_state::State,
St::End: source_clip_state::IsUnset,
{
pub fn end(
mut self,
value: impl Into<i64>,
) -> SourceClipBuilder<source_clip_state::SetEnd<St>, S> {
self._fields.0 = Option::Some(value.into());
SourceClipBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceClipBuilder<St, S>
where
St: source_clip_state::State,
St::Start: source_clip_state::IsUnset,
{
pub fn start(
mut self,
value: impl Into<i64>,
) -> SourceClipBuilder<source_clip_state::SetStart<St>, S> {
self._fields.1 = Option::Some(value.into());
SourceClipBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceClipBuilder<St, S>
where
St: source_clip_state::State,
St::Video: source_clip_state::IsUnset,
{
pub fn video(
mut self,
value: impl Into<AtUri<S>>,
) -> SourceClipBuilder<source_clip_state::SetVideo<St>, S> {
self._fields.2 = Option::Some(value.into());
SourceClipBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceClipBuilder<St, S>
where
St: source_clip_state::State,
St::End: source_clip_state::IsSet,
St::Start: source_clip_state::IsSet,
St::Video: source_clip_state::IsSet,
{
pub fn build(self) -> SourceClip<S> {
SourceClip {
end: self._fields.0.unwrap(),
start: self._fields.1.unwrap(),
video: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SourceClip<S> {
SourceClip {
end: self._fields.0.unwrap(),
start: self._fields.1.unwrap(),
video: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}
pub mod source_tracks_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 Tracks;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Tracks = Unset;
}
pub struct SetTracks<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetTracks<St> {}
impl<St: State> State for SetTracks<St> {
type Tracks = Set<members::tracks>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct tracks(());
}
}
pub struct SourceTracksBuilder<St: source_tracks_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<Vec<StrongRef<S>>>,),
_type: PhantomData<fn() -> S>,
}
impl SourceTracks<DefaultStr> {
pub fn new() -> SourceTracksBuilder<source_tracks_state::Empty, DefaultStr> {
SourceTracksBuilder::new()
}
}
impl<S: BosStr> SourceTracks<S> {
pub fn builder() -> SourceTracksBuilder<source_tracks_state::Empty, S> {
SourceTracksBuilder::builder()
}
}
impl SourceTracksBuilder<source_tracks_state::Empty, DefaultStr> {
pub fn new() -> Self {
SourceTracksBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<S: BosStr> SourceTracksBuilder<source_tracks_state::Empty, S> {
pub fn builder() -> Self {
SourceTracksBuilder {
_state: PhantomData,
_fields: (None,),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceTracksBuilder<St, S>
where
St: source_tracks_state::State,
St::Tracks: source_tracks_state::IsUnset,
{
pub fn tracks(
mut self,
value: impl Into<Vec<StrongRef<S>>>,
) -> SourceTracksBuilder<source_tracks_state::SetTracks<St>, S> {
self._fields.0 = Option::Some(value.into());
SourceTracksBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SourceTracksBuilder<St, S>
where
St: source_tracks_state::State,
St::Tracks: source_tracks_state::IsSet,
{
pub fn build(self) -> SourceTracks<S> {
SourceTracks {
tracks: self._fields.0.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: BTreeMap<SmolStr, Data<S>>,
) -> SourceTracks<S> {
SourceTracks {
tracks: self._fields.0.unwrap(),
extra_data: Some(extra_data),
}
}
}