authentik_rust/models/
invitation_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// InvitationRequest : Invitation Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct InvitationRequest {
16    #[serde(rename = "name")]
17    pub name: String,
18    #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
19    pub expires: Option<String>,
20    #[serde(rename = "fixed_data", skip_serializing_if = "Option::is_none")]
21    pub fixed_data: Option<std::collections::HashMap<String, serde_json::Value>>,
22    /// When enabled, the invitation will be deleted after usage.
23    #[serde(rename = "single_use", skip_serializing_if = "Option::is_none")]
24    pub single_use: Option<bool>,
25    /// When set, only the configured flow can use this invitation.
26    #[serde(rename = "flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub flow: Option<Option<uuid::Uuid>>,
28}
29
30impl InvitationRequest {
31    /// Invitation Serializer
32    pub fn new(name: String) -> InvitationRequest {
33        InvitationRequest {
34            name,
35            expires: None,
36            fixed_data: None,
37            single_use: None,
38            flow: None,
39        }
40    }
41}
42