authentik_rust/models/
user_consent.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/// UserConsent : UserConsent Serializer
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct UserConsent {
16    #[serde(rename = "pk")]
17    pub pk: i32,
18    #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
19    pub expires: Option<String>,
20    #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")]
21    pub expiring: Option<bool>,
22    #[serde(rename = "user")]
23    pub user: Box<models::User>,
24    #[serde(rename = "application")]
25    pub application: Box<models::Application>,
26    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
27    pub permissions: Option<String>,
28}
29
30impl UserConsent {
31    /// UserConsent Serializer
32    pub fn new(pk: i32, user: models::User, application: models::Application) -> UserConsent {
33        UserConsent {
34            pk,
35            expires: None,
36            expiring: None,
37            user: Box::new(user),
38            application: Box::new(application),
39            permissions: None,
40        }
41    }
42}
43