atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.video.startUpload` namespace.
pub const NSID: &str = "app.bsky.video.startUpload";
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct InputData {
    ///Advisory, non-authoritative duration used only for early failure; the authoritative probe runs asynchronously after upload.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub duration_ms: core::option::Option<i64>,
    ///Advisory, non-authoritative height used only for early failure; the authoritative probe runs asynchronously after upload.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub height: core::option::Option<i64>,
    ///Declared MIME type of the video.
    pub mime_type: String,
    ///Optional client-provided file name.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub name: core::option::Option<String>,
    ///Exact byte size of the complete upload-ready video file before it is split into parts.
    pub size_bytes: core::num::NonZeroU64,
    ///Advisory, non-authoritative width used only for early failure; the authoritative probe runs asynchronously after upload.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub width: core::option::Option<i64>,
}
pub type Input = crate::types::Object<InputData>;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct OutputData {
    pub expires_at: crate::types::string::Datetime,
    pub job_id: String,
    pub part_count: i64,
    pub part_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 declared MIME type is not supported.
    UnsupportedContentType(Option<String>),
    ///The exact file size exceeds the per-file cap or remaining daily byte allowance.
    VideoTooLarge(Option<String>),
    ///The advisory declared duration exceeds the limit.
    VideoTooLong(Option<String>),
    ///The advisory declared dimensions have an unsupported aspect ratio.
    BadAspectRatio(Option<String>),
    ///The daily video or byte allowance, including active reservations, is exhausted.
    DailyLimitExceeded(Option<String>),
    ///The account has reached its open multipart upload limit.
    TooManyOpenUploads(Option<String>),
    ///The account is not permitted to upload video.
    UploadForbidden(Option<String>),
    ///The service is draining, at capacity, or temporarily unable to create the multipart upload.
    ServiceOverloaded(Option<String>),
}
impl std::fmt::Display for Error {
    fn fmt(&self, _f: &mut std::fmt::Formatter) -> std::fmt::Result {
        match self {
            Error::UnsupportedContentType(msg) => {
                write!(_f, "UnsupportedContentType")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::VideoTooLarge(msg) => {
                write!(_f, "VideoTooLarge")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::VideoTooLong(msg) => {
                write!(_f, "VideoTooLong")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::BadAspectRatio(msg) => {
                write!(_f, "BadAspectRatio")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::DailyLimitExceeded(msg) => {
                write!(_f, "DailyLimitExceeded")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::TooManyOpenUploads(msg) => {
                write!(_f, "TooManyOpenUploads")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::UploadForbidden(msg) => {
                write!(_f, "UploadForbidden")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
            Error::ServiceOverloaded(msg) => {
                write!(_f, "ServiceOverloaded")?;
                if let Some(msg) = msg {
                    write!(_f, ": {msg}")?;
                }
            }
        }
        Ok(())
    }
}