atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.video.finishUpload` namespace.
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 {
    ///The processing job to poll with getJobStatus; on deduplication this may differ from the input jobId.
    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 {
    ///The job ID is unknown or aged out of retention; known terminal sessions are never reported as not found.
    UploadNotFound(Option<String>),
    ///The upload session expired before finalization began.
    UploadExpired(Option<String>),
    ///Not all parts are recorded; the error message lists the missing part numbers.
    MissingParts(Option<String>),
    ///A finish is in progress; check getUploadStatus and retry.
    UploadNotReady(Option<String>),
    ///The assembled object's detected content type is not supported.
    UnsupportedContentType(Option<String>),
    ///The session is known to have failed; the error carries its failure reason.
    UploadFailed(Option<String>),
    ///The session is known to have been aborted.
    UploadAborted(Option<String>),
    ///The service is draining or temporarily at capacity; retry later.
    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(())
    }
}