use crate::client::models;
use serde::{Deserialize, Serialize};
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UserBadge {
#[serde(rename = "_id")]
pub _id: String,
#[serde(rename = "userId")]
pub user_id: String,
#[serde(rename = "badgeId")]
pub badge_id: String,
#[serde(rename = "fromTenantId")]
pub from_tenant_id: String,
#[serde(rename = "createdAt")]
pub created_at: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "type")]
pub r#type: i32,
#[serde(rename = "threshold")]
pub threshold: i64,
#[serde(rename = "description")]
pub description: String,
#[serde(rename = "displayLabel")]
pub display_label: String,
#[serde(rename = "displaySrc", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub display_src: Option<Option<String>>,
#[serde(rename = "backgroundColor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub background_color: Option<Option<String>>,
#[serde(rename = "borderColor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub border_color: Option<Option<String>>,
#[serde(rename = "textColor", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub text_color: Option<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")]
pub veteran_user_threshold_millis: i64,
#[serde(rename = "displayedOnComments")]
pub displayed_on_comments: bool,
#[serde(rename = "receivedAt")]
pub received_at: chrono::DateTime<chrono::FixedOffset>,
#[serde(rename = "order", skip_serializing_if = "Option::is_none")]
pub order: Option<i32>,
#[serde(rename = "urlId", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub url_id: Option<Option<String>>,
}
impl UserBadge {
pub fn new(_id: String, user_id: String, badge_id: String, from_tenant_id: String, created_at: chrono::DateTime<chrono::FixedOffset>, r#type: i32, threshold: i64, description: String, display_label: String, veteran_user_threshold_millis: i64, displayed_on_comments: bool, received_at: chrono::DateTime<chrono::FixedOffset>) -> UserBadge {
UserBadge {
_id,
user_id,
badge_id,
from_tenant_id,
created_at,
r#type,
threshold,
description,
display_label,
display_src: None,
background_color: None,
border_color: None,
text_color: None,
css_class: None,
veteran_user_threshold_millis,
displayed_on_comments,
received_at,
order: None,
url_id: None,
}
}
}