mango_api/requests/
scanlation_group.rs

1//! Utilities for scanlation group specific server part of the application.
2//!
3//! The meaning of most of the confusing structs here can be found at <https://api.mangadex.org/docs/3-enumerations/#manga-links-data>
4//!
5//! All queries encountered here can be constructed with the builder syntax from the [bon] crate
6
7use serde::{Deserialize, Serialize};
8
9use super::query_utils::{LocalizedString, Relationship};
10use super::{Entity, EntityType, Locale};
11
12/// Used for serialization/deserialization
13#[derive(Serialize, Deserialize, Clone, Debug)]
14#[serde(rename_all = "camelCase")]
15pub struct ScanlationGroupAttributes {
16    pub name: String,
17    pub alt_names: Vec<LocalizedString>,
18    pub website: Option<String>,
19    pub irc_server: Option<String>,
20    pub discord: Option<String>,
21    pub contact_email: Option<String>,
22    pub description: Option<String>,
23    pub twitter: Option<String>,
24    pub manga_updates: Option<String>,
25    pub focused_language: Option<Vec<Locale>>,
26    pub locked: bool,
27    pub official: bool,
28    pub verified: bool,
29    pub inactive: bool,
30    pub ex_licensed: bool,
31    pub publish_delay: Option<String>,
32    pub version: usize,
33    pub created_at: String,
34    pub updated_at: String,
35}
36
37/// Main structure used for representing the response containg scanlation group info
38#[derive(Serialize, Deserialize, Clone, Debug)]
39pub struct ScanlationGroup {
40    pub id: String,
41    #[serde(rename = "type")]
42    pub entity_type: EntityType,
43    pub attributes: ScanlationGroupAttributes,
44    pub relationships: Vec<Relationship>,
45}
46
47impl Entity for ScanlationGroup {}