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", skip_serializing_if = "Option::is_none")]
18	pub created_by: Option<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	/// A custom date/time denoting when the organization was created, specified in RFC3339 format (e.g. 2012-10-20T07:15:20.902Z).
32	#[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
33	pub created_at: Option<String>,
34}
35
36impl CreateOrganizationRequest {
37	pub fn new(name: String) -> CreateOrganizationRequest {
38		CreateOrganizationRequest {
39			name,
40			created_by: None,
41			private_metadata: None,
42			public_metadata: None,
43			slug: None,
44			max_allowed_memberships: None,
45			created_at: None,
46		}
47	}
48}