Skip to main content

authentik_client/models/
endpoint.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.0
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Endpoint : Endpoint Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Endpoint {
17    #[serde(rename = "pk")]
18    pub pk: uuid::Uuid,
19    #[serde(rename = "name")]
20    pub name: String,
21    #[serde(rename = "provider")]
22    pub provider: i32,
23    #[serde(rename = "provider_obj")]
24    pub provider_obj: models::RacProvider,
25    #[serde(rename = "protocol")]
26    pub protocol: models::ProtocolEnum,
27    #[serde(rename = "host")]
28    pub host: String,
29    #[serde(rename = "settings", skip_serializing_if = "Option::is_none")]
30    pub settings: Option<std::collections::HashMap<String, serde_json::Value>>,
31    #[serde(rename = "property_mappings", skip_serializing_if = "Option::is_none")]
32    pub property_mappings: Option<Vec<uuid::Uuid>>,
33    #[serde(rename = "auth_mode")]
34    pub auth_mode: models::EndpointAuthModeEnum,
35    /// Build actual launch URL (the provider itself does not have one, just individual endpoints)
36    #[serde(rename = "launch_url", deserialize_with = "Option::deserialize")]
37    pub launch_url: Option<String>,
38    #[serde(rename = "maximum_connections", skip_serializing_if = "Option::is_none")]
39    pub maximum_connections: Option<i32>,
40}
41
42impl Endpoint {
43    /// Endpoint Serializer
44    pub fn new(
45        pk: uuid::Uuid,
46        name: String,
47        provider: i32,
48        provider_obj: models::RacProvider,
49        protocol: models::ProtocolEnum,
50        host: String,
51        auth_mode: models::EndpointAuthModeEnum,
52        launch_url: Option<String>,
53    ) -> Endpoint {
54        Endpoint {
55            pk,
56            name,
57            provider,
58            provider_obj,
59            protocol,
60            host,
61            settings: None,
62            property_mappings: None,
63            auth_mode,
64            launch_url,
65            maximum_connections: None,
66        }
67    }
68}