authentik_rust/models/
blueprint_instance.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/// BlueprintInstance : Info about a single blueprint instance file
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct BlueprintInstance {
16    #[serde(rename = "pk")]
17    pub pk: uuid::Uuid,
18    #[serde(rename = "name")]
19    pub name: String,
20    #[serde(rename = "path", skip_serializing_if = "Option::is_none")]
21    pub path: Option<String>,
22    #[serde(rename = "context", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub context: Option<Option<serde_json::Value>>,
24    #[serde(rename = "last_applied")]
25    pub last_applied: String,
26    #[serde(rename = "last_applied_hash")]
27    pub last_applied_hash: String,
28    #[serde(rename = "status")]
29    pub status: models::BlueprintInstanceStatusEnum,
30    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
31    pub enabled: Option<bool>,
32    #[serde(rename = "managed_models")]
33    pub managed_models: Vec<String>,
34    #[serde(rename = "metadata", deserialize_with = "Option::deserialize")]
35    pub metadata: Option<serde_json::Value>,
36    #[serde(rename = "content", skip_serializing_if = "Option::is_none")]
37    pub content: Option<String>,
38}
39
40impl BlueprintInstance {
41    /// Info about a single blueprint instance file
42    pub fn new(pk: uuid::Uuid, name: String, last_applied: String, last_applied_hash: String, status: models::BlueprintInstanceStatusEnum, managed_models: Vec<String>, metadata: Option<serde_json::Value>) -> BlueprintInstance {
43        BlueprintInstance {
44            pk,
45            name,
46            path: None,
47            context: None,
48            last_applied,
49            last_applied_hash,
50            status,
51            enabled: None,
52            managed_models,
53            metadata,
54            content: None,
55        }
56    }
57}
58