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 TenantBadge {
    #[serde(rename = "_id")]
    pub _id: String,
    #[serde(rename = "tenantId")]
    pub tenant_id: String,
    #[serde(rename = "createdByUserId")]
    pub created_by_user_id: String,
    #[serde(rename = "createdAt")]
    pub created_at: chrono::DateTime<chrono::FixedOffset>,
    #[serde(rename = "enabled")]
    pub enabled: bool,
    #[serde(rename = "urlId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub url_id: Option<Option<String>>,
    #[serde(rename = "type")]
    pub r#type: f64,
    #[serde(rename = "threshold")]
    pub threshold: f64,
    #[serde(rename = "uses")]
    pub uses: f64,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "description")]
    pub description: String,
    #[serde(rename = "displayLabel")]
    pub display_label: String,
    #[serde(rename = "displaySrc", deserialize_with = "Option::deserialize")]
    pub display_src: Option<String>,
    #[serde(rename = "backgroundColor", deserialize_with = "Option::deserialize")]
    pub background_color: Option<String>,
    #[serde(rename = "borderColor", deserialize_with = "Option::deserialize")]
    pub border_color: Option<String>,
    #[serde(rename = "textColor", deserialize_with = "Option::deserialize")]
    pub text_color: Option<String>,
    #[serde(rename = "cssClass", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub css_class: Option<Option<String>>,
    #[serde(rename = "veteranUserThresholdMillis", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub veteran_user_threshold_millis: Option<Option<f64>>,
    #[serde(rename = "isAwaitingReprocess")]
    pub is_awaiting_reprocess: bool,
    #[serde(rename = "isAwaitingDeletion")]
    pub is_awaiting_deletion: bool,
    #[serde(rename = "replacesBadgeId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub replaces_badge_id: Option<Option<String>>,
}

impl TenantBadge {
    pub fn new(_id: String, tenant_id: String, created_by_user_id: String, created_at: chrono::DateTime<chrono::FixedOffset>, enabled: bool, r#type: f64, threshold: f64, uses: f64, name: String, description: String, display_label: String, display_src: Option<String>, background_color: Option<String>, border_color: Option<String>, text_color: Option<String>, is_awaiting_reprocess: bool, is_awaiting_deletion: bool) -> TenantBadge {
        TenantBadge {
            _id,
            tenant_id,
            created_by_user_id,
            created_at,
            enabled,
            url_id: None,
            r#type,
            threshold,
            uses,
            name,
            description,
            display_label,
            display_src,
            background_color,
            border_color,
            text_color,
            css_class: None,
            veteran_user_threshold_millis: None,
            is_awaiting_reprocess,
            is_awaiting_deletion,
            replaces_badge_id: None,
        }
    }
}