authentik_rust/models/
outpost.rs1use crate::models;
12
13#[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 #[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 #[serde(rename = "token_identifier")]
33 pub token_identifier: String,
34 #[serde(rename = "config")]
35 pub config: std::collections::HashMap<String, serde_json::Value>,
36 #[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 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