authentik-client 2026.2.2-rc2

Making authentication simple.
Documentation
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.2-rc2
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// LifecycleRuleRequest : Mixin to validate that a valid enterprise license exists before allowing to save the object
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LifecycleRuleRequest {
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "content_type")]
    pub content_type: models::ContentTypeEnum,
    #[serde(
        rename = "object_id",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub object_id: Option<Option<String>>,
    #[serde(rename = "interval", skip_serializing_if = "Option::is_none")]
    pub interval: Option<String>,
    #[serde(rename = "grace_period", skip_serializing_if = "Option::is_none")]
    pub grace_period: Option<String>,
    #[serde(rename = "reviewer_groups", skip_serializing_if = "Option::is_none")]
    pub reviewer_groups: Option<Vec<uuid::Uuid>>,
    #[serde(rename = "min_reviewers", skip_serializing_if = "Option::is_none")]
    pub min_reviewers: Option<u16>,
    #[serde(rename = "min_reviewers_is_per_group", skip_serializing_if = "Option::is_none")]
    pub min_reviewers_is_per_group: Option<bool>,
    #[serde(rename = "reviewers")]
    pub reviewers: Vec<uuid::Uuid>,
    /// Select which transports should be used to notify the reviewers. If none are selected, the notification will only be shown in the authentik UI.
    #[serde(rename = "notification_transports", skip_serializing_if = "Option::is_none")]
    pub notification_transports: Option<Vec<uuid::Uuid>>,
}

impl LifecycleRuleRequest {
    /// Mixin to validate that a valid enterprise license exists before allowing to save the object
    pub fn new(
        name: String,
        content_type: models::ContentTypeEnum,
        reviewers: Vec<uuid::Uuid>,
    ) -> LifecycleRuleRequest {
        LifecycleRuleRequest {
            name,
            content_type,
            object_id: None,
            interval: None,
            grace_period: None,
            reviewer_groups: None,
            min_reviewers: None,
            min_reviewers_is_per_group: None,
            reviewers,
            notification_transports: None,
        }
    }
}