clerk-rs 0.4.2

The official community Rust SDK for the Clerk API
Documentation
/*
 * Clerk Backend API
 *
 * The Clerk REST Backend API, meant to be accessed by backend servers. Please see https://clerk.com/docs for more information.
 *
 * The version of the OpenAPI document: v1
 * Contact: support@clerk.com
 * Generated by: https://openapi-generator.tech
 */

#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct Organization {
	#[serde(rename = "object")]
	pub object: Object,
	#[serde(rename = "id")]
	pub id: String,
	#[serde(rename = "name")]
	pub name: String,
	#[serde(rename = "slug")]
	pub slug: String,
	#[serde(rename = "members_count", skip_serializing_if = "Option::is_none")]
	pub members_count: Option<i64>,
	#[serde(rename = "max_allowed_memberships")]
	pub max_allowed_memberships: i64,
	#[serde(rename = "admin_delete_enabled", skip_serializing_if = "Option::is_none")]
	pub admin_delete_enabled: Option<bool>,
	#[serde(rename = "public_metadata")]
	pub public_metadata: serde_json::Value,
	#[serde(rename = "private_metadata")]
	pub private_metadata: serde_json::Value,
	#[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
	pub created_by: Option<String>,
	/// Unix timestamp of creation.
	#[serde(rename = "created_at")]
	pub created_at: i64,
	/// Unix timestamp of last update.
	#[serde(rename = "updated_at")]
	pub updated_at: i64,
}

impl Organization {
	pub fn new(
		object: Object,
		id: String,
		name: String,
		slug: String,
		max_allowed_memberships: i64,
		public_metadata: serde_json::Value,
		private_metadata: serde_json::Value,
		created_at: i64,
		updated_at: i64,
	) -> Organization {
		Organization {
			object,
			id,
			name,
			slug,
			members_count: None,
			max_allowed_memberships,
			admin_delete_enabled: None,
			public_metadata,
			private_metadata,
			created_by: None,
			created_at,
			updated_at,
		}
	}
}

///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Object {
	#[serde(rename = "organization")]
	Organization,
}

impl Default for Object {
	fn default() -> Object {
		Self::Organization
	}
}