authentik_client/models/
invitation.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Invitation {
17 #[serde(rename = "pk")]
18 pub pk: uuid::Uuid,
19 #[serde(rename = "name")]
20 pub name: String,
21 #[serde(
22 rename = "expires",
23 default,
24 with = "::serde_with::rust::double_option",
25 skip_serializing_if = "Option::is_none"
26 )]
27 pub expires: Option<Option<String>>,
28 #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")]
29 pub fixed_data: Option<std::collections::HashMap<String, serde_json::Value>>,
30 #[serde(rename = "created_by")]
31 pub created_by: models::PartialUser,
32 #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")]
34 pub single_use: Option<bool>,
35 #[serde(
37 rename = "flow",
38 default,
39 with = "::serde_with::rust::double_option",
40 skip_serializing_if = "Option::is_none"
41 )]
42 pub flow: Option<Option<uuid::Uuid>>,
43 #[serde(rename = "flow_obj")]
44 pub flow_obj: models::Flow,
45}
46
47impl Invitation {
48 pub fn new(pk: uuid::Uuid, name: String, created_by: models::PartialUser, flow_obj: models::Flow) -> Invitation {
50 Invitation {
51 pk,
52 name,
53 expires: None,
54 fixed_data: None,
55 created_by,
56 single_use: None,
57 flow: None,
58 flow_obj,
59 }
60 }
61}