mangadex_api_schema_rust/v5/
upload_session.rs

1//! Upload session information from a response body.
2
3use mangadex_api_types::{MangaDexDateTime, RelationshipType};
4use serde::Deserialize;
5
6use crate::TypedAttributes;
7
8#[derive(Clone, Debug, Deserialize, Copy, Default)]
9#[serde(rename_all = "camelCase")]
10#[non_exhaustive]
11#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
12#[cfg_attr(feature = "specta", derive(specta::Type))]
13pub struct UploadSessionAttributes {
14    pub is_committed: bool,
15    pub is_processed: bool,
16    pub is_deleted: bool,
17    pub version: u32,
18    /// Datetime in `YYYY-MM-DDTHH:MM:SS+HH:MM` format.
19    #[cfg_attr(feature = "specta", specta(type = String))]
20    #[cfg_attr(
21        feature = "serialize",
22        serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
23    )]
24    pub created_at: MangaDexDateTime,
25    /// Datetime in `YYYY-MM-DDTHH:MM:SS+HH:MM` format.
26    #[cfg_attr(feature = "specta", specta(type = String))]
27    #[cfg_attr(
28        feature = "serialize",
29        serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
30    )]
31    pub updated_at: MangaDexDateTime,
32}
33
34impl TypedAttributes for UploadSessionAttributes {
35    const TYPE_: mangadex_api_types::RelationshipType = RelationshipType::UploadSession;
36}