Skip to main content

authentik_client/models/
invitation.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Invitation : Invitation Serializer
15#[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    /// When enabled, the invitation will be deleted after usage.
33    #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")]
34    pub single_use: Option<bool>,
35    /// When set, only the configured flow can use this invitation.
36    #[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    /// Invitation Serializer
49    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}