azisaba-graph 0.1.0-rc.2

An API for connecting and sharing data across Azisaba Network.
Documentation
/*
 * Azisaba Graph API
 *
 * An API for connecting and sharing data across Azisaba Network.
 *
 * The version of the OpenAPI document: 0.0.1
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct PatchNote {
    /// The unique identifier of the patch note.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// The target of the patch note.
    #[serde(rename = "target")]
    pub target: Target,
    /// The category of the patch note.
    #[serde(rename = "category")]
    pub category: Category,
    /// The title of the patch note.
    #[serde(rename = "title")]
    pub title: String,
    /// The body text of the patch note.
    #[serde(rename = "body")]
    pub body: String,
    /// The unique identifier of the player.
    #[serde(rename = "authorId", deserialize_with = "Option::deserialize")]
    pub author_id: Option<uuid::Uuid>,
    /// The URLs of images attached to the patch note.
    #[serde(rename = "imageUrls")]
    pub image_urls: Vec<String>,
    /// The date and time at which the patch note was created.
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
}

impl PatchNote {
    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 {
        PatchNote {
            id,
            target,
            category,
            title,
            body,
            author_id,
            image_urls,
            created_at,
        }
    }
}
/// The target of the patch note.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Target {
    #[serde(rename = "general")]
    General,
    #[serde(rename = "creativePro")]
    CreativePro,
    #[serde(rename = "frontier")]
    Frontier,
    #[serde(rename = "life")]
    Life,
    #[serde(rename = "leonGunWar2")]
    LeonGunWar2,
    #[serde(rename = "sclat")]
    Sclat,
}

impl Default for Target {
    fn default() -> Target {
        Self::General
    }
}
/// The category of the patch note.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Category {
    #[serde(rename = "balance")]
    Balance,
    #[serde(rename = "event")]
    Event,
    #[serde(rename = "feature")]
    Feature,
    #[serde(rename = "fix")]
    Fix,
    #[serde(rename = "improvement")]
    Improvement,
    #[serde(rename = "map")]
    Map,
    #[serde(rename = "remove")]
    Remove,
}

impl Default for Category {
    fn default() -> Category {
        Self::Balance
    }
}