Skip to main content

authentik_client/models/
lifecycle_rule.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// LifecycleRule : Mixin to validate that a valid enterprise license exists before allowing to save the object
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct LifecycleRule {
17    #[serde(rename = "id")]
18    pub id: uuid::Uuid,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "content_type")]
22    pub content_type: models::ContentTypeEnum,
23    #[serde(
24        rename = "object_id",
25        default,
26        with = "::serde_with::rust::double_option",
27        skip_serializing_if = "Option::is_none"
28    )]
29    pub object_id: Option<Option<String>>,
30    #[serde(rename = "interval", skip_serializing_if = "Option::is_none")]
31    pub interval: Option<String>,
32    #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")]
33    pub grace_period: Option<String>,
34    #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")]
35    pub reviewer_groups: Option<Vec<uuid::Uuid>>,
36    #[serde(rename = "reviewer_groups_obj")]
37    pub reviewer_groups_obj: Vec<models::ReviewerGroup>,
38    #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")]
39    pub min_reviewers: Option<u16>,
40    #[serde(rename = "min_reviewers_is_per_group", skip_serializing_if = "Option::is_none")]
41    pub min_reviewers_is_per_group: Option<bool>,
42    #[serde(rename = "reviewers")]
43    pub reviewers: Vec<uuid::Uuid>,
44    #[serde(rename = "reviewers_obj")]
45    pub reviewers_obj: Vec<models::ReviewerUser>,
46    /// Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI.
47    #[serde(rename = "notification_transports", skip_serializing_if = "Option::is_none")]
48    pub notification_transports: Option<Vec<uuid::Uuid>>,
49    #[serde(rename = "target_verbose")]
50    pub target_verbose: String,
51}
52
53impl LifecycleRule {
54    /// Mixin to validate that a valid enterprise license exists before allowing to save the object
55    pub fn new(
56        id: uuid::Uuid,
57        name: String,
58        content_type: models::ContentTypeEnum,
59        reviewer_groups_obj: Vec<models::ReviewerGroup>,
60        reviewers: Vec<uuid::Uuid>,
61        reviewers_obj: Vec<models::ReviewerUser>,
62        target_verbose: String,
63    ) -> LifecycleRule {
64        LifecycleRule {
65            id,
66            name,
67            content_type,
68            object_id: None,
69            interval: None,
70            grace_period: None,
71            reviewer_groups: None,
72            reviewer_groups_obj,
73            min_reviewers: None,
74            min_reviewers_is_per_group: None,
75            reviewers,
76            reviewers_obj,
77            notification_transports: None,
78            target_verbose,
79        }
80    }
81}