clerk_rs/models/
client.rs

1/*
2 * Clerk Backend API
3 *
4 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
5 *
6 * The version of the OpenAPI document: v1
7 * Contact: support@clerk.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
12pub struct Client {
13	/// String representing the object's type. Objects of the same type share the same value.
14	#[serde(rename = "object")]
15	pub object: Object,
16	/// String representing the identifier of the session.
17	#[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	/// Last active session_id.
28	#[serde(rename = "last_active_session_id", deserialize_with = "Option::deserialize")]
29	pub last_active_session_id: Option<String>,
30	/// Unix timestamp of last update.
31	#[serde(rename = "updated_at")]
32	pub updated_at: i64,
33	/// Unix timestamp of creation.
34	#[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/// String representing the object's type. Objects of the same type share the same value.
65#[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}