clerk_rs/models/
create_organization_invitation_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 CreateOrganizationInvitationRequest {
13	/// The email address of the new member that is going to be invited to the organization
14	#[serde(rename = "email_address")]
15	pub email_address: String,
16	/// The ID of the user that invites the new member to the organization. Must be an administrator in the organization.
17	#[serde(rename = "inviter_user_id")]
18	pub inviter_user_id: String,
19	/// The role of the new member in the organization
20	#[serde(rename = "role")]
21	pub role: String,
22	/// Metadata saved on the organization invitation, 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	/// Metadata saved on the organization invitation, fully accessible (read/write) from the Backend API but not visible from the Frontend API.
26	#[serde(rename = "private_metadata", skip_serializing_if = "Option::is_none")]
27	pub private_metadata: Option<serde_json::Value>,
28	/// Optional URL that the invitee will be redirected to once they accept the invitation by clicking the join link in the invitation email.
29	#[serde(rename = "redirect_url", skip_serializing_if = "Option::is_none")]
30	pub redirect_url: Option<String>,
31}
32
33impl CreateOrganizationInvitationRequest {
34	pub fn new(email_address: String, inviter_user_id: String, role: String) -> CreateOrganizationInvitationRequest {
35		CreateOrganizationInvitationRequest {
36			email_address,
37			inviter_user_id,
38			role,
39			public_metadata: None,
40			private_metadata: None,
41			redirect_url: None,
42		}
43	}
44}