use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct BusinessIntro {
#[serde(skip_serializing_if = "Option::is_none")]
pub title: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub message: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub sticker: Option<Box<crate::types::Sticker>>,
}
impl BusinessIntro {
#[must_use]
pub fn new() -> Self {
Self {
title: None,
message: None,
sticker: None,
}
}
#[must_use]
pub fn title<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.title = Some(val.into());
this
}
#[must_use]
pub fn title_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.title = val.map(Into::into);
this
}
#[must_use]
pub fn message<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.message = Some(val.into());
this
}
#[must_use]
pub fn message_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.message = val.map(Into::into);
this
}
#[must_use]
pub fn sticker<T: Into<crate::types::Sticker>>(self, val: T) -> Self {
let mut this = self;
this.sticker = Some(Box::new(val.into()));
this
}
#[must_use]
pub fn sticker_option<T: Into<crate::types::Sticker>>(self, val: Option<T>) -> Self {
let mut this = self;
this.sticker = val.map(|val| Box::new(val.into()));
this
}
}
impl Default for BusinessIntro {
fn default() -> Self {
Self::new()
}
}