Skip to main content

authentik_client/models/
user_group_request.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.8.6
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UserGroupRequest : Simplified Group Serializer for user's groups
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserGroupRequest {
17    #[serde(rename = "name")]
18    pub name: String,
19    /// Users added to this group will be superusers.
20    #[serde(rename = "is_superuser", skip_serializing_if = "Option::is_none")]
21    pub is_superuser: Option<bool>,
22    #[serde(
23        rename = "parent",
24        default,
25        with = "::serde_with::rust::double_option",
26        skip_serializing_if = "Option::is_none"
27    )]
28    pub parent: Option<Option<uuid::Uuid>>,
29    #[serde(rename = "attributes", skip_serializing_if = "Option::is_none")]
30    pub attributes: Option<std::collections::HashMap<String, serde_json::Value>>,
31}
32
33impl UserGroupRequest {
34    /// Simplified Group Serializer for user's groups
35    pub fn new(name: String) -> UserGroupRequest {
36        UserGroupRequest {
37            name,
38            is_superuser: None,
39            parent: None,
40            attributes: None,
41        }
42    }
43}