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
use serde::{Deserialize, Serialize};

use crate::{BulkEndpoint, Endpoint, EndpointWithId};

pub type CatId = u32;

#[derive(Clone, Debug, Serialize, Deserialize)]
#[cfg_attr(test, serde(deny_unknown_fields))]
pub struct Cat {
    pub id: CatId,
    pub hint: String,
}

impl EndpointWithId for Cat {
    type IdType = CatId;
}
impl Endpoint for Cat {
    const AUTHENTICATED: bool = false;
    const LOCALE: bool = false;
    const URL: &'static str = "v2/home/cats";
    const VERSION: &'static str = "2023-08-14T00:00:00.000Z";
}

impl BulkEndpoint for Cat {
    const ALL: bool = true;

    fn id(&self) -> &Self::IdType {
        &self.id
    }
}