trieve_client/models/invitation_data.rs
1/*
2 * Trieve API
3 *
4 * Trieve OpenAPI Specification. This document describes all of the operations available through the Trieve API.
5 *
6 * The version of the OpenAPI document: 0.11.7
7 * Contact: developers@trieve.ai
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
14pub struct InvitationData {
15 /// The url of the app that the user will be directed to in order to set their password. Usually admin.trieve.ai, but may differ for local dev or self-hosted setups.
16 #[serde(rename = "app_url")]
17 pub app_url: String,
18 /// The email of the user to invite. Must be a valid email as they will be sent an email to register.
19 #[serde(rename = "email")]
20 pub email: String,
21 /// The id of the organization to invite the user to.
22 #[serde(rename = "organization_id")]
23 pub organization_id: uuid::Uuid,
24 /// The url that the user will be redirected to after setting their password.
25 #[serde(rename = "redirect_uri")]
26 pub redirect_uri: String,
27 /// The role the user will have in the organization. 0 = User, 1 = Admin, 2 = Owner.
28 #[serde(rename = "user_role")]
29 pub user_role: i32,
30}
31
32impl InvitationData {
33 pub fn new(app_url: String, email: String, organization_id: uuid::Uuid, redirect_uri: String, user_role: i32) -> InvitationData {
34 InvitationData {
35 app_url,
36 email,
37 organization_id,
38 redirect_uri,
39 user_role,
40 }
41 }
42}
43