authentik_rust/models/
endpoint.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/// Endpoint : Endpoint Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Endpoint {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "provider")]
21    pub provider: i32,
22    #[serde(rename = "provider_obj")]
23    pub provider_obj: Box<models::RacProvider>,
24    #[serde(rename = "protocol")]
25    pub protocol: models::ProtocolEnum,
26    #[serde(rename = "host")]
27    pub host: String,
28    #[serde(rename = "settings", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
29    pub settings: Option<Option<serde_json::Value>>,
30    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
31    pub property_mappings: Option<Vec<uuid::Uuid>>,
32    #[serde(rename = "auth_mode")]
33    pub auth_mode: models::AuthModeEnum,
34    /// Build actual launch URL (the provider itself does not have one, just individual endpoints)
35    #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")]
36    pub launch_url: Option<String>,
37    #[serde(rename = "maximum_connections", skip_serializing_if = "Option::is_none")]
38    pub maximum_connections: Option<i32>,
39}
40
41impl Endpoint {
42    /// Endpoint Serializer
43    pub fn new(pk: uuid::Uuid, name: String, provider: i32, provider_obj: models::RacProvider, protocol: models::ProtocolEnum, host: String, auth_mode: models::AuthModeEnum, launch_url: Option<String>) -> Endpoint {
44        Endpoint {
45            pk,
46            name,
47            provider,
48            provider_obj: Box::new(provider_obj),
49            protocol,
50            host,
51            settings: None,
52            property_mappings: None,
53            auth_mode,
54            launch_url,
55            maximum_connections: None,
56        }
57    }
58}
59