clerk_rs/models/
client.rs1#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct Client {
13 #[serde(rename = "object")]
15 pub object: Object,
16 #[serde(rename = "id")]
18 pub id: String,
19 #[serde(rename = "session_ids")]
20 pub session_ids: Vec<String>,
21 #[serde(rename = "sessions")]
22 pub sessions: Vec<crate::models::Session>,
23 #[serde(rename = "sign_in_id", deserialize_with = "Option::deserialize")]
24 pub sign_in_id: Option<String>,
25 #[serde(rename = "sign_up_id", deserialize_with = "Option::deserialize")]
26 pub sign_up_id: Option<String>,
27 #[serde(rename = "last_active_session_id", deserialize_with = "Option::deserialize")]
29 pub last_active_session_id: Option<String>,
30 #[serde(rename = "updated_at")]
32 pub updated_at: i64,
33 #[serde(rename = "created_at")]
35 pub created_at: i64,
36}
37
38impl Client {
39 pub fn new(
40 object: Object,
41 id: String,
42 session_ids: Vec<String>,
43 sessions: Vec<crate::models::Session>,
44 sign_in_id: Option<String>,
45 sign_up_id: Option<String>,
46 last_active_session_id: Option<String>,
47 updated_at: i64,
48 created_at: i64,
49 ) -> Client {
50 Client {
51 object,
52 id,
53 session_ids,
54 sessions,
55 sign_in_id,
56 sign_up_id,
57 last_active_session_id,
58 updated_at,
59 created_at,
60 }
61 }
62}
63
64#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
66pub enum Object {
67 #[serde(rename = "client")]
68 Client,
69}
70
71impl Default for Object {
72 fn default() -> Object {
73 Self::Client
74 }
75}