1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
* Appwrite
*
* Appwrite backend as a service cuts up to 70% of the time and costs required for building a modern application. We abstract and simplify common development tasks behind a REST APIs, to help you develop your app in a fast and secure way. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
*
* The version of the OpenAPI document: 1.4.9
* Contact: team@appwrite.io
* Generated by: https://openapi-generator.tech
*/
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct TeamsCreateMembershipRequest {
/// Email of the new team member.
#[serde(rename = "email", skip_serializing_if = "Option::is_none")]
pub email: Option<String>,
/// ID of the user to be added to a team.
#[serde(rename = "userId", skip_serializing_if = "Option::is_none")]
pub user_id: Option<String>,
/// Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
#[serde(rename = "phone", skip_serializing_if = "Option::is_none")]
pub phone: Option<String>,
/// Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
#[serde(rename = "roles")]
pub roles: Vec<String>,
/// URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
#[serde(rename = "url", skip_serializing_if = "Option::is_none")]
pub url: Option<String>,
/// Name of the new team member. Max length: 128 chars.
#[serde(rename = "name", skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
}
impl TeamsCreateMembershipRequest {
pub fn new(roles: Vec<String>) -> TeamsCreateMembershipRequest {
TeamsCreateMembershipRequest {
email: None,
user_id: None,
phone: None,
roles,
url: None,
name: None,
}
}
}