atrium_api/app/bsky/video/
start_upload.rs1pub 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 #[serde(skip_serializing_if = "core::option::Option::is_none")]
9 pub duration_ms: core::option::Option<i64>,
10 #[serde(skip_serializing_if = "core::option::Option::is_none")]
12 pub height: core::option::Option<i64>,
13 pub mime_type: String,
15 #[serde(skip_serializing_if = "core::option::Option::is_none")]
17 pub name: core::option::Option<String>,
18 pub size_bytes: core::num::NonZeroU64,
20 #[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 UnsupportedContentType(Option<String>),
39 VideoTooLarge(Option<String>),
41 VideoTooLong(Option<String>),
43 BadAspectRatio(Option<String>),
45 DailyLimitExceeded(Option<String>),
47 TooManyOpenUploads(Option<String>),
49 UploadForbidden(Option<String>),
51 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}