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
use crate::format::release::ExtLink;
use crate::format::schema::Language;
use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Debug)]
pub struct Staff {
    /// Vndbid
    pub id: Option<String>,
    /// Alias id
    pub aid: Option<u32>,
    /// Whether the ‘name’ and ‘original’ fields represent the main name for this staff entry
    pub ismain: Option<bool>,
    /// Possibly romanized name
    pub name: Option<String>,
    /// Name in original script
    pub original: Option<String>,
    /// Staff's primary language
    pub lang: Option<Language>,
    /// Male or Female
    pub gender: Option<StaffGender>,
    /// May contain formatting codes
    pub description: Option<String>,
    /// Links to external websites
    pub extlinks: Option<Vec<ExtLink>>,
    /// List of names used by this person
    pub aliases: Option<Vec<StaffAlias>>,
}

#[derive(Deserialize, Serialize, Debug)]
#[serde(rename_all = "lowercase")]
pub enum StaffGender {
    #[serde(rename = "m")]
    Male,
    #[serde(rename = "f")]
    Female,
}

#[derive(Deserialize, Serialize, Debug)]
pub struct StaffAlias {
    /// Alias id
    pub aid: Option<u32>,
    /// Name in the original script
    pub name: Option<String>,
    /// Romanized version of ‘name’
    pub latin: Option<String>,
    /// Whether this alias is used as “main” name for the staff entry
    pub ismain: Option<bool>,
}