authentik_rust/models/
invitation.rs1use crate::models;
12
13#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Invitation {
16 #[serde(rename = "pk")]
17 pub pk: uuid::Uuid,
18 #[serde(rename = "name")]
19 pub name: String,
20 #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
21 pub expires: Option<String>,
22 #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")]
23 pub fixed_data: Option<std::collections::HashMap<String, serde_json::Value>>,
24 #[serde(rename = "created_by")]
25 pub created_by: Box<models::GroupMember>,
26 #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")]
28 pub single_use: Option<bool>,
29 #[serde(rename = "flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31 pub flow: Option<Option<uuid::Uuid>>,
32 #[serde(rename = "flow_obj")]
33 pub flow_obj: Box<models::Flow>,
34}
35
36impl Invitation {
37 pub fn new(pk: uuid::Uuid, name: String, created_by: models::GroupMember, flow_obj: models::Flow) -> Invitation {
39 Invitation {
40 pk,
41 name,
42 expires: None,
43 fixed_data: None,
44 created_by: Box::new(created_by),
45 single_use: None,
46 flow: None,
47 flow_obj: Box::new(flow_obj),
48 }
49 }
50}
51