clerk_rs/models/
create_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 CreateInvitationRequest {
13	/// The email address the invitation will be sent to
14	#[serde(rename = "email_address")]
15	pub email_address: String,
16	/// Metadata that will be attached to the newly created invitation. The value of this property should be a well-formed JSON object. Once the user accepts the invitation and signs up, these metadata will end up in the user's public metadata.
17	#[serde(rename = "public_metadata", skip_serializing_if = "Option::is_none")]
18	pub public_metadata: Option<serde_json::Value>,
19	/// Optional URL which specifies where to redirect the user once they click the invitation link. This is only required if you have implemented a [custom flow](https://clerk.com/docs/authentication/invitations#custom-flow) and you're not using Clerk Hosted Pages or Clerk Components.
20	#[serde(rename = "redirect_url", skip_serializing_if = "Option::is_none")]
21	pub redirect_url: Option<String>,
22	/// Optional flag which denotes whether an email invitation should be sent to the given email address. Defaults to true.
23	#[serde(rename = "notify", skip_serializing_if = "Option::is_none")]
24	pub notify: Option<bool>,
25	/// Whether an invitation should be created if there is already an existing invitation for this email address, or it's claimed by another user.
26	#[serde(rename = "ignore_existing", skip_serializing_if = "Option::is_none")]
27	pub ignore_existing: Option<bool>,
28}
29
30impl CreateInvitationRequest {
31	pub fn new(email_address: String) -> CreateInvitationRequest {
32		CreateInvitationRequest {
33			email_address,
34			public_metadata: None,
35			redirect_url: None,
36			notify: None,
37			ignore_existing: None,
38		}
39	}
40}