authentik_rust/models/
outpost.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/// Outpost : Outpost Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct Outpost {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "type")]
21    pub r#type: models::OutpostTypeEnum,
22    #[serde(rename = "providers")]
23    pub providers: Vec<i32>,
24    #[serde(rename = "providers_obj")]
25    pub providers_obj: Vec<models::Provider>,
26    /// Select Service-Connection authentik should use to manage this outpost. Leave empty if authentik should not handle the deployment.
27    #[serde(rename = "service_connection", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28    pub service_connection: Option<Option<uuid::Uuid>>,
29    #[serde(rename = "service_connection_obj")]
30    pub service_connection_obj: Box<models::ServiceConnection>,
31    /// Get Token identifier
32    #[serde(rename = "token_identifier")]
33    pub token_identifier: String,
34    #[serde(rename = "config")]
35    pub config: std::collections::HashMap<String, serde_json::Value>,
36    /// 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.
37    #[serde(rename = "managed", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
38    pub managed: Option<Option<String>>,
39}
40
41impl Outpost {
42    /// Outpost Serializer
43    pub fn new(pk: uuid::Uuid, name: String, r#type: models::OutpostTypeEnum, providers: Vec<i32>, providers_obj: Vec<models::Provider>, service_connection_obj: models::ServiceConnection, token_identifier: String, config: std::collections::HashMap<String, serde_json::Value>) -> Outpost {
44        Outpost {
45            pk,
46            name,
47            r#type,
48            providers,
49            providers_obj,
50            service_connection: None,
51            service_connection_obj: Box::new(service_connection_obj),
52            token_identifier,
53            config,
54            managed: None,
55        }
56    }
57}
58