fundamentum_edge_mcu_http_client/
api_version.rs

1//! The various version of the Fundamentum API this library supports. More
2//! information in the [documentation][fundamentum-doc].
3//!
4//! [fundamentum-doc]: https://dimonoff.atlassian.net/wiki/spaces/F2/pages/306273353781/Devices+API
5
6/// Api V1. More information in the [documentation][v1-doc].
7///
8/// [v1-doc]: https://devices.fundamentum-iot-dev.com/api/v1/docs/
9#[deprecated(since = "0.1.0", note = "Use V3 instead.")]
10pub struct V1;
11
12/// Api V2. More information in the [documentation][v2-doc].
13///
14/// [v2-doc]: https://devices.fundamentum-iot-dev.com/api/v2/docs/
15#[deprecated(since = "0.1.0", note = "Use V3 instead.")]
16pub struct V2;
17
18/// Api V3. More information in the [documentation][v3-doc].
19///
20/// [v3-doc]: https://devices.fundamentum-iot-dev.com/api/v3/docs/
21pub struct V3;
22
23mod private {
24    pub trait Sealed {}
25}
26
27#[allow(deprecated)]
28impl private::Sealed for V1 {}
29#[allow(deprecated)]
30impl private::Sealed for V2 {}
31impl private::Sealed for V3 {}
32
33/// Trait to get the version of the API.
34pub trait ApiVersion: private::Sealed {
35    /// Version of the API.
36    const VERSION: &'static str;
37}
38
39#[allow(deprecated)]
40impl ApiVersion for V1 {
41    const VERSION: &'static str = "v1";
42}
43
44#[allow(deprecated)]
45impl ApiVersion for V2 {
46    const VERSION: &'static str = "v2";
47}
48
49impl ApiVersion for V3 {
50    const VERSION: &'static str = "v3";
51}