Skip to main content

authentik_client/models/
device_connection.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2026.2.1
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct DeviceConnection {
16    #[serde(rename = "device")]
17    pub device: uuid::Uuid,
18    #[serde(rename = "connector")]
19    pub connector: uuid::Uuid,
20    #[serde(rename = "connector_obj")]
21    pub connector_obj: models::Connector,
22    #[serde(rename = "latest_snapshot", deserialize_with = "Option::deserialize")]
23    pub latest_snapshot: Option<models::DeviceFactSnapshot>,
24}
25
26impl DeviceConnection {
27    pub fn new(
28        device: uuid::Uuid,
29        connector: uuid::Uuid,
30        connector_obj: models::Connector,
31        latest_snapshot: Option<models::DeviceFactSnapshot>,
32    ) -> DeviceConnection {
33        DeviceConnection {
34            device,
35            connector,
36            connector_obj,
37            latest_snapshot,
38        }
39    }
40}