pub const NSID: &str = "app.bsky.video.startUpload";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub duration_ms: core::option::Option<i64>,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub height: core::option::Option<i64>,
pub mime_type: String,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub name: core::option::Option<String>,
pub size_bytes: core::num::NonZeroU64,
#[serde(skip_serializing_if = "core::option::Option::is_none")]
pub width: core::option::Option<i64>,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
pub expires_at: crate::types::string::Datetime,
pub job_id: String,
pub part_count: i64,
pub part_size_bytes: i64,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
UnsupportedContentType(Option<String>),
VideoTooLarge(Option<String>),
VideoTooLong(Option<String>),
BadAspectRatio(Option<String>),
DailyLimitExceeded(Option<String>),
TooManyOpenUploads(Option<String>),
UploadForbidden(Option<String>),
ServiceOverloaded(Option<String>),
}
impl std::fmt::Display for Error {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Error::UnsupportedContentType(msg) => {
write!(_f, "UnsupportedContentType")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::VideoTooLarge(msg) => {
write!(_f, "VideoTooLarge")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::VideoTooLong(msg) => {
write!(_f, "VideoTooLong")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::BadAspectRatio(msg) => {
write!(_f, "BadAspectRatio")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::DailyLimitExceeded(msg) => {
write!(_f, "DailyLimitExceeded")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::TooManyOpenUploads(msg) => {
write!(_f, "TooManyOpenUploads")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadForbidden(msg) => {
write!(_f, "UploadForbidden")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::ServiceOverloaded(msg) => {
write!(_f, "ServiceOverloaded")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}