authentik-rust 0.0.1

Making authentication simple.
Documentation
/*
 * authentik
 *
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2024.2.1
 * Contact: hello@goauthentik.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;

/// UserConsent : UserConsent Serializer
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserConsent {
    #[serde(rename = "pk")]
    pub pk: i32,
    #[serde(rename = "expires", skip_serializing_if = "Option::is_none")]
    pub expires: Option<String>,
    #[serde(rename = "expiring", skip_serializing_if = "Option::is_none")]
    pub expiring: Option<bool>,
    #[serde(rename = "user")]
    pub user: Box<models::User>,
    #[serde(rename = "application")]
    pub application: Box<models::Application>,
    #[serde(rename = "permissions", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<String>,
}

impl UserConsent {
    /// UserConsent Serializer
    pub fn new(pk: i32, user: models::User, application: models::Application) -> UserConsent {
        UserConsent {
            pk,
            expires: None,
            expiring: None,
            user: Box::new(user),
            application: Box::new(application),
            permissions: None,
        }
    }
}