Skip to main content

azisaba_graph/models/
patch_note.rs

1/*
2 * Azisaba Graph API
3 *
4 * An API for connecting and sharing data across the Azisaba Network.
5 *
6 * The version of the OpenAPI document: 0.0.1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PatchNote : Represents a patch note.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PatchNote {
17    /// The unique identifier of the patch note.
18    #[serde(rename = "id")]
19    pub id: uuid::Uuid,
20    /// The target of the patch note.
21    #[serde(rename = "target")]
22    pub target: Target,
23    /// The category of the patch note.
24    #[serde(rename = "category")]
25    pub category: Category,
26    /// The title of the patch note.
27    #[serde(rename = "title")]
28    pub title: String,
29    /// The body text of the patch note.
30    #[serde(rename = "body")]
31    pub body: String,
32    /// The unique identifier of the player.
33    #[serde(rename = "authorId", deserialize_with = "Option::deserialize")]
34    pub author_id: Option<uuid::Uuid>,
35    /// The URLs of images attached to the patch note.
36    #[serde(rename = "imageUrls")]
37    pub image_urls: Vec<String>,
38    /// The date and time at which the patch note was created.
39    #[serde(rename = "createdAt")]
40    pub created_at: chrono::DateTime<chrono::FixedOffset>,
41}
42
43impl PatchNote {
44    /// Represents a patch note.
45    pub fn new(id: uuid::Uuid, target: Target, category: Category, title: String, body: String, author_id: Option<uuid::Uuid>, image_urls: Vec<String>, created_at: chrono::DateTime<chrono::FixedOffset>) -> PatchNote {
46        PatchNote {
47            id,
48            target,
49            category,
50            title,
51            body,
52            author_id,
53            image_urls,
54            created_at,
55        }
56    }
57}
58/// The target of the patch note.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum Target {
61    #[serde(rename = "general")]
62    General,
63    #[serde(rename = "creativePro")]
64    CreativePro,
65    #[serde(rename = "frontier")]
66    Frontier,
67    #[serde(rename = "life")]
68    Life,
69    #[serde(rename = "leonGunWar2")]
70    LeonGunWar2,
71    #[serde(rename = "sclat")]
72    Sclat,
73}
74
75impl Default for Target {
76    fn default() -> Target {
77        Self::General
78    }
79}
80/// The category of the patch note.
81#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
82pub enum Category {
83    #[serde(rename = "balance")]
84    Balance,
85    #[serde(rename = "event")]
86    Event,
87    #[serde(rename = "feature")]
88    Feature,
89    #[serde(rename = "fix")]
90    Fix,
91    #[serde(rename = "improvement")]
92    Improvement,
93    #[serde(rename = "map")]
94    Map,
95    #[serde(rename = "remove")]
96    Remove,
97}
98
99impl Default for Category {
100    fn default() -> Category {
101        Self::Balance
102    }
103}
104