Skip to main content

atrium_api/app/bsky/video/
abort_upload.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.video.abortUpload` namespace.
3pub const NSID: &str = "app.bsky.video.abortUpload";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    pub job_id: String,
8}
9pub type Input = crate::types::Object<InputData>;
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.
14    #[serde(skip_serializing_if = "core::option::Option::is_none")]
15    pub completed_job_id: core::option::Option<String>,
16    ///Present only when state is failed.
17    #[serde(skip_serializing_if = "core::option::Option::is_none")]
18    pub failure_reason: core::option::Option<String>,
19    pub state: String,
20}
21pub type Output = crate::types::Object<OutputData>;
22#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
23#[serde(tag = "error", content = "message")]
24pub enum Error {
25    ///The job ID is unknown or aged out of retention; known terminal sessions return their outcome and are never reported as not found.
26    UploadNotFound(Option<String>),
27    ///A finish is in progress; check getUploadStatus and retry.
28    UploadNotReady(Option<String>),
29}
30impl std::fmt::Display for Error {
31    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
32        match self {
33            Error::UploadNotFound(msg) => {
34                write!(_f, "UploadNotFound")?;
35                if let Some(msg) = msg {
36                    write!(_f, ": {msg}")?;
37                }
38            }
39            Error::UploadNotReady(msg) => {
40                write!(_f, "UploadNotReady")?;
41                if let Some(msg) = msg {
42                    write!(_f, ": {msg}")?;
43                }
44            }
45        }
46        Ok(())
47    }
48}