Skip to main content

vndb_api/format/
staff.rs

1use crate::format::release::ExtLink;
2use crate::format::schema::Language;
3use serde::{Deserialize, Serialize};
4
5#[derive(Deserialize, Serialize, Debug)]
6pub struct Staff {
7    /// Vndbid
8    pub id: Option<String>,
9    /// Alias id
10    pub aid: Option<u32>,
11    /// Whether the ‘name’ and ‘original’ fields represent the main name for this staff entry
12    pub ismain: Option<bool>,
13    /// Possibly romanized name
14    pub name: Option<String>,
15    /// Name in original script
16    pub original: Option<String>,
17    /// Staff's primary language
18    pub lang: Option<Language>,
19    /// Male or Female
20    pub gender: Option<StaffGender>,
21    /// May contain formatting codes
22    pub description: Option<String>,
23    /// Links to external websites
24    pub extlinks: Option<Vec<ExtLink>>,
25    /// List of names used by this person
26    pub aliases: Option<Vec<StaffAlias>>,
27}
28
29#[derive(Deserialize, Serialize, Debug)]
30#[serde(rename_all = "lowercase")]
31pub enum StaffGender {
32    #[serde(rename = "m")]
33    Male,
34    #[serde(rename = "f")]
35    Female,
36}
37
38#[derive(Deserialize, Serialize, Debug)]
39pub struct StaffAlias {
40    /// Alias id
41    pub aid: Option<u32>,
42    /// Name in the original script
43    pub name: Option<String>,
44    /// Romanized version of ‘name’
45    pub latin: Option<String>,
46    /// Whether this alias is used as “main” name for the staff entry
47    pub ismain: Option<bool>,
48}