Skip to main content

authentik_client/models/
scope_mapping.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/// ScopeMapping : ScopeMapping Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ScopeMapping {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    /// Objects that are managed by authentik. These objects are created and updated automatically. This flag only indicates that an object can be overwritten by migrations. You can still modify the objects via the API, but expect changes to be overwritten in a later update.
20    #[serde(
21        rename = "managed",
22        default,
23        with = "::serde_with::rust::double_option",
24        skip_serializing_if = "Option::is_none"
25    )]
26    pub managed: Option<Option<String>>,
27    #[serde(rename = "name")]
28    pub name: String,
29    #[serde(rename = "expression")]
30    pub expression: String,
31    /// Get object's component so that we know how to edit the object
32    #[serde(rename = "component")]
33    pub component: String,
34    /// Return object's verbose_name
35    #[serde(rename = "verbose_name")]
36    pub verbose_name: String,
37    /// Return object's plural verbose_name
38    #[serde(rename = "verbose_name_plural")]
39    pub verbose_name_plural: String,
40    /// Return internal model name
41    #[serde(rename = "meta_model_name")]
42    pub meta_model_name: String,
43    /// Scope name requested by the client
44    #[serde(rename = "scope_name")]
45    pub scope_name: String,
46    /// Description shown to the user when consenting. If left empty, the user won't be informed.
47    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
48    pub description: Option<String>,
49}
50
51impl ScopeMapping {
52    /// ScopeMapping Serializer
53    pub fn new(
54        pk: uuid::Uuid,
55        name: String,
56        expression: String,
57        component: String,
58        verbose_name: String,
59        verbose_name_plural: String,
60        meta_model_name: String,
61        scope_name: String,
62    ) -> ScopeMapping {
63        ScopeMapping {
64            pk,
65            managed: None,
66            name,
67            expression,
68            component,
69            verbose_name,
70            verbose_name_plural,
71            meta_model_name,
72            scope_name,
73            description: None,
74        }
75    }
76}