Skip to main content

lichess_api/model/teams/
pm_all.rs

1use crate::model::{Body, Request};
2use serde::Serialize;
3
4#[derive(Default, Clone, Debug, Serialize)]
5pub struct PostQuery;
6
7#[derive(Clone, Debug, Serialize)]
8pub struct PmAllForm {
9    pub message: String,
10}
11
12pub type PostRequest = Request<PostQuery, PmAllForm>;
13
14impl PostRequest {
15    pub fn new(team_id: &str, message: impl Into<String>) -> Self {
16        let form = PmAllForm {
17            message: message.into(),
18        };
19
20        Self::post(
21            format!("/team/{team_id}/pm-all"),
22            None,
23            Body::Form(form),
24            None,
25        )
26    }
27}