1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
use serde::{Deserialize, Serialize};

#[derive(Default, Clone, Debug, Serialize)]
pub struct GetQuery;

pub type GetRequest = crate::model::Request<GetQuery>;

impl GetRequest {
    pub fn new() -> Self {
        Self {
            path: "/api/account/kid".to_string(),
            ..Default::default()
        }
    }
}

#[derive(Default, Clone, Debug, Serialize)]
pub struct PostQuery {
    pub v: bool,
}

pub type PostRequest = crate::model::Request<PostQuery>;

impl PostRequest {
    pub fn new(on: bool) -> Self {
        Self {
            method: http::Method::POST,
            path: "/api/account/kid".to_string(),
            query: Some(PostQuery { v: on }),
            ..Default::default()
        }
    }
}

#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct KidMode {
    pub kid: bool,
}