use crate::client::Bot;
use serde::Serialize;
#[derive(Clone, Debug, Serialize)]
pub struct SetUserEmojiStatus {
pub user_id: i64,
#[serde(skip_serializing_if = "Option::is_none")]
pub emoji_status_custom_emoji_id: Option<Box<str>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub emoji_status_expiration_date: Option<i64>,
}
impl SetUserEmojiStatus {
#[must_use]
pub fn new<T0: Into<i64>>(user_id: T0) -> Self {
Self {
user_id: user_id.into(),
emoji_status_custom_emoji_id: None,
emoji_status_expiration_date: None,
}
}
#[must_use]
pub fn user_id<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.user_id = val.into();
this
}
#[must_use]
pub fn emoji_status_custom_emoji_id<T: Into<Box<str>>>(self, val: T) -> Self {
let mut this = self;
this.emoji_status_custom_emoji_id = Some(val.into());
this
}
#[must_use]
pub fn emoji_status_custom_emoji_id_option<T: Into<Box<str>>>(self, val: Option<T>) -> Self {
let mut this = self;
this.emoji_status_custom_emoji_id = val.map(Into::into);
this
}
#[must_use]
pub fn emoji_status_expiration_date<T: Into<i64>>(self, val: T) -> Self {
let mut this = self;
this.emoji_status_expiration_date = Some(val.into());
this
}
#[must_use]
pub fn emoji_status_expiration_date_option<T: Into<i64>>(self, val: Option<T>) -> Self {
let mut this = self;
this.emoji_status_expiration_date = val.map(Into::into);
this
}
}
impl super::TelegramMethod for SetUserEmojiStatus {
type Method = Self;
type Return = bool;
fn build_request<Client>(self, _bot: &Bot<Client>) -> super::Request<Self::Method> {
super::Request::new("setUserEmojiStatus", self, None)
}
}