gw2lib_model/misc/
currencies.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{BulkEndpoint, Endpoint, EndpointWithId};
4
5pub type CurrencyId = u16;
6
7#[derive(Clone, PartialEq, Eq, PartialOrd, Debug, Serialize, Deserialize)]
8#[cfg_attr(test, serde(deny_unknown_fields))]
9pub struct Currency {
10    pub id: CurrencyId,
11    pub name: String,
12    pub description: String,
13    pub icon: String,
14    pub order: u16,
15}
16
17impl EndpointWithId for Currency {
18    type IdType = CurrencyId;
19}
20impl Endpoint for Currency {
21    const AUTHENTICATED: bool = false;
22    const LOCALE: bool = true;
23    const URL: &'static str = "v2/currencies";
24    const VERSION: &'static str = "2021-01-11T00:00:00.000Z";
25}
26
27impl BulkEndpoint for Currency {
28    const ALL: bool = true;
29
30    fn id(&self) -> &Self::IdType {
31        &self.id
32    }
33}