mangadex_api_schema_rust/v5/
api_client.rs

1use mangadex_api_types::{ApiClientProfile, ApiClientState, MangaDexDateTime, ResultType};
2use serde::Deserialize;
3
4use crate::TypedAttributes;
5
6/// General Api Client information.
7#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
8#[serde(rename_all = "camelCase")]
9#[non_exhaustive]
10#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
11#[cfg_attr(feature = "specta", derive(specta::Type))]
12pub struct ApiClientAttributes {
13    pub name: String,
14    pub description: Option<String>,
15    pub profile: ApiClientProfile,
16    pub external_client_id: Option<String>,
17    pub is_active: bool,
18    pub state: ApiClientState,
19    #[cfg_attr(
20        feature = "serialize",
21        serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
22    )]
23    pub created_at: MangaDexDateTime,
24    #[cfg_attr(
25        feature = "serialize",
26        serde(serialize_with = "crate::v5::mangadex_datetime_serialize")
27    )]
28    pub updated_at: MangaDexDateTime,
29    pub version: u32,
30}
31
32impl TypedAttributes for ApiClientAttributes {
33    const TYPE_: mangadex_api_types::RelationshipType =
34        mangadex_api_types::RelationshipType::ApiClient;
35}
36
37/// General Api Client information.
38#[derive(Clone, Debug, Deserialize, PartialEq, Default)]
39#[serde(rename_all = "camelCase")]
40#[non_exhaustive]
41#[cfg_attr(feature = "serialize", derive(serde::Serialize))]
42#[cfg_attr(feature = "specta", derive(specta::Type))]
43pub struct ApiClientSecret {
44    #[serde(default)]
45    pub result: ResultType,
46    pub data: String,
47}