clerk_rs/models/
create_organization_request.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 CreateOrganizationRequest {
13	/// The name of the new organization
14	#[serde(rename = "name")]
15	pub name: String,
16	/// The ID of the User who will become the administrator for the new organization
17	#[serde(rename = "created_by")]
18	pub created_by: String,
19	/// Metadata saved on the organization, accessible only from the Backend API
20	#[serde(rename = "private_metadata", skip_serializing_if = "Option::is_none")]
21	pub private_metadata: Option<serde_json::Value>,
22	/// Metadata saved on the organization, read-only from the Frontend API and fully accessible (read/write) from the Backend API
23	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
24	pub public_metadata: Option<serde_json::Value>,
25	/// A slug for the new organization. Can contain only lowercase alphanumeric characters and the dash \"-\". Must be unique for the instance.
26	#[serde(rename = "slug", skip_serializing_if = "Option::is_none")]
27	pub slug: Option<String>,
28	/// The maximum number of memberships allowed for this organization
29	#[serde(rename = "max_allowed_memberships", skip_serializing_if = "Option::is_none")]
30	pub max_allowed_memberships: Option<i64>,
31}
32
33impl CreateOrganizationRequest {
34	pub fn new(name: String, created_by: String) -> CreateOrganizationRequest {
35		CreateOrganizationRequest {
36			name,
37			created_by,
38			private_metadata: None,
39			public_metadata: None,
40			slug: None,
41			max_allowed_memberships: None,
42		}
43	}
44}