use crate::client::Bot;
use serde::Serialize;
#[derive(Clone, Debug, Serialize)]
pub struct SetMyProfilePhoto {
pub photo: crate::types::InputProfilePhoto,
}
impl SetMyProfilePhoto {
#[must_use]
pub fn new<T0: Into<crate::types::InputProfilePhoto>>(photo: T0) -> Self {
Self {
photo: photo.into(),
}
}
#[must_use]
pub fn photo<T: Into<crate::types::InputProfilePhoto>>(mut self, val: T) -> Self {
self.photo = val.into();
self
}
}
impl super::TelegramMethod for SetMyProfilePhoto {
type Method = Self;
type Return = bool;
fn build_request<Client>(mut self, _bot: &Bot<Client>) -> super::Request<Self::Method> {
let mut files = vec![];
super::prepare_input_profile_photo(&mut files, &mut self.photo);
super::Request::new("setMyProfilePhoto", self, Some(files))
}
}