fandwill-vo 0.1.0

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, FixedOffset};
use serde::Serialize;

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

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