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 CreateOrganizationRequest {
	/// The name of the new organization
	#[serde(rename = "name")]
	pub name: String,
	/// The ID of the User who will become the administrator for the new organization
	#[serde(rename = "created_by", skip_serializing_if = "Option::is_none")]
	pub created_by: Option<String>,
	/// Metadata saved on the organization, accessible only from the Backend API
	#[serde(rename = "private_metadata", skip_serializing_if = "Option::is_none")]
	pub private_metadata: Option<serde_json::Value>,
	/// Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API
	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
	pub public_metadata: Option<serde_json::Value>,
	/// A slug for the new organization. Can contain only lowercase alphanumeric characters and the dash \"-\". Must be unique for the instance.
	#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
	pub slug: Option<String>,
	/// The maximum number of memberships allowed for this organization
	#[serde(rename = "max_allowed_memberships", skip_serializing_if = "Option::is_none")]
	pub max_allowed_memberships: Option<i64>,
	/// A custom date/time denoting when the organization was created, specified in RFC3339 format (e.g. 2012-10-20T07:15:20.902Z).
	#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
	pub created_at: Option<String>,
}

impl CreateOrganizationRequest {
	pub fn new(name: String) -> CreateOrganizationRequest {
		CreateOrganizationRequest {
			name,
			created_by: None,
			private_metadata: None,
			public_metadata: None,
			slug: None,
			max_allowed_memberships: None,
			created_at: None,
		}
	}
}