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.getUploadStatus` namespace.
pub const NSID: &str = "app.bsky.video.getUploadStatus";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ParametersData {
    pub job_id: String,
}
pub type Parameters = crate::types::Object<ParametersData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    ///Present only when state is completed; may differ from jobId on deduplication.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub completed_job_id: core::option::Option<String>,
    pub expires_at: crate::types::string::Datetime,
    ///Present only when state is failed.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub failure_reason: core::option::Option<String>,
    pub job_id: String,
    ///Present only when state is completed.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub job_status: core::option::Option<crate::app::bsky::video::defs::JobStatus>,
    pub part_count: i64,
    pub part_size_bytes: i64,
    pub received_parts: Vec<core::num::NonZeroU64>,
    pub state: String,
}
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 remain readable and are never reported as not found.
    UploadNotFound(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}")?;
                }
            }
        }
        Ok(())
    }
}