use std::{
future::{Future, IntoFuture},
pin::Pin,
};
use serde::Serialize;
use crate::{api::API, errors::ConogramError, impl_into_future, request::RequestT};
#[derive(Debug, Clone, Serialize)]
pub struct DeleteStickerSetParams {
pub name: String,
}
impl_into_future!(DeleteStickerSetRequest<'a>);
#[derive(Clone)]
pub struct DeleteStickerSetRequest<'a> {
api: &'a API,
params: DeleteStickerSetParams,
}
impl<'a> RequestT for DeleteStickerSetRequest<'a> {
type ParamsType = DeleteStickerSetParams;
type ReturnType = bool;
fn get_name() -> &'static str {
"deleteStickerSet"
}
fn get_api_ref(&self) -> &API {
self.api
}
fn get_params_ref(&self) -> &Self::ParamsType {
&self.params
}
fn is_multipart() -> bool {
false
}
}
impl<'a> DeleteStickerSetRequest<'a> {
pub fn new(api: &'a API, name: impl Into<String>) -> Self {
Self {
api,
params: DeleteStickerSetParams { name: name.into() },
}
}
#[must_use]
pub fn name(mut self, name: impl Into<String>) -> Self {
self.params.name = name.into();
self
}
}
impl API {
pub fn delete_sticker_set(&self, name: impl Into<String>) -> DeleteStickerSetRequest {
DeleteStickerSetRequest::new(self, name)
}
}