fandwill-vo 0.1.1

Serde, garde, and utoipa value objects for the Fandwill platform API.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize, Clone)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct RootResponse {
    pub start_at: DateTime<Utc>,
    pub version: String,
}

impl RootResponse {
    pub fn new(start_at: impl Into<DateTime<Utc>>, version: impl Into<String>) -> Self {
        Self {
            start_at: start_at.into(),
            version: version.into(),
        }
    }
}