authentik_rust/models/
session_user.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/// SessionUser : Response for the /user/me endpoint, returns the currently active user (as `user` property) and, if this user is being impersonated, the original user in the `original` property.
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct SessionUser {
16    #[serde(rename = "user")]
17    pub user: Box<models::UserSelf>,
18    #[serde(rename = "original", skip_serializing_if = "Option::is_none")]
19    pub original: Option<Box<models::UserSelf>>,
20}
21
22impl SessionUser {
23    /// Response for the /user/me endpoint, returns the currently active user (as `user` property) and, if this user is being impersonated, the original user in the `original` property.
24    pub fn new(user: models::UserSelf) -> SessionUser {
25        SessionUser {
26            user: Box::new(user),
27            original: None,
28        }
29    }
30}
31