authentik_rust/models/
scope_mapping.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2024.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// ScopeMapping : ScopeMapping Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ScopeMapping {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    /// 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.
19    #[serde(rename = "managed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
20    pub managed: Option<Option<String>>,
21    #[serde(rename = "name")]
22    pub name: String,
23    #[serde(rename = "expression")]
24    pub expression: String,
25    /// Get object's component so that we know how to edit the object
26    #[serde(rename = "component")]
27    pub component: String,
28    /// Return object's verbose_name
29    #[serde(rename = "verbose_name")]
30    pub verbose_name: String,
31    /// Return object's plural verbose_name
32    #[serde(rename = "verbose_name_plural")]
33    pub verbose_name_plural: String,
34    /// Return internal model name
35    #[serde(rename = "meta_model_name")]
36    pub meta_model_name: String,
37    /// Scope name requested by the client
38    #[serde(rename = "scope_name")]
39    pub scope_name: String,
40    /// Description shown to the user when consenting. If left empty, the user won't be informed.
41    #[serde(rename = "description", skip_serializing_if = "Option::is_none")]
42    pub description: Option<String>,
43}
44
45impl ScopeMapping {
46    /// ScopeMapping Serializer
47    pub fn new(pk: uuid::Uuid, name: String, expression: String, component: String, verbose_name: String, verbose_name_plural: String, meta_model_name: String, scope_name: String) -> ScopeMapping {
48        ScopeMapping {
49            pk,
50            managed: None,
51            name,
52            expression,
53            component,
54            verbose_name,
55            verbose_name_plural,
56            meta_model_name,
57            scope_name,
58            description: None,
59        }
60    }
61}
62