divviup_client/
api_token.rs1use serde::{Deserialize, Serialize};
2use time::OffsetDateTime;
3use uuid::Uuid;
4
5#[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)]
6pub struct ApiToken {
7 pub id: Uuid,
8 pub account_id: Uuid,
9 pub token_hash: String,
10 #[serde(with = "::time::serde::rfc3339")]
11 pub created_at: OffsetDateTime,
12 #[serde(default, with = "::time::serde::rfc3339::option")]
13 pub deleted_at: Option<OffsetDateTime>,
14 #[serde(default, with = "::time::serde::rfc3339::option")]
15 pub last_used_at: Option<OffsetDateTime>,
16 #[serde(with = "::time::serde::rfc3339")]
17 pub updated_at: OffsetDateTime,
18 pub name: Option<String>,
19 pub token: Option<String>,
20}