Skip to main content

authentik_client/models/
application.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/// Application : Application Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Application {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    /// Application's display Name.
20    #[serde(rename = "name")]
21    pub name: String,
22    /// Internal application name, used in URLs.
23    #[serde(rename = "slug")]
24    pub slug: String,
25    #[serde(
26        rename = "provider",
27        default,
28        with = "::serde_with::rust::double_option",
29        skip_serializing_if = "Option::is_none"
30    )]
31    pub provider: Option<Option<i32>>,
32    #[serde(rename = "provider_obj")]
33    pub provider_obj: models::Provider,
34    #[serde(rename = "backchannel_providers", skip_serializing_if = "Option::is_none")]
35    pub backchannel_providers: Option<Vec<i32>>,
36    #[serde(rename = "backchannel_providers_obj")]
37    pub backchannel_providers_obj: Vec<models::Provider>,
38    /// Allow formatting of launch URL
39    #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")]
40    pub launch_url: Option<String>,
41    /// Open launch URL in a new browser tab or window.
42    #[serde(rename = "open_in_new_tab", skip_serializing_if = "Option::is_none")]
43    pub open_in_new_tab: Option<bool>,
44    #[serde(rename = "meta_launch_url", skip_serializing_if = "Option::is_none")]
45    pub meta_launch_url: Option<String>,
46    /// Get the URL to the App Icon image. If the name is /static or starts with http it is returned as-is
47    #[serde(rename = "meta_icon", deserialize_with = "Option::deserialize")]
48    pub meta_icon: Option<String>,
49    #[serde(rename = "meta_description", skip_serializing_if = "Option::is_none")]
50    pub meta_description: Option<String>,
51    #[serde(rename = "meta_publisher", skip_serializing_if = "Option::is_none")]
52    pub meta_publisher: Option<String>,
53    #[serde(rename = "policy_engine_mode", skip_serializing_if = "Option::is_none")]
54    pub policy_engine_mode: Option<models::PolicyEngineMode>,
55    #[serde(rename = "group", skip_serializing_if = "Option::is_none")]
56    pub group: Option<String>,
57}
58
59impl Application {
60    /// Application Serializer
61    pub fn new(
62        pk: uuid::Uuid,
63        name: String,
64        slug: String,
65        provider_obj: models::Provider,
66        backchannel_providers_obj: Vec<models::Provider>,
67        launch_url: Option<String>,
68        meta_icon: Option<String>,
69    ) -> Application {
70        Application {
71            pk,
72            name,
73            slug,
74            provider: None,
75            provider_obj,
76            backchannel_providers: None,
77            backchannel_providers_obj,
78            launch_url,
79            open_in_new_tab: None,
80            meta_launch_url: None,
81            meta_icon,
82            meta_description: None,
83            meta_publisher: None,
84            policy_engine_mode: None,
85            group: None,
86        }
87    }
88}