pub const NSID: &str = "app.bsky.video.finishUpload";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
pub job_id: String,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
pub completed_job_id: String,
pub job_status: crate::app::bsky::video::defs::JobStatus,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
UploadNotFound(Option<String>),
UploadExpired(Option<String>),
MissingParts(Option<String>),
UploadNotReady(Option<String>),
UnsupportedContentType(Option<String>),
UploadFailed(Option<String>),
UploadAborted(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::UploadNotFound(msg) => {
write!(_f, "UploadNotFound")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadExpired(msg) => {
write!(_f, "UploadExpired")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::MissingParts(msg) => {
write!(_f, "MissingParts")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadNotReady(msg) => {
write!(_f, "UploadNotReady")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UnsupportedContentType(msg) => {
write!(_f, "UnsupportedContentType")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadFailed(msg) => {
write!(_f, "UploadFailed")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadAborted(msg) => {
write!(_f, "UploadAborted")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::ServiceOverloaded(msg) => {
write!(_f, "ServiceOverloaded")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}