authentik_rust/models/
provider.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/// Provider : Provider Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Provider {
16    #[serde(rename = "pk")]
17    pub pk: i32,
18    #[serde(rename = "name")]
19    pub name: String,
20    /// Flow used for authentication when the associated application is accessed by an un-authenticated user.
21    #[serde(rename = "authentication_flow", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22    pub authentication_flow: Option<Option<uuid::Uuid>>,
23    /// Flow used when authorizing this provider.
24    #[serde(rename = "authorization_flow")]
25    pub authorization_flow: uuid::Uuid,
26    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
27    pub property_mappings: Option<Vec<uuid::Uuid>>,
28    /// Get object component so that we know how to edit the object
29    #[serde(rename = "component")]
30    pub component: String,
31    /// Internal application name, used in URLs.
32    #[serde(rename = "assigned_application_slug")]
33    pub assigned_application_slug: String,
34    /// Application's display Name.
35    #[serde(rename = "assigned_application_name")]
36    pub assigned_application_name: String,
37    /// Internal application name, used in URLs.
38    #[serde(rename = "assigned_backchannel_application_slug")]
39    pub assigned_backchannel_application_slug: String,
40    /// Application's display Name.
41    #[serde(rename = "assigned_backchannel_application_name")]
42    pub assigned_backchannel_application_name: String,
43    /// Return object's verbose_name
44    #[serde(rename = "verbose_name")]
45    pub verbose_name: String,
46    /// Return object's plural verbose_name
47    #[serde(rename = "verbose_name_plural")]
48    pub verbose_name_plural: String,
49    /// Return internal model name
50    #[serde(rename = "meta_model_name")]
51    pub meta_model_name: String,
52}
53
54impl Provider {
55    /// Provider Serializer
56    pub fn new(pk: i32, name: String, authorization_flow: uuid::Uuid, component: String, assigned_application_slug: String, assigned_application_name: String, assigned_backchannel_application_slug: String, assigned_backchannel_application_name: String, verbose_name: String, verbose_name_plural: String, meta_model_name: String) -> Provider {
57        Provider {
58            pk,
59            name,
60            authentication_flow: None,
61            authorization_flow,
62            property_mappings: None,
63            component,
64            assigned_application_slug,
65            assigned_application_name,
66            assigned_backchannel_application_slug,
67            assigned_backchannel_application_name,
68            verbose_name,
69            verbose_name_plural,
70            meta_model_name,
71        }
72    }
73}
74