1use restson::RestPath;
2use serde::{Deserialize, Serialize};
3
4#[derive(Serialize, Deserialize, Debug)]
5pub struct PingMeta {
6 id: String,
7 #[serde(alias = "statusEmoji")]
8 status_emoji: String,
9}
10
11#[derive(Serialize, Deserialize, Debug)]
12pub struct Ping {
13 meta: PingMeta,
14}
15
16impl Ping {
17 pub fn status(&self) -> &str {
18 &self.meta.status_emoji
19 }
20}
21
22impl RestPath<()> for Ping {
23 fn get_path(_: ()) -> Result<String, restson::Error> {
24 Ok(String::from("util/ping"))
25 }
26}