use super::base::{Request, TelegramMethod};
use crate::{client::Bot, types::ChatIdKind};
use serde::Serialize;
#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize)]
pub struct ReopenGeneralForumTopic {
pub chat_id: ChatIdKind,
}
impl ReopenGeneralForumTopic {
#[must_use]
pub fn new(chat_id: impl Into<ChatIdKind>) -> Self {
Self {
chat_id: chat_id.into(),
}
}
#[must_use]
pub fn chat_id(self, val: impl Into<ChatIdKind>) -> Self {
Self {
chat_id: val.into(),
}
}
}
impl TelegramMethod for ReopenGeneralForumTopic {
type Method = Self;
type Return = bool;
fn build_request<Client>(&self, _bot: &Bot<Client>) -> Request<Self::Method> {
Request::new("reopenGeneralForumTopic", self, None)
}
}
impl AsRef<ReopenGeneralForumTopic> for ReopenGeneralForumTopic {
fn as_ref(&self) -> &Self {
self
}
}