clerk_rs/models/
organization.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 Organization {
13	#[serde(rename = "object")]
14	pub object: Object,
15	#[serde(rename = "id")]
16	pub id: String,
17	#[serde(rename = "name")]
18	pub name: String,
19	#[serde(rename = "slug")]
20	pub slug: String,
21	#[serde(
22		rename = "members_count",
23		default,
24		with = "::serde_with::rust::double_option",
25		skip_serializing_if = "Option::is_none"
26	)]
27	pub members_count: Option<Option<i64>>,
28	#[serde(rename = "max_allowed_memberships")]
29	pub max_allowed_memberships: i64,
30	#[serde(rename = "admin_delete_enabled", skip_serializing_if = "Option::is_none")]
31	pub admin_delete_enabled: Option<bool>,
32	#[serde(rename = "public_metadata")]
33	pub public_metadata: serde_json::Value,
34	#[serde(rename = "private_metadata")]
35	pub private_metadata: serde_json::Value,
36	#[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
37	pub created_by: Option<String>,
38	/// Unix timestamp of creation.
39	#[serde(rename = "created_at")]
40	pub created_at: i64,
41	/// Unix timestamp of last update.
42	#[serde(rename = "updated_at")]
43	pub updated_at: i64,
44}
45
46impl Organization {
47	pub fn new(
48		object: Object,
49		id: String,
50		name: String,
51		slug: String,
52		max_allowed_memberships: i64,
53		public_metadata: serde_json::Value,
54		private_metadata: serde_json::Value,
55		created_at: i64,
56		updated_at: i64,
57	) -> Organization {
58		Organization {
59			object,
60			id,
61			name,
62			slug,
63			members_count: None,
64			max_allowed_memberships,
65			admin_delete_enabled: None,
66			public_metadata,
67			private_metadata,
68			created_by: None,
69			created_at,
70			updated_at,
71		}
72	}
73}
74
75///
76#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
77pub enum Object {
78	#[serde(rename = "organization")]
79	Organization,
80}
81
82impl Default for Object {
83	fn default() -> Object {
84		Self::Organization
85	}
86}