fastcomments-sdk 3.0.1

Official FastComments Rust SDK (Typed API Client & Utilities)
Documentation
/*
 * fastcomments
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 0.0.0
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApiCommentCommonBannedUser {
    #[serde(rename = "_id")]
    pub _id: String,
    #[serde(rename = "userId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub user_id: Option<Option<String>>,
    #[serde(rename = "banType")]
    pub ban_type: String,
    #[serde(rename = "email", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub email: Option<Option<String>>,
    #[serde(rename = "ipHash", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub ip_hash: Option<Option<String>>,
    #[serde(rename = "bannedUntil", deserialize_with = "Option::deserialize")]
    pub banned_until: Option<chrono::DateTime<chrono::FixedOffset>>,
    #[serde(rename = "hasEmailWildcard")]
    pub has_email_wildcard: bool,
    #[serde(rename = "banReason", skip_serializing_if = "Option::is_none")]
    pub ban_reason: Option<String>,
}

impl ApiCommentCommonBannedUser {
    pub fn new(_id: String, ban_type: String, banned_until: Option<chrono::DateTime<chrono::FixedOffset>>, has_email_wildcard: bool) -> ApiCommentCommonBannedUser {
        ApiCommentCommonBannedUser {
            _id,
            user_id: None,
            ban_type,
            email: None,
            ip_hash: None,
            banned_until,
            has_email_wildcard,
            ban_reason: None,
        }
    }
}