Skip to main content

atrium_api/app/bsky/video/
get_upload_status.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.video.getUploadStatus` namespace.
3pub const NSID: &str = "app.bsky.video.getUploadStatus";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct ParametersData {
7    pub job_id: String,
8}
9pub type Parameters = crate::types::Object<ParametersData>;
10#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
11#[serde(rename_all = "camelCase")]
12pub struct OutputData {
13    ///Present only when state is completed; may differ from jobId on deduplication.
14    #[serde(skip_serializing_if = "core::option::Option::is_none")]
15    pub completed_job_id: core::option::Option<String>,
16    pub expires_at: crate::types::string::Datetime,
17    ///Present only when state is failed.
18    #[serde(skip_serializing_if = "core::option::Option::is_none")]
19    pub failure_reason: core::option::Option<String>,
20    pub job_id: String,
21    ///Present only when state is completed.
22    #[serde(skip_serializing_if = "core::option::Option::is_none")]
23    pub job_status: core::option::Option<crate::app::bsky::video::defs::JobStatus>,
24    pub part_count: i64,
25    pub part_size_bytes: i64,
26    pub received_parts: Vec<core::num::NonZeroU64>,
27    pub state: String,
28}
29pub type Output = crate::types::Object<OutputData>;
30#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
31#[serde(tag = "error", content = "message")]
32pub enum Error {
33    ///The job ID is unknown or aged out of retention; known terminal sessions remain readable and are never reported as not found.
34    UploadNotFound(Option<String>),
35}
36impl std::fmt::Display for Error {
37    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
38        match self {
39            Error::UploadNotFound(msg) => {
40                write!(_f, "UploadNotFound")?;
41                if let Some(msg) = msg {
42                    write!(_f, ": {msg}")?;
43                }
44            }
45        }
46        Ok(())
47    }
48}