authentik_client/models/
outpost.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Outpost {
17 #[serde(rename = "pk")]
18 pub pk: uuid::Uuid,
19 #[serde(rename = "name")]
20 pub name: String,
21 #[serde(rename = "type")]
22 pub r#type: models::OutpostTypeEnum,
23 #[serde(rename = "providers")]
24 pub providers: Vec<i32>,
25 #[serde(rename = "providers_obj")]
26 pub providers_obj: Vec<models::Provider>,
27 #[serde(
29 rename = "service_connection",
30 default,
31 with = "::serde_with::rust::double_option",
32 skip_serializing_if = "Option::is_none"
33 )]
34 pub service_connection: Option<Option<uuid::Uuid>>,
35 #[serde(rename = "service_connection_obj", deserialize_with = "Option::deserialize")]
36 pub service_connection_obj: Option<models::ServiceConnection>,
37 #[serde(rename = "refresh_interval_s")]
38 pub refresh_interval_s: i32,
39 #[serde(rename = "token_identifier")]
41 pub token_identifier: String,
42 #[serde(rename = "config")]
43 pub config: std::collections::HashMap<String, serde_json::Value>,
44 #[serde(
46 rename = "managed",
47 default,
48 with = "::serde_with::rust::double_option",
49 skip_serializing_if = "Option::is_none"
50 )]
51 pub managed: Option<Option<String>>,
52}
53
54impl Outpost {
55 pub fn new(
57 pk: uuid::Uuid,
58 name: String,
59 r#type: models::OutpostTypeEnum,
60 providers: Vec<i32>,
61 providers_obj: Vec<models::Provider>,
62 service_connection_obj: Option<models::ServiceConnection>,
63 refresh_interval_s: i32,
64 token_identifier: String,
65 config: std::collections::HashMap<String, serde_json::Value>,
66 ) -> Outpost {
67 Outpost {
68 pk,
69 name,
70 r#type,
71 providers,
72 providers_obj,
73 service_connection: None,
74 service_connection_obj,
75 refresh_interval_s,
76 token_identifier,
77 config,
78 managed: None,
79 }
80 }
81}