1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.video.uploadPart` namespace.
pub const NSID: &str = "app.bsky.video.uploadPart";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
pub part_number: core::num::NonZeroU64,
pub size_bytes: i64,
}
pub type Output = crate::types::Object<OutputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "error", content = "message")]
pub enum Error {
///The job ID is unknown or aged out of retention; known terminal sessions are never reported as not found.
UploadNotFound(Option<String>),
///The upload session expired before completion.
UploadExpired(Option<String>),
///The part number is outside the upload's valid part range.
InvalidPartNumber(Option<String>),
///Content-Length does not exactly match the expected size for this part.
PartSizeMismatch(Option<String>),
///A finish is in progress; check getUploadStatus and retry.
UploadNotReady(Option<String>),
///The session is known to have failed; the error carries its failure reason.
UploadFailed(Option<String>),
///The session is known to have been aborted.
UploadAborted(Option<String>),
///The session is known to have already completed.
UploadAlreadyCompleted(Option<String>),
///The service is draining or temporarily at capacity; retry on another worker.
ServiceOverloaded(Option<String>),
}
impl std::fmt::Display for Error {
fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
match self {
Error::UploadNotFound(msg) => {
write!(_f, "UploadNotFound")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadExpired(msg) => {
write!(_f, "UploadExpired")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::InvalidPartNumber(msg) => {
write!(_f, "InvalidPartNumber")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::PartSizeMismatch(msg) => {
write!(_f, "PartSizeMismatch")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadNotReady(msg) => {
write!(_f, "UploadNotReady")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadFailed(msg) => {
write!(_f, "UploadFailed")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadAborted(msg) => {
write!(_f, "UploadAborted")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::UploadAlreadyCompleted(msg) => {
write!(_f, "UploadAlreadyCompleted")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
Error::ServiceOverloaded(msg) => {
write!(_f, "ServiceOverloaded")?;
if let Some(msg) = msg {
write!(_f, ": {msg}")?;
}
}
}
Ok(())
}
}