/*
 * Tribufu API
 *
 * API to access Tribufu services.
 *
 * The version of the OpenAPI document: 1.3.0
 * Contact: contact@tribufu.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ClientInfo {
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(rename = "name", deserialize_with = "Option::deserialize")]
    pub name: Option<String>,
    #[serde(rename = "type", skip_serializing_if = "Option::is_none")]
    pub r#type: Option<models::ClientType>,
    #[serde(rename = "photo_url", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub photo_url: Option<Option<String>>,
    #[serde(rename = "permissions", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub permissions: Option<Option<Vec<String>>>,
}

impl ClientInfo {
    pub fn new(name: Option<String>) -> ClientInfo {
        ClientInfo {
            id: None,
            name,
            r#type: None,
            photo_url: None,
            permissions: None,
        }
    }
}

