Skip to main content

atrium_api/app/bsky/video/
start_upload.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.video.startUpload` namespace.
3pub const NSID: &str = "app.bsky.video.startUpload";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct InputData {
7    ///Advisory, non-authoritative duration used only for early failure; the authoritative probe runs asynchronously after upload.
8    #[serde(skip_serializing_if = "core::option::Option::is_none")]
9    pub duration_ms: core::option::Option<i64>,
10    ///Advisory, non-authoritative height used only for early failure; the authoritative probe runs asynchronously after upload.
11    #[serde(skip_serializing_if = "core::option::Option::is_none")]
12    pub height: core::option::Option<i64>,
13    ///Declared MIME type of the video.
14    pub mime_type: String,
15    ///Optional client-provided file name.
16    #[serde(skip_serializing_if = "core::option::Option::is_none")]
17    pub name: core::option::Option<String>,
18    ///Exact byte size of the complete upload-ready video file before it is split into parts.
19    pub size_bytes: core::num::NonZeroU64,
20    ///Advisory, non-authoritative width used only for early failure; the authoritative probe runs asynchronously after upload.
21    #[serde(skip_serializing_if = "core::option::Option::is_none")]
22    pub width: core::option::Option<i64>,
23}
24pub type Input = crate::types::Object<InputData>;
25#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
26#[serde(rename_all = "camelCase")]
27pub struct OutputData {
28    pub expires_at: crate::types::string::Datetime,
29    pub job_id: String,
30    pub part_count: i64,
31    pub part_size_bytes: i64,
32}
33pub type Output = crate::types::Object<OutputData>;
34#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
35#[serde(tag = "error", content = "message")]
36pub enum Error {
37    ///The declared MIME type is not supported.
38    UnsupportedContentType(Option<String>),
39    ///The exact file size exceeds the per-file cap or remaining daily byte allowance.
40    VideoTooLarge(Option<String>),
41    ///The advisory declared duration exceeds the limit.
42    VideoTooLong(Option<String>),
43    ///The advisory declared dimensions have an unsupported aspect ratio.
44    BadAspectRatio(Option<String>),
45    ///The daily video or byte allowance, including active reservations, is exhausted.
46    DailyLimitExceeded(Option<String>),
47    ///The account has reached its open multipart upload limit.
48    TooManyOpenUploads(Option<String>),
49    ///The account is not permitted to upload video.
50    UploadForbidden(Option<String>),
51    ///The service is draining, at capacity, or temporarily unable to create the multipart upload.
52    ServiceOverloaded(Option<String>),
53}
54impl std::fmt::Display for Error {
55    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
56        match self {
57            Error::UnsupportedContentType(msg) => {
58                write!(_f, "UnsupportedContentType")?;
59                if let Some(msg) = msg {
60                    write!(_f, ": {msg}")?;
61                }
62            }
63            Error::VideoTooLarge(msg) => {
64                write!(_f, "VideoTooLarge")?;
65                if let Some(msg) = msg {
66                    write!(_f, ": {msg}")?;
67                }
68            }
69            Error::VideoTooLong(msg) => {
70                write!(_f, "VideoTooLong")?;
71                if let Some(msg) = msg {
72                    write!(_f, ": {msg}")?;
73                }
74            }
75            Error::BadAspectRatio(msg) => {
76                write!(_f, "BadAspectRatio")?;
77                if let Some(msg) = msg {
78                    write!(_f, ": {msg}")?;
79                }
80            }
81            Error::DailyLimitExceeded(msg) => {
82                write!(_f, "DailyLimitExceeded")?;
83                if let Some(msg) = msg {
84                    write!(_f, ": {msg}")?;
85                }
86            }
87            Error::TooManyOpenUploads(msg) => {
88                write!(_f, "TooManyOpenUploads")?;
89                if let Some(msg) = msg {
90                    write!(_f, ": {msg}")?;
91                }
92            }
93            Error::UploadForbidden(msg) => {
94                write!(_f, "UploadForbidden")?;
95                if let Some(msg) = msg {
96                    write!(_f, ": {msg}")?;
97                }
98            }
99            Error::ServiceOverloaded(msg) => {
100                write!(_f, "ServiceOverloaded")?;
101                if let Some(msg) = msg {
102                    write!(_f, ": {msg}")?;
103                }
104            }
105        }
106        Ok(())
107    }
108}