atrium_api/app/bsky/video/
upload_part.rs1pub const NSID: &str = "app.bsky.video.uploadPart";
4#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
5#[serde(rename_all = "camelCase")]
6pub struct OutputData {
7 pub part_number: core::num::NonZeroU64,
8 pub size_bytes: i64,
9}
10pub type Output = crate::types::Object<OutputData>;
11#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
12#[serde(tag = "error", content = "message")]
13pub enum Error {
14 UploadNotFound(Option<String>),
16 UploadExpired(Option<String>),
18 InvalidPartNumber(Option<String>),
20 PartSizeMismatch(Option<String>),
22 UploadNotReady(Option<String>),
24 UploadFailed(Option<String>),
26 UploadAborted(Option<String>),
28 UploadAlreadyCompleted(Option<String>),
30 ServiceOverloaded(Option<String>),
32}
33impl std::fmt::Display for Error {
34 fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
35 match self {
36 Error::UploadNotFound(msg) => {
37 write!(_f, "UploadNotFound")?;
38 if let Some(msg) = msg {
39 write!(_f, ": {msg}")?;
40 }
41 }
42 Error::UploadExpired(msg) => {
43 write!(_f, "UploadExpired")?;
44 if let Some(msg) = msg {
45 write!(_f, ": {msg}")?;
46 }
47 }
48 Error::InvalidPartNumber(msg) => {
49 write!(_f, "InvalidPartNumber")?;
50 if let Some(msg) = msg {
51 write!(_f, ": {msg}")?;
52 }
53 }
54 Error::PartSizeMismatch(msg) => {
55 write!(_f, "PartSizeMismatch")?;
56 if let Some(msg) = msg {
57 write!(_f, ": {msg}")?;
58 }
59 }
60 Error::UploadNotReady(msg) => {
61 write!(_f, "UploadNotReady")?;
62 if let Some(msg) = msg {
63 write!(_f, ": {msg}")?;
64 }
65 }
66 Error::UploadFailed(msg) => {
67 write!(_f, "UploadFailed")?;
68 if let Some(msg) = msg {
69 write!(_f, ": {msg}")?;
70 }
71 }
72 Error::UploadAborted(msg) => {
73 write!(_f, "UploadAborted")?;
74 if let Some(msg) = msg {
75 write!(_f, ": {msg}")?;
76 }
77 }
78 Error::UploadAlreadyCompleted(msg) => {
79 write!(_f, "UploadAlreadyCompleted")?;
80 if let Some(msg) = msg {
81 write!(_f, ": {msg}")?;
82 }
83 }
84 Error::ServiceOverloaded(msg) => {
85 write!(_f, "ServiceOverloaded")?;
86 if let Some(msg) = msg {
87 write!(_f, ": {msg}")?;
88 }
89 }
90 }
91 Ok(())
92 }
93}