use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize)]
pub struct FeishuCardTextIcon {
#[serde(skip_serializing_if = "Option::is_none")]
tag: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
token: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
color: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
img_key: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
size: Option<String>,
}
impl Default for FeishuCardTextIcon {
fn default() -> Self {
FeishuCardTextIcon {
tag: Some("standard_icon".to_string()),
token: None,
color: None,
img_key: None,
size: None,
}
}
}
impl FeishuCardTextIcon {
pub fn new() -> Self {
Self::default()
}
pub fn tag(mut self, tag: &str) -> Self {
self.tag = Some(tag.to_string());
self
}
pub fn token(mut self, token: &str) -> Self {
self.token = Some(token.to_string());
self
}
pub fn color(mut self, color: &str) -> Self {
self.color = Some(color.to_string());
self
}
pub fn img_key(mut self, img_key: &str) -> Self {
self.img_key = Some(img_key.to_string());
self
}
pub fn size(mut self, size: &str) -> Self {
self.size = Some(size.to_string());
self
}
}