Skip to main content

dinio_sdk/models/
user.rs

1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4/// A Dinio user account. A non-Admin can read only their own
5/// ([`Users::get`](crate::api::Users::get)).
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct User {
8    /// User id; what a zone Owner needs to add the user as a zone member.
9    pub uuid: Uuid,
10    /// Identity provider that created the account (e.g. the IdP name, `dev` in
11    /// development).
12    pub auth_provider: String,
13    /// The user's id at that provider.
14    pub external_id: String,
15    /// `Admin` or `User` (kept as a string for forward compatibility).
16    pub role: String,
17    /// Email address, unique on the platform.
18    pub email: String,
19    /// A suspended user cannot sign in or use their key, and the zone keys of zones they
20    /// own stop working too. Only an Admin can change it, so a suspended user never sees
21    /// `true` here.
22    pub suspended: bool,
23    /// Whether the user has a personal API key. The key itself is shown only once, by
24    /// [`Users::create_api_key`](crate::api::Users::create_api_key).
25    #[serde(default)]
26    pub has_api_key: bool,
27    /// Unix seconds.
28    pub created_at: i64,
29    /// Unix seconds.
30    pub updated_at: i64,
31}