authentik_client/models/
user_consent.rs

1/*
2 * authentik
3 *
4 * Making authentication simple.
5 *
6 * The version of the OpenAPI document: 2025.10.2
7 * Contact: hello@goauthentik.io
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// UserConsent : UserConsent Serializer
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct UserConsent {
17    #[serde(rename = "pk")]
18    pub pk: i32,
19    #[serde(
20        rename = "expires",
21        default,
22        with = "::serde_with::rust::double_option",
23        skip_serializing_if = "Option::is_none"
24    )]
25    pub expires: Option<Option<String>>,
26    #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")]
27    pub expiring: Option<bool>,
28    #[serde(rename = "user")]
29    pub user: models::User,
30    #[serde(rename = "application")]
31    pub application: models::Application,
32    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
33    pub permissions: Option<String>,
34}
35
36impl UserConsent {
37    /// UserConsent Serializer
38    pub fn new(pk: i32, user: models::User, application: models::Application) -> UserConsent {
39        UserConsent {
40            pk,
41            expires: None,
42            expiring: None,
43            user,
44            application,
45            permissions: None,
46        }
47    }
48}