Skip to main content

authentik_client/models/
partial_group.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.4
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PartialGroup : Partial Group Serializer, does not include child relations.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PartialGroup {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    /// Get a numerical, int32 ID for the group
20    #[serde(rename = "num_pk")]
21    pub num_pk: i32,
22    #[serde(rename = "name")]
23    pub name: String,
24    /// Users added to this group will be superusers.
25    #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")]
26    pub is_superuser: Option<bool>,
27    #[serde(
28        rename = "parent",
29        default,
30        with = "::serde_with::rust::double_option",
31        skip_serializing_if = "Option::is_none"
32    )]
33    pub parent: Option<Option<uuid::Uuid>>,
34    #[serde(rename = "parent_name", deserialize_with = "Option::deserialize")]
35    pub parent_name: Option<String>,
36    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
37    pub attributes: Option<std::collections::HashMap<String, serde_json::Value>>,
38}
39
40impl PartialGroup {
41    /// Partial Group Serializer, does not include child relations.
42    pub fn new(pk: uuid::Uuid, num_pk: i32, name: String, parent_name: Option<String>) -> PartialGroup {
43        PartialGroup {
44            pk,
45            num_pk,
46            name,
47            is_superuser: None,
48            parent: None,
49            parent_name,
50            attributes: None,
51        }
52    }
53}